@sitecoreai-labs/sitecoreai-cli 0.0.4 → 0.1.0
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 +146 -55
- package/README.md +372 -325
- package/dist/agents/api/agents.d.ts +27 -0
- package/dist/agents/api/agents.js +70 -0
- package/dist/agents/api/catalog.d.ts +8 -0
- package/dist/agents/api/catalog.js +33 -0
- package/dist/agents/api/custom-mcps.d.ts +26 -0
- package/dist/agents/api/custom-mcps.js +53 -0
- package/dist/agents/api/html-templates.d.ts +35 -0
- package/dist/agents/api/html-templates.js +116 -0
- package/dist/agents/api/request.d.ts +28 -0
- package/dist/agents/api/request.js +207 -0
- package/dist/agents/api/runs.d.ts +31 -0
- package/dist/agents/api/runs.js +82 -0
- package/dist/agents/api/schema.d.ts +182 -0
- package/dist/agents/api/schema.js +10 -0
- package/dist/agents/api/schemas.d.ts +37 -0
- package/dist/agents/api/schemas.js +95 -0
- package/dist/agents/api/skills.d.ts +25 -0
- package/dist/agents/api/skills.js +55 -0
- package/dist/agents/api/spaces.d.ts +34 -0
- package/dist/agents/api/spaces.js +72 -0
- package/dist/agents/api/tools.d.ts +4 -0
- package/dist/agents/api/tools.js +18 -0
- package/dist/agents/api/widgets.d.ts +32 -0
- package/dist/agents/api/widgets.js +89 -0
- package/dist/agents/client.d.ts +18 -0
- package/dist/agents/client.js +28 -0
- package/dist/agents/index.d.ts +31 -0
- package/dist/agents/index.js +51 -0
- package/dist/agents/recipe/agent.diff.d.ts +4 -0
- package/dist/agents/recipe/agent.diff.js +55 -0
- package/dist/agents/recipe/agent.kind.d.ts +12 -0
- package/dist/agents/recipe/agent.kind.js +107 -0
- package/dist/agents/recipe/agent.schema.d.ts +26 -0
- package/dist/agents/recipe/agent.schema.js +42 -0
- package/dist/agents/recipe/client.d.ts +4 -0
- package/dist/agents/recipe/client.js +15 -0
- package/dist/agents/recipe/converge.d.ts +11 -0
- package/dist/agents/recipe/converge.js +32 -0
- package/dist/agents/recipe/custom-mcp.kind.d.ts +4 -0
- package/dist/agents/recipe/custom-mcp.kind.js +42 -0
- package/dist/agents/recipe/custom-mcp.schema.d.ts +11 -0
- package/dist/agents/recipe/custom-mcp.schema.js +15 -0
- package/dist/agents/recipe/html-template.kind.d.ts +4 -0
- package/dist/agents/recipe/html-template.kind.js +50 -0
- package/dist/agents/recipe/html-template.schema.d.ts +13 -0
- package/dist/agents/recipe/html-template.schema.js +17 -0
- package/dist/agents/recipe/index.d.ts +43 -0
- package/dist/agents/recipe/index.js +81 -0
- package/dist/agents/recipe/schema.kind.d.ts +4 -0
- package/dist/agents/recipe/schema.kind.js +50 -0
- package/dist/agents/recipe/schema.schema.d.ts +15 -0
- package/dist/agents/recipe/schema.schema.js +21 -0
- package/dist/agents/recipe/skill.kind.d.ts +4 -0
- package/dist/agents/recipe/skill.kind.js +48 -0
- package/dist/agents/recipe/skill.schema.d.ts +14 -0
- package/dist/agents/recipe/skill.schema.js +18 -0
- package/dist/agents/recipe/widget.kind.d.ts +4 -0
- package/dist/agents/recipe/widget.kind.js +49 -0
- package/dist/agents/recipe/widget.schema.d.ts +20 -0
- package/dist/agents/recipe/widget.schema.js +23 -0
- package/dist/agents/session/index.d.ts +50 -0
- package/dist/agents/session/index.js +127 -0
- package/dist/agents/session/playwright-login.d.ts +11 -0
- package/dist/agents/session/playwright-login.js +169 -0
- package/dist/agents/session/types.d.ts +72 -0
- package/dist/agents/session/types.js +26 -0
- package/dist/agents/tasks/agent.d.ts +27 -0
- package/dist/agents/tasks/agent.js +183 -0
- package/dist/agents/tasks/index.d.ts +14 -0
- package/dist/agents/tasks/index.js +30 -0
- package/dist/agents/tasks/resources.d.ts +39 -0
- package/dist/agents/tasks/resources.js +219 -0
- package/dist/agents/tasks/session.d.ts +6 -0
- package/dist/agents/tasks/session.js +63 -0
- package/dist/agents/tasks/shared.d.ts +38 -0
- package/dist/agents/tasks/shared.js +72 -0
- package/dist/agents/tasks/space.d.ts +12 -0
- package/dist/agents/tasks/space.js +55 -0
- package/dist/brand/api/auth.d.ts +58 -0
- package/dist/brand/api/auth.js +141 -0
- package/dist/brand/api/client.d.ts +40 -0
- package/dist/brand/api/client.js +83 -0
- package/dist/brand/api/types.d.ts +119 -0
- package/dist/brand/api/types.js +9 -0
- package/dist/brand/credential.d.ts +55 -0
- package/dist/brand/credential.js +87 -0
- package/dist/brand/documents/list.d.ts +85 -0
- package/dist/brand/documents/list.js +53 -0
- package/dist/brand/documents/upload.d.ts +113 -0
- package/dist/brand/documents/upload.js +106 -0
- package/dist/brand/index.d.ts +33 -0
- package/dist/brand/index.js +76 -0
- package/dist/brand/kits/create.d.ts +58 -0
- package/dist/brand/kits/create.js +68 -0
- package/dist/brand/kits/list.d.ts +53 -0
- package/dist/brand/kits/list.js +36 -0
- package/dist/brand/kits/sections.d.ts +156 -0
- package/dist/brand/kits/sections.js +80 -0
- package/dist/brand/pipeline/run.d.ts +58 -0
- package/dist/brand/pipeline/run.js +63 -0
- package/dist/brand/recipe/client.d.ts +4 -0
- package/dist/brand/recipe/client.js +24 -0
- package/dist/brand/recipe/diff.d.ts +4 -0
- package/dist/brand/recipe/diff.js +74 -0
- package/dist/brand/recipe/index.d.ts +10 -0
- package/dist/brand/recipe/index.js +20 -0
- package/dist/brand/recipe/kind.d.ts +4 -0
- package/dist/brand/recipe/kind.js +0 -0
- package/dist/brand/recipe/schema.d.ts +54 -0
- package/dist/brand/recipe/schema.js +59 -0
- package/dist/brand/review/format-json.d.ts +33 -0
- package/dist/brand/review/format-json.js +36 -0
- package/dist/brand/review/format-sarif.d.ts +64 -0
- package/dist/brand/review/format-sarif.js +77 -0
- package/dist/brand/review/format-text.d.ts +24 -0
- package/dist/brand/review/format-text.js +60 -0
- package/dist/brand/review/generate.d.ts +37 -0
- package/dist/brand/review/generate.js +146 -0
- package/dist/brand/review/outcomes.d.ts +43 -0
- package/dist/brand/review/outcomes.js +58 -0
- package/dist/brand/seed.d.ts +81 -0
- package/dist/brand/seed.js +151 -0
- package/dist/brand/tasks/login.d.ts +37 -0
- package/dist/brand/tasks/login.js +192 -0
- package/dist/brand/tasks/review.d.ts +111 -0
- package/dist/brand/tasks/review.js +310 -0
- package/dist/brief/api/brief-types.d.ts +64 -0
- package/dist/brief/api/brief-types.js +103 -0
- package/dist/brief/api/briefs.d.ts +66 -0
- package/dist/brief/api/briefs.js +58 -0
- package/dist/brief/api/comments.d.ts +43 -0
- package/dist/brief/api/comments.js +29 -0
- package/dist/brief/api/request.d.ts +5 -0
- package/dist/brief/api/request.js +83 -0
- package/dist/brief/api/schema.d.ts +158 -0
- package/dist/brief/api/schema.js +18 -0
- package/dist/brief/api/tasks.d.ts +41 -0
- package/dist/brief/api/tasks.js +24 -0
- package/dist/brief/api/types.d.ts +17 -0
- package/dist/brief/api/types.js +21 -0
- package/dist/brief/auth.d.ts +44 -0
- package/dist/brief/auth.js +101 -0
- package/dist/brief/client.d.ts +25 -0
- package/dist/brief/client.js +56 -0
- package/dist/brief/index.d.ts +31 -0
- package/dist/brief/index.js +53 -0
- package/dist/brief/recipe/client.d.ts +4 -0
- package/dist/brief/recipe/client.js +52 -0
- package/dist/brief/recipe/diff.d.ts +4 -0
- package/dist/brief/recipe/diff.js +74 -0
- package/dist/brief/recipe/index.d.ts +10 -0
- package/dist/brief/recipe/index.js +23 -0
- package/dist/brief/recipe/kind.d.ts +4 -0
- package/dist/brief/recipe/kind.js +114 -0
- package/dist/brief/recipe/schema.d.ts +152 -0
- package/dist/brief/recipe/schema.js +99 -0
- package/dist/brief/tasks/index.d.ts +128 -0
- package/dist/brief/tasks/index.js +286 -0
- package/dist/campaigns/api/deliverables.d.ts +37 -0
- package/dist/campaigns/api/deliverables.js +30 -0
- package/dist/campaigns/api/projects.d.ts +49 -0
- package/dist/campaigns/api/projects.js +45 -0
- package/dist/campaigns/api/request.d.ts +5 -0
- package/dist/campaigns/api/request.js +119 -0
- package/dist/campaigns/api/schema.d.ts +144 -0
- package/dist/campaigns/api/schema.js +22 -0
- package/dist/campaigns/api/tasks.d.ts +42 -0
- package/dist/campaigns/api/tasks.js +68 -0
- package/dist/campaigns/api/types.d.ts +17 -0
- package/dist/campaigns/api/types.js +27 -0
- package/dist/campaigns/api/users.d.ts +13 -0
- package/dist/campaigns/api/users.js +16 -0
- package/dist/campaigns/auth.d.ts +19 -0
- package/dist/campaigns/auth.js +86 -0
- package/dist/campaigns/client.d.ts +25 -0
- package/dist/campaigns/client.js +48 -0
- package/dist/campaigns/index.d.ts +29 -0
- package/dist/campaigns/index.js +47 -0
- package/dist/campaigns/recipe/client.d.ts +4 -0
- package/dist/campaigns/recipe/client.js +41 -0
- package/dist/campaigns/recipe/diff.d.ts +4 -0
- package/dist/campaigns/recipe/diff.js +119 -0
- package/dist/campaigns/recipe/index.d.ts +10 -0
- package/dist/campaigns/recipe/index.js +19 -0
- package/dist/campaigns/recipe/kind.d.ts +4 -0
- package/dist/campaigns/recipe/kind.js +217 -0
- package/dist/campaigns/recipe/schema.d.ts +79 -0
- package/dist/campaigns/recipe/schema.js +67 -0
- package/dist/campaigns/tasks/index.d.ts +124 -0
- package/dist/campaigns/tasks/index.js +271 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +84 -63
- package/dist/commands/agents/index.d.ts +28 -0
- package/dist/commands/agents/index.js +289 -0
- package/dist/commands/agents/sync.d.ts +13 -0
- package/dist/commands/agents/sync.js +139 -0
- package/dist/commands/audit/all.d.ts +2 -0
- package/dist/commands/audit/all.js +26 -0
- package/dist/commands/audit/alt-text-missing.d.ts +2 -0
- package/dist/commands/audit/alt-text-missing.js +19 -0
- package/dist/commands/audit/baseline.d.ts +2 -0
- package/dist/commands/audit/baseline.js +75 -0
- package/dist/commands/audit/broken-images.d.ts +2 -0
- package/dist/commands/audit/broken-images.js +25 -0
- package/dist/commands/audit/broken-links.d.ts +2 -0
- package/dist/commands/audit/broken-links.js +18 -0
- package/dist/commands/audit/datasource-missing.d.ts +2 -0
- package/dist/commands/audit/datasource-missing.js +19 -0
- package/dist/commands/audit/dead-templates.d.ts +2 -0
- package/dist/commands/audit/dead-templates.js +18 -0
- package/dist/commands/audit/duplicates.d.ts +2 -0
- package/dist/commands/audit/duplicates.js +21 -0
- package/dist/commands/audit/empty-items.d.ts +2 -0
- package/dist/commands/audit/empty-items.js +19 -0
- package/dist/commands/audit/empty-links.d.ts +2 -0
- package/dist/commands/audit/empty-links.js +25 -0
- package/dist/commands/audit/empty-roles.d.ts +2 -0
- package/dist/commands/audit/empty-roles.js +18 -0
- package/dist/commands/audit/fallback-drift.d.ts +2 -0
- package/dist/commands/audit/fallback-drift.js +22 -0
- package/dist/commands/audit/find-replace.d.ts +2 -0
- package/dist/commands/audit/find-replace.js +27 -0
- package/dist/commands/audit/heavy-templates.d.ts +2 -0
- package/dist/commands/audit/heavy-templates.js +19 -0
- package/dist/commands/audit/history.d.ts +2 -0
- package/dist/commands/audit/history.js +44 -0
- package/dist/commands/audit/index.d.ts +2 -0
- package/dist/commands/audit/index.js +100 -0
- package/dist/commands/audit/language-data.d.ts +2 -0
- package/dist/commands/audit/language-data.js +24 -0
- package/dist/commands/audit/large-fields.d.ts +2 -0
- package/dist/commands/audit/large-fields.js +21 -0
- package/dist/commands/audit/missing-meta.d.ts +2 -0
- package/dist/commands/audit/missing-meta.js +22 -0
- package/dist/commands/audit/orphans.d.ts +2 -0
- package/dist/commands/audit/orphans.js +22 -0
- package/dist/commands/audit/page-design-orphans.d.ts +2 -0
- package/dist/commands/audit/page-design-orphans.js +18 -0
- package/dist/commands/audit/personalization-broken.d.ts +2 -0
- package/dist/commands/audit/personalization-broken.js +18 -0
- package/dist/commands/audit/references.d.ts +2 -0
- package/dist/commands/audit/references.js +27 -0
- package/dist/commands/audit/role-bloat.d.ts +2 -0
- package/dist/commands/audit/role-bloat.js +19 -0
- package/dist/commands/audit/shared.d.ts +7 -0
- package/dist/commands/audit/shared.js +32 -0
- package/dist/commands/audit/site-residue.d.ts +2 -0
- package/dist/commands/audit/site-residue.js +22 -0
- package/dist/commands/audit/slug-conflicts.d.ts +2 -0
- package/dist/commands/audit/slug-conflicts.js +20 -0
- package/dist/commands/audit/stale-content.d.ts +2 -0
- package/dist/commands/audit/stale-content.js +21 -0
- package/dist/commands/audit/stale-users.d.ts +2 -0
- package/dist/commands/audit/stale-users.js +21 -0
- package/dist/commands/audit/stale-workflow.d.ts +2 -0
- package/dist/commands/audit/stale-workflow.js +19 -0
- package/dist/commands/audit/suite.d.ts +2 -0
- package/dist/commands/audit/suite.js +31 -0
- package/dist/commands/audit/template-dependencies.d.ts +2 -0
- package/dist/commands/audit/template-dependencies.js +22 -0
- package/dist/commands/audit/translation-coverage.d.ts +2 -0
- package/dist/commands/audit/translation-coverage.js +22 -0
- package/dist/commands/audit/unused-media.d.ts +2 -0
- package/dist/commands/audit/unused-media.js +21 -0
- package/dist/commands/brand/docs.d.ts +9 -0
- package/dist/commands/brand/docs.js +168 -0
- package/dist/commands/brand/index.d.ts +13 -0
- package/dist/commands/brand/index.js +37 -0
- package/dist/commands/brand/ingest-enrich.d.ts +3 -0
- package/dist/commands/brand/ingest-enrich.js +71 -0
- package/dist/commands/brand/kits.d.ts +18 -0
- package/dist/commands/brand/kits.js +361 -0
- package/dist/commands/brand/review.d.ts +13 -0
- package/dist/commands/brand/review.js +65 -0
- package/dist/commands/brand/seed.d.ts +9 -0
- package/dist/commands/brand/seed.js +136 -0
- package/dist/commands/brand/sync.d.ts +11 -0
- package/dist/commands/brand/sync.js +128 -0
- package/dist/commands/brief/comments.d.ts +11 -0
- package/dist/commands/brief/comments.js +55 -0
- package/dist/commands/brief/delete.d.ts +10 -0
- package/dist/commands/brief/delete.js +40 -0
- package/dist/commands/brief/index.d.ts +19 -0
- package/dist/commands/brief/index.js +53 -0
- package/dist/commands/brief/list.d.ts +2 -0
- package/dist/commands/brief/list.js +19 -0
- package/dist/commands/brief/set-status.d.ts +10 -0
- package/dist/commands/brief/set-status.js +33 -0
- package/dist/commands/brief/show.d.ts +2 -0
- package/dist/commands/brief/show.js +19 -0
- package/dist/commands/brief/sync.d.ts +12 -0
- package/dist/commands/brief/sync.js +121 -0
- package/dist/commands/brief/todos.d.ts +9 -0
- package/dist/commands/brief/todos.js +28 -0
- package/dist/commands/brief/types.d.ts +16 -0
- package/dist/commands/brief/types.js +129 -0
- package/dist/commands/campaign/index.d.ts +2 -0
- package/dist/commands/campaign/index.js +309 -0
- package/dist/commands/campaign/sync.d.ts +12 -0
- package/dist/commands/campaign/sync.js +121 -0
- package/dist/commands/cleanup/archive.d.ts +2 -0
- package/dist/commands/cleanup/archive.js +21 -0
- package/dist/commands/cleanup/dead-templates.d.ts +2 -0
- package/dist/commands/cleanup/dead-templates.js +21 -0
- package/dist/commands/cleanup/duplicates.d.ts +2 -0
- package/dist/commands/cleanup/duplicates.js +49 -0
- package/dist/commands/cleanup/empty-folders.d.ts +2 -0
- package/dist/commands/cleanup/empty-folders.js +18 -0
- package/dist/commands/cleanup/field-set.d.ts +2 -0
- package/dist/commands/cleanup/field-set.js +44 -0
- package/dist/commands/cleanup/find-replace.d.ts +2 -0
- package/dist/commands/cleanup/find-replace.js +35 -0
- package/dist/commands/cleanup/index.d.ts +2 -0
- package/dist/commands/cleanup/index.js +48 -0
- package/dist/commands/cleanup/language-versions.d.ts +2 -0
- package/dist/commands/cleanup/language-versions.js +25 -0
- package/dist/commands/cleanup/rename.d.ts +2 -0
- package/dist/commands/cleanup/rename.js +32 -0
- package/dist/commands/cleanup/roles.d.ts +2 -0
- package/dist/commands/cleanup/roles.js +20 -0
- package/dist/commands/cleanup/shared.d.ts +2 -0
- package/dist/commands/cleanup/shared.js +15 -0
- package/dist/commands/cleanup/site-residue.d.ts +2 -0
- package/dist/commands/cleanup/site-residue.js +32 -0
- package/dist/commands/cleanup/slug-conflicts.d.ts +2 -0
- package/dist/commands/cleanup/slug-conflicts.js +54 -0
- package/dist/commands/cleanup/subtree.d.ts +2 -0
- package/dist/commands/cleanup/subtree.js +25 -0
- package/dist/commands/cleanup/users.d.ts +2 -0
- package/dist/commands/cleanup/users.js +23 -0
- package/dist/commands/cleanup/versions.d.ts +2 -0
- package/dist/commands/cleanup/versions.js +42 -0
- package/dist/commands/cleanup/workflow.d.ts +2 -0
- package/dist/commands/cleanup/workflow.js +40 -0
- package/dist/commands/config.d.ts +0 -1
- package/dist/commands/config.js +3 -3
- package/dist/commands/content/index.d.ts +2 -0
- package/dist/commands/content/index.js +11 -0
- package/dist/commands/content/version/index.d.ts +2 -0
- package/dist/commands/content/version/index.js +19 -0
- package/dist/commands/content/version/inspect.d.ts +2 -0
- package/dist/commands/content/version/inspect.js +22 -0
- package/dist/commands/content/version/set-never-publish.d.ts +2 -0
- package/dist/commands/content/version/set-never-publish.js +40 -0
- package/dist/commands/content/version/set-validity.d.ts +2 -0
- package/dist/commands/content/version/set-validity.js +30 -0
- package/dist/commands/deploy/deployments.d.ts +0 -1
- package/dist/commands/deploy/deployments.js +9 -9
- package/dist/commands/deploy/editing-host.d.ts +0 -1
- package/dist/commands/deploy/editing-host.js +25 -13
- package/dist/commands/deploy/environments/deployments.d.ts +0 -1
- package/dist/commands/deploy/environments/deployments.js +3 -3
- package/dist/commands/deploy/environments/index.d.ts +0 -1
- package/dist/commands/deploy/environments/index.js +1 -0
- package/dist/commands/deploy/environments/mutations.d.ts +0 -1
- package/dist/commands/deploy/environments/mutations.js +18 -17
- package/dist/commands/deploy/environments/queries.d.ts +1 -1
- package/dist/commands/deploy/environments/queries.js +29 -8
- package/dist/commands/deploy/environments/variables.d.ts +0 -1
- package/dist/commands/deploy/environments/variables.js +9 -8
- package/dist/commands/deploy/environments.d.ts +0 -1
- package/dist/commands/deploy/index.d.ts +0 -1
- package/dist/commands/deploy/index.js +1 -1
- package/dist/commands/deploy/logs.d.ts +0 -1
- package/dist/commands/deploy/logs.js +4 -4
- package/dist/commands/deploy/organizations.d.ts +0 -1
- package/dist/commands/deploy/organizations.js +5 -5
- package/dist/commands/deploy/projects.d.ts +0 -1
- package/dist/commands/deploy/projects.js +32 -20
- package/dist/commands/deploy/shared.d.ts +0 -1
- package/dist/commands/deploy/shared.js +1 -0
- package/dist/commands/deploy/site.d.ts +2 -3
- package/dist/commands/deploy/site.js +6 -5
- package/dist/commands/deploy/source-control.d.ts +0 -1
- package/dist/commands/deploy/source-control.js +13 -13
- package/dist/commands/deploy.d.ts +0 -1
- package/dist/commands/explain/index.d.ts +14 -0
- package/dist/commands/explain/index.js +25 -0
- package/dist/commands/explain/orphan-site.d.ts +11 -0
- package/dist/commands/explain/orphan-site.js +36 -0
- package/dist/commands/explain/why-blocked.d.ts +13 -0
- package/dist/commands/explain/why-blocked.js +42 -0
- package/dist/commands/health.d.ts +2 -0
- package/dist/commands/health.js +28 -0
- package/dist/commands/history.d.ts +0 -1
- package/dist/commands/history.js +11 -42
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.js +42 -8
- package/dist/commands/login.d.ts +11 -1
- package/dist/commands/login.js +35 -4
- package/dist/commands/logout.d.ts +0 -1
- package/dist/commands/logout.js +3 -3
- package/dist/commands/mcp/serve.d.ts +27 -0
- package/dist/commands/mcp/serve.js +120 -0
- package/dist/commands/mcp/tools.d.ts +8 -0
- package/dist/commands/mcp/tools.js +75 -0
- package/dist/commands/mcp.d.ts +2 -0
- package/dist/commands/mcp.js +23 -0
- package/dist/commands/policy.d.ts +16 -0
- package/dist/commands/policy.js +296 -0
- package/dist/commands/publish/all.d.ts +2 -0
- package/dist/commands/publish/all.js +41 -0
- package/dist/commands/publish/cancel.d.ts +2 -0
- package/dist/commands/publish/cancel.js +25 -0
- package/dist/commands/publish/history.d.ts +2 -0
- package/dist/commands/publish/history.js +34 -0
- package/dist/commands/publish/index.d.ts +2 -0
- package/dist/commands/publish/index.js +30 -0
- package/dist/commands/publish/item.d.ts +2 -0
- package/dist/commands/publish/item.js +55 -0
- package/dist/commands/publish/status.d.ts +2 -0
- package/dist/commands/publish/status.js +34 -0
- package/dist/commands/publish/unpublish.d.ts +2 -0
- package/dist/commands/publish/unpublish.js +52 -0
- package/dist/commands/recipe/index.d.ts +0 -1
- package/dist/commands/recipe/index.js +19 -15
- package/dist/commands/serialization/index.d.ts +0 -1
- package/dist/commands/serialization/index.js +14 -9
- package/dist/commands/serialization/package.d.ts +0 -1
- package/dist/commands/serialization/package.js +3 -3
- package/dist/commands/setup-client.d.ts +17 -0
- package/dist/commands/setup-client.js +148 -0
- package/dist/commands/shared.d.ts +72 -2
- package/dist/commands/shared.js +151 -24
- package/dist/commands/shell.d.ts +0 -1
- package/dist/commands/shell.js +1 -1
- package/dist/commands/status.d.ts +0 -1
- package/dist/commands/status.js +3 -3
- package/dist/commands/sync.d.ts +23 -0
- package/dist/commands/sync.js +154 -0
- package/dist/commands/telemetry.d.ts +0 -1
- package/dist/commands/telemetry.js +40 -2
- package/dist/commands/topics/index.d.ts +5 -0
- package/dist/commands/topics/index.js +102 -0
- package/dist/commands/webhook/create.d.ts +2 -0
- package/dist/commands/webhook/create.js +52 -0
- package/dist/commands/webhook/delete.d.ts +2 -0
- package/dist/commands/webhook/delete.js +20 -0
- package/dist/commands/webhook/event-types.d.ts +2 -0
- package/dist/commands/webhook/event-types.js +22 -0
- package/dist/commands/webhook/index.d.ts +2 -0
- package/dist/commands/webhook/index.js +33 -0
- package/dist/commands/webhook/inspect.d.ts +2 -0
- package/dist/commands/webhook/inspect.js +17 -0
- package/dist/commands/webhook/list.d.ts +2 -0
- package/dist/commands/webhook/list.js +24 -0
- package/dist/commands/webhook/shared.d.ts +2 -0
- package/dist/commands/webhook/shared.js +11 -0
- package/dist/commands/workflow/advance.d.ts +2 -0
- package/dist/commands/workflow/advance.js +22 -0
- package/dist/commands/workflow/apply.d.ts +2 -0
- package/dist/commands/workflow/apply.js +22 -0
- package/dist/commands/workflow/assigned.d.ts +2 -0
- package/dist/commands/workflow/assigned.js +21 -0
- package/dist/commands/workflow/index.d.ts +2 -0
- package/dist/commands/workflow/index.js +35 -0
- package/dist/commands/workflow/inspect.d.ts +2 -0
- package/dist/commands/workflow/inspect.js +17 -0
- package/dist/commands/workflow/list-commands.d.ts +2 -0
- package/dist/commands/workflow/list-commands.js +17 -0
- package/dist/commands/workflow/list-defs.d.ts +2 -0
- package/dist/commands/workflow/list-defs.js +17 -0
- package/dist/commands/workflow/reset.d.ts +2 -0
- package/dist/commands/workflow/reset.js +20 -0
- package/dist/commands/workflow/shared.d.ts +3 -0
- package/dist/commands/workflow/shared.js +12 -0
- package/dist/commands/workflow/status.d.ts +2 -0
- package/dist/commands/workflow/status.js +18 -0
- package/dist/config/env-overrides.d.ts +0 -1
- package/dist/config/env-overrides.js +41 -5
- package/dist/config/index.d.ts +15 -3
- package/dist/config/index.js +43 -3
- package/dist/config/modules.d.ts +0 -1
- package/dist/config/modules.js +2 -2
- package/dist/config/paths.d.ts +0 -1
- package/dist/config/paths.js +11 -2
- package/dist/config/root-config.d.ts +24 -1
- package/dist/config/root-config.js +84 -7
- package/dist/config/schema.json +113 -25
- package/dist/config/types.d.ts +228 -13
- package/dist/config/types.js +1 -1
- package/dist/config/validation.d.ts +1 -4
- package/dist/content/api/version-fields.d.ts +129 -0
- package/dist/content/api/version-fields.js +193 -0
- package/dist/content/index.d.ts +15 -0
- package/dist/content/index.js +40 -0
- package/dist/content/tasks/shared.d.ts +86 -0
- package/dist/content/tasks/shared.js +130 -0
- package/dist/content/tasks/version-inspect.d.ts +13 -0
- package/dist/content/tasks/version-inspect.js +56 -0
- package/dist/content/tasks/version-never-publish.d.ts +16 -0
- package/dist/content/tasks/version-never-publish.js +115 -0
- package/dist/content/tasks/version-validity.d.ts +24 -0
- package/dist/content/tasks/version-validity.js +159 -0
- package/dist/deploy/api/client-naming.d.ts +80 -0
- package/dist/deploy/api/client-naming.js +124 -0
- package/dist/deploy/api/client.d.ts +72 -0
- package/dist/deploy/api/client.js +72 -0
- package/dist/deploy/api/clients.d.ts +126 -0
- package/dist/deploy/api/clients.js +89 -0
- package/dist/deploy/api/common/headers.d.ts +0 -1
- package/dist/deploy/api/common/request.d.ts +0 -5
- package/dist/deploy/api/common/request.js +93 -120
- package/dist/deploy/api/common/transport-events.d.ts +31 -0
- package/dist/deploy/api/common/transport-events.js +24 -0
- package/dist/deploy/api/common/types.d.ts +60 -1
- package/dist/deploy/api/deployment-logs.d.ts +0 -1
- package/dist/deploy/api/deployment-logs.js +5 -5
- package/dist/deploy/api/deployments.d.ts +1 -2
- package/dist/deploy/api/deployments.js +22 -20
- package/dist/deploy/api/environments.d.ts +28 -2
- package/dist/deploy/api/environments.js +103 -20
- package/dist/deploy/api/index.d.ts +31 -9
- package/dist/deploy/api/index.js +129 -22
- package/dist/deploy/api/logs.d.ts +1 -2
- package/dist/deploy/api/logs.js +9 -7
- package/dist/deploy/api/organizations.d.ts +1 -2
- package/dist/deploy/api/organizations.js +8 -7
- package/dist/deploy/api/projects.d.ts +19 -4
- package/dist/deploy/api/projects.js +75 -13
- package/dist/deploy/api/source-control.d.ts +1 -2
- package/dist/deploy/api/source-control.js +25 -24
- package/dist/deploy/api.d.ts +0 -1
- package/dist/deploy/context.d.ts +52 -0
- package/dist/deploy/context.js +234 -0
- package/dist/deploy/index.d.ts +11 -0
- package/dist/deploy/index.js +38 -0
- package/dist/deploy/tasks/deployment-result.d.ts +0 -1
- package/dist/deploy/tasks/deployments.d.ts +0 -1
- package/dist/deploy/tasks/deployments.js +12 -11
- package/dist/deploy/tasks/editing-host.d.ts +0 -1
- package/dist/deploy/tasks/editing-host.js +48 -18
- package/dist/deploy/tasks/environments.d.ts +3 -3
- package/dist/deploy/tasks/environments.js +108 -24
- package/dist/deploy/tasks/health.d.ts +23 -0
- package/dist/deploy/tasks/health.js +181 -0
- package/dist/deploy/tasks/logs.d.ts +0 -1
- package/dist/deploy/tasks/logs.js +4 -4
- package/dist/deploy/tasks/organizations.d.ts +0 -1
- package/dist/deploy/tasks/organizations.js +5 -5
- package/dist/deploy/tasks/projects.d.ts +6 -2
- package/dist/deploy/tasks/projects.js +61 -42
- package/dist/deploy/tasks/shared.d.ts +9 -52
- package/dist/deploy/tasks/shared.js +46 -222
- package/dist/deploy/tasks/site-bind.d.ts +1 -2
- package/dist/deploy/tasks/site-bind.js +7 -7
- package/dist/deploy/tasks/site.d.ts +2 -3
- package/dist/deploy/tasks/site.js +4 -4
- package/dist/deploy/tasks/source-control.d.ts +0 -1
- package/dist/deploy/tasks/source-control.js +14 -14
- package/dist/deploy/tasks/transport-spinner.d.ts +5 -0
- package/dist/deploy/tasks/transport-spinner.js +118 -0
- package/dist/deploy/tasks/types.d.ts +16 -3
- package/dist/deploy/tasks/types.js +1 -1
- package/dist/hygiene/api/client.d.ts +294 -0
- package/dist/hygiene/api/client.js +827 -0
- package/dist/hygiene/api/graphql.d.ts +4 -0
- package/dist/hygiene/api/graphql.js +18 -0
- package/dist/hygiene/audit-suite.d.ts +84 -0
- package/dist/hygiene/audit-suite.js +95 -0
- package/dist/hygiene/baseline.d.ts +56 -0
- package/dist/hygiene/baseline.js +248 -0
- package/dist/hygiene/cache.d.ts +35 -0
- package/dist/hygiene/cache.js +179 -0
- package/dist/hygiene/history.d.ts +70 -0
- package/dist/hygiene/history.js +148 -0
- package/dist/hygiene/index.d.ts +128 -0
- package/dist/hygiene/index.js +168 -0
- package/dist/hygiene/output-adapters.d.ts +49 -0
- package/dist/hygiene/output-adapters.js +270 -0
- package/dist/hygiene/tasks/audit/all.d.ts +58 -0
- package/dist/hygiene/tasks/audit/all.js +274 -0
- package/dist/hygiene/tasks/audit/alt-text-missing.d.ts +27 -0
- package/dist/hygiene/tasks/audit/alt-text-missing.js +87 -0
- package/dist/hygiene/tasks/audit/baseline.d.ts +66 -0
- package/dist/hygiene/tasks/audit/baseline.js +185 -0
- package/dist/hygiene/tasks/audit/broken-images.d.ts +41 -0
- package/dist/hygiene/tasks/audit/broken-images.js +183 -0
- package/dist/hygiene/tasks/audit/broken-links.d.ts +53 -0
- package/dist/hygiene/tasks/audit/broken-links.js +121 -0
- package/dist/hygiene/tasks/audit/datasource-missing.d.ts +44 -0
- package/dist/hygiene/tasks/audit/datasource-missing.js +146 -0
- package/dist/hygiene/tasks/audit/dead-templates.d.ts +46 -0
- package/dist/hygiene/tasks/audit/dead-templates.js +216 -0
- package/dist/hygiene/tasks/audit/duplicates.d.ts +48 -0
- package/dist/hygiene/tasks/audit/duplicates.js +94 -0
- package/dist/hygiene/tasks/audit/empty-items.d.ts +24 -0
- package/dist/hygiene/tasks/audit/empty-items.js +53 -0
- package/dist/hygiene/tasks/audit/empty-links.d.ts +37 -0
- package/dist/hygiene/tasks/audit/empty-links.js +145 -0
- package/dist/hygiene/tasks/audit/empty-roles.d.ts +41 -0
- package/dist/hygiene/tasks/audit/empty-roles.js +51 -0
- package/dist/hygiene/tasks/audit/fallback-drift.d.ts +53 -0
- package/dist/hygiene/tasks/audit/fallback-drift.js +115 -0
- package/dist/hygiene/tasks/audit/find-replace.d.ts +75 -0
- package/dist/hygiene/tasks/audit/find-replace.js +142 -0
- package/dist/hygiene/tasks/audit/heavy-templates.d.ts +46 -0
- package/dist/hygiene/tasks/audit/heavy-templates.js +73 -0
- package/dist/hygiene/tasks/audit/history.d.ts +30 -0
- package/dist/hygiene/tasks/audit/history.js +161 -0
- package/dist/hygiene/tasks/audit/language-data.d.ts +55 -0
- package/dist/hygiene/tasks/audit/language-data.js +126 -0
- package/dist/hygiene/tasks/audit/large-fields.d.ts +48 -0
- package/dist/hygiene/tasks/audit/large-fields.js +84 -0
- package/dist/hygiene/tasks/audit/missing-meta.d.ts +57 -0
- package/dist/hygiene/tasks/audit/missing-meta.js +97 -0
- package/dist/hygiene/tasks/audit/orphans.d.ts +47 -0
- package/dist/hygiene/tasks/audit/orphans.js +78 -0
- package/dist/hygiene/tasks/audit/page-design-orphans.d.ts +24 -0
- package/dist/hygiene/tasks/audit/page-design-orphans.js +80 -0
- package/dist/hygiene/tasks/audit/personalization-broken.d.ts +25 -0
- package/dist/hygiene/tasks/audit/personalization-broken.js +96 -0
- package/dist/hygiene/tasks/audit/references.d.ts +70 -0
- package/dist/hygiene/tasks/audit/references.js +142 -0
- package/dist/hygiene/tasks/audit/role-bloat.d.ts +42 -0
- package/dist/hygiene/tasks/audit/role-bloat.js +64 -0
- package/dist/hygiene/tasks/audit/site-residue.d.ts +39 -0
- package/dist/hygiene/tasks/audit/site-residue.js +164 -0
- package/dist/hygiene/tasks/audit/slug-conflicts.d.ts +58 -0
- package/dist/hygiene/tasks/audit/slug-conflicts.js +87 -0
- package/dist/hygiene/tasks/audit/stale-content.d.ts +68 -0
- package/dist/hygiene/tasks/audit/stale-content.js +133 -0
- package/dist/hygiene/tasks/audit/stale-users.d.ts +54 -0
- package/dist/hygiene/tasks/audit/stale-users.js +83 -0
- package/dist/hygiene/tasks/audit/stale-workflow.d.ts +50 -0
- package/dist/hygiene/tasks/audit/stale-workflow.js +109 -0
- package/dist/hygiene/tasks/audit/suite-run.d.ts +28 -0
- package/dist/hygiene/tasks/audit/suite-run.js +46 -0
- package/dist/hygiene/tasks/audit/template-dependencies.d.ts +72 -0
- package/dist/hygiene/tasks/audit/template-dependencies.js +97 -0
- package/dist/hygiene/tasks/audit/translation-coverage.d.ts +64 -0
- package/dist/hygiene/tasks/audit/translation-coverage.js +123 -0
- package/dist/hygiene/tasks/audit/unused-media.d.ts +58 -0
- package/dist/hygiene/tasks/audit/unused-media.js +144 -0
- package/dist/hygiene/tasks/browse.d.ts +49 -0
- package/dist/hygiene/tasks/browse.js +50 -0
- package/dist/hygiene/tasks/cleanup/archive-purge.d.ts +50 -0
- package/dist/hygiene/tasks/cleanup/archive-purge.js +129 -0
- package/dist/hygiene/tasks/cleanup/dead-templates.d.ts +74 -0
- package/dist/hygiene/tasks/cleanup/dead-templates.js +247 -0
- package/dist/hygiene/tasks/cleanup/duplicates.d.ts +86 -0
- package/dist/hygiene/tasks/cleanup/duplicates.js +189 -0
- package/dist/hygiene/tasks/cleanup/empty-folders.d.ts +75 -0
- package/dist/hygiene/tasks/cleanup/empty-folders.js +165 -0
- package/dist/hygiene/tasks/cleanup/field-set.d.ts +108 -0
- package/dist/hygiene/tasks/cleanup/field-set.js +230 -0
- package/dist/hygiene/tasks/cleanup/find-replace.d.ts +77 -0
- package/dist/hygiene/tasks/cleanup/find-replace.js +180 -0
- package/dist/hygiene/tasks/cleanup/language-version-add.d.ts +74 -0
- package/dist/hygiene/tasks/cleanup/language-version-add.js +136 -0
- package/dist/hygiene/tasks/cleanup/rename.d.ts +78 -0
- package/dist/hygiene/tasks/cleanup/rename.js +152 -0
- package/dist/hygiene/tasks/cleanup/roles.d.ts +58 -0
- package/dist/hygiene/tasks/cleanup/roles.js +177 -0
- package/dist/hygiene/tasks/cleanup/site-residue.d.ts +55 -0
- package/dist/hygiene/tasks/cleanup/site-residue.js +247 -0
- package/dist/hygiene/tasks/cleanup/slug-conflicts.d.ts +126 -0
- package/dist/hygiene/tasks/cleanup/slug-conflicts.js +296 -0
- package/dist/hygiene/tasks/cleanup/subtree-prune.d.ts +40 -0
- package/dist/hygiene/tasks/cleanup/subtree-prune.js +113 -0
- package/dist/hygiene/tasks/cleanup/subtree.d.ts +123 -0
- package/dist/hygiene/tasks/cleanup/subtree.js +312 -0
- package/dist/hygiene/tasks/cleanup/users.d.ts +48 -0
- package/dist/hygiene/tasks/cleanup/users.js +92 -0
- package/dist/hygiene/tasks/cleanup/versions-archive.d.ts +57 -0
- package/dist/hygiene/tasks/cleanup/versions-archive.js +162 -0
- package/dist/hygiene/tasks/cleanup/versions-prune.d.ts +76 -0
- package/dist/hygiene/tasks/cleanup/versions-prune.js +194 -0
- package/dist/hygiene/tasks/cleanup/workflow-advance.d.ts +76 -0
- package/dist/hygiene/tasks/cleanup/workflow-advance.js +185 -0
- package/dist/hygiene/tasks/cleanup/workflow-apply.d.ts +97 -0
- package/dist/hygiene/tasks/cleanup/workflow-apply.js +310 -0
- package/dist/hygiene/tasks/explain/orphan-site.d.ts +53 -0
- package/dist/hygiene/tasks/explain/orphan-site.js +83 -0
- package/dist/hygiene/tasks/explain/why-blocked.d.ts +81 -0
- package/dist/hygiene/tasks/explain/why-blocked.js +149 -0
- package/dist/hygiene/tasks/reference-kind.d.ts +47 -0
- package/dist/hygiene/tasks/reference-kind.js +73 -0
- package/dist/hygiene/tasks/shared.d.ts +350 -0
- package/dist/hygiene/tasks/shared.js +532 -0
- package/dist/mcp/auth.d.ts +80 -0
- package/dist/mcp/auth.js +165 -0
- package/dist/mcp/build-registry.d.ts +12 -0
- package/dist/mcp/build-registry.js +75 -0
- package/dist/mcp/descriptions.d.ts +22 -0
- package/dist/mcp/descriptions.js +113 -0
- package/dist/mcp/dispatch.d.ts +44 -0
- package/dist/mcp/dispatch.js +110 -0
- package/dist/mcp/errors.d.ts +31 -0
- package/dist/mcp/errors.js +117 -0
- package/dist/mcp/http.d.ts +42 -0
- package/dist/mcp/http.js +128 -0
- package/dist/mcp/logging.d.ts +28 -0
- package/dist/mcp/logging.js +78 -0
- package/dist/mcp/prompts/workflows.d.ts +13 -0
- package/dist/mcp/prompts/workflows.js +171 -0
- package/dist/mcp/redact.d.ts +11 -0
- package/dist/mcp/redact.js +35 -0
- package/dist/mcp/registry.d.ts +84 -0
- package/dist/mcp/registry.js +62 -0
- package/dist/mcp/resources/brand.d.ts +20 -0
- package/dist/mcp/resources/brand.js +514 -0
- package/dist/mcp/resources/env.d.ts +10 -0
- package/dist/mcp/resources/env.js +120 -0
- package/dist/mcp/resources/help.d.ts +10 -0
- package/dist/mcp/resources/help.js +475 -0
- package/dist/mcp/resources/recipes.d.ts +13 -0
- package/dist/mcp/resources/recipes.js +270 -0
- package/dist/mcp/schemas/common.d.ts +22 -0
- package/dist/mcp/schemas/common.js +43 -0
- package/dist/mcp/server.d.ts +26 -0
- package/dist/mcp/server.js +88 -0
- package/dist/mcp/tools/access-check.d.ts +11 -0
- package/dist/mcp/tools/access-check.js +47 -0
- package/dist/mcp/tools/agents-recipe.d.ts +2 -0
- package/dist/mcp/tools/agents-recipe.js +139 -0
- package/dist/mcp/tools/agents.d.ts +2 -0
- package/dist/mcp/tools/agents.js +148 -0
- package/dist/mcp/tools/audit.d.ts +41 -0
- package/dist/mcp/tools/audit.js +584 -0
- package/dist/mcp/tools/bootstrap.d.ts +8 -0
- package/dist/mcp/tools/bootstrap.js +200 -0
- package/dist/mcp/tools/brand-recipe.d.ts +2 -0
- package/dist/mcp/tools/brand-recipe.js +123 -0
- package/dist/mcp/tools/brand.d.ts +28 -0
- package/dist/mcp/tools/brand.js +549 -0
- package/dist/mcp/tools/brief-recipe.d.ts +2 -0
- package/dist/mcp/tools/brief-recipe.js +123 -0
- package/dist/mcp/tools/brief.d.ts +16 -0
- package/dist/mcp/tools/brief.js +388 -0
- package/dist/mcp/tools/browse.d.ts +9 -0
- package/dist/mcp/tools/browse.js +57 -0
- package/dist/mcp/tools/campaign-recipe.d.ts +2 -0
- package/dist/mcp/tools/campaign-recipe.js +125 -0
- package/dist/mcp/tools/campaign.d.ts +20 -0
- package/dist/mcp/tools/campaign.js +342 -0
- package/dist/mcp/tools/cleanup.d.ts +22 -0
- package/dist/mcp/tools/cleanup.js +608 -0
- package/dist/mcp/tools/deploy.d.ts +19 -0
- package/dist/mcp/tools/deploy.js +797 -0
- package/dist/mcp/tools/explain.d.ts +2 -0
- package/dist/mcp/tools/explain.js +132 -0
- package/dist/mcp/tools/inspector.d.ts +12 -0
- package/dist/mcp/tools/inspector.js +101 -0
- package/dist/mcp/tools/onboard.d.ts +11 -0
- package/dist/mcp/tools/onboard.js +65 -0
- package/dist/mcp/tools/publish.d.ts +30 -0
- package/dist/mcp/tools/publish.js +173 -0
- package/dist/mcp/tools/recipe-sync.d.ts +2 -0
- package/dist/mcp/tools/recipe-sync.js +117 -0
- package/dist/mcp/tools/recipe.d.ts +18 -0
- package/dist/mcp/tools/recipe.js +250 -0
- package/dist/mcp/tools/serialization.d.ts +17 -0
- package/dist/mcp/tools/serialization.js +282 -0
- package/dist/mcp/tools/webhook.d.ts +12 -0
- package/dist/mcp/tools/webhook.js +246 -0
- package/dist/mcp/tools/workflow.d.ts +21 -0
- package/dist/mcp/tools/workflow.js +436 -0
- package/dist/policy/access-check.d.ts +56 -0
- package/dist/policy/access-check.js +160 -0
- package/dist/policy/allow-write.d.ts +37 -0
- package/dist/policy/allow-write.js +78 -0
- package/dist/policy/authorize.d.ts +36 -0
- package/dist/policy/authorize.js +102 -0
- package/dist/policy/caller.d.ts +23 -0
- package/dist/policy/caller.js +66 -0
- package/dist/policy/enforce.d.ts +25 -0
- package/dist/policy/enforce.js +57 -0
- package/dist/policy/enroll.d.ts +57 -0
- package/dist/policy/enroll.js +101 -0
- package/dist/policy/environment.d.ts +35 -0
- package/dist/policy/environment.js +44 -0
- package/dist/policy/identity.d.ts +24 -0
- package/dist/policy/identity.js +58 -0
- package/dist/policy/index.d.ts +22 -0
- package/dist/policy/index.js +42 -0
- package/dist/policy/operations.d.ts +24 -0
- package/dist/policy/operations.js +37 -0
- package/dist/policy/organization.d.ts +62 -0
- package/dist/policy/organization.js +97 -0
- package/dist/policy/paths.d.ts +21 -0
- package/dist/policy/paths.js +46 -0
- package/dist/policy/resolve.d.ts +15 -0
- package/dist/policy/resolve.js +67 -0
- package/dist/policy/schema.d.ts +137 -0
- package/dist/policy/schema.js +92 -0
- package/dist/policy/store.d.ts +25 -0
- package/dist/policy/store.js +85 -0
- package/dist/policy/types.d.ts +52 -0
- package/dist/policy/types.js +22 -0
- package/dist/program.d.ts +35 -0
- package/dist/program.js +131 -0
- package/dist/publishing/api/auth.d.ts +49 -0
- package/dist/publishing/api/auth.js +173 -0
- package/dist/publishing/api/client.d.ts +5 -0
- package/dist/publishing/api/client.js +153 -0
- package/dist/publishing/api/languages.d.ts +61 -0
- package/dist/publishing/api/languages.js +116 -0
- package/dist/publishing/api/path-resolver.d.ts +10 -0
- package/dist/publishing/api/path-resolver.js +76 -0
- package/dist/publishing/api/sites.d.ts +23 -0
- package/dist/publishing/api/sites.js +27 -0
- package/dist/publishing/api/types.d.ts +166 -0
- package/dist/publishing/api/types.js +17 -0
- package/dist/publishing/index.d.ts +25 -0
- package/dist/publishing/index.js +51 -0
- package/dist/publishing/job-diagnostics.d.ts +44 -0
- package/dist/publishing/job-diagnostics.js +87 -0
- package/dist/publishing/job-watcher.d.ts +33 -0
- package/dist/publishing/job-watcher.js +118 -0
- package/dist/publishing/tasks/all.d.ts +41 -0
- package/dist/publishing/tasks/all.js +234 -0
- package/dist/publishing/tasks/cancel.d.ts +18 -0
- package/dist/publishing/tasks/cancel.js +147 -0
- package/dist/publishing/tasks/history.d.ts +22 -0
- package/dist/publishing/tasks/history.js +85 -0
- package/dist/publishing/tasks/item.d.ts +69 -0
- package/dist/publishing/tasks/item.js +194 -0
- package/dist/publishing/tasks/status.d.ts +17 -0
- package/dist/publishing/tasks/status.js +74 -0
- package/dist/publishing/tasks/unpublish.d.ts +69 -0
- package/dist/publishing/tasks/unpublish.js +546 -0
- package/dist/recipe/api/auth.d.ts +1 -2
- package/dist/recipe/api/auth.js +1 -1
- package/dist/recipe/api/authoring-client.d.ts +9 -3
- package/dist/recipe/api/authoring-client.js +101 -17
- package/dist/recipe/api/client.d.ts +50 -1
- package/dist/recipe/api/graphql.d.ts +2 -3
- package/dist/recipe/api/graphql.js +1 -1
- package/dist/recipe/api/ref-encoding.d.ts +0 -1
- package/dist/recipe/api/ref-encoding.js +5 -5
- package/dist/recipe/api/site-discovery.d.ts +1 -2
- package/dist/recipe/api/sites-client.d.ts +6 -3
- package/dist/recipe/api/sites-client.js +11 -8
- package/dist/recipe/cache.d.ts +0 -1
- package/dist/recipe/compile/component-section.d.ts +1 -2
- package/dist/recipe/compile/component-section.js +2 -2
- package/dist/recipe/compile/component-template.d.ts +0 -1
- package/dist/recipe/compile/component-template.js +15 -19
- package/dist/recipe/compile/content-item.d.ts +42 -22
- package/dist/recipe/compile/content-item.js +198 -46
- package/dist/recipe/compile/content-template.d.ts +0 -1
- package/dist/recipe/compile/content-template.js +25 -1
- package/dist/recipe/compile/design-parameters-template.d.ts +13 -0
- package/dist/recipe/compile/design-parameters-template.js +92 -0
- package/dist/recipe/compile/enumeration.d.ts +0 -1
- package/dist/recipe/compile/enumeration.js +4 -4
- package/dist/recipe/compile/page-design.d.ts +0 -1
- package/dist/recipe/compile/page-design.js +1 -1
- package/dist/recipe/compile/page-template.d.ts +30 -0
- package/dist/recipe/compile/page-template.js +121 -0
- package/dist/recipe/compile/page.d.ts +26 -0
- package/dist/recipe/compile/page.js +184 -0
- package/dist/recipe/compile/partial-design.d.ts +0 -1
- package/dist/recipe/compile/partial-design.js +1 -1
- package/dist/recipe/compile/placeholder.d.ts +23 -0
- package/dist/recipe/compile/placeholder.js +32 -0
- package/dist/recipe/compile/section-definition.d.ts +0 -1
- package/dist/recipe/compile/shared.d.ts +52 -7
- package/dist/recipe/compile/shared.js +55 -15
- package/dist/recipe/compile/site-template.d.ts +0 -1
- package/dist/recipe/compile/site-template.js +1 -1
- package/dist/recipe/compile/site.d.ts +0 -1
- package/dist/recipe/compile/site.js +1 -1
- package/dist/recipe/compile/webhook-authorization.d.ts +23 -0
- package/dist/recipe/compile/webhook-authorization.js +116 -0
- package/dist/recipe/compile/workflow.d.ts +46 -0
- package/dist/recipe/compile/workflow.js +368 -0
- package/dist/recipe/compile.d.ts +19 -3
- package/dist/recipe/compile.js +297 -11
- package/dist/recipe/ensure-marker-field.d.ts +25 -0
- package/dist/recipe/ensure-marker-field.js +140 -0
- package/dist/recipe/execute.d.ts +19 -2
- package/dist/recipe/execute.js +39 -8
- package/dist/recipe/guids.d.ts +106 -9
- package/dist/recipe/guids.js +126 -15
- package/dist/recipe/index.d.ts +11 -5
- package/dist/recipe/index.js +46 -23
- package/dist/recipe/io.d.ts +0 -1
- package/dist/recipe/io.js +33 -10
- package/dist/recipe/ir/operations.d.ts +66 -4
- package/dist/recipe/ir/operations.js +55 -2
- package/dist/recipe/ir/sitecore-templates.d.ts +87 -1
- package/dist/recipe/ir/sitecore-templates.js +94 -1
- package/dist/recipe/layout/emit.d.ts +22 -3
- package/dist/recipe/layout/emit.js +18 -7
- package/dist/recipe/layout/parse.d.ts +164 -0
- package/dist/recipe/layout/parse.js +295 -0
- package/dist/recipe/layout/templates-mapping.d.ts +0 -1
- package/dist/recipe/marker.d.ts +28 -0
- package/dist/recipe/marker.js +37 -0
- package/dist/recipe/plan.d.ts +9 -2
- package/dist/recipe/plan.js +195 -19
- package/dist/recipe/policy.d.ts +0 -1
- package/dist/recipe/policy.js +19 -1
- package/dist/recipe/read-current.d.ts +109 -0
- package/dist/recipe/read-current.js +1285 -0
- package/dist/recipe/recipe-kind.d.ts +4 -0
- package/dist/recipe/recipe-kind.js +217 -0
- package/dist/recipe/rollback-log.d.ts +52 -0
- package/dist/recipe/rollback-log.js +90 -0
- package/dist/recipe/rollback.d.ts +12 -1
- package/dist/recipe/rollback.js +32 -7
- package/dist/recipe/sandbox/load.d.ts +17 -0
- package/dist/recipe/sandbox/load.js +145 -0
- package/dist/recipe/sandbox/recipe-runner.cjs +49 -0
- package/dist/recipe/sandbox/transpile.d.ts +17 -0
- package/dist/recipe/sandbox/transpile.js +46 -0
- package/dist/recipe/schema/field-types.d.ts +3 -4
- package/dist/recipe/schema/recipe.d.ts +1631 -213
- package/dist/recipe/schema/recipe.js +576 -37
- package/dist/recipe/schema/source-fields.d.ts +0 -1
- package/dist/recipe/tasks/compile.d.ts +1 -2
- package/dist/recipe/tasks/compile.js +14 -4
- package/dist/recipe/tasks/diff.d.ts +1 -2
- package/dist/recipe/tasks/placeholder-allow.d.ts +0 -1
- package/dist/recipe/tasks/placeholder-allow.js +3 -7
- package/dist/recipe/tasks/plan.d.ts +3 -4
- package/dist/recipe/tasks/plan.js +5 -5
- package/dist/recipe/tasks/prune-defaults.d.ts +1 -2
- package/dist/recipe/tasks/prune-defaults.js +6 -7
- package/dist/recipe/tasks/push.d.ts +1 -2
- package/dist/recipe/tasks/push.js +46 -6
- package/dist/recipe/tasks/shared.d.ts +21 -4
- package/dist/recipe/tasks/shared.js +34 -21
- package/dist/recipe/unstable.d.ts +18 -0
- package/dist/recipe/unstable.js +36 -0
- package/dist/recipe/validate.d.ts +51 -2
- package/dist/recipe/validate.js +162 -15
- package/dist/scripting/connect.d.ts +24 -0
- package/dist/scripting/connect.js +17 -0
- package/dist/scripting/helpers/multilist.d.ts +26 -0
- package/dist/scripting/helpers/multilist.js +75 -0
- package/dist/scripting/index.d.ts +20 -0
- package/dist/scripting/index.js +57 -0
- package/dist/serialization/api/auth.d.ts +57 -0
- package/dist/serialization/api/auth.js +433 -0
- package/dist/serialization/api/client.d.ts +41 -0
- package/dist/serialization/api/client.js +41 -0
- package/dist/serialization/api/graphql.d.ts +11 -0
- package/dist/serialization/api/history.d.ts +8 -0
- package/dist/serialization/api/index.d.ts +23 -0
- package/dist/serialization/api/index.js +64 -0
- package/dist/serialization/api/items.d.ts +7 -0
- package/dist/serialization/api/items.js +132 -0
- package/dist/serialization/api/publish.d.ts +43 -0
- package/dist/serialization/api/publish.js +67 -0
- package/dist/serialization/api/roles.d.ts +8 -0
- package/dist/serialization/api/types.d.ts +65 -0
- package/dist/serialization/api/types.js +2 -0
- package/dist/serialization/api/users.d.ts +8 -0
- package/dist/serialization/commands.d.ts +0 -1
- package/dist/serialization/compare.d.ts +0 -1
- package/dist/serialization/context.d.ts +25 -0
- package/dist/serialization/context.js +58 -0
- package/dist/serialization/field-filter.d.ts +0 -1
- package/dist/serialization/filesystem-store/constants.d.ts +0 -1
- package/dist/serialization/filesystem-store/items.d.ts +0 -1
- package/dist/serialization/filesystem-store/items.js +1 -1
- package/dist/serialization/filesystem-store/roles.d.ts +1 -2
- package/dist/serialization/filesystem-store/users.d.ts +1 -2
- package/dist/serialization/filesystem-store/utils.d.ts +0 -1
- package/dist/serialization/index.d.ts +12 -0
- package/dist/serialization/index.js +32 -0
- package/dist/serialization/item-path.d.ts +0 -1
- package/dist/serialization/item-path.js +3 -3
- package/dist/serialization/path-provider.d.ts +0 -1
- package/dist/serialization/path-provider.js +4 -4
- package/dist/serialization/signature.d.ts +0 -1
- package/dist/serialization/tasks/diff.d.ts +0 -1
- package/dist/serialization/tasks/diff.js +176 -48
- package/dist/serialization/tasks/env/constants.d.ts +13 -1
- package/dist/serialization/tasks/env/constants.js +64 -1
- package/dist/serialization/tasks/env/deploy-token.d.ts +0 -1
- package/dist/serialization/tasks/env/deploy-token.js +69 -17
- package/dist/serialization/tasks/env/init/auth.d.ts +11 -3
- package/dist/serialization/tasks/env/init/auth.js +19 -17
- package/dist/serialization/tasks/env/init/deploy-lookup.d.ts +1 -2
- package/dist/serialization/tasks/env/init/deploy-lookup.js +18 -5
- package/dist/serialization/tasks/env/init.d.ts +0 -1
- package/dist/serialization/tasks/env/init.js +18 -12
- package/dist/serialization/tasks/env/logout.d.ts +0 -1
- package/dist/serialization/tasks/env/logout.js +13 -6
- package/dist/serialization/tasks/env/onboard.d.ts +40 -0
- package/dist/serialization/tasks/env/onboard.js +53 -0
- package/dist/serialization/tasks/env/setup-clients.d.ts +24 -0
- package/dist/serialization/tasks/env/setup-clients.js +119 -0
- package/dist/serialization/tasks/env/setup-env.d.ts +54 -0
- package/dist/serialization/tasks/env/setup-env.js +216 -0
- package/dist/serialization/tasks/env/setup-org-client.d.ts +21 -0
- package/dist/serialization/tasks/env/setup-org-client.js +146 -0
- package/dist/serialization/tasks/env/status.d.ts +0 -1
- package/dist/serialization/tasks/env/status.js +36 -11
- package/dist/serialization/tasks/helpers/collect.d.ts +1 -2
- package/dist/serialization/tasks/helpers/collect.js +22 -15
- package/dist/serialization/tasks/helpers/commands.d.ts +0 -1
- package/dist/serialization/tasks/helpers/filesystem.d.ts +0 -1
- package/dist/serialization/tasks/helpers/filesystem.js +4 -4
- package/dist/serialization/tasks/helpers/items.d.ts +0 -1
- package/dist/serialization/tasks/helpers/sitecore.d.ts +1 -2
- package/dist/serialization/tasks/helpers/sitecore.js +2 -2
- package/dist/serialization/tasks/info.d.ts +0 -1
- package/dist/serialization/tasks/package.d.ts +0 -1
- package/dist/serialization/tasks/package.js +21 -16
- package/dist/serialization/tasks/pull.d.ts +0 -1
- package/dist/serialization/tasks/pull.js +24 -9
- package/dist/serialization/tasks/push.d.ts +0 -1
- package/dist/serialization/tasks/push.js +27 -11
- package/dist/serialization/tasks/roles.d.ts +2 -2
- package/dist/serialization/tasks/roles.js +9 -9
- package/dist/serialization/tasks/shared.d.ts +9 -16
- package/dist/serialization/tasks/shared.js +14 -44
- package/dist/serialization/tasks/types.d.ts +44 -4
- package/dist/serialization/tasks/types.js +1 -1
- package/dist/serialization/tasks/users.d.ts +2 -2
- package/dist/serialization/tasks/users.js +9 -9
- package/dist/serialization/tasks/validate.d.ts +0 -1
- package/dist/serialization/tasks/validate.js +2 -2
- package/dist/serialization/tasks/watch.d.ts +0 -1
- package/dist/serialization/tasks/watch.js +9 -8
- package/dist/serialization/tree-spec.d.ts +0 -1
- package/dist/serialization/tree-spec.js +21 -21
- package/dist/serialization/types.d.ts +0 -1
- package/dist/serialization/wildcard.d.ts +0 -1
- package/dist/serialization/wildcard.js +2 -2
- package/dist/serialization/yaml.d.ts +0 -1
- package/dist/serialization/yaml.js +1 -1
- package/dist/shared/browser.d.ts +0 -1
- package/dist/shared/cli-options.d.ts +0 -1
- package/dist/shared/cli-tasks.d.ts +1 -2
- package/dist/shared/cli-tasks.js +2 -2
- package/dist/shared/client-credential.d.ts +82 -0
- package/dist/shared/client-credential.js +117 -0
- package/dist/shared/concurrency.d.ts +20 -0
- package/dist/shared/concurrency.js +67 -0
- package/dist/shared/config-template.d.ts +0 -1
- package/dist/shared/credential-matrix.d.ts +83 -0
- package/dist/shared/credential-matrix.js +65 -0
- package/dist/shared/env-tier.d.ts +2 -0
- package/dist/shared/env-tier.js +31 -0
- package/dist/shared/envelope.d.ts +69 -0
- package/dist/shared/envelope.js +84 -0
- package/dist/shared/errors.d.ts +79 -9
- package/dist/shared/errors.js +49 -11
- package/dist/shared/graphql.d.ts +2 -3
- package/dist/shared/graphql.js +31 -15
- package/dist/shared/history.d.ts +25 -1
- package/dist/shared/history.js +35 -1
- package/dist/shared/human-only-operations.d.ts +28 -0
- package/dist/shared/human-only-operations.js +33 -0
- package/dist/shared/keychain.d.ts +68 -1
- package/dist/shared/keychain.js +416 -46
- package/dist/shared/logger.d.ts +2 -1
- package/dist/shared/logger.js +12 -1
- package/dist/shared/output.d.ts +0 -1
- package/dist/shared/prompt.d.ts +0 -1
- package/dist/shared/prompt.js +2 -2
- package/dist/shared/publish-audit.d.ts +154 -0
- package/dist/shared/publish-audit.js +52 -0
- package/dist/shared/publish-consent.d.ts +104 -0
- package/dist/shared/publish-consent.js +148 -0
- package/dist/shared/redact.d.ts +0 -1
- package/dist/shared/redact.js +4 -2
- package/dist/shared/region.d.ts +96 -0
- package/dist/shared/region.js +129 -0
- package/dist/shared/rwlock.d.ts +43 -0
- package/dist/shared/rwlock.js +110 -0
- package/dist/shared/spinner.d.ts +0 -1
- package/dist/shared/style.d.ts +0 -1
- package/dist/shared/telemetry.d.ts +15 -2
- package/dist/shared/telemetry.js +59 -34
- package/dist/shared/topics.d.ts +33 -0
- package/dist/shared/topics.js +151 -0
- package/dist/shared/validate.d.ts +0 -1
- package/dist/shared/validate.js +18 -3
- package/dist/sites/api/collections.d.ts +0 -1
- package/dist/sites/api/jobs.d.ts +0 -1
- package/dist/sites/api/languages.d.ts +0 -1
- package/dist/sites/api/request.d.ts +0 -1
- package/dist/sites/api/request.js +13 -4
- package/dist/sites/api/sites.d.ts +44 -1
- package/dist/sites/api/sites.js +42 -1
- package/dist/sites/api/types.d.ts +0 -1
- package/dist/sites/index.d.ts +25 -0
- package/dist/sites/index.js +44 -0
- package/dist/sync/aggregate-kinds.d.ts +7 -0
- package/dist/sync/aggregate-kinds.js +32 -0
- package/dist/sync/aggregate.d.ts +100 -0
- package/dist/sync/aggregate.js +173 -0
- package/dist/sync/engine.d.ts +28 -0
- package/dist/sync/engine.js +38 -0
- package/dist/sync/index.d.ts +18 -0
- package/dist/sync/index.js +25 -0
- package/dist/sync/io.d.ts +8 -0
- package/dist/sync/io.js +52 -0
- package/dist/sync/kind.d.ts +80 -0
- package/dist/sync/kind.js +2 -0
- package/dist/sync/plan.d.ts +55 -0
- package/dist/sync/plan.js +27 -0
- package/dist/sync/registry.d.ts +7 -0
- package/dist/sync/registry.js +36 -0
- package/dist/webhooks/api/client.d.ts +134 -0
- package/dist/webhooks/api/client.js +326 -0
- package/dist/webhooks/api/graphql.d.ts +4 -0
- package/dist/webhooks/api/graphql.js +18 -0
- package/dist/webhooks/api/templates.d.ts +41 -0
- package/dist/webhooks/api/templates.js +78 -0
- package/dist/webhooks/index.d.ts +16 -0
- package/dist/webhooks/index.js +43 -0
- package/dist/webhooks/tasks/create.d.ts +58 -0
- package/dist/webhooks/tasks/create.js +127 -0
- package/dist/webhooks/tasks/delete.d.ts +14 -0
- package/dist/webhooks/tasks/delete.js +57 -0
- package/dist/webhooks/tasks/event-types.d.ts +21 -0
- package/dist/webhooks/tasks/event-types.js +32 -0
- package/dist/webhooks/tasks/inspect.d.ts +12 -0
- package/dist/webhooks/tasks/inspect.js +65 -0
- package/dist/webhooks/tasks/list.d.ts +29 -0
- package/dist/webhooks/tasks/list.js +41 -0
- package/dist/webhooks/tasks/shared.d.ts +35 -0
- package/dist/webhooks/tasks/shared.js +38 -0
- package/dist/workflow/api/client.d.ts +208 -0
- package/dist/workflow/api/client.js +421 -0
- package/dist/workflow/api/graphql.d.ts +4 -0
- package/dist/workflow/api/graphql.js +18 -0
- package/dist/workflow/api/resolve-command.d.ts +27 -0
- package/dist/workflow/api/resolve-command.js +26 -0
- package/dist/workflow/index.d.ts +18 -0
- package/dist/workflow/index.js +37 -0
- package/dist/workflow/tasks/advance.d.ts +39 -0
- package/dist/workflow/tasks/advance.js +182 -0
- package/dist/workflow/tasks/apply.d.ts +47 -0
- package/dist/workflow/tasks/apply.js +193 -0
- package/dist/workflow/tasks/assigned.d.ts +33 -0
- package/dist/workflow/tasks/assigned.js +41 -0
- package/dist/workflow/tasks/inspect.d.ts +60 -0
- package/dist/workflow/tasks/inspect.js +171 -0
- package/dist/workflow/tasks/list-commands.d.ts +21 -0
- package/dist/workflow/tasks/list-commands.js +54 -0
- package/dist/workflow/tasks/list-defs.d.ts +21 -0
- package/dist/workflow/tasks/list-defs.js +28 -0
- package/dist/workflow/tasks/reset.d.ts +33 -0
- package/dist/workflow/tasks/reset.js +137 -0
- package/dist/workflow/tasks/shared.d.ts +75 -0
- package/dist/workflow/tasks/shared.js +124 -0
- package/dist/workflow/tasks/status.d.ts +21 -0
- package/dist/workflow/tasks/status.js +41 -0
- package/package.json +102 -8
- package/dist/cli.d.ts.map +0 -1
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/deploy/deployments.d.ts.map +0 -1
- package/dist/commands/deploy/editing-host.d.ts.map +0 -1
- package/dist/commands/deploy/environments/deployments.d.ts.map +0 -1
- package/dist/commands/deploy/environments/index.d.ts.map +0 -1
- package/dist/commands/deploy/environments/mutations.d.ts.map +0 -1
- package/dist/commands/deploy/environments/queries.d.ts.map +0 -1
- package/dist/commands/deploy/environments/variables.d.ts.map +0 -1
- package/dist/commands/deploy/environments.d.ts.map +0 -1
- package/dist/commands/deploy/index.d.ts.map +0 -1
- package/dist/commands/deploy/logs.d.ts.map +0 -1
- package/dist/commands/deploy/organizations.d.ts.map +0 -1
- package/dist/commands/deploy/projects.d.ts.map +0 -1
- package/dist/commands/deploy/shared.d.ts.map +0 -1
- package/dist/commands/deploy/site.d.ts.map +0 -1
- package/dist/commands/deploy/source-control.d.ts.map +0 -1
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/history.d.ts.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/logout.d.ts.map +0 -1
- package/dist/commands/recipe/index.d.ts.map +0 -1
- package/dist/commands/serialization/index.d.ts.map +0 -1
- package/dist/commands/serialization/package.d.ts.map +0 -1
- package/dist/commands/shared.d.ts.map +0 -1
- package/dist/commands/shell.d.ts.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/telemetry.d.ts.map +0 -1
- package/dist/config/env-overrides.d.ts.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/modules.d.ts.map +0 -1
- package/dist/config/paths.d.ts.map +0 -1
- package/dist/config/root-config.d.ts.map +0 -1
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/validation.d.ts.map +0 -1
- package/dist/deploy/api/common/headers.d.ts.map +0 -1
- package/dist/deploy/api/common/index.d.ts +0 -4
- package/dist/deploy/api/common/index.d.ts.map +0 -1
- package/dist/deploy/api/common/index.js +0 -19
- package/dist/deploy/api/common/request.d.ts.map +0 -1
- package/dist/deploy/api/common/types.d.ts.map +0 -1
- package/dist/deploy/api/common.d.ts +0 -2
- package/dist/deploy/api/common.d.ts.map +0 -1
- package/dist/deploy/api/common.js +0 -17
- package/dist/deploy/api/deployment-logs.d.ts.map +0 -1
- package/dist/deploy/api/deployments.d.ts.map +0 -1
- package/dist/deploy/api/environments.d.ts.map +0 -1
- package/dist/deploy/api/index.d.ts.map +0 -1
- package/dist/deploy/api/logs.d.ts.map +0 -1
- package/dist/deploy/api/organizations.d.ts.map +0 -1
- package/dist/deploy/api/projects.d.ts.map +0 -1
- package/dist/deploy/api/source-control.d.ts.map +0 -1
- package/dist/deploy/api.d.ts.map +0 -1
- package/dist/deploy/tasks/deployment-result.d.ts.map +0 -1
- package/dist/deploy/tasks/deployments.d.ts.map +0 -1
- package/dist/deploy/tasks/editing-host.d.ts.map +0 -1
- package/dist/deploy/tasks/environments.d.ts.map +0 -1
- package/dist/deploy/tasks/index.d.ts +0 -10
- package/dist/deploy/tasks/index.d.ts.map +0 -1
- package/dist/deploy/tasks/index.js +0 -25
- package/dist/deploy/tasks/logs.d.ts.map +0 -1
- package/dist/deploy/tasks/organizations.d.ts.map +0 -1
- package/dist/deploy/tasks/projects.d.ts.map +0 -1
- package/dist/deploy/tasks/shared.d.ts.map +0 -1
- package/dist/deploy/tasks/site-bind.d.ts.map +0 -1
- package/dist/deploy/tasks/site.d.ts.map +0 -1
- package/dist/deploy/tasks/source-control.d.ts.map +0 -1
- package/dist/deploy/tasks/types.d.ts.map +0 -1
- package/dist/deploy/tasks.d.ts +0 -3
- package/dist/deploy/tasks.d.ts.map +0 -1
- package/dist/deploy/tasks.js +0 -18
- package/dist/recipe/api/auth.d.ts.map +0 -1
- package/dist/recipe/api/authoring-client.d.ts.map +0 -1
- package/dist/recipe/api/client.d.ts.map +0 -1
- package/dist/recipe/api/graphql.d.ts.map +0 -1
- package/dist/recipe/api/ref-encoding.d.ts.map +0 -1
- package/dist/recipe/api/site-discovery.d.ts.map +0 -1
- package/dist/recipe/api/sites-client.d.ts.map +0 -1
- package/dist/recipe/cache.d.ts.map +0 -1
- package/dist/recipe/compile/component-section.d.ts.map +0 -1
- package/dist/recipe/compile/component-template.d.ts.map +0 -1
- package/dist/recipe/compile/content-item.d.ts.map +0 -1
- package/dist/recipe/compile/content-template.d.ts.map +0 -1
- package/dist/recipe/compile/enumeration.d.ts.map +0 -1
- package/dist/recipe/compile/page-design.d.ts.map +0 -1
- package/dist/recipe/compile/parameters-template.d.ts +0 -14
- package/dist/recipe/compile/parameters-template.d.ts.map +0 -1
- package/dist/recipe/compile/parameters-template.js +0 -92
- package/dist/recipe/compile/partial-design.d.ts.map +0 -1
- package/dist/recipe/compile/section-definition.d.ts.map +0 -1
- package/dist/recipe/compile/shared.d.ts.map +0 -1
- package/dist/recipe/compile/site-template.d.ts.map +0 -1
- package/dist/recipe/compile/site.d.ts.map +0 -1
- package/dist/recipe/compile.d.ts.map +0 -1
- package/dist/recipe/execute.d.ts.map +0 -1
- package/dist/recipe/guids.d.ts.map +0 -1
- package/dist/recipe/index.d.ts.map +0 -1
- package/dist/recipe/io.d.ts.map +0 -1
- package/dist/recipe/ir/operations.d.ts.map +0 -1
- package/dist/recipe/ir/sitecore-templates.d.ts.map +0 -1
- package/dist/recipe/layout/emit.d.ts.map +0 -1
- package/dist/recipe/layout/templates-mapping.d.ts.map +0 -1
- package/dist/recipe/plan.d.ts.map +0 -1
- package/dist/recipe/policy.d.ts.map +0 -1
- package/dist/recipe/rollback.d.ts.map +0 -1
- package/dist/recipe/schema/field-types.d.ts.map +0 -1
- package/dist/recipe/schema/recipe.d.ts.map +0 -1
- package/dist/recipe/schema/source-fields.d.ts.map +0 -1
- package/dist/recipe/tasks/compile.d.ts.map +0 -1
- package/dist/recipe/tasks/diff.d.ts.map +0 -1
- package/dist/recipe/tasks/index.d.ts +0 -9
- package/dist/recipe/tasks/index.d.ts.map +0 -1
- package/dist/recipe/tasks/index.js +0 -13
- package/dist/recipe/tasks/placeholder-allow.d.ts.map +0 -1
- package/dist/recipe/tasks/plan.d.ts.map +0 -1
- package/dist/recipe/tasks/prune-defaults.d.ts.map +0 -1
- package/dist/recipe/tasks/push.d.ts.map +0 -1
- package/dist/recipe/tasks/shared.d.ts.map +0 -1
- package/dist/recipe/validate.d.ts.map +0 -1
- package/dist/serialization/commands.d.ts.map +0 -1
- package/dist/serialization/compare.d.ts.map +0 -1
- package/dist/serialization/field-filter.d.ts.map +0 -1
- package/dist/serialization/filesystem-store/constants.d.ts.map +0 -1
- package/dist/serialization/filesystem-store/index.d.ts +0 -4
- package/dist/serialization/filesystem-store/index.d.ts.map +0 -1
- package/dist/serialization/filesystem-store/index.js +0 -15
- package/dist/serialization/filesystem-store/items.d.ts.map +0 -1
- package/dist/serialization/filesystem-store/roles.d.ts.map +0 -1
- package/dist/serialization/filesystem-store/users.d.ts.map +0 -1
- package/dist/serialization/filesystem-store/utils.d.ts.map +0 -1
- package/dist/serialization/filesystem-store.d.ts +0 -2
- package/dist/serialization/filesystem-store.d.ts.map +0 -1
- package/dist/serialization/filesystem-store.js +0 -17
- package/dist/serialization/item-path.d.ts.map +0 -1
- package/dist/serialization/path-provider.d.ts.map +0 -1
- package/dist/serialization/signature.d.ts.map +0 -1
- package/dist/serialization/sitecore-api/auth.d.ts +0 -31
- package/dist/serialization/sitecore-api/auth.d.ts.map +0 -1
- package/dist/serialization/sitecore-api/auth.js +0 -319
- package/dist/serialization/sitecore-api/graphql.d.ts +0 -12
- package/dist/serialization/sitecore-api/graphql.d.ts.map +0 -1
- package/dist/serialization/sitecore-api/history.d.ts +0 -9
- package/dist/serialization/sitecore-api/history.d.ts.map +0 -1
- package/dist/serialization/sitecore-api/index.d.ts +0 -7
- package/dist/serialization/sitecore-api/index.d.ts.map +0 -1
- package/dist/serialization/sitecore-api/index.js +0 -22
- package/dist/serialization/sitecore-api/items.d.ts +0 -8
- package/dist/serialization/sitecore-api/items.d.ts.map +0 -1
- package/dist/serialization/sitecore-api/items.js +0 -132
- package/dist/serialization/sitecore-api/publish.d.ts +0 -14
- package/dist/serialization/sitecore-api/publish.d.ts.map +0 -1
- package/dist/serialization/sitecore-api/publish.js +0 -43
- package/dist/serialization/sitecore-api/roles.d.ts +0 -9
- package/dist/serialization/sitecore-api/roles.d.ts.map +0 -1
- package/dist/serialization/sitecore-api/users.d.ts +0 -9
- package/dist/serialization/sitecore-api/users.d.ts.map +0 -1
- package/dist/serialization/sitecore-api.d.ts +0 -2
- package/dist/serialization/sitecore-api.d.ts.map +0 -1
- package/dist/serialization/sitecore-api.js +0 -17
- package/dist/serialization/tasks/diff.d.ts.map +0 -1
- package/dist/serialization/tasks/env/constants.d.ts.map +0 -1
- package/dist/serialization/tasks/env/deploy-token.d.ts.map +0 -1
- package/dist/serialization/tasks/env/index.d.ts +0 -5
- package/dist/serialization/tasks/env/index.d.ts.map +0 -1
- package/dist/serialization/tasks/env/index.js +0 -11
- package/dist/serialization/tasks/env/init/auth.d.ts.map +0 -1
- package/dist/serialization/tasks/env/init/deploy-lookup.d.ts.map +0 -1
- package/dist/serialization/tasks/env/init.d.ts.map +0 -1
- package/dist/serialization/tasks/env/logout.d.ts.map +0 -1
- package/dist/serialization/tasks/env/status.d.ts.map +0 -1
- package/dist/serialization/tasks/env.d.ts +0 -2
- package/dist/serialization/tasks/env.d.ts.map +0 -1
- package/dist/serialization/tasks/env.js +0 -17
- package/dist/serialization/tasks/helpers/collect.d.ts.map +0 -1
- package/dist/serialization/tasks/helpers/commands.d.ts.map +0 -1
- package/dist/serialization/tasks/helpers/filesystem.d.ts.map +0 -1
- package/dist/serialization/tasks/helpers/index.d.ts +0 -6
- package/dist/serialization/tasks/helpers/index.d.ts.map +0 -1
- package/dist/serialization/tasks/helpers/index.js +0 -13
- package/dist/serialization/tasks/helpers/items.d.ts.map +0 -1
- package/dist/serialization/tasks/helpers/sitecore.d.ts.map +0 -1
- package/dist/serialization/tasks/helpers.d.ts +0 -2
- package/dist/serialization/tasks/helpers.d.ts.map +0 -1
- package/dist/serialization/tasks/helpers.js +0 -17
- package/dist/serialization/tasks/index.d.ts +0 -8
- package/dist/serialization/tasks/index.d.ts.map +0 -1
- package/dist/serialization/tasks/index.js +0 -19
- package/dist/serialization/tasks/info.d.ts.map +0 -1
- package/dist/serialization/tasks/package.d.ts.map +0 -1
- package/dist/serialization/tasks/pull.d.ts.map +0 -1
- package/dist/serialization/tasks/push.d.ts.map +0 -1
- package/dist/serialization/tasks/roles.d.ts.map +0 -1
- package/dist/serialization/tasks/shared.d.ts.map +0 -1
- package/dist/serialization/tasks/types.d.ts.map +0 -1
- package/dist/serialization/tasks/users.d.ts.map +0 -1
- package/dist/serialization/tasks/validate.d.ts.map +0 -1
- package/dist/serialization/tasks/watch.d.ts.map +0 -1
- package/dist/serialization/tasks.d.ts +0 -4
- package/dist/serialization/tasks.d.ts.map +0 -1
- package/dist/serialization/tasks.js +0 -19
- package/dist/serialization/tree-spec.d.ts.map +0 -1
- package/dist/serialization/types.d.ts.map +0 -1
- package/dist/serialization/wildcard.d.ts.map +0 -1
- package/dist/serialization/yaml.d.ts.map +0 -1
- package/dist/shared/browser.d.ts.map +0 -1
- package/dist/shared/cli-options.d.ts.map +0 -1
- package/dist/shared/cli-tasks.d.ts.map +0 -1
- package/dist/shared/config-template.d.ts.map +0 -1
- package/dist/shared/env.d.ts +0 -28
- package/dist/shared/env.d.ts.map +0 -1
- package/dist/shared/env.js +0 -38
- package/dist/shared/errors.d.ts.map +0 -1
- package/dist/shared/graphql.d.ts.map +0 -1
- package/dist/shared/history.d.ts.map +0 -1
- package/dist/shared/keychain.d.ts.map +0 -1
- package/dist/shared/logger.d.ts.map +0 -1
- package/dist/shared/output.d.ts.map +0 -1
- package/dist/shared/prompt.d.ts.map +0 -1
- package/dist/shared/redact.d.ts.map +0 -1
- package/dist/shared/spinner.d.ts.map +0 -1
- package/dist/shared/style.d.ts.map +0 -1
- package/dist/shared/telemetry.d.ts.map +0 -1
- package/dist/shared/validate.d.ts.map +0 -1
- package/dist/sites/api/collections.d.ts.map +0 -1
- package/dist/sites/api/index.d.ts +0 -26
- package/dist/sites/api/index.d.ts.map +0 -1
- package/dist/sites/api/index.js +0 -55
- package/dist/sites/api/jobs.d.ts.map +0 -1
- package/dist/sites/api/languages.d.ts.map +0 -1
- package/dist/sites/api/request.d.ts.map +0 -1
- package/dist/sites/api/sites.d.ts.map +0 -1
- package/dist/sites/api/types.d.ts.map +0 -1
- /package/dist/serialization/{sitecore-api → api}/graphql.js +0 -0
- /package/dist/serialization/{sitecore-api → api}/history.js +0 -0
- /package/dist/serialization/{sitecore-api → api}/roles.js +0 -0
- /package/dist/serialization/{sitecore-api → api}/users.js +0 -0
|
@@ -0,0 +1,1285 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Reverse-projection — live Sitecore items → clean `Recipe` objects.
|
|
4
|
+
*
|
|
5
|
+
* This is the inverse of `src/recipe/compile/*`: where the compilers turn
|
|
6
|
+
* recipes into the Sitecore items a push would create, `readCurrent` walks
|
|
7
|
+
* the items a compiler *would have* produced and reconstructs the recipe.
|
|
8
|
+
* It is the `readCurrent` half of the `recipe` recipe kind (see
|
|
9
|
+
* `recipe-kind.ts` and docs/recipe-sync-architecture.md).
|
|
10
|
+
*
|
|
11
|
+
* ## Scope
|
|
12
|
+
*
|
|
13
|
+
* Nine recipe kinds reverse-project here — those whose item layout is
|
|
14
|
+
* stable and recoverable from the content tree alone:
|
|
15
|
+
*
|
|
16
|
+
* 1. `component-section` — a Template Folder directly under componentsRoot
|
|
17
|
+
* 2. `component-template` — a Template with a matching rendering item
|
|
18
|
+
* 3. `content-template` — a Template under contentModelsRoot, no rendering
|
|
19
|
+
* 4. `page-template` — a Template carrying the SXA page base set
|
|
20
|
+
* 5. `enumeration` — an Enumeration container under enumerationsRoot
|
|
21
|
+
* 6. `partial-design` — an SXA Partial Design item under partialDesignsRoot
|
|
22
|
+
* 7. `page-design` — an SXA Page Design item under pageDesignsRoot
|
|
23
|
+
* 8. `page` — a page item under pagesRoot
|
|
24
|
+
* 9. `placeholder` — a Placeholder Settings item under
|
|
25
|
+
* placeholderSettingsRoot
|
|
26
|
+
*
|
|
27
|
+
* Kinds 6–9 are the layout-bearing (and layout-adjacent) kinds: their
|
|
28
|
+
* fidelity hinges on parsing Sitecore layout XML back into the recipe
|
|
29
|
+
* `Layout` structure — `src/recipe/layout/parse.ts`, the inverse of
|
|
30
|
+
* `layout/emit.ts`. GUIDs inside the layout XML reference renderings and
|
|
31
|
+
* datasources; `readCurrent` builds a GUID→handle index off the
|
|
32
|
+
* `Scai Handle` marker (see `buildGuidHandleIndex`) and resolves them.
|
|
33
|
+
*
|
|
34
|
+
* Items under the configured roots that match none of these patterns are
|
|
35
|
+
* silently skipped — not an error. The remaining kinds (site, workflow,
|
|
36
|
+
* content-item, webhook-authorization, …) live in trees this walk doesn't
|
|
37
|
+
* visit; `readCurrent` just doesn't produce them.
|
|
38
|
+
*
|
|
39
|
+
* ## Fidelity — this projection is LOSSY by design
|
|
40
|
+
*
|
|
41
|
+
* Recipes carry high-level *intent* the item tree doesn't preserve. The
|
|
42
|
+
* contract is a documented best-effort: reconstruct what the items
|
|
43
|
+
* faithfully yield, and where a recipe field genuinely can't be recovered,
|
|
44
|
+
* **omit it or use the schema default — never fabricate a value**. A
|
|
45
|
+
* `readCurrent` → compile → `plan` round-trip on an unchanged environment
|
|
46
|
+
* should be close to all-`noop`; perfect is the goal, best-effort is the
|
|
47
|
+
* accepted v1 bar. See the per-kind JSDoc below for exactly what is faithful
|
|
48
|
+
* vs. approximated vs. omitted.
|
|
49
|
+
*
|
|
50
|
+
* Layout-XML reverse parsing is itself lossy at the GUID-resolution step:
|
|
51
|
+
* a layout `<r>` element that references a GUID with no `Scai Handle`
|
|
52
|
+
* marker is genuinely unrecoverable — the placement is dropped rather than
|
|
53
|
+
* pointed at a fabricated handle. See `placementFromParsed`.
|
|
54
|
+
*
|
|
55
|
+
* ## v1 limitation
|
|
56
|
+
*
|
|
57
|
+
* `ref.id` is ignored — `readCurrent` pulls every reverse-projectable
|
|
58
|
+
* subtree under the configured roots. Scoping the pull to a single item by
|
|
59
|
+
* name is a future refinement; the orchestrator (`recipe-kind.ts`) passes
|
|
60
|
+
* the whole-set `KindRef` today.
|
|
61
|
+
*/
|
|
62
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
|
+
exports.readCurrentRecipes = void 0;
|
|
64
|
+
const sitecore_templates_1 = require("./ir/sitecore-templates");
|
|
65
|
+
const parse_1 = require("./layout/parse");
|
|
66
|
+
const marker_1 = require("./marker");
|
|
67
|
+
const field_types_1 = require("./schema/field-types");
|
|
68
|
+
/**
|
|
69
|
+
* Normalise a Sitecore GUID for comparison: lowercase, strip curly braces
|
|
70
|
+
* and hyphens. The Authoring API returns GUIDs hyphen-less
|
|
71
|
+
* (`1930bbeb7805471a…`) while the built-in template constants are
|
|
72
|
+
* hyphenated — normalising both sides to the bare 32-hex form is what makes
|
|
73
|
+
* `conformsTo` / `guidEquals` actually match against a live tenant.
|
|
74
|
+
*/
|
|
75
|
+
const normalizeGuid = (guid) => guid.trim().toLowerCase().replace(/[{}-]/g, "");
|
|
76
|
+
/** True when two Sitecore GUIDs refer to the same item (curly/case-insensitive). */
|
|
77
|
+
const guidEquals = (a, b) => a !== undefined && b !== undefined && normalizeGuid(a) === normalizeGuid(b);
|
|
78
|
+
/**
|
|
79
|
+
* Look up a field value on a `RemoteItem` by field GUID OR field name. The
|
|
80
|
+
* compiler emits some fields by GUID and some by name; reverse-projection
|
|
81
|
+
* matches on either so it stays robust against the GUID/name split the
|
|
82
|
+
* executor's resolver papers over (see `RemoteFieldValue.name`).
|
|
83
|
+
*/
|
|
84
|
+
const fieldValue = (item, fieldId, fieldName) => {
|
|
85
|
+
const byId = item.fields.find((f) => guidEquals(f.fieldId, fieldId));
|
|
86
|
+
if (byId)
|
|
87
|
+
return byId.value;
|
|
88
|
+
if (fieldName) {
|
|
89
|
+
const byName = item.fields.find((f) => f.name !== undefined && f.name.toLowerCase() === fieldName.toLowerCase());
|
|
90
|
+
if (byName)
|
|
91
|
+
return byName.value;
|
|
92
|
+
}
|
|
93
|
+
return undefined;
|
|
94
|
+
};
|
|
95
|
+
/** Find a field value by field NAME only (case-insensitive). */
|
|
96
|
+
const fieldValueByName = (item, fieldName) => {
|
|
97
|
+
const match = item.fields.find((f) => f.name !== undefined && f.name.toLowerCase() === fieldName.toLowerCase());
|
|
98
|
+
return match?.value;
|
|
99
|
+
};
|
|
100
|
+
/** True when the item conforms to the given Sitecore built-in template. */
|
|
101
|
+
const conformsTo = (item, templateId) => guidEquals(item.templateId, templateId);
|
|
102
|
+
/**
|
|
103
|
+
* Synthesise a recipe `handle` (`<kebab-name>@<major>`) from an item name.
|
|
104
|
+
* The fallback for *unmarked* items only — see `handleOf`. We kebab-case the
|
|
105
|
+
* item name and pin major version `1`.
|
|
106
|
+
*
|
|
107
|
+
* LOSSY: if the original recipe handle differed from `kebab(name)@1` (e.g.
|
|
108
|
+
* a `@2` major, or a handle that doesn't track the name), the round-trip
|
|
109
|
+
* produces a different handle — and therefore different derived GUIDs.
|
|
110
|
+
* Acceptable for v1: a synthesised handle is only ever used for an item the
|
|
111
|
+
* `Scai Handle` marker didn't cover (an environment scai never pushed to, or
|
|
112
|
+
* an item authored outside scai), and a pulled recipe is re-authored
|
|
113
|
+
* material, not a byte-exact mirror.
|
|
114
|
+
*/
|
|
115
|
+
const handleFromName = (name) => {
|
|
116
|
+
const kebab = name
|
|
117
|
+
.trim()
|
|
118
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1-$2")
|
|
119
|
+
.replace(/[^a-zA-Z0-9]+/g, "-")
|
|
120
|
+
.replace(/^-+|-+$/g, "")
|
|
121
|
+
.toLowerCase();
|
|
122
|
+
// Handles must match /^[a-z][a-z0-9-]*@[0-9]+$/ — guard a leading digit.
|
|
123
|
+
const safe = /^[a-z]/.test(kebab) ? kebab : `x-${kebab}`;
|
|
124
|
+
return `${safe || "item"}@1`;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Recover an item's recipe handle — its stable identity.
|
|
128
|
+
*
|
|
129
|
+
* Prefers the `Scai Handle` marker field, which carries the *exact* handle
|
|
130
|
+
* `push` stamped on every recipe-managed item: a marked item round-trips to
|
|
131
|
+
* the author's real handle regardless of how the item was later moved or
|
|
132
|
+
* renamed. Falls back to synthesising one from the item name
|
|
133
|
+
* (`handleFromName`) only for unmarked items — a first capture of an
|
|
134
|
+
* environment scai never pushed to, or items created outside scai.
|
|
135
|
+
*
|
|
136
|
+
* See `marker.ts` and docs/recipe-sync-architecture.md, "Recipe identity".
|
|
137
|
+
*/
|
|
138
|
+
const handleOf = (item) => {
|
|
139
|
+
const marked = fieldValueByName(item, marker_1.SCAI_HANDLE_FIELD_NAME);
|
|
140
|
+
if (marked !== undefined && marked.trim() !== "")
|
|
141
|
+
return marked.trim();
|
|
142
|
+
return handleFromName(item.name);
|
|
143
|
+
};
|
|
144
|
+
/** Sitecore stores child sort order; default 0 when absent. */
|
|
145
|
+
const sortOrderOf = (item) => {
|
|
146
|
+
const raw = fieldValue(item, sitecore_templates_1.SYSTEM_FIELDS.SORT_ORDER, "__Sortorder");
|
|
147
|
+
const n = raw === undefined ? NaN : Number.parseInt(raw, 10);
|
|
148
|
+
return Number.isFinite(n) ? n : 0;
|
|
149
|
+
};
|
|
150
|
+
/** Stable child ordering: Sitecore sort order, then name as a tiebreak. */
|
|
151
|
+
const byTreeOrder = (a, b) => {
|
|
152
|
+
const so = sortOrderOf(a) - sortOrderOf(b);
|
|
153
|
+
return so !== 0 ? so : a.name.localeCompare(b.name);
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Inverse of `sitecoreFieldTypeLabel` — the stored `Type` string
|
|
157
|
+
* (`"Single-Line Text"`, `"Rich Text"`, …) back to its `SitecoreFieldType`
|
|
158
|
+
* token. Returns `undefined` for an unrecognised label.
|
|
159
|
+
*/
|
|
160
|
+
const SITECORE_TYPES = [
|
|
161
|
+
"single-line-text",
|
|
162
|
+
"multi-line-text",
|
|
163
|
+
"rich-text",
|
|
164
|
+
"image",
|
|
165
|
+
"file",
|
|
166
|
+
"general-link",
|
|
167
|
+
"checkbox",
|
|
168
|
+
"number",
|
|
169
|
+
"integer",
|
|
170
|
+
"date",
|
|
171
|
+
"datetime",
|
|
172
|
+
"droplist",
|
|
173
|
+
"droplink",
|
|
174
|
+
"treelist",
|
|
175
|
+
"treelist-with-search",
|
|
176
|
+
"lookup",
|
|
177
|
+
"tags",
|
|
178
|
+
];
|
|
179
|
+
const sitecoreTypeFromLabel = (label) => {
|
|
180
|
+
const target = label.trim().toLowerCase();
|
|
181
|
+
return SITECORE_TYPES.find((t) => (0, field_types_1.sitecoreFieldTypeLabel)(t).toLowerCase() === target);
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Map a stored Sitecore field type back to the recipe's abstract
|
|
185
|
+
* `FieldShape`. This inverts `defaultSitecoreFieldType`.
|
|
186
|
+
*
|
|
187
|
+
* LOSSY: the forward map is many-to-one in places, so the inverse picks the
|
|
188
|
+
* canonical shape. Notably `droplink` could originate from either
|
|
189
|
+
* `shape: "enum"` or `shape: "reference"` (single) — `fieldFromItem`
|
|
190
|
+
* disambiguates using the presence of a `Source` (enum → `Source` is an
|
|
191
|
+
* enumerations path; bare reference → typically no enum-shaped source). The
|
|
192
|
+
* raw type is always preserved verbatim on `sitecore.type` so the field
|
|
193
|
+
* still compiles to the exact same Sitecore type regardless.
|
|
194
|
+
*/
|
|
195
|
+
const shapeFromSitecoreType = (type) => {
|
|
196
|
+
switch (type) {
|
|
197
|
+
case "single-line-text":
|
|
198
|
+
return "text";
|
|
199
|
+
case "multi-line-text":
|
|
200
|
+
return "text";
|
|
201
|
+
case "rich-text":
|
|
202
|
+
return "richText";
|
|
203
|
+
case "image":
|
|
204
|
+
return "image";
|
|
205
|
+
case "file":
|
|
206
|
+
return "image";
|
|
207
|
+
case "general-link":
|
|
208
|
+
return "link";
|
|
209
|
+
case "checkbox":
|
|
210
|
+
return "boolean";
|
|
211
|
+
case "number":
|
|
212
|
+
return "number";
|
|
213
|
+
case "integer":
|
|
214
|
+
return "integer";
|
|
215
|
+
case "date":
|
|
216
|
+
return "date";
|
|
217
|
+
case "datetime":
|
|
218
|
+
return "datetime";
|
|
219
|
+
case "droplist":
|
|
220
|
+
return "enum";
|
|
221
|
+
case "droplink":
|
|
222
|
+
return "reference";
|
|
223
|
+
case "treelist":
|
|
224
|
+
return "reference";
|
|
225
|
+
case "treelist-with-search":
|
|
226
|
+
return "reference";
|
|
227
|
+
case "lookup":
|
|
228
|
+
return "reference";
|
|
229
|
+
case "tags":
|
|
230
|
+
return "reference";
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Reverse-project a single `TEMPLATE_FIELD` item into a `FieldDefinition`.
|
|
235
|
+
*
|
|
236
|
+
* Faithful: field `name`, the Sitecore `Type` (carried verbatim on
|
|
237
|
+
* `sitecore.type`), the section it lives under (`sitecore.section`),
|
|
238
|
+
* `sitecore.sortOrder`, and the storage axis (`sitecore.storage`, recovered
|
|
239
|
+
* from the field's `Shared` / `Unversioned` flags). The `Source` value is
|
|
240
|
+
* preserved verbatim via `sitecore.sourceRaw` — the structured
|
|
241
|
+
* `sourceTypes`/`sourceQuery`/`sourceScope` decomposition is intentionally
|
|
242
|
+
* NOT reverse-engineered (it would require parsing the URL-encoded Source
|
|
243
|
+
* and resolving GUIDs back to handles); `sourceRaw` round-trips to the
|
|
244
|
+
* identical wire string.
|
|
245
|
+
*
|
|
246
|
+
* LOSSY / omitted: `required`, `hint`, `default`, `enumHandle`, and the
|
|
247
|
+
* abstract `multiple` flag are not recoverable from a field item alone and
|
|
248
|
+
* are omitted. The abstract `shape` is a best-effort inverse of the stored
|
|
249
|
+
* `Type` — see `shapeFromSitecoreType`.
|
|
250
|
+
*/
|
|
251
|
+
const fieldFromItem = (fieldItem, sectionName) => {
|
|
252
|
+
const typeLabel = fieldValue(fieldItem, sitecore_templates_1.TEMPLATE_FIELD_FIELDS.TYPE, "Type");
|
|
253
|
+
const sitecoreType = typeLabel ? sitecoreTypeFromLabel(typeLabel) : undefined;
|
|
254
|
+
const shape = sitecoreType ? shapeFromSitecoreType(sitecoreType) : "text";
|
|
255
|
+
const augment = {};
|
|
256
|
+
// Carry the exact Sitecore type so the field compiles back to the same
|
|
257
|
+
// type even when the abstract shape inverse is imperfect.
|
|
258
|
+
if (sitecoreType)
|
|
259
|
+
augment.type = sitecoreType;
|
|
260
|
+
const source = fieldValue(fieldItem, sitecore_templates_1.TEMPLATE_FIELD_FIELDS.SOURCE, "Source");
|
|
261
|
+
if (source !== undefined && source !== "") {
|
|
262
|
+
// Verbatim round-trip: sourceRaw re-emits the identical Source string.
|
|
263
|
+
augment.sourceRaw = source;
|
|
264
|
+
}
|
|
265
|
+
// Field storage axis — `Shared` / `Unversioned` are shared flags on the
|
|
266
|
+
// field item. `versioned` is the Sitecore default; omit it rather than
|
|
267
|
+
// fabricate, so the round-trip stays clean.
|
|
268
|
+
if (fieldValue(fieldItem, sitecore_templates_1.TEMPLATE_FIELD_FIELDS.SHARED, "Shared") === "1") {
|
|
269
|
+
augment.storage = "shared";
|
|
270
|
+
}
|
|
271
|
+
else if (fieldValue(fieldItem, sitecore_templates_1.TEMPLATE_FIELD_FIELDS.UNVERSIONED, "Unversioned") === "1") {
|
|
272
|
+
augment.storage = "unversioned";
|
|
273
|
+
}
|
|
274
|
+
const sortOrderRaw = fieldValue(fieldItem, sitecore_templates_1.SYSTEM_FIELDS.SORT_ORDER, "__Sortorder");
|
|
275
|
+
if (sortOrderRaw !== undefined) {
|
|
276
|
+
const n = Number.parseInt(sortOrderRaw, 10);
|
|
277
|
+
if (Number.isFinite(n))
|
|
278
|
+
augment.sortOrder = n;
|
|
279
|
+
}
|
|
280
|
+
// Section is meaningful for `fields` (component/content templates); the
|
|
281
|
+
// compiler defaults it to "Content", so omit it when it matches.
|
|
282
|
+
if (sectionName && sectionName !== "Content") {
|
|
283
|
+
augment.section = sectionName;
|
|
284
|
+
}
|
|
285
|
+
const definition = { name: fieldItem.name, shape };
|
|
286
|
+
if (Object.keys(augment).length > 0) {
|
|
287
|
+
definition.sitecore = augment;
|
|
288
|
+
}
|
|
289
|
+
return definition;
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Walk a template item's `TEMPLATE_SECTION` children and reverse-project
|
|
293
|
+
* every `TEMPLATE_FIELD` leaf under them into ordered `FieldDefinition`s.
|
|
294
|
+
*
|
|
295
|
+
* `__Standard Values` children are skipped — they're not sections. Sections
|
|
296
|
+
* and fields are emitted in Sitecore sort order so the round-trip preserves
|
|
297
|
+
* authored ordering.
|
|
298
|
+
*/
|
|
299
|
+
const fieldsOfTemplate = async (templateItem, client) => {
|
|
300
|
+
const sections = (await client.getChildren({ itemId: templateItem.itemId }))
|
|
301
|
+
.filter((child) => conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.TEMPLATE_SECTION))
|
|
302
|
+
.sort(byTreeOrder);
|
|
303
|
+
const fields = [];
|
|
304
|
+
for (const section of sections) {
|
|
305
|
+
const fieldItems = (await client.getChildren({ itemId: section.itemId }))
|
|
306
|
+
.filter((child) => conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.TEMPLATE_FIELD))
|
|
307
|
+
.sort(byTreeOrder);
|
|
308
|
+
for (const fieldItem of fieldItems) {
|
|
309
|
+
fields.push(fieldFromItem(fieldItem, section.name));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return fields;
|
|
313
|
+
};
|
|
314
|
+
/**
|
|
315
|
+
* Reverse-project one component-template `TEMPLATE` item (paired with its
|
|
316
|
+
* rendering) into a `ComponentTemplateRecipe`.
|
|
317
|
+
*
|
|
318
|
+
* Faithful: `name`, `displayName` (`__Display name`, falling back to
|
|
319
|
+
* `name`), `description`, and the full `fields[]` tree (sections + fields).
|
|
320
|
+
*
|
|
321
|
+
* LOSSY / omitted:
|
|
322
|
+
* - `handle` is the `Scai Handle` marker, or synthesised from `name` for an
|
|
323
|
+
* unmarked item (see `handleOf`).
|
|
324
|
+
* - `section` reference — the component lives *under* a section folder, and
|
|
325
|
+
* the section is its own recipe with its own handle; the caller resolves
|
|
326
|
+
* that section's handle (marker-aware) and threads it in here. When the
|
|
327
|
+
* component sits flat under a root, `section` is omitted.
|
|
328
|
+
* - `variants`, `params`, `datasource`, `insertOptions`, `availableIn`,
|
|
329
|
+
* `placedIn`, `placeholders`, `children`, `parameters`, `dynamicPlaceholders`,
|
|
330
|
+
* `otherProperties` — these live in separate trees (Headless Variants,
|
|
331
|
+
* Presentation Parameters, Available Renderings, Placeholder Settings) or
|
|
332
|
+
* in the rendering's URL-encoded blobs. v1 reverse-projection captures
|
|
333
|
+
* the template + datasource fields only; the schema defaults ([]/false)
|
|
334
|
+
* cover the rest. The rendering item is detected (to classify the
|
|
335
|
+
* template as a component) but its `OtherProperties` / `Datasource
|
|
336
|
+
* Location` are not decoded.
|
|
337
|
+
*/
|
|
338
|
+
const componentTemplateFromItem = async (templateItem, sectionHandle, client) => {
|
|
339
|
+
const displayName = fieldValue(templateItem, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name") ?? templateItem.name;
|
|
340
|
+
const description = fieldValueByName(templateItem, "__Long description");
|
|
341
|
+
const fields = await fieldsOfTemplate(templateItem, client);
|
|
342
|
+
const recipe = {
|
|
343
|
+
kind: "component-template",
|
|
344
|
+
schemaVersion: "1",
|
|
345
|
+
handle: handleOf(templateItem),
|
|
346
|
+
name: templateItem.name,
|
|
347
|
+
displayName,
|
|
348
|
+
fields,
|
|
349
|
+
// Schema defaults — not reverse-projected in v1 (see JSDoc).
|
|
350
|
+
variants: [],
|
|
351
|
+
params: [],
|
|
352
|
+
placedIn: [],
|
|
353
|
+
placeholders: [],
|
|
354
|
+
dynamicPlaceholders: false,
|
|
355
|
+
};
|
|
356
|
+
if (description !== undefined && description !== "")
|
|
357
|
+
recipe.description = description;
|
|
358
|
+
if (sectionHandle) {
|
|
359
|
+
recipe.section = { handle: sectionHandle };
|
|
360
|
+
}
|
|
361
|
+
return recipe;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* Reverse-project one content-template `TEMPLATE` item into a
|
|
365
|
+
* `ContentTemplateRecipe`.
|
|
366
|
+
*
|
|
367
|
+
* Faithful: `name`, `displayName`, `description`, and the `fields[]` tree.
|
|
368
|
+
*
|
|
369
|
+
* LOSSY / omitted: `handle` is the `Scai Handle` marker, or synthesised from
|
|
370
|
+
* `name` for an unmarked item (see `handleOf`); `meta.tax.group` is
|
|
371
|
+
* reconstructed from the Content Models group folder the template sits under
|
|
372
|
+
* (threaded in by the caller); `insertOptions` and `defaultWorkflow` are not
|
|
373
|
+
* reverse-projected (they live on the `__Standard Values` item's
|
|
374
|
+
* `__Masters` / `__Default workflow` fields as GUID lists that would need
|
|
375
|
+
* resolving back to handles).
|
|
376
|
+
*/
|
|
377
|
+
const contentTemplateFromItem = async (templateItem, group, client) => {
|
|
378
|
+
const displayName = fieldValue(templateItem, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name") ?? templateItem.name;
|
|
379
|
+
const description = fieldValueByName(templateItem, "__Long description");
|
|
380
|
+
const fields = await fieldsOfTemplate(templateItem, client);
|
|
381
|
+
const recipe = {
|
|
382
|
+
kind: "content-template",
|
|
383
|
+
schemaVersion: "1",
|
|
384
|
+
handle: handleOf(templateItem),
|
|
385
|
+
name: templateItem.name,
|
|
386
|
+
displayName,
|
|
387
|
+
fields,
|
|
388
|
+
};
|
|
389
|
+
if (description !== undefined && description !== "")
|
|
390
|
+
recipe.description = description;
|
|
391
|
+
if (group)
|
|
392
|
+
recipe.meta = { tax: { group } };
|
|
393
|
+
return recipe;
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* Reverse-project one page-template `TEMPLATE` item into a
|
|
397
|
+
* `PageTemplateRecipe`.
|
|
398
|
+
*
|
|
399
|
+
* Faithful: `name`, `displayName`, `description`, and the `fields[]`
|
|
400
|
+
* tree (the page-specific fields on top of the inherited SXA base).
|
|
401
|
+
*
|
|
402
|
+
* LOSSY / omitted: `handle` is the `Scai Handle` marker or synthesised
|
|
403
|
+
* from `name`; `insertOptions`, `layout` (the standard-values
|
|
404
|
+
* `__Renderings` shell), and `defaultWorkflow` are not reverse-projected
|
|
405
|
+
* — the same omissions as `contentTemplateFromItem`, plus layout-XML
|
|
406
|
+
* reverse parsing which v1 doesn't do.
|
|
407
|
+
*/
|
|
408
|
+
const pageTemplateFromItem = async (templateItem, client) => {
|
|
409
|
+
const displayName = fieldValue(templateItem, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name") ?? templateItem.name;
|
|
410
|
+
const description = fieldValueByName(templateItem, "__Long description");
|
|
411
|
+
const fields = await fieldsOfTemplate(templateItem, client);
|
|
412
|
+
const recipe = {
|
|
413
|
+
kind: "page-template",
|
|
414
|
+
schemaVersion: "1",
|
|
415
|
+
handle: handleOf(templateItem),
|
|
416
|
+
name: templateItem.name,
|
|
417
|
+
displayName,
|
|
418
|
+
fields,
|
|
419
|
+
};
|
|
420
|
+
if (description !== undefined && description !== "")
|
|
421
|
+
recipe.description = description;
|
|
422
|
+
return recipe;
|
|
423
|
+
};
|
|
424
|
+
/**
|
|
425
|
+
* Reverse-project one component-section Template Folder into a
|
|
426
|
+
* `ComponentSectionRecipe`.
|
|
427
|
+
*
|
|
428
|
+
* Faithful: `name`, `displayName` (`__Display name`, default `name`),
|
|
429
|
+
* `description`, `icon` (`__Icon`), and `sortOrder` (`__Sortorder`).
|
|
430
|
+
*
|
|
431
|
+
* LOSSY / omitted: `handle` is the `Scai Handle` marker, or synthesised from
|
|
432
|
+
* `name` for an unmarked folder (see `handleOf`). The section's identity is
|
|
433
|
+
* otherwise purely the folder — nothing else to recover.
|
|
434
|
+
*/
|
|
435
|
+
const componentSectionFromItem = (folderItem) => {
|
|
436
|
+
const displayName = fieldValue(folderItem, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name");
|
|
437
|
+
const description = fieldValueByName(folderItem, "__Long description");
|
|
438
|
+
const icon = fieldValue(folderItem, sitecore_templates_1.SYSTEM_FIELDS.ICON, "__Icon");
|
|
439
|
+
const sortOrderRaw = fieldValue(folderItem, sitecore_templates_1.SYSTEM_FIELDS.SORT_ORDER, "__Sortorder");
|
|
440
|
+
const recipe = {
|
|
441
|
+
kind: "component-section",
|
|
442
|
+
schemaVersion: "1",
|
|
443
|
+
handle: handleOf(folderItem),
|
|
444
|
+
name: folderItem.name,
|
|
445
|
+
};
|
|
446
|
+
if (displayName !== undefined && displayName !== "" && displayName !== folderItem.name) {
|
|
447
|
+
recipe.displayName = displayName;
|
|
448
|
+
}
|
|
449
|
+
if (description !== undefined && description !== "")
|
|
450
|
+
recipe.description = description;
|
|
451
|
+
if (icon !== undefined && icon !== "")
|
|
452
|
+
recipe.icon = icon;
|
|
453
|
+
if (sortOrderRaw !== undefined) {
|
|
454
|
+
const n = Number.parseInt(sortOrderRaw, 10);
|
|
455
|
+
if (Number.isFinite(n))
|
|
456
|
+
recipe.sortOrder = n;
|
|
457
|
+
}
|
|
458
|
+
return recipe;
|
|
459
|
+
};
|
|
460
|
+
/**
|
|
461
|
+
* Reverse-project one `Enumeration`-container item into an
|
|
462
|
+
* `EnumerationRecipe`.
|
|
463
|
+
*
|
|
464
|
+
* Faithful: `name`, `displayName`, `description`, the ordered `values[]`
|
|
465
|
+
* (each value item's `name` + `displayName`), and `default` — read from the
|
|
466
|
+
* container's `Value` shared field, kept only when it matches one of the
|
|
467
|
+
* declared values (the compiler validates `default ∈ values`).
|
|
468
|
+
*
|
|
469
|
+
* LOSSY / omitted: `handle` is the `Scai Handle` marker, or synthesised from
|
|
470
|
+
* `name` for an unmarked container (see `handleOf`); `location.folder` is
|
|
471
|
+
* reconstructed by the caller from the grouping folders the container sits
|
|
472
|
+
* under. An enumeration with no value items can't reverse-project (the
|
|
473
|
+
* schema requires `values.min(1)`) — such a container is skipped by the
|
|
474
|
+
* orchestrator with no error.
|
|
475
|
+
*/
|
|
476
|
+
const enumerationFromItem = async (containerItem, folder, client) => {
|
|
477
|
+
const valueItems = (await client.getChildren({ itemId: containerItem.itemId }))
|
|
478
|
+
.filter((child) => child.name !== "__Standard Values")
|
|
479
|
+
.sort(byTreeOrder);
|
|
480
|
+
if (valueItems.length === 0) {
|
|
481
|
+
// The schema requires values.min(1) — a value-less container is not a
|
|
482
|
+
// reverse-projectable enumeration. Skip rather than emit invalid data.
|
|
483
|
+
return null;
|
|
484
|
+
}
|
|
485
|
+
const values = valueItems.map((valueItem) => {
|
|
486
|
+
const valueDisplayName = fieldValue(valueItem, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name");
|
|
487
|
+
const value = { name: valueItem.name };
|
|
488
|
+
if (valueDisplayName !== undefined &&
|
|
489
|
+
valueDisplayName !== "" &&
|
|
490
|
+
valueDisplayName !== valueItem.name) {
|
|
491
|
+
value.displayName = valueDisplayName;
|
|
492
|
+
}
|
|
493
|
+
return value;
|
|
494
|
+
});
|
|
495
|
+
const displayName = fieldValue(containerItem, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name");
|
|
496
|
+
const description = fieldValueByName(containerItem, "__Long description");
|
|
497
|
+
const defaultValue = fieldValueByName(containerItem, "Value");
|
|
498
|
+
const recipe = {
|
|
499
|
+
kind: "enumeration",
|
|
500
|
+
schemaVersion: "1",
|
|
501
|
+
handle: handleOf(containerItem),
|
|
502
|
+
name: containerItem.name,
|
|
503
|
+
values,
|
|
504
|
+
};
|
|
505
|
+
if (displayName !== undefined && displayName !== "" && displayName !== containerItem.name) {
|
|
506
|
+
recipe.displayName = displayName;
|
|
507
|
+
}
|
|
508
|
+
if (description !== undefined && description !== "")
|
|
509
|
+
recipe.description = description;
|
|
510
|
+
if (folder)
|
|
511
|
+
recipe.location = { scope: "site", folder };
|
|
512
|
+
// Only carry `default` when it names a real value — the compiler rejects
|
|
513
|
+
// an out-of-range default, and a stale container `Value` is not intent.
|
|
514
|
+
if (defaultValue !== undefined &&
|
|
515
|
+
defaultValue !== "" &&
|
|
516
|
+
values.some((v) => v.name === defaultValue)) {
|
|
517
|
+
recipe.default = defaultValue;
|
|
518
|
+
}
|
|
519
|
+
return recipe;
|
|
520
|
+
};
|
|
521
|
+
/** True when a template item carries the SXA component base templates. */
|
|
522
|
+
const hasSxaComponentBases = (templateItem) => {
|
|
523
|
+
const bases = fieldValue(templateItem, sitecore_templates_1.SYSTEM_FIELDS.BASE_TEMPLATE, "__Base template");
|
|
524
|
+
if (!bases)
|
|
525
|
+
return false;
|
|
526
|
+
const baseGuids = bases.split("|").map(normalizeGuid);
|
|
527
|
+
return sitecore_templates_1.SXA_COMPONENT_BASE_TEMPLATES.some((sxaBase) => baseGuids.includes(normalizeGuid(sxaBase)));
|
|
528
|
+
};
|
|
529
|
+
/**
|
|
530
|
+
* True when a template item carries the SXA Headless page base set —
|
|
531
|
+
* the marker that classifies it as a `page-template` rather than a
|
|
532
|
+
* plain content template. Disjoint from `hasSxaComponentBases`:
|
|
533
|
+
* components inherit datasource/component bases, pages inherit the
|
|
534
|
+
* Base Page / navigation / designable / sitemap facets.
|
|
535
|
+
*/
|
|
536
|
+
const hasSxaPageBases = (templateItem) => {
|
|
537
|
+
const bases = fieldValue(templateItem, sitecore_templates_1.SYSTEM_FIELDS.BASE_TEMPLATE, "__Base template");
|
|
538
|
+
if (!bases)
|
|
539
|
+
return false;
|
|
540
|
+
const baseGuids = bases.split("|").map(normalizeGuid);
|
|
541
|
+
// `Base Page` alone is a sufficient signal — the other four facets
|
|
542
|
+
// ride with it in every recipe-emitted page template.
|
|
543
|
+
return sitecore_templates_1.SXA_HEADLESS_PAGE_BASE_TEMPLATES.some((pageBase) => baseGuids.includes(normalizeGuid(pageBase)));
|
|
544
|
+
};
|
|
545
|
+
/**
|
|
546
|
+
* Index every rendering item under `renderingsRoot` by component name, so a
|
|
547
|
+
* candidate template can be classified as a component (has a rendering) vs.
|
|
548
|
+
* a content template (no rendering). Returns a Set of component names — the
|
|
549
|
+
* rendering's `Component Name` field, falling back to the item name.
|
|
550
|
+
*
|
|
551
|
+
* Returns an empty set when `renderingsRoot` resolves to no item.
|
|
552
|
+
*/
|
|
553
|
+
const collectRenderingComponentNames = async (renderingsRoot, client) => {
|
|
554
|
+
const names = new Set();
|
|
555
|
+
const root = renderingsRoot ? await client.getItem({ path: renderingsRoot }) : null;
|
|
556
|
+
if (!root)
|
|
557
|
+
return names;
|
|
558
|
+
const walk = async (parent) => {
|
|
559
|
+
const children = await client.getChildren({ itemId: parent.itemId });
|
|
560
|
+
for (const child of children) {
|
|
561
|
+
if (conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.RENDERING)) {
|
|
562
|
+
const componentName = fieldValue(child, sitecore_templates_1.RENDERING_FIELDS.COMPONENT_NAME, "ComponentName") ?? child.name;
|
|
563
|
+
names.add(componentName);
|
|
564
|
+
names.add(child.name);
|
|
565
|
+
}
|
|
566
|
+
else if (conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.RENDERING_FOLDER) ||
|
|
567
|
+
conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.FOLDER)) {
|
|
568
|
+
await walk(child);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
await walk(root);
|
|
573
|
+
return names;
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
576
|
+
* Walk every `TEMPLATE` item under a templates-tree root, reverse-projecting
|
|
577
|
+
* each into either a component-template or content-template recipe.
|
|
578
|
+
*
|
|
579
|
+
* Templates are discovered by recursing through `TEMPLATE_FOLDER` items. A
|
|
580
|
+
* `TEMPLATE_FOLDER` sitting *directly* under `componentsRoot` is itself a
|
|
581
|
+
* component section and is emitted as a `ComponentSectionRecipe`; its
|
|
582
|
+
* children are then component templates carrying that `section`.
|
|
583
|
+
*
|
|
584
|
+
* Classification of a `TEMPLATE` item:
|
|
585
|
+
* - has SXA component bases OR a matching rendering → component-template
|
|
586
|
+
* - otherwise → content-template
|
|
587
|
+
*/
|
|
588
|
+
const walkTemplatesTree = async (rootPath, client, renderingComponentNames, isComponentsRoot, isContentModelsRoot) => {
|
|
589
|
+
const recipes = [];
|
|
590
|
+
const root = rootPath ? await client.getItem({ path: rootPath }) : null;
|
|
591
|
+
if (!root)
|
|
592
|
+
return recipes;
|
|
593
|
+
/**
|
|
594
|
+
* Recurse. `sectionHandle` is the handle of the component section the
|
|
595
|
+
* current subtree is under (set when we descended through a section folder
|
|
596
|
+
* under componentsRoot — marker-aware, so component templates reference the
|
|
597
|
+
* section by its real handle); `group` is the Content Models group folder
|
|
598
|
+
* name.
|
|
599
|
+
*/
|
|
600
|
+
const walk = async (parent, sectionHandle, group, depth) => {
|
|
601
|
+
const children = (await client.getChildren({ itemId: parent.itemId })).sort(byTreeOrder);
|
|
602
|
+
for (const child of children) {
|
|
603
|
+
if (conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.TEMPLATE)) {
|
|
604
|
+
// Classify the template item. Page bases are checked first —
|
|
605
|
+
// they're disjoint from component bases, and a page template
|
|
606
|
+
// is neither a component nor a plain content shape.
|
|
607
|
+
if (hasSxaPageBases(child)) {
|
|
608
|
+
recipes.push(await pageTemplateFromItem(child, client));
|
|
609
|
+
}
|
|
610
|
+
else if (hasSxaComponentBases(child) || renderingComponentNames.has(child.name)) {
|
|
611
|
+
recipes.push(await componentTemplateFromItem(child, sectionHandle, client));
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
recipes.push(await contentTemplateFromItem(child, group, client));
|
|
615
|
+
}
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
if (conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.TEMPLATE_FOLDER) ||
|
|
619
|
+
conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.FOLDER)) {
|
|
620
|
+
// A folder directly under componentsRoot IS a component section.
|
|
621
|
+
// Emit the section recipe, then descend carrying its handle so the
|
|
622
|
+
// component templates beneath it reference the same identity.
|
|
623
|
+
if (isComponentsRoot && depth === 0) {
|
|
624
|
+
const section = componentSectionFromItem(child);
|
|
625
|
+
recipes.push(section);
|
|
626
|
+
await walk(child, section.handle, group, depth + 1);
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
// A folder directly under contentModelsRoot is a taxonomy group.
|
|
630
|
+
const nextGroup = isContentModelsRoot && depth === 0 ? child.name : group;
|
|
631
|
+
// Skip the subordinate buckets (Component Folders / Presentation
|
|
632
|
+
// Parameters) — they hold support templates, not authorable kinds.
|
|
633
|
+
if (child.name === "Component Folders" || child.name === "Presentation Parameters") {
|
|
634
|
+
continue;
|
|
635
|
+
}
|
|
636
|
+
await walk(child, sectionHandle, nextGroup, depth + 1);
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
// Anything else (Standard Values, renderings, etc.) — not a
|
|
640
|
+
// reverse-projectable kind. Skip silently.
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
await walk(root, undefined, undefined, 0);
|
|
644
|
+
return recipes;
|
|
645
|
+
};
|
|
646
|
+
/**
|
|
647
|
+
* Walk the enumerations tree, reverse-projecting each `Enumeration`-template
|
|
648
|
+
* container into an `EnumerationRecipe`. Grouping folders (`Enumerations
|
|
649
|
+
* Folder` template) are recursed into; the cumulative folder path is
|
|
650
|
+
* threaded onto each enum's `location.folder`.
|
|
651
|
+
*/
|
|
652
|
+
const walkEnumerationsTree = async (rootPath, client) => {
|
|
653
|
+
const recipes = [];
|
|
654
|
+
const root = rootPath ? await client.getItem({ path: rootPath }) : null;
|
|
655
|
+
if (!root)
|
|
656
|
+
return recipes;
|
|
657
|
+
/**
|
|
658
|
+
* An item is an enumeration *container* (vs. a grouping folder) when its
|
|
659
|
+
* children are leaf value items rather than further containers/folders.
|
|
660
|
+
* The cheapest reliable signal available without GUID knowledge of the
|
|
661
|
+
* per-site `Enumeration` template: a container's children carry no
|
|
662
|
+
* sub-children that are themselves enumerations. We instead use the
|
|
663
|
+
* structural rule the compiler guarantees — grouping folders only ever
|
|
664
|
+
* parent containers/other folders, containers only ever parent value
|
|
665
|
+
* leaves — and treat any item whose children are all childless leaves as
|
|
666
|
+
* a container. `Enumerations Folder` items are recursed; everything else
|
|
667
|
+
* with ≥1 child is treated as a container.
|
|
668
|
+
*/
|
|
669
|
+
const walk = async (parent, folderPath) => {
|
|
670
|
+
const children = (await client.getChildren({ itemId: parent.itemId }))
|
|
671
|
+
.filter((c) => c.name !== "__Standard Values")
|
|
672
|
+
.sort(byTreeOrder);
|
|
673
|
+
for (const child of children) {
|
|
674
|
+
const grandchildren = (await client.getChildren({ itemId: child.itemId })).filter((gc) => gc.name !== "__Standard Values");
|
|
675
|
+
if (grandchildren.length === 0) {
|
|
676
|
+
// A childless item under the enumerations root is neither a
|
|
677
|
+
// grouping folder nor a populated container — skip.
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
// Determine whether `child` is a grouping folder or a container by
|
|
681
|
+
// inspecting its grandchildren: if any grandchild itself has
|
|
682
|
+
// children, `child` groups containers → it's a folder. Otherwise its
|
|
683
|
+
// children are value leaves → `child` is a container.
|
|
684
|
+
let groupsContainers = false;
|
|
685
|
+
for (const gc of grandchildren) {
|
|
686
|
+
const ggc = await client.getChildren({ itemId: gc.itemId });
|
|
687
|
+
if (ggc.filter((x) => x.name !== "__Standard Values").length > 0) {
|
|
688
|
+
groupsContainers = true;
|
|
689
|
+
break;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
if (groupsContainers) {
|
|
693
|
+
const nextFolder = folderPath ? `${folderPath}/${child.name}` : child.name;
|
|
694
|
+
await walk(child, nextFolder);
|
|
695
|
+
}
|
|
696
|
+
else {
|
|
697
|
+
const recipe = await enumerationFromItem(child, folderPath, client);
|
|
698
|
+
if (recipe)
|
|
699
|
+
recipes.push(recipe);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
await walk(root, undefined);
|
|
704
|
+
return recipes;
|
|
705
|
+
};
|
|
706
|
+
/**
|
|
707
|
+
* Walk a content-tree subtree collecting every item's `Scai Handle` marker
|
|
708
|
+
* into a GUID→handle map. Recurses through *all* children — the renderings
|
|
709
|
+
* tree nests renderings under section folders, the content tree nests page
|
|
710
|
+
* items and datasource items arbitrarily deep.
|
|
711
|
+
*
|
|
712
|
+
* Returns silently (contributing nothing) when `rootPath` resolves to no
|
|
713
|
+
* item — an absent root is not an error, just an empty contribution.
|
|
714
|
+
*/
|
|
715
|
+
const indexMarkersUnder = async (rootPath, client, index) => {
|
|
716
|
+
const root = rootPath ? await client.getItem({ path: rootPath }) : null;
|
|
717
|
+
if (!root)
|
|
718
|
+
return;
|
|
719
|
+
const visit = async (item) => {
|
|
720
|
+
const marker = fieldValueByName(item, marker_1.SCAI_HANDLE_FIELD_NAME);
|
|
721
|
+
if (marker !== undefined && marker.trim() !== "") {
|
|
722
|
+
index.set(normalizeGuid(item.itemId), marker.trim());
|
|
723
|
+
}
|
|
724
|
+
const children = await client.getChildren({ itemId: item.itemId });
|
|
725
|
+
for (const child of children) {
|
|
726
|
+
await visit(child);
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
await visit(root);
|
|
730
|
+
};
|
|
731
|
+
/**
|
|
732
|
+
* Build the GUID→handle index `readCurrent` resolves cross-item GUID
|
|
733
|
+
* references against. Indexes:
|
|
734
|
+
*
|
|
735
|
+
* - the renderings tree — so layout `<r id>` GUIDs and placeholder
|
|
736
|
+
* `Allowed Controls` GUIDs resolve to `componentHandle`s;
|
|
737
|
+
* - the templates trees (`componentsRoot` / `contentModelsRoot` /
|
|
738
|
+
* `pageTemplatesRoot` / the `templatesRoot` fallback) — so a page
|
|
739
|
+
* item's `templateId` and the Page Designs root's `TemplatesMapping`
|
|
740
|
+
* template GUIDs resolve to page-template handles;
|
|
741
|
+
* - the Partial Designs tree — so a page design's `PartialDesigns`
|
|
742
|
+
* GUID list resolves to partial-design handles;
|
|
743
|
+
* - the pages tree — so layout `<r ds>` GUIDs that point at page-local
|
|
744
|
+
* datasource items resolve.
|
|
745
|
+
*
|
|
746
|
+
* `read-current.ts` does not reverse-project content-item *items*
|
|
747
|
+
* themselves — but it still needs their markers to resolve the GUIDs
|
|
748
|
+
* layout XML points at, so the pages tree (which holds `<page>/Data/<slot>`
|
|
749
|
+
* datasource items) is indexed too.
|
|
750
|
+
*
|
|
751
|
+
* Walking the same root twice is harmless — `indexMarkersUnder` is a pure
|
|
752
|
+
* `Map.set`, and a duplicate path simply re-sets identical entries.
|
|
753
|
+
*/
|
|
754
|
+
const buildGuidHandleIndex = async (roots, client) => {
|
|
755
|
+
const index = new Map();
|
|
756
|
+
await indexMarkersUnder(roots.renderingsRoot, client, index);
|
|
757
|
+
await indexMarkersUnder(roots.componentsRoot, client, index);
|
|
758
|
+
await indexMarkersUnder(roots.contentModelsRoot, client, index);
|
|
759
|
+
await indexMarkersUnder(roots.pageTemplatesRoot, client, index);
|
|
760
|
+
// Flat templatesRoot fallback — only when no bucket root covers it (the
|
|
761
|
+
// same dedup rule the templates walk uses).
|
|
762
|
+
if (!roots.componentsRoot && !roots.contentModelsRoot) {
|
|
763
|
+
await indexMarkersUnder(roots.templatesRoot, client, index);
|
|
764
|
+
}
|
|
765
|
+
await indexMarkersUnder(roots.partialDesignsRoot, client, index);
|
|
766
|
+
await indexMarkersUnder(roots.pagesRoot, client, index);
|
|
767
|
+
return index;
|
|
768
|
+
};
|
|
769
|
+
/**
|
|
770
|
+
* Resolve one `ParsedPlacement` (a decoded layout `<r>` element) into a
|
|
771
|
+
* recipe-level `ComponentPlacement`, or `null` when the placement's
|
|
772
|
+
* rendering GUID can't be resolved to a handle.
|
|
773
|
+
*
|
|
774
|
+
* Faithful: `variant`, `params`, and — for a `local:<slot>` sentinel — the
|
|
775
|
+
* `scoped` slot, all of which the layout XML carries directly.
|
|
776
|
+
*
|
|
777
|
+
* LOSSY:
|
|
778
|
+
* - the rendering GUID MUST resolve via the marker index; an unindexed
|
|
779
|
+
* GUID drops the whole placement (returning `null`) — there is no
|
|
780
|
+
* recoverable handle, and a fabricated one would derive the wrong
|
|
781
|
+
* `renderingId` on the next push.
|
|
782
|
+
* - a `ds` GUID that resolves becomes a `kind: "shared"` datasourceRef;
|
|
783
|
+
* one that doesn't is omitted (the placement keeps its variant/params
|
|
784
|
+
* but loses the datasource binding — better than a dangling handle).
|
|
785
|
+
* Distinguishing a `shared` content-item GUID from a `scoped` page-local
|
|
786
|
+
* one is not attempted: `readCurrent` does not reverse-project page-tree
|
|
787
|
+
* datasource items, and a resolved `ds` handle is treated as `shared`.
|
|
788
|
+
* A `local:<slot>` sentinel is the one unambiguous `scoped` signal.
|
|
789
|
+
*/
|
|
790
|
+
const placementFromParsed = (parsed, guidIndex) => {
|
|
791
|
+
const componentHandle = guidIndex.get(parsed.renderingGuid);
|
|
792
|
+
if (componentHandle === undefined) {
|
|
793
|
+
// Unrecoverable — the rendering GUID carries no marker. Drop the
|
|
794
|
+
// placement rather than fabricate a handle.
|
|
795
|
+
return null;
|
|
796
|
+
}
|
|
797
|
+
const placement = { componentHandle };
|
|
798
|
+
if (parsed.variant !== undefined)
|
|
799
|
+
placement.variant = parsed.variant;
|
|
800
|
+
if (parsed.params !== undefined)
|
|
801
|
+
placement.params = parsed.params;
|
|
802
|
+
if (parsed.datasource !== undefined) {
|
|
803
|
+
if (parsed.datasource.kind === "local") {
|
|
804
|
+
placement.datasourceRef = { kind: "scoped", slot: parsed.datasource.slot };
|
|
805
|
+
}
|
|
806
|
+
else {
|
|
807
|
+
const dsHandle = guidIndex.get(parsed.datasource.guid);
|
|
808
|
+
if (dsHandle !== undefined) {
|
|
809
|
+
placement.datasourceRef = { kind: "shared", handle: dsHandle };
|
|
810
|
+
}
|
|
811
|
+
// An unresolved ds GUID → omit datasourceRef (config-driven by
|
|
812
|
+
// default; the binding is genuinely unrecoverable).
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
return placement;
|
|
816
|
+
};
|
|
817
|
+
/**
|
|
818
|
+
* Reverse-project a layout XML string into a recipe-level `Layout`.
|
|
819
|
+
*
|
|
820
|
+
* Parses the XML (`parseLayoutXml` — handles both canonical + delta wire
|
|
821
|
+
* forms), then resolves every placement's GUIDs to handles through the
|
|
822
|
+
* marker index. Placements whose rendering GUID is unresolvable are
|
|
823
|
+
* dropped; a placeholder left with no placements after the drop is
|
|
824
|
+
* omitted entirely. Per-placeholder placement order is preserved.
|
|
825
|
+
*/
|
|
826
|
+
const layoutFromXml = (xml, guidIndex) => {
|
|
827
|
+
const parsed = (0, parse_1.parseLayoutXml)(xml);
|
|
828
|
+
const placeholders = {};
|
|
829
|
+
for (const [key, parsedPlacements] of Object.entries(parsed.placeholders)) {
|
|
830
|
+
const placements = [];
|
|
831
|
+
for (const parsedPlacement of parsedPlacements) {
|
|
832
|
+
const placement = placementFromParsed(parsedPlacement, guidIndex);
|
|
833
|
+
if (placement)
|
|
834
|
+
placements.push(placement);
|
|
835
|
+
}
|
|
836
|
+
if (placements.length > 0)
|
|
837
|
+
placeholders[key] = placements;
|
|
838
|
+
}
|
|
839
|
+
return { placeholders };
|
|
840
|
+
};
|
|
841
|
+
/** Read an item's layout XML — `__Renderings` (shared) field. */
|
|
842
|
+
const sharedLayoutXmlOf = (item) => fieldValue(item, sitecore_templates_1.LAYOUT_FIELDS.RENDERINGS, "__Renderings") ?? "";
|
|
843
|
+
/** Read an item's final layout XML — `__Final Renderings` (versioned) field. */
|
|
844
|
+
const finalLayoutXmlOf = (item) => fieldValue(item, sitecore_templates_1.LAYOUT_FIELDS.FINAL_RENDERINGS, "__Final Renderings") ?? "";
|
|
845
|
+
/**
|
|
846
|
+
* Reverse-project one SXA Partial Design item into a `PartialDesignRecipe`.
|
|
847
|
+
*
|
|
848
|
+
* Faithful: `name`, `displayName` (`__Display name`, default `name`),
|
|
849
|
+
* `description`, `icon`, and the `layout` — parsed from the item's
|
|
850
|
+
* `__Renderings` field (delta wire form; `parseLayoutXml` handles it) and
|
|
851
|
+
* resolved against the marker index.
|
|
852
|
+
*
|
|
853
|
+
* LOSSY / omitted: `handle` is the `Scai Handle` marker or synthesised from
|
|
854
|
+
* `name` (see `handleOf`). Layout placements whose rendering GUID carries
|
|
855
|
+
* no marker are dropped (see `placementFromParsed`) — the partial still
|
|
856
|
+
* reverse-projects, just without those placements.
|
|
857
|
+
*/
|
|
858
|
+
const partialDesignFromItem = (item, guidIndex) => {
|
|
859
|
+
const displayName = fieldValue(item, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name") ?? item.name;
|
|
860
|
+
const description = fieldValueByName(item, "__Long description");
|
|
861
|
+
const icon = fieldValue(item, sitecore_templates_1.SYSTEM_FIELDS.ICON, "__Icon");
|
|
862
|
+
const recipe = {
|
|
863
|
+
kind: "partial-design",
|
|
864
|
+
schemaVersion: "1",
|
|
865
|
+
handle: handleOf(item),
|
|
866
|
+
name: item.name,
|
|
867
|
+
displayName,
|
|
868
|
+
layout: layoutFromXml(sharedLayoutXmlOf(item), guidIndex),
|
|
869
|
+
};
|
|
870
|
+
if (description !== undefined && description !== "")
|
|
871
|
+
recipe.description = description;
|
|
872
|
+
if (icon !== undefined && icon !== "")
|
|
873
|
+
recipe.icon = icon;
|
|
874
|
+
return recipe;
|
|
875
|
+
};
|
|
876
|
+
/**
|
|
877
|
+
* Decode the Page Designs root's `TemplatesMapping` field into a list of
|
|
878
|
+
* `{ templateGuid, designGuid }` pairs. Inverse of
|
|
879
|
+
* `encodeTemplatesMapping` (`layout/templates-mapping.ts`): the field
|
|
880
|
+
* stores `{tplGuid}={designGuid}&…` URL-encoded.
|
|
881
|
+
*/
|
|
882
|
+
const decodeTemplatesMapping = (raw) => {
|
|
883
|
+
const entries = [];
|
|
884
|
+
for (const pair of raw.split("&")) {
|
|
885
|
+
if (pair === "")
|
|
886
|
+
continue;
|
|
887
|
+
const eq = pair.indexOf("=");
|
|
888
|
+
if (eq < 0)
|
|
889
|
+
continue;
|
|
890
|
+
const templateGuid = normalizeGuid(decodeURIComponent(pair.slice(0, eq)));
|
|
891
|
+
const designGuid = normalizeGuid(decodeURIComponent(pair.slice(eq + 1)));
|
|
892
|
+
if (templateGuid && designGuid)
|
|
893
|
+
entries.push({ templateGuid, designGuid });
|
|
894
|
+
}
|
|
895
|
+
return entries;
|
|
896
|
+
};
|
|
897
|
+
/**
|
|
898
|
+
* Reverse-project one SXA Page Design item into a `PageDesignRecipe`.
|
|
899
|
+
*
|
|
900
|
+
* Faithful: `name`, `displayName`, `description`, `icon`, `partials`
|
|
901
|
+
* (the `PartialDesigns` field's pipe-separated GUID list, each resolved
|
|
902
|
+
* via the marker index), and `layout` (the design's own `__Renderings`,
|
|
903
|
+
* usually empty).
|
|
904
|
+
*
|
|
905
|
+
* `appliesTo`: RECOVERED — but from the *Page Designs root's*
|
|
906
|
+
* `TemplatesMapping` field, NOT the design item. `TemplatesMapping` is a
|
|
907
|
+
* cross-recipe aggregate on the root (`{tplGuid}={designGuid}&…`); the
|
|
908
|
+
* caller decodes it once, finds every entry whose `designGuid` is this
|
|
909
|
+
* design, and threads the resolved page-template handles in here. When the
|
|
910
|
+
* root carries no mapping (or none points at this design) `appliesTo` is
|
|
911
|
+
* left at its schema default `[]`.
|
|
912
|
+
*
|
|
913
|
+
* LOSSY / omitted: `handle` is the `Scai Handle` marker or synthesised.
|
|
914
|
+
* A `partials[]` GUID with no marker, or a layout placement whose
|
|
915
|
+
* rendering GUID has no marker, is dropped.
|
|
916
|
+
*/
|
|
917
|
+
const pageDesignFromItem = (item, appliesTo, guidIndex) => {
|
|
918
|
+
const displayName = fieldValue(item, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name") ?? item.name;
|
|
919
|
+
const description = fieldValueByName(item, "__Long description");
|
|
920
|
+
const icon = fieldValue(item, sitecore_templates_1.SYSTEM_FIELDS.ICON, "__Icon");
|
|
921
|
+
// `PartialDesigns` — pipe-separated GUID list; resolve each via the
|
|
922
|
+
// marker index, dropping any GUID that carries no marker.
|
|
923
|
+
const partialsRaw = fieldValue(item, sitecore_templates_1.COMPOSITION_FIELDS.PARTIAL_DESIGNS, "PartialDesigns");
|
|
924
|
+
const partials = [];
|
|
925
|
+
if (partialsRaw !== undefined && partialsRaw.trim() !== "") {
|
|
926
|
+
for (const guid of partialsRaw.split("|")) {
|
|
927
|
+
const handle = guidIndex.get(normalizeGuid(guid));
|
|
928
|
+
if (handle !== undefined)
|
|
929
|
+
partials.push(handle);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
const recipe = {
|
|
933
|
+
kind: "page-design",
|
|
934
|
+
schemaVersion: "1",
|
|
935
|
+
handle: handleOf(item),
|
|
936
|
+
name: item.name,
|
|
937
|
+
displayName,
|
|
938
|
+
appliesTo,
|
|
939
|
+
partials,
|
|
940
|
+
};
|
|
941
|
+
if (description !== undefined && description !== "")
|
|
942
|
+
recipe.description = description;
|
|
943
|
+
if (icon !== undefined && icon !== "")
|
|
944
|
+
recipe.icon = icon;
|
|
945
|
+
// The design's own layout — most designs leave it empty. Only carry a
|
|
946
|
+
// non-empty layout (schema makes it optional; an empty one is omitted).
|
|
947
|
+
const layout = layoutFromXml(sharedLayoutXmlOf(item), guidIndex);
|
|
948
|
+
if (Object.keys(layout.placeholders).length > 0)
|
|
949
|
+
recipe.layout = layout;
|
|
950
|
+
return recipe;
|
|
951
|
+
};
|
|
952
|
+
/**
|
|
953
|
+
* Reverse-project one page item into a `PageRecipe`.
|
|
954
|
+
*
|
|
955
|
+
* Faithful: `name`, `displayName`, `description`, and `layout` — parsed
|
|
956
|
+
* from the page item's `__Final Renderings` (canonical wire form) and
|
|
957
|
+
* resolved against the marker index.
|
|
958
|
+
*
|
|
959
|
+
* `template`: RECOVERED via the marker index — the page item conforms to
|
|
960
|
+
* a page template, and its `templateId` resolves to that template's
|
|
961
|
+
* handle. When the template GUID carries no marker the page can't
|
|
962
|
+
* reverse-project (a `PageRecipe` REQUIRES a `template`), so the caller
|
|
963
|
+
* skips it — see `walkPagesTree`.
|
|
964
|
+
*
|
|
965
|
+
* `scoped` datasources: a layout placement whose `ds` GUID is a
|
|
966
|
+
* `<page>/Data/<slot>` child is recovered as `kind: "scoped"` only via the
|
|
967
|
+
* `local:<slot>` sentinel that `emitLayoutXml` writes when no resolver was
|
|
968
|
+
* available. A scoped placement that was compiled with a resolver carries
|
|
969
|
+
* a real GUID instead; that GUID resolves through the marker index the
|
|
970
|
+
* same as a shared one, so it reverse-projects as `kind: "shared"` — an
|
|
971
|
+
* accepted v1 lossiness (the datasource still resolves to the right item).
|
|
972
|
+
*
|
|
973
|
+
* LOSSY / omitted: `handle` is the `Scai Handle` marker or synthesised.
|
|
974
|
+
* `fields` (the page's own field values) and `workflow` are NOT
|
|
975
|
+
* reverse-projected — page field values would need the page template's
|
|
976
|
+
* field shapes to decode each stored value back to a typed
|
|
977
|
+
* `ContentFieldValue`, the same cross-template decode `ContentItemRecipe`
|
|
978
|
+
* reverse-projection (also out of scope) would need. `fields` is left at
|
|
979
|
+
* its schema default `{}`.
|
|
980
|
+
*/
|
|
981
|
+
const pageFromItem = (item, templateHandle, guidIndex) => {
|
|
982
|
+
const displayName = fieldValue(item, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name") ?? item.name;
|
|
983
|
+
const description = fieldValueByName(item, "__Long description");
|
|
984
|
+
const recipe = {
|
|
985
|
+
kind: "page",
|
|
986
|
+
schemaVersion: "1",
|
|
987
|
+
handle: handleOf(item),
|
|
988
|
+
name: item.name,
|
|
989
|
+
displayName,
|
|
990
|
+
template: templateHandle,
|
|
991
|
+
fields: {},
|
|
992
|
+
};
|
|
993
|
+
if (description !== undefined && description !== "")
|
|
994
|
+
recipe.description = description;
|
|
995
|
+
const layout = layoutFromXml(finalLayoutXmlOf(item), guidIndex);
|
|
996
|
+
if (Object.keys(layout.placeholders).length > 0)
|
|
997
|
+
recipe.layout = layout;
|
|
998
|
+
return recipe;
|
|
999
|
+
};
|
|
1000
|
+
/**
|
|
1001
|
+
* Reverse-project one SXA Placeholder Settings item into a
|
|
1002
|
+
* `PlaceholderRecipe`.
|
|
1003
|
+
*
|
|
1004
|
+
* Faithful: `name`, `displayName` (`__Display name`, default `name`),
|
|
1005
|
+
* `description`, `icon`, and `key` — the `Placeholder Key` field, which is
|
|
1006
|
+
* the item's load-bearing identity.
|
|
1007
|
+
*
|
|
1008
|
+
* `allowedComponents`: BEST-EFFORT — the `Allowed Controls` field is a
|
|
1009
|
+
* pipe-separated list of *rendering* GUIDs; each is resolved to a
|
|
1010
|
+
* component handle via the marker index, and any GUID with no marker is
|
|
1011
|
+
* dropped. The list therefore round-trips only the controls scai itself
|
|
1012
|
+
* placed (a hand-authored Allowed Controls entry pointing at an unmarked
|
|
1013
|
+
* OOTB rendering is silently lost) — acceptable per the lossy contract.
|
|
1014
|
+
*
|
|
1015
|
+
* LOSSY / omitted: `handle` is the `Scai Handle` marker or synthesised
|
|
1016
|
+
* from `name`. `folder` (the grouping path under the placeholder settings
|
|
1017
|
+
* root) is reconstructed by the caller from the folders the item sits
|
|
1018
|
+
* under. `dynamic` is not recoverable from a Placeholder Settings item
|
|
1019
|
+
* alone — it is left at its schema default `false`.
|
|
1020
|
+
*
|
|
1021
|
+
* Returns `null` when the item carries no `Placeholder Key` — a
|
|
1022
|
+
* `PlaceholderRecipe` REQUIRES a non-empty `key`, and a key-less
|
|
1023
|
+
* Placeholder Settings item is not reverse-projectable.
|
|
1024
|
+
*/
|
|
1025
|
+
const placeholderFromItem = (item, folder, guidIndex) => {
|
|
1026
|
+
const key = fieldValue(item, sitecore_templates_1.PLACEHOLDER_FIELDS.PLACEHOLDER_KEY, "Placeholder Key");
|
|
1027
|
+
if (key === undefined || key.trim() === "") {
|
|
1028
|
+
// No Placeholder Key — schema requires `key.min(1)`. Skip.
|
|
1029
|
+
return null;
|
|
1030
|
+
}
|
|
1031
|
+
const displayName = fieldValue(item, sitecore_templates_1.SYSTEM_FIELDS.DISPLAY_NAME, "__Display name") ?? item.name;
|
|
1032
|
+
const description = fieldValueByName(item, "__Long description");
|
|
1033
|
+
const icon = fieldValue(item, sitecore_templates_1.SYSTEM_FIELDS.ICON, "__Icon");
|
|
1034
|
+
// `Allowed Controls` — pipe-separated rendering GUIDs; resolve each via
|
|
1035
|
+
// the marker index, dropping any GUID that carries no marker.
|
|
1036
|
+
const allowedRaw = fieldValue(item, sitecore_templates_1.PLACEHOLDER_FIELDS.ALLOWED_CONTROLS, "Allowed Controls");
|
|
1037
|
+
const allowedComponents = [];
|
|
1038
|
+
if (allowedRaw !== undefined && allowedRaw.trim() !== "") {
|
|
1039
|
+
for (const guid of allowedRaw.split("|")) {
|
|
1040
|
+
const handle = guidIndex.get(normalizeGuid(guid));
|
|
1041
|
+
if (handle !== undefined)
|
|
1042
|
+
allowedComponents.push(handle);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
const recipe = {
|
|
1046
|
+
kind: "placeholder",
|
|
1047
|
+
schemaVersion: "1",
|
|
1048
|
+
handle: handleOf(item),
|
|
1049
|
+
key: key.trim(),
|
|
1050
|
+
name: item.name,
|
|
1051
|
+
displayName,
|
|
1052
|
+
dynamic: false,
|
|
1053
|
+
allowedComponents,
|
|
1054
|
+
};
|
|
1055
|
+
if (description !== undefined && description !== "")
|
|
1056
|
+
recipe.description = description;
|
|
1057
|
+
if (icon !== undefined && icon !== "")
|
|
1058
|
+
recipe.icon = icon;
|
|
1059
|
+
if (folder)
|
|
1060
|
+
recipe.folder = folder;
|
|
1061
|
+
return recipe;
|
|
1062
|
+
};
|
|
1063
|
+
/**
|
|
1064
|
+
* Walk the Partial Designs root, reverse-projecting every SXA Partial
|
|
1065
|
+
* Design item into a `PartialDesignRecipe`. Partial designs sit flat
|
|
1066
|
+
* directly under the root (the partial-design compiler parents them at
|
|
1067
|
+
* `joinPath(partialDesignsRoot, recipe.name)`); a child that doesn't
|
|
1068
|
+
* conform to the Partial Design template is skipped silently.
|
|
1069
|
+
*/
|
|
1070
|
+
const walkPartialDesignsTree = async (rootPath, client, guidIndex) => {
|
|
1071
|
+
const recipes = [];
|
|
1072
|
+
const root = rootPath ? await client.getItem({ path: rootPath }) : null;
|
|
1073
|
+
if (!root)
|
|
1074
|
+
return recipes;
|
|
1075
|
+
const children = (await client.getChildren({ itemId: root.itemId })).sort(byTreeOrder);
|
|
1076
|
+
for (const child of children) {
|
|
1077
|
+
if (conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.PARTIAL_DESIGN)) {
|
|
1078
|
+
recipes.push(partialDesignFromItem(child, guidIndex));
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
return recipes;
|
|
1082
|
+
};
|
|
1083
|
+
/**
|
|
1084
|
+
* Walk the Page Designs root, reverse-projecting every SXA Page Design
|
|
1085
|
+
* item into a `PageDesignRecipe`.
|
|
1086
|
+
*
|
|
1087
|
+
* `appliesTo` is recovered from the root's own `TemplatesMapping` field:
|
|
1088
|
+
* the field is decoded once up front into design-GUID → template-handles
|
|
1089
|
+
* groupings, and each page design's slice is threaded into
|
|
1090
|
+
* `pageDesignFromItem`. A template GUID in the mapping with no marker is
|
|
1091
|
+
* dropped from `appliesTo` (unrecoverable handle).
|
|
1092
|
+
*/
|
|
1093
|
+
const walkPageDesignsTree = async (rootPath, client, guidIndex) => {
|
|
1094
|
+
const recipes = [];
|
|
1095
|
+
const root = rootPath ? await client.getItem({ path: rootPath }) : null;
|
|
1096
|
+
if (!root)
|
|
1097
|
+
return recipes;
|
|
1098
|
+
// Decode the root's TemplatesMapping into `designGuid → [templateHandle]`.
|
|
1099
|
+
const mappingRaw = fieldValue(root, sitecore_templates_1.COMPOSITION_FIELDS.TEMPLATES_MAPPING, "TemplatesMapping");
|
|
1100
|
+
const appliesToByDesign = new Map();
|
|
1101
|
+
if (mappingRaw !== undefined && mappingRaw.trim() !== "") {
|
|
1102
|
+
for (const { templateGuid, designGuid } of decodeTemplatesMapping(mappingRaw)) {
|
|
1103
|
+
const templateHandle = guidIndex.get(templateGuid);
|
|
1104
|
+
if (templateHandle === undefined)
|
|
1105
|
+
continue; // unrecoverable handle
|
|
1106
|
+
const list = appliesToByDesign.get(designGuid) ?? [];
|
|
1107
|
+
list.push(templateHandle);
|
|
1108
|
+
appliesToByDesign.set(designGuid, list);
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
const children = (await client.getChildren({ itemId: root.itemId })).sort(byTreeOrder);
|
|
1112
|
+
for (const child of children) {
|
|
1113
|
+
if (conformsTo(child, sitecore_templates_1.SITECORE_TEMPLATES.PAGE_DESIGN)) {
|
|
1114
|
+
const appliesTo = appliesToByDesign.get(normalizeGuid(child.itemId)) ?? [];
|
|
1115
|
+
recipes.push(pageDesignFromItem(child, appliesTo, guidIndex));
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
return recipes;
|
|
1119
|
+
};
|
|
1120
|
+
/**
|
|
1121
|
+
* Walk the pages root, reverse-projecting every page item into a
|
|
1122
|
+
* `PageRecipe`.
|
|
1123
|
+
*
|
|
1124
|
+
* A "page" here is any child whose `templateId` resolves — through the
|
|
1125
|
+
* marker index — to a page-template handle: page items conform to a page
|
|
1126
|
+
* template, and `pageFromItem` needs that handle for the recipe's required
|
|
1127
|
+
* `template` field. A child whose template GUID carries no marker is
|
|
1128
|
+
* skipped (its template is unrecoverable, so the page can't reverse-
|
|
1129
|
+
* project). The page's own `Data` datasource folder is skipped — it is a
|
|
1130
|
+
* generic Folder, not a page.
|
|
1131
|
+
*
|
|
1132
|
+
* Recurses one level into child pages (page-tree nesting): a page item's
|
|
1133
|
+
* children that are themselves pages reverse-project too. The `Data`
|
|
1134
|
+
* folder is not descended into.
|
|
1135
|
+
*/
|
|
1136
|
+
const walkPagesTree = async (rootPath, client, guidIndex) => {
|
|
1137
|
+
const recipes = [];
|
|
1138
|
+
const root = rootPath ? await client.getItem({ path: rootPath }) : null;
|
|
1139
|
+
if (!root)
|
|
1140
|
+
return recipes;
|
|
1141
|
+
const visit = async (parent) => {
|
|
1142
|
+
const children = (await client.getChildren({ itemId: parent.itemId })).sort(byTreeOrder);
|
|
1143
|
+
for (const child of children) {
|
|
1144
|
+
if (child.name === "Data" || child.name === "__Standard Values")
|
|
1145
|
+
continue;
|
|
1146
|
+
const templateHandle = guidIndex.get(normalizeGuid(child.templateId));
|
|
1147
|
+
if (templateHandle === undefined) {
|
|
1148
|
+
// Template GUID carries no marker — the page's template is
|
|
1149
|
+
// unrecoverable, so the page can't reverse-project. Skip.
|
|
1150
|
+
continue;
|
|
1151
|
+
}
|
|
1152
|
+
recipes.push(pageFromItem(child, templateHandle, guidIndex));
|
|
1153
|
+
await visit(child);
|
|
1154
|
+
}
|
|
1155
|
+
};
|
|
1156
|
+
await visit(root);
|
|
1157
|
+
return recipes;
|
|
1158
|
+
};
|
|
1159
|
+
/**
|
|
1160
|
+
* Walk the Placeholder Settings root, reverse-projecting every Placeholder
|
|
1161
|
+
* Settings item into a `PlaceholderRecipe`.
|
|
1162
|
+
*
|
|
1163
|
+
* Items conforming to `PLACEHOLDER_TEMPLATE_ID` are leaves; folders (any
|
|
1164
|
+
* other item with children) are grouping folders — recursed into, with the
|
|
1165
|
+
* cumulative folder path threaded onto each placeholder's `folder`. A
|
|
1166
|
+
* key-less Placeholder Settings item is skipped (`placeholderFromItem`
|
|
1167
|
+
* returns `null`).
|
|
1168
|
+
*/
|
|
1169
|
+
const walkPlaceholderSettingsTree = async (rootPath, client, guidIndex) => {
|
|
1170
|
+
const recipes = [];
|
|
1171
|
+
const root = rootPath ? await client.getItem({ path: rootPath }) : null;
|
|
1172
|
+
if (!root)
|
|
1173
|
+
return recipes;
|
|
1174
|
+
const visit = async (parent, folderPath) => {
|
|
1175
|
+
const children = (await client.getChildren({ itemId: parent.itemId }))
|
|
1176
|
+
.filter((c) => c.name !== "__Standard Values")
|
|
1177
|
+
.sort(byTreeOrder);
|
|
1178
|
+
for (const child of children) {
|
|
1179
|
+
if (conformsTo(child, sitecore_templates_1.PLACEHOLDER_TEMPLATE_ID)) {
|
|
1180
|
+
const recipe = placeholderFromItem(child, folderPath, guidIndex);
|
|
1181
|
+
if (recipe)
|
|
1182
|
+
recipes.push(recipe);
|
|
1183
|
+
continue;
|
|
1184
|
+
}
|
|
1185
|
+
// Anything that isn't a Placeholder leaf is a grouping folder —
|
|
1186
|
+
// descend, extending the cumulative folder path.
|
|
1187
|
+
const nextFolder = folderPath ? `${folderPath}/${child.name}` : child.name;
|
|
1188
|
+
await visit(child, nextFolder);
|
|
1189
|
+
}
|
|
1190
|
+
};
|
|
1191
|
+
await visit(root, undefined);
|
|
1192
|
+
return recipes;
|
|
1193
|
+
};
|
|
1194
|
+
/**
|
|
1195
|
+
* Reverse-project every in-scope subtree under the configured roots into a
|
|
1196
|
+
* `Recipe[]` — all nine reverse-projectable kinds (see the module JSDoc).
|
|
1197
|
+
*
|
|
1198
|
+
* Order of work: the templates trees and enumerations first, then the
|
|
1199
|
+
* layout-bearing kinds. The layout-bearing walkers share a GUID→handle
|
|
1200
|
+
* marker index (`buildGuidHandleIndex`) built once up front — skipped
|
|
1201
|
+
* entirely when no layout-bearing root is configured, so an environment
|
|
1202
|
+
* without partial/page designs pays nothing for the index walk.
|
|
1203
|
+
*
|
|
1204
|
+
* Returns `null` only when the environment has *no* roots configured at all
|
|
1205
|
+
* — the signal `recipe-kind.ts` uses to report "this environment has no
|
|
1206
|
+
* recipe-projectable surface." Otherwise always returns the array, which may
|
|
1207
|
+
* legitimately be empty (roots configured but empty trees).
|
|
1208
|
+
*
|
|
1209
|
+
* @param roots Content-tree roots resolved off the env profile.
|
|
1210
|
+
* @param client Authoring API read client (`getItem` / `getChildren`).
|
|
1211
|
+
*/
|
|
1212
|
+
const readCurrentRecipes = async (roots, client) => {
|
|
1213
|
+
const isSet = (r) => typeof r === "string" && r.length > 0;
|
|
1214
|
+
const anyRootSet = [
|
|
1215
|
+
roots.componentsRoot,
|
|
1216
|
+
roots.contentModelsRoot,
|
|
1217
|
+
roots.pageTemplatesRoot,
|
|
1218
|
+
roots.templatesRoot,
|
|
1219
|
+
roots.enumerationsRoot,
|
|
1220
|
+
roots.partialDesignsRoot,
|
|
1221
|
+
roots.pageDesignsRoot,
|
|
1222
|
+
roots.pagesRoot,
|
|
1223
|
+
roots.placeholderSettingsRoot,
|
|
1224
|
+
].some(isSet);
|
|
1225
|
+
if (!anyRootSet) {
|
|
1226
|
+
// No roots at all — the environment has no recipe-projectable surface.
|
|
1227
|
+
return null;
|
|
1228
|
+
}
|
|
1229
|
+
const recipes = [];
|
|
1230
|
+
// A template is a component iff a rendering exists for it. Index renderings
|
|
1231
|
+
// once up front so the templates walk is a pure lookup.
|
|
1232
|
+
const renderingComponentNames = roots.renderingsRoot
|
|
1233
|
+
? await collectRenderingComponentNames(roots.renderingsRoot, client)
|
|
1234
|
+
: new Set();
|
|
1235
|
+
// Walk each distinct templates-tree root exactly once. `componentsRoot` and
|
|
1236
|
+
// `contentModelsRoot` are usually distinct paths; `templatesRoot` is the
|
|
1237
|
+
// legacy fallback and is only walked when neither bucket root is set (a
|
|
1238
|
+
// shared path would otherwise double-emit).
|
|
1239
|
+
const walkedPaths = new Set();
|
|
1240
|
+
const walkTemplateRoot = async (path, isComponentsRoot, isContentModelsRoot) => {
|
|
1241
|
+
if (!path || walkedPaths.has(path))
|
|
1242
|
+
return;
|
|
1243
|
+
walkedPaths.add(path);
|
|
1244
|
+
recipes.push(...(await walkTemplatesTree(path, client, renderingComponentNames, isComponentsRoot, isContentModelsRoot)));
|
|
1245
|
+
};
|
|
1246
|
+
await walkTemplateRoot(roots.componentsRoot, true, false);
|
|
1247
|
+
await walkTemplateRoot(roots.contentModelsRoot, false, true);
|
|
1248
|
+
// Page templates live under their own root (usually a per-site folder
|
|
1249
|
+
// the flat templatesRoot walk wouldn't descend into). `walkedPaths`
|
|
1250
|
+
// dedups if it happens to coincide with another root.
|
|
1251
|
+
await walkTemplateRoot(roots.pageTemplatesRoot, false, false);
|
|
1252
|
+
// Only fall back to the flat templatesRoot when no bucket root covered it.
|
|
1253
|
+
if (!roots.componentsRoot && !roots.contentModelsRoot) {
|
|
1254
|
+
await walkTemplateRoot(roots.templatesRoot, false, false);
|
|
1255
|
+
}
|
|
1256
|
+
if (roots.enumerationsRoot) {
|
|
1257
|
+
recipes.push(...(await walkEnumerationsTree(roots.enumerationsRoot, client)));
|
|
1258
|
+
}
|
|
1259
|
+
// Layout-bearing kinds (partial-design, page-design, page) reference
|
|
1260
|
+
// renderings + datasources by GUID inside their layout XML; placeholder
|
|
1261
|
+
// `Allowed Controls` does too. Build the GUID→handle marker index once
|
|
1262
|
+
// before reverse-projecting any of them. Skip the (potentially large)
|
|
1263
|
+
// index walk entirely when no layout-bearing root is configured.
|
|
1264
|
+
const hasLayoutRoot = isSet(roots.partialDesignsRoot) ||
|
|
1265
|
+
isSet(roots.pageDesignsRoot) ||
|
|
1266
|
+
isSet(roots.pagesRoot) ||
|
|
1267
|
+
isSet(roots.placeholderSettingsRoot);
|
|
1268
|
+
if (hasLayoutRoot) {
|
|
1269
|
+
const guidIndex = await buildGuidHandleIndex(roots, client);
|
|
1270
|
+
if (roots.partialDesignsRoot) {
|
|
1271
|
+
recipes.push(...(await walkPartialDesignsTree(roots.partialDesignsRoot, client, guidIndex)));
|
|
1272
|
+
}
|
|
1273
|
+
if (roots.pageDesignsRoot) {
|
|
1274
|
+
recipes.push(...(await walkPageDesignsTree(roots.pageDesignsRoot, client, guidIndex)));
|
|
1275
|
+
}
|
|
1276
|
+
if (roots.pagesRoot) {
|
|
1277
|
+
recipes.push(...(await walkPagesTree(roots.pagesRoot, client, guidIndex)));
|
|
1278
|
+
}
|
|
1279
|
+
if (roots.placeholderSettingsRoot) {
|
|
1280
|
+
recipes.push(...(await walkPlaceholderSettingsTree(roots.placeholderSettingsRoot, client, guidIndex)));
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
return recipes;
|
|
1284
|
+
};
|
|
1285
|
+
exports.readCurrentRecipes = readCurrentRecipes;
|