@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,827 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_MASTER_INDEX = exports.MEDIA_LIBRARY_ROOT = exports.createHygieneApiClient = void 0;
|
|
4
|
+
const errors_1 = require("../../shared/errors");
|
|
5
|
+
const graphql_1 = require("../../shared/graphql");
|
|
6
|
+
const client_1 = require("../../workflow/api/client");
|
|
7
|
+
const graphql_2 = require("./graphql");
|
|
8
|
+
/**
|
|
9
|
+
* Authoring GraphQL operations used by `scai hygiene audit` and `scai hygiene cleanup`.
|
|
10
|
+
*
|
|
11
|
+
* Schema verified against XM Cloud Authoring API by introspection
|
|
12
|
+
* (2026-05-13). The shape of `SearchQueryInput`, `Item.versions`,
|
|
13
|
+
* `ItemWorkflow`, `archivedItems`, and `deleteItemVersion` are pinned
|
|
14
|
+
* here; if a tenant exposes a divergent schema, the call surfaces as
|
|
15
|
+
* a `NETWORK` `ScaiError` with the upstream message preserved.
|
|
16
|
+
*
|
|
17
|
+
* Index name: `sitecore_master_index` is the conventional master-DB
|
|
18
|
+
* index name on XM Cloud. Indexes are not user-renameable on XM Cloud,
|
|
19
|
+
* but the search index is overridable per-call so callers can target
|
|
20
|
+
* `sitecore_web_index` for published-state queries if needed.
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_MASTER_INDEX = "sitecore_master_index";
|
|
23
|
+
exports.DEFAULT_MASTER_INDEX = DEFAULT_MASTER_INDEX;
|
|
24
|
+
const MEDIA_LIBRARY_ROOT = "/sitecore/media library";
|
|
25
|
+
exports.MEDIA_LIBRARY_ROOT = MEDIA_LIBRARY_ROOT;
|
|
26
|
+
const SEARCH_RESULT_FRAGMENT = `
|
|
27
|
+
totalCount
|
|
28
|
+
results {
|
|
29
|
+
itemId
|
|
30
|
+
path
|
|
31
|
+
name
|
|
32
|
+
displayName
|
|
33
|
+
templateId
|
|
34
|
+
templateName
|
|
35
|
+
language { name }
|
|
36
|
+
version
|
|
37
|
+
updatedDate
|
|
38
|
+
createdDate
|
|
39
|
+
database
|
|
40
|
+
parentId
|
|
41
|
+
}`;
|
|
42
|
+
/**
|
|
43
|
+
* Build the `search` query as an inlined GraphQL document.
|
|
44
|
+
*
|
|
45
|
+
* **Why inline instead of variables.** The XM Cloud Authoring API
|
|
46
|
+
* rejects `SearchCriteriaType` (and likely all enum types) when passed
|
|
47
|
+
* via JSON variables — the server returns `EXEC_INVALID_TYPE: "The
|
|
48
|
+
* value of $query has a wrong structure."` even for spec-conformant
|
|
49
|
+
* variable bindings. Inlining the enum as a GraphQL literal token
|
|
50
|
+
* (`criteriaType: CONTAINS`) is the only shape the resolver accepts.
|
|
51
|
+
*
|
|
52
|
+
* We escape strings via JSON.stringify, which is GraphQL-string-safe
|
|
53
|
+
* because GraphQL string syntax is a strict subset of JSON string
|
|
54
|
+
* syntax (both use `\"`, `\\`, `\n`, etc.). Numbers and booleans pass
|
|
55
|
+
* through as their JS toString form. Enums are emitted as bare tokens
|
|
56
|
+
* (no quotes), which is what makes this work.
|
|
57
|
+
*/
|
|
58
|
+
const ENUM_FIELDS = new Set(["criteriaType", "operator", "direction"]);
|
|
59
|
+
const serializeGraphQLValue = (value, key) => {
|
|
60
|
+
if (value === null || value === undefined)
|
|
61
|
+
return "null";
|
|
62
|
+
if (key && ENUM_FIELDS.has(key) && typeof value === "string") {
|
|
63
|
+
// Enum token — bare identifier, no quotes.
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
if (typeof value === "string")
|
|
67
|
+
return JSON.stringify(value);
|
|
68
|
+
if (typeof value === "number" || typeof value === "boolean")
|
|
69
|
+
return String(value);
|
|
70
|
+
if (Array.isArray(value)) {
|
|
71
|
+
return `[${value.map((v) => serializeGraphQLValue(v, key)).join(", ")}]`;
|
|
72
|
+
}
|
|
73
|
+
if (typeof value === "object") {
|
|
74
|
+
const obj = value;
|
|
75
|
+
const entries = Object.entries(obj).filter(([, v]) => v !== undefined);
|
|
76
|
+
return `{ ${entries.map(([k, v]) => `${k}: ${serializeGraphQLValue(v, k)}`).join(", ")} }`;
|
|
77
|
+
}
|
|
78
|
+
return String(value);
|
|
79
|
+
};
|
|
80
|
+
const buildSearchDocument = (queryInput) => {
|
|
81
|
+
const literal = serializeGraphQLValue(queryInput);
|
|
82
|
+
return `query { search(query: ${literal}) { ${SEARCH_RESULT_FRAGMENT} } }`;
|
|
83
|
+
};
|
|
84
|
+
const GET_ITEM_FIELDS_BY_PATH = `
|
|
85
|
+
query($path: String!) {
|
|
86
|
+
item(where: { path: $path }) {
|
|
87
|
+
itemId
|
|
88
|
+
path
|
|
89
|
+
fields(ownFields: false) {
|
|
90
|
+
nodes {
|
|
91
|
+
name
|
|
92
|
+
value
|
|
93
|
+
templateField { templateFieldId }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}`;
|
|
98
|
+
const GET_ITEM_FIELDS_BY_ID = `
|
|
99
|
+
query($itemId: ID!) {
|
|
100
|
+
item(where: { itemId: $itemId }) {
|
|
101
|
+
itemId
|
|
102
|
+
path
|
|
103
|
+
fields(ownFields: false) {
|
|
104
|
+
nodes {
|
|
105
|
+
name
|
|
106
|
+
value
|
|
107
|
+
templateField { templateFieldId }
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}`;
|
|
112
|
+
const GET_ITEM_VERSIONS_BY_PATH = `
|
|
113
|
+
query($path: String!, $language: String) {
|
|
114
|
+
item(where: { path: $path, language: $language, existingVersionOnly: true }) {
|
|
115
|
+
versions {
|
|
116
|
+
itemId
|
|
117
|
+
version
|
|
118
|
+
versionName
|
|
119
|
+
language { name }
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}`;
|
|
123
|
+
const GET_ITEM_VERSIONS_BY_ID = `
|
|
124
|
+
query($itemId: ID!, $language: String) {
|
|
125
|
+
item(where: { itemId: $itemId, language: $language, existingVersionOnly: true }) {
|
|
126
|
+
versions {
|
|
127
|
+
itemId
|
|
128
|
+
version
|
|
129
|
+
versionName
|
|
130
|
+
language { name }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}`;
|
|
134
|
+
const LIST_ARCHIVED_ITEMS_DEFAULT = `
|
|
135
|
+
query($pageIndex: Int, $pageSize: Int) {
|
|
136
|
+
archivedItems(pageIndex: $pageIndex, pageSize: $pageSize) {
|
|
137
|
+
archivalId
|
|
138
|
+
itemId
|
|
139
|
+
name
|
|
140
|
+
originalLocation
|
|
141
|
+
archivedBy
|
|
142
|
+
archivedDate
|
|
143
|
+
parentId
|
|
144
|
+
}
|
|
145
|
+
}`;
|
|
146
|
+
const LIST_ARCHIVED_ITEMS_NAMED = `
|
|
147
|
+
query($archiveName: String!, $pageIndex: Int, $pageSize: Int) {
|
|
148
|
+
archivedItems(archiveName: $archiveName, pageIndex: $pageIndex, pageSize: $pageSize) {
|
|
149
|
+
archivalId
|
|
150
|
+
itemId
|
|
151
|
+
name
|
|
152
|
+
originalLocation
|
|
153
|
+
archivedBy
|
|
154
|
+
archivedDate
|
|
155
|
+
parentId
|
|
156
|
+
}
|
|
157
|
+
}`;
|
|
158
|
+
const DELETE_ITEM_VERSION_MUTATION = `
|
|
159
|
+
mutation($input: DeleteItemVersionInput!) {
|
|
160
|
+
deleteItemVersion(input: $input) {
|
|
161
|
+
successful
|
|
162
|
+
}
|
|
163
|
+
}`;
|
|
164
|
+
const DELETE_ITEM_MUTATION = `
|
|
165
|
+
mutation($input: DeleteItemInput!) {
|
|
166
|
+
deleteItem(input: $input) {
|
|
167
|
+
successful
|
|
168
|
+
}
|
|
169
|
+
}`;
|
|
170
|
+
const DELETE_ITEM_TEMPLATE_MUTATION = `
|
|
171
|
+
mutation($input: DeleteItemTemplateInput!) {
|
|
172
|
+
deleteItemTemplate(input: $input) {
|
|
173
|
+
successful
|
|
174
|
+
}
|
|
175
|
+
}`;
|
|
176
|
+
const UPDATE_ITEM_MUTATION = `
|
|
177
|
+
mutation($input: UpdateItemInput!) {
|
|
178
|
+
updateItem(input: $input) {
|
|
179
|
+
item { itemId }
|
|
180
|
+
}
|
|
181
|
+
}`;
|
|
182
|
+
const ADD_ITEM_VERSION_MUTATION = `
|
|
183
|
+
mutation($input: AddItemVersionInput!) {
|
|
184
|
+
addItemVersion(input: $input) {
|
|
185
|
+
item { itemId }
|
|
186
|
+
versionNumber
|
|
187
|
+
}
|
|
188
|
+
}`;
|
|
189
|
+
const LIST_USERS_QUERY = `
|
|
190
|
+
query($first: PaginationAmount, $after: String) {
|
|
191
|
+
users(first: $first, after: $after) {
|
|
192
|
+
nodes { name isAdministrator isAuthenticated domain { name } }
|
|
193
|
+
pageInfo { hasNextPage endCursor }
|
|
194
|
+
}
|
|
195
|
+
}`;
|
|
196
|
+
/**
|
|
197
|
+
* Per-role member sampling: `nodes` on `AccountConnection` doesn't
|
|
198
|
+
* expose `totalCount`, so we page-1 the members and check `nodes`
|
|
199
|
+
* length. >= 1 → has members; 0 → empty role. Quickest signal we can
|
|
200
|
+
* get without an O(R*M) per-role member walk.
|
|
201
|
+
*/
|
|
202
|
+
const LIST_ROLES_QUERY = `
|
|
203
|
+
query($first: PaginationAmount, $after: String) {
|
|
204
|
+
roles(first: $first, after: $after) {
|
|
205
|
+
nodes {
|
|
206
|
+
name
|
|
207
|
+
domain { name }
|
|
208
|
+
members(first: 1) { nodes { name } }
|
|
209
|
+
}
|
|
210
|
+
pageInfo { hasNextPage endCursor }
|
|
211
|
+
}
|
|
212
|
+
}`;
|
|
213
|
+
const GET_USER_DETAIL_QUERY = `
|
|
214
|
+
query($userName: String!) {
|
|
215
|
+
user(userName: $userName) {
|
|
216
|
+
name
|
|
217
|
+
isAdministrator
|
|
218
|
+
roles { name }
|
|
219
|
+
profile { lastLoginDate lastActivityDate }
|
|
220
|
+
}
|
|
221
|
+
}`;
|
|
222
|
+
const DELETE_USER_MUTATION = `
|
|
223
|
+
mutation($input: DeleteUserInput!) {
|
|
224
|
+
deleteUser(input: $input) { successful }
|
|
225
|
+
}`;
|
|
226
|
+
const DELETE_ROLE_MUTATION = `
|
|
227
|
+
mutation($input: DeleteRoleInput!) {
|
|
228
|
+
deleteRole(input: $input) { successful }
|
|
229
|
+
}`;
|
|
230
|
+
const DELETE_ARCHIVED_ITEM_MUTATION = `
|
|
231
|
+
mutation($input: DeleteArchivedItemInput!) {
|
|
232
|
+
deleteArchivedItem(input: $input) {
|
|
233
|
+
successful
|
|
234
|
+
}
|
|
235
|
+
}`;
|
|
236
|
+
const ARCHIVE_VERSION_MUTATION = `
|
|
237
|
+
mutation($input: ArchiveVersionInput!) {
|
|
238
|
+
archiveVersion(input: $input) {
|
|
239
|
+
archiveVersionId
|
|
240
|
+
}
|
|
241
|
+
}`;
|
|
242
|
+
/**
|
|
243
|
+
* Sitecore's well-known "Template" template id. Items based on this
|
|
244
|
+
* template ARE themselves templates; using it as a `_template` filter
|
|
245
|
+
* via search lets us enumerate templates under any content-tree subtree
|
|
246
|
+
* (the Authoring API's `itemTemplates` connection doesn't accept a
|
|
247
|
+
* subtree scope, only a single-template `path`).
|
|
248
|
+
*/
|
|
249
|
+
const TEMPLATE_TEMPLATE_ID = "ab86861a603046c5b394e8f99e8b87db";
|
|
250
|
+
const CHILD_FRAGMENT = `
|
|
251
|
+
itemId
|
|
252
|
+
name
|
|
253
|
+
path
|
|
254
|
+
template { templateId }`;
|
|
255
|
+
const GET_CHILDREN_BY_PATH = `
|
|
256
|
+
query($path: String!) {
|
|
257
|
+
item(where: { path: $path }) {
|
|
258
|
+
children {
|
|
259
|
+
nodes { ${CHILD_FRAGMENT} }
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}`;
|
|
263
|
+
const GET_CHILDREN_BY_ID = `
|
|
264
|
+
query($itemId: ID!) {
|
|
265
|
+
item(where: { itemId: $itemId }) {
|
|
266
|
+
children {
|
|
267
|
+
nodes { ${CHILD_FRAGMENT} }
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}`;
|
|
271
|
+
const createHygieneApiClient = (options) => {
|
|
272
|
+
const { environment, request } = options;
|
|
273
|
+
const defaultIndex = options.defaultIndex ?? DEFAULT_MASTER_INDEX;
|
|
274
|
+
const readRequest = {
|
|
275
|
+
...request,
|
|
276
|
+
retry: { ...request?.retry, retryableStatuses: graphql_1.READ_RETRYABLE_STATUSES },
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* Hygiene mutations are limited to `deleteItemVersion`. Reused recipe-style
|
|
280
|
+
* "no retry on writes" policy — the Authoring API has no idempotency-key
|
|
281
|
+
* mechanism, so retrying a delete that may have already applied risks
|
|
282
|
+
* surfacing a confusing "version not found" on the second attempt.
|
|
283
|
+
*/
|
|
284
|
+
const writeRequest = {
|
|
285
|
+
...(request ?? {}),
|
|
286
|
+
retry: { maxAttempts: 1 },
|
|
287
|
+
};
|
|
288
|
+
// Workflow primitives live in @/workflow/api; we delegate the
|
|
289
|
+
// hygiene-facing methods so cleanup-workflow-advance and
|
|
290
|
+
// audit-stale-workflow keep their existing HygieneApiClient surface.
|
|
291
|
+
const workflowClient = (0, client_1.createWorkflowApiClient)({
|
|
292
|
+
environment,
|
|
293
|
+
request,
|
|
294
|
+
});
|
|
295
|
+
const buildSearchQuery = (query) => ({
|
|
296
|
+
index: query.index ?? defaultIndex,
|
|
297
|
+
...(query.language !== undefined && { language: query.language }),
|
|
298
|
+
...(query.latestVersionOnly !== undefined && {
|
|
299
|
+
latestVersionOnly: query.latestVersionOnly,
|
|
300
|
+
}),
|
|
301
|
+
...(query.paging !== undefined && { paging: query.paging }),
|
|
302
|
+
...(query.searchStatement !== undefined && { searchStatement: query.searchStatement }),
|
|
303
|
+
...(query.filterStatement !== undefined && { filterStatement: query.filterStatement }),
|
|
304
|
+
...(query.sort !== undefined && { sort: query.sort }),
|
|
305
|
+
});
|
|
306
|
+
const search = async (query) => {
|
|
307
|
+
const document = buildSearchDocument(buildSearchQuery(query));
|
|
308
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, document, undefined, readRequest);
|
|
309
|
+
return {
|
|
310
|
+
totalCount: data.search?.totalCount ?? 0,
|
|
311
|
+
results: data.search?.results ?? [],
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
async function* searchAll(query, perPage = 100, parallel = 1) {
|
|
315
|
+
const startIndex = query.paging?.pageIndex ?? 0;
|
|
316
|
+
const pageSize = query.paging?.pageSize ?? perPage;
|
|
317
|
+
// Sanitise: parallel must be >= 1.
|
|
318
|
+
const fanout = Math.max(1, Math.floor(parallel));
|
|
319
|
+
// Always fetch the first page sequentially. We need its `totalCount`
|
|
320
|
+
// to know how many pages to schedule in parallel mode; in serial
|
|
321
|
+
// mode we use it both for results and for the termination test.
|
|
322
|
+
const firstPage = await search({
|
|
323
|
+
...query,
|
|
324
|
+
paging: { pageIndex: startIndex, pageSize },
|
|
325
|
+
});
|
|
326
|
+
for (const r of firstPage.results)
|
|
327
|
+
yield r;
|
|
328
|
+
if (firstPage.results.length < pageSize || firstPage.totalCount <= pageSize) {
|
|
329
|
+
// No further pages needed.
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const totalPages = Math.ceil(firstPage.totalCount / pageSize);
|
|
333
|
+
// First page already consumed; remaining pages are [startIndex+1 ... totalPages-1+startIndex].
|
|
334
|
+
const remainingStart = startIndex + 1;
|
|
335
|
+
const remainingEnd = startIndex + totalPages - 1;
|
|
336
|
+
if (fanout === 1) {
|
|
337
|
+
// Serial path — preserves the original ordering guarantee that
|
|
338
|
+
// existing callers may rely on (e.g. test fixtures).
|
|
339
|
+
let seen = firstPage.results.length;
|
|
340
|
+
for (let pageIndex = remainingStart; pageIndex <= remainingEnd; pageIndex += 1) {
|
|
341
|
+
const page = await search({
|
|
342
|
+
...query,
|
|
343
|
+
paging: { pageIndex, pageSize },
|
|
344
|
+
});
|
|
345
|
+
for (const r of page.results)
|
|
346
|
+
yield r;
|
|
347
|
+
seen += page.results.length;
|
|
348
|
+
if (page.results.length < pageSize || seen >= firstPage.totalCount)
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
// Parallel path — fetch pages in windows of size `fanout`. Within
|
|
354
|
+
// a window, pages resolve concurrently; the window's results are
|
|
355
|
+
// yielded in pageIndex order so per-window ordering is stable, but
|
|
356
|
+
// cross-window order remains the page-index order.
|
|
357
|
+
for (let windowStart = remainingStart; windowStart <= remainingEnd; windowStart += fanout) {
|
|
358
|
+
const windowEnd = Math.min(windowStart + fanout - 1, remainingEnd);
|
|
359
|
+
const indices = [];
|
|
360
|
+
for (let i = windowStart; i <= windowEnd; i += 1)
|
|
361
|
+
indices.push(i);
|
|
362
|
+
const pages = await Promise.all(indices.map((pageIndex) => search({
|
|
363
|
+
...query,
|
|
364
|
+
paging: { pageIndex, pageSize },
|
|
365
|
+
})));
|
|
366
|
+
for (const page of pages) {
|
|
367
|
+
for (const r of page.results)
|
|
368
|
+
yield r;
|
|
369
|
+
}
|
|
370
|
+
// Early stop: if the last page of this window returned a short
|
|
371
|
+
// page, no further pages exist regardless of totalCount drift.
|
|
372
|
+
if (pages[pages.length - 1].results.length < pageSize)
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const fieldsFromNode = (node) => {
|
|
377
|
+
if (!node)
|
|
378
|
+
return [];
|
|
379
|
+
return node.fields.nodes
|
|
380
|
+
.filter((f) => f.templateField?.templateFieldId)
|
|
381
|
+
.map((f) => ({
|
|
382
|
+
fieldId: f.templateField.templateFieldId,
|
|
383
|
+
name: f.name,
|
|
384
|
+
value: f.value,
|
|
385
|
+
}));
|
|
386
|
+
};
|
|
387
|
+
const getItemFields = async (selector) => {
|
|
388
|
+
if (selector.itemId) {
|
|
389
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, GET_ITEM_FIELDS_BY_ID, { itemId: selector.itemId }, readRequest);
|
|
390
|
+
return data.item ? fieldsFromNode(data.item) : null;
|
|
391
|
+
}
|
|
392
|
+
if (selector.path) {
|
|
393
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, GET_ITEM_FIELDS_BY_PATH, { path: selector.path }, readRequest);
|
|
394
|
+
return data.item ? fieldsFromNode(data.item) : null;
|
|
395
|
+
}
|
|
396
|
+
throw (0, errors_1.createScaiError)("getItemFields requires path or itemId.", "INPUT_INVALID");
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Aliased batched read for field-lookup. One POST returns up to
|
|
400
|
+
* `itemIds.length` items' fields. Keeps the request payload bounded
|
|
401
|
+
* — caller should chunk to ~25 per batch like the recipe client does.
|
|
402
|
+
*/
|
|
403
|
+
const getItemFieldsBatch = async (itemIds) => {
|
|
404
|
+
const result = new Map();
|
|
405
|
+
if (itemIds.length === 0)
|
|
406
|
+
return result;
|
|
407
|
+
const varDecls = itemIds.map((_, i) => `$id${i}: ID!`).join(", ");
|
|
408
|
+
const selections = itemIds
|
|
409
|
+
.map((_, i) => `
|
|
410
|
+
i${i}: item(where: { itemId: $id${i} }) {
|
|
411
|
+
itemId
|
|
412
|
+
fields(ownFields: false) {
|
|
413
|
+
nodes { name value templateField { templateFieldId } }
|
|
414
|
+
}
|
|
415
|
+
}`)
|
|
416
|
+
.join("");
|
|
417
|
+
const query = `query Batch(${varDecls}) {${selections}\n}`;
|
|
418
|
+
const variables = {};
|
|
419
|
+
itemIds.forEach((id, i) => {
|
|
420
|
+
variables[`id${i}`] = id;
|
|
421
|
+
});
|
|
422
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, query, variables, readRequest);
|
|
423
|
+
itemIds.forEach((id, i) => {
|
|
424
|
+
const node = data[`i${i}`];
|
|
425
|
+
result.set(id, node ? fieldsFromNode(node) : null);
|
|
426
|
+
});
|
|
427
|
+
return result;
|
|
428
|
+
};
|
|
429
|
+
const itemExists = async (itemId) => {
|
|
430
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, `query($itemId: ID!) { item(where: { itemId: $itemId }) { itemId } }`, { itemId }, readRequest);
|
|
431
|
+
return data.item !== null;
|
|
432
|
+
};
|
|
433
|
+
const itemsExistBatch = async (itemIds) => {
|
|
434
|
+
const result = new Map();
|
|
435
|
+
if (itemIds.length === 0)
|
|
436
|
+
return result;
|
|
437
|
+
const varDecls = itemIds.map((_, i) => `$id${i}: ID!`).join(", ");
|
|
438
|
+
const selections = itemIds
|
|
439
|
+
.map((_, i) => `
|
|
440
|
+
i${i}: item(where: { itemId: $id${i} }) { itemId }`)
|
|
441
|
+
.join("");
|
|
442
|
+
const query = `query Batch(${varDecls}) {${selections}\n}`;
|
|
443
|
+
const variables = {};
|
|
444
|
+
itemIds.forEach((id, i) => {
|
|
445
|
+
variables[`id${i}`] = id;
|
|
446
|
+
});
|
|
447
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, query, variables, readRequest);
|
|
448
|
+
itemIds.forEach((id, i) => {
|
|
449
|
+
result.set(id, data[`i${i}`] !== null);
|
|
450
|
+
});
|
|
451
|
+
return result;
|
|
452
|
+
};
|
|
453
|
+
const getItemVersions = async (selector) => {
|
|
454
|
+
const variables = { language: selector.language ?? null };
|
|
455
|
+
if (selector.itemId) {
|
|
456
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, GET_ITEM_VERSIONS_BY_ID, { itemId: selector.itemId, ...variables }, readRequest);
|
|
457
|
+
return data.item?.versions ?? [];
|
|
458
|
+
}
|
|
459
|
+
if (selector.path) {
|
|
460
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, GET_ITEM_VERSIONS_BY_PATH, { path: selector.path, ...variables }, readRequest);
|
|
461
|
+
return data.item?.versions ?? [];
|
|
462
|
+
}
|
|
463
|
+
throw (0, errors_1.createScaiError)("getItemVersions requires path or itemId.", "INPUT_INVALID");
|
|
464
|
+
};
|
|
465
|
+
const getItemWorkflow = async (itemId, path) => {
|
|
466
|
+
const result = await workflowClient.getItemWorkflow({ itemId });
|
|
467
|
+
if (!result)
|
|
468
|
+
return null;
|
|
469
|
+
return { ...result, path: result.path ?? path };
|
|
470
|
+
};
|
|
471
|
+
const listArchivedItems = async (opts = {}) => {
|
|
472
|
+
// The Authoring API resolver rejects a null `archiveName` even when
|
|
473
|
+
// the GraphQL declaration types it as nullable. Use a query that
|
|
474
|
+
// omits the variable entirely when the caller didn't ask for a
|
|
475
|
+
// specific archive — that's the "all archives" path. When the caller
|
|
476
|
+
// does provide a name, use the variant that declares it as required.
|
|
477
|
+
const pageIndex = opts.pageIndex ?? 0;
|
|
478
|
+
const pageSize = opts.pageSize ?? 100;
|
|
479
|
+
if (opts.archiveName !== undefined) {
|
|
480
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, LIST_ARCHIVED_ITEMS_NAMED, { archiveName: opts.archiveName, pageIndex, pageSize }, readRequest);
|
|
481
|
+
return data.archivedItems ?? [];
|
|
482
|
+
}
|
|
483
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, LIST_ARCHIVED_ITEMS_DEFAULT, { pageIndex, pageSize }, readRequest);
|
|
484
|
+
return data.archivedItems ?? [];
|
|
485
|
+
};
|
|
486
|
+
const deleteItemVersion = async (input) => {
|
|
487
|
+
if (!input.itemId && !input.path) {
|
|
488
|
+
throw (0, errors_1.createScaiError)("deleteItemVersion requires either itemId or path.", "INPUT_INVALID");
|
|
489
|
+
}
|
|
490
|
+
const payload = {
|
|
491
|
+
language: input.language,
|
|
492
|
+
version: input.version,
|
|
493
|
+
database: input.database ?? "master",
|
|
494
|
+
};
|
|
495
|
+
if (input.itemId)
|
|
496
|
+
payload.itemId = input.itemId;
|
|
497
|
+
else if (input.path)
|
|
498
|
+
payload.path = input.path;
|
|
499
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, DELETE_ITEM_VERSION_MUTATION, { input: payload }, writeRequest);
|
|
500
|
+
if (!data.deleteItemVersion?.successful) {
|
|
501
|
+
throw (0, errors_1.createScaiError)(`deleteItemVersion returned successful=${data.deleteItemVersion?.successful} for ${input.itemId ?? input.path} @${input.language} v${input.version}`, "UNKNOWN");
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
const deleteItem = async (input) => {
|
|
505
|
+
if (!input.itemId && !input.path) {
|
|
506
|
+
throw (0, errors_1.createScaiError)("deleteItem requires either itemId or path.", "INPUT_INVALID");
|
|
507
|
+
}
|
|
508
|
+
const payload = {
|
|
509
|
+
database: input.database ?? "master",
|
|
510
|
+
permanently: input.permanently ?? true,
|
|
511
|
+
};
|
|
512
|
+
if (input.itemId)
|
|
513
|
+
payload.itemId = input.itemId;
|
|
514
|
+
else if (input.path)
|
|
515
|
+
payload.path = input.path;
|
|
516
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, DELETE_ITEM_MUTATION, { input: payload }, writeRequest);
|
|
517
|
+
if (!data.deleteItem?.successful) {
|
|
518
|
+
throw (0, errors_1.createScaiError)(`deleteItem returned successful=${data.deleteItem?.successful} for ${input.itemId ?? input.path}`, "UNKNOWN");
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
const deleteItemTemplate = async (templateId, database = "master") => {
|
|
522
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, DELETE_ITEM_TEMPLATE_MUTATION, { input: { templateId, database } }, writeRequest);
|
|
523
|
+
if (!data.deleteItemTemplate?.successful) {
|
|
524
|
+
throw (0, errors_1.createScaiError)(`deleteItemTemplate returned successful=${data.deleteItemTemplate?.successful} for template ${templateId}`, "UNKNOWN");
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
const deleteArchivedItem = async (archivalId, archiveName) => {
|
|
528
|
+
const input = { archivalId };
|
|
529
|
+
if (archiveName !== undefined)
|
|
530
|
+
input.archiveName = archiveName;
|
|
531
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, DELETE_ARCHIVED_ITEM_MUTATION, { input }, writeRequest);
|
|
532
|
+
if (!data.deleteArchivedItem?.successful) {
|
|
533
|
+
throw (0, errors_1.createScaiError)(`deleteArchivedItem returned successful=${data.deleteArchivedItem?.successful} for ${archivalId}`, "UNKNOWN");
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
const archiveVersion = async (input) => {
|
|
537
|
+
if (!input.itemId && !input.itemPath) {
|
|
538
|
+
throw (0, errors_1.createScaiError)("archiveVersion requires either itemId or itemPath.", "INPUT_INVALID");
|
|
539
|
+
}
|
|
540
|
+
const payload = {
|
|
541
|
+
language: input.language,
|
|
542
|
+
version: input.version,
|
|
543
|
+
};
|
|
544
|
+
if (input.itemId)
|
|
545
|
+
payload.itemId = input.itemId;
|
|
546
|
+
else if (input.itemPath)
|
|
547
|
+
payload.itemPath = input.itemPath;
|
|
548
|
+
if (input.archiveName !== undefined)
|
|
549
|
+
payload.archiveName = input.archiveName;
|
|
550
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, ARCHIVE_VERSION_MUTATION, { input: payload }, writeRequest);
|
|
551
|
+
return data.archiveVersion?.archiveVersionId ?? null;
|
|
552
|
+
};
|
|
553
|
+
/**
|
|
554
|
+
* Enumerate item templates, optionally scoped to a content-tree subtree.
|
|
555
|
+
*
|
|
556
|
+
* Implementation note: the Authoring API's `itemTemplates(where: {path})`
|
|
557
|
+
* matches one template by path (not a subtree), and `standardValuesItem`
|
|
558
|
+
* requires a `language` argument that's awkward to thread through here.
|
|
559
|
+
* Instead, we use the search index — items where `_template` is the
|
|
560
|
+
* well-known "Template" template id ARE themselves templates. Adding a
|
|
561
|
+
* `_path` filter scopes to a subtree. Name + path are pulled from the
|
|
562
|
+
* search result; `fullName` is derived from the path by stripping the
|
|
563
|
+
* `/sitecore/templates/` prefix.
|
|
564
|
+
*/
|
|
565
|
+
const listItemTemplates = async (opts = {}) => {
|
|
566
|
+
const results = [];
|
|
567
|
+
let rootItemId;
|
|
568
|
+
let rootPrefix;
|
|
569
|
+
if (opts.rootPath) {
|
|
570
|
+
const normalizedRoot = opts.rootPath.replace(/\/+$/, "").toLowerCase();
|
|
571
|
+
// A `pageSize: 1` `_fullpath` lookup cannot distinguish an exact hit
|
|
572
|
+
// from a near-match the index ranked first; a wrong (shallower) root
|
|
573
|
+
// silently widens the `_path CONTAINS` scope below. Fetch a small
|
|
574
|
+
// page and confirm the path matches exactly.
|
|
575
|
+
const r = await search({
|
|
576
|
+
paging: { pageSize: 20 },
|
|
577
|
+
searchStatement: {
|
|
578
|
+
criteria: {
|
|
579
|
+
field: "_fullpath",
|
|
580
|
+
value: normalizedRoot,
|
|
581
|
+
criteriaType: "EXACT",
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
});
|
|
585
|
+
rootItemId = r.results.find((x) => x.path?.toLowerCase() === normalizedRoot)?.itemId;
|
|
586
|
+
if (!rootItemId) {
|
|
587
|
+
throw (0, errors_1.createScaiError)(`Root path '${opts.rootPath}' was not found in the template tree.`, "INPUT_INVALID", { hint: "Pass --root as an existing item path, e.g. /sitecore/templates/Project." });
|
|
588
|
+
}
|
|
589
|
+
rootPrefix = `${normalizedRoot}/`;
|
|
590
|
+
}
|
|
591
|
+
const statement = rootItemId
|
|
592
|
+
? {
|
|
593
|
+
operator: "MUST",
|
|
594
|
+
subStatements: [
|
|
595
|
+
{
|
|
596
|
+
criteria: {
|
|
597
|
+
field: "_template",
|
|
598
|
+
value: TEMPLATE_TEMPLATE_ID,
|
|
599
|
+
criteriaType: "EXACT",
|
|
600
|
+
},
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
criteria: {
|
|
604
|
+
field: "_path",
|
|
605
|
+
value: rootItemId.toLowerCase().replace(/[-{}]/g, ""),
|
|
606
|
+
criteriaType: "CONTAINS",
|
|
607
|
+
},
|
|
608
|
+
},
|
|
609
|
+
],
|
|
610
|
+
}
|
|
611
|
+
: {
|
|
612
|
+
criteria: {
|
|
613
|
+
field: "_template",
|
|
614
|
+
value: TEMPLATE_TEMPLATE_ID,
|
|
615
|
+
criteriaType: "EXACT",
|
|
616
|
+
},
|
|
617
|
+
};
|
|
618
|
+
// Dedup by templateId. The search index returns the same template
|
|
619
|
+
// multiple times when its `_path` contains the root itemId in
|
|
620
|
+
// multiple language indexes / version rows, even with
|
|
621
|
+
// `latestVersionOnly: true` (SXA tenants in particular surface
|
|
622
|
+
// `Project`, `Experience Accelerator`, etc. 4–5x each). Without
|
|
623
|
+
// this Set, every downstream audit double-counts.
|
|
624
|
+
const seen = new Set();
|
|
625
|
+
for await (const r of searchAll({
|
|
626
|
+
latestVersionOnly: true,
|
|
627
|
+
searchStatement: statement,
|
|
628
|
+
}, opts.pageSize ?? 100)) {
|
|
629
|
+
if (!r.itemId || seen.has(r.itemId))
|
|
630
|
+
continue;
|
|
631
|
+
// The `_path CONTAINS` index filter is a substring match and can
|
|
632
|
+
// over-match; confirm the hit truly sits under the requested root.
|
|
633
|
+
if (rootPrefix && !(r.path?.toLowerCase() ?? "").startsWith(rootPrefix))
|
|
634
|
+
continue;
|
|
635
|
+
seen.add(r.itemId);
|
|
636
|
+
const fullName = r.path ? r.path.replace(/^\/sitecore\/templates\//i, "") : null;
|
|
637
|
+
results.push({
|
|
638
|
+
templateId: r.itemId,
|
|
639
|
+
name: r.name,
|
|
640
|
+
fullName,
|
|
641
|
+
standardValuesItemId: null,
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
return results;
|
|
645
|
+
};
|
|
646
|
+
const getChildren = async (selector) => {
|
|
647
|
+
const map = (nodes) => nodes.map((n) => ({
|
|
648
|
+
itemId: n.itemId,
|
|
649
|
+
name: n.name,
|
|
650
|
+
path: n.path,
|
|
651
|
+
templateId: n.template?.templateId ?? null,
|
|
652
|
+
templateName: null,
|
|
653
|
+
}));
|
|
654
|
+
if (selector.itemId) {
|
|
655
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, GET_CHILDREN_BY_ID, { itemId: selector.itemId }, readRequest);
|
|
656
|
+
return data.item ? map(data.item.children.nodes) : [];
|
|
657
|
+
}
|
|
658
|
+
if (selector.path) {
|
|
659
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, GET_CHILDREN_BY_PATH, { path: selector.path }, readRequest);
|
|
660
|
+
return data.item ? map(data.item.children.nodes) : [];
|
|
661
|
+
}
|
|
662
|
+
throw (0, errors_1.createScaiError)("getChildren requires itemId or path.", "INPUT_INVALID");
|
|
663
|
+
};
|
|
664
|
+
const updateItemFields = async (input) => {
|
|
665
|
+
if (!input.itemId) {
|
|
666
|
+
throw (0, errors_1.createScaiError)("updateItemFields requires itemId.", "INPUT_INVALID");
|
|
667
|
+
}
|
|
668
|
+
if (!input.fields.length) {
|
|
669
|
+
// No-op for empty field updates — saves a wire call.
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, UPDATE_ITEM_MUTATION, {
|
|
673
|
+
input: {
|
|
674
|
+
itemId: input.itemId,
|
|
675
|
+
fields: input.fields,
|
|
676
|
+
},
|
|
677
|
+
}, writeRequest);
|
|
678
|
+
if (!data.updateItem?.item?.itemId) {
|
|
679
|
+
throw (0, errors_1.createScaiError)(`updateItem returned no itemId for ${input.itemId}.`, "UNKNOWN");
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
const renameItem = async (input) => {
|
|
683
|
+
if (!input.itemId) {
|
|
684
|
+
throw (0, errors_1.createScaiError)("renameItem requires itemId.", "INPUT_INVALID");
|
|
685
|
+
}
|
|
686
|
+
if (!input.name || !input.name.trim()) {
|
|
687
|
+
throw (0, errors_1.createScaiError)("renameItem requires a non-empty name.", "INPUT_INVALID");
|
|
688
|
+
}
|
|
689
|
+
if (/[/\\]/.test(input.name)) {
|
|
690
|
+
// Slashes in a Sitecore item name produce paths the resolver can't
|
|
691
|
+
// round-trip; reject at the API boundary so the caller doesn't
|
|
692
|
+
// hand the foot-gun to the user.
|
|
693
|
+
throw (0, errors_1.createScaiError)("Item names cannot contain '/' or '\\'.", "INPUT_INVALID");
|
|
694
|
+
}
|
|
695
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, UPDATE_ITEM_MUTATION, { input: { itemId: input.itemId, name: input.name } }, writeRequest);
|
|
696
|
+
if (!data.updateItem?.item?.itemId) {
|
|
697
|
+
throw (0, errors_1.createScaiError)(`renameItem returned no itemId for ${input.itemId}.`, "UNKNOWN");
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
const addItemVersion = async (input) => {
|
|
701
|
+
if (!input.itemId) {
|
|
702
|
+
throw (0, errors_1.createScaiError)("addItemVersion requires itemId.", "INPUT_INVALID");
|
|
703
|
+
}
|
|
704
|
+
if (!input.language) {
|
|
705
|
+
throw (0, errors_1.createScaiError)("addItemVersion requires language.", "INPUT_INVALID");
|
|
706
|
+
}
|
|
707
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, ADD_ITEM_VERSION_MUTATION, {
|
|
708
|
+
input: {
|
|
709
|
+
itemId: input.itemId,
|
|
710
|
+
language: input.language,
|
|
711
|
+
...(input.baseVersion !== undefined && { versionNumber: input.baseVersion }),
|
|
712
|
+
},
|
|
713
|
+
}, writeRequest);
|
|
714
|
+
if (!data.addItemVersion?.item?.itemId) {
|
|
715
|
+
throw (0, errors_1.createScaiError)(`addItemVersion returned no itemId for ${input.itemId}/${input.language}.`, "UNKNOWN");
|
|
716
|
+
}
|
|
717
|
+
return { versionNumber: data.addItemVersion.versionNumber };
|
|
718
|
+
};
|
|
719
|
+
const listUsers = async (opts = {}) => {
|
|
720
|
+
const pageSize = opts.pageSize ?? 100;
|
|
721
|
+
const result = [];
|
|
722
|
+
let after = null;
|
|
723
|
+
while (true) {
|
|
724
|
+
const variables = { first: pageSize };
|
|
725
|
+
if (after)
|
|
726
|
+
variables.after = after;
|
|
727
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, LIST_USERS_QUERY, variables, readRequest);
|
|
728
|
+
const conn = data.users;
|
|
729
|
+
if (!conn)
|
|
730
|
+
break;
|
|
731
|
+
for (const u of conn.nodes) {
|
|
732
|
+
result.push({
|
|
733
|
+
name: u.name,
|
|
734
|
+
isAdministrator: u.isAdministrator,
|
|
735
|
+
isAuthenticated: u.isAuthenticated,
|
|
736
|
+
domain: u.domain?.name ?? null,
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
if (!conn.pageInfo.hasNextPage || !conn.pageInfo.endCursor)
|
|
740
|
+
break;
|
|
741
|
+
after = conn.pageInfo.endCursor;
|
|
742
|
+
}
|
|
743
|
+
return result;
|
|
744
|
+
};
|
|
745
|
+
const listRoles = async (opts = {}) => {
|
|
746
|
+
const pageSize = opts.pageSize ?? 100;
|
|
747
|
+
const result = [];
|
|
748
|
+
let after = null;
|
|
749
|
+
while (true) {
|
|
750
|
+
const variables = { first: pageSize };
|
|
751
|
+
if (after)
|
|
752
|
+
variables.after = after;
|
|
753
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, LIST_ROLES_QUERY, variables, readRequest);
|
|
754
|
+
const conn = data.roles;
|
|
755
|
+
if (!conn)
|
|
756
|
+
break;
|
|
757
|
+
for (const r of conn.nodes) {
|
|
758
|
+
// members(first:1) — count signal only. >= 1 → role has at
|
|
759
|
+
// least one direct member. 0 → empty role.
|
|
760
|
+
result.push({
|
|
761
|
+
name: r.name,
|
|
762
|
+
domain: r.domain?.name ?? null,
|
|
763
|
+
memberCount: r.members?.nodes.length ?? 0,
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
if (!conn.pageInfo.hasNextPage || !conn.pageInfo.endCursor)
|
|
767
|
+
break;
|
|
768
|
+
after = conn.pageInfo.endCursor;
|
|
769
|
+
}
|
|
770
|
+
return result;
|
|
771
|
+
};
|
|
772
|
+
const getUserDetail = async (userName) => {
|
|
773
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, GET_USER_DETAIL_QUERY, { userName }, readRequest);
|
|
774
|
+
if (!data.user)
|
|
775
|
+
return null;
|
|
776
|
+
return {
|
|
777
|
+
name: data.user.name,
|
|
778
|
+
isAdministrator: data.user.isAdministrator,
|
|
779
|
+
roles: data.user.roles.map((r) => r.name),
|
|
780
|
+
lastLogin: data.user.profile?.lastLoginDate ?? null,
|
|
781
|
+
lastActivity: data.user.profile?.lastActivityDate ?? null,
|
|
782
|
+
};
|
|
783
|
+
};
|
|
784
|
+
const deleteUser = async (userName) => {
|
|
785
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, DELETE_USER_MUTATION, { input: { userName } }, writeRequest);
|
|
786
|
+
if (!data.deleteUser?.successful) {
|
|
787
|
+
throw (0, errors_1.createScaiError)(`deleteUser returned successful=${data.deleteUser?.successful} for ${userName}`, "UNKNOWN");
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
const deleteRole = async (roleName) => {
|
|
791
|
+
const data = await (0, graphql_2.runHygieneAuthoringGraphQL)(environment, DELETE_ROLE_MUTATION, { input: { roleName } }, writeRequest);
|
|
792
|
+
if (!data.deleteRole?.successful) {
|
|
793
|
+
throw (0, errors_1.createScaiError)(`deleteRole returned successful=${data.deleteRole?.successful} for ${roleName}`, "UNKNOWN");
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
const executeWorkflowCommand = workflowClient.executeWorkflowCommand;
|
|
797
|
+
const getWorkflowCommandsForItem = workflowClient.getWorkflowCommandsForItem;
|
|
798
|
+
return {
|
|
799
|
+
search,
|
|
800
|
+
searchAll,
|
|
801
|
+
getItemFields,
|
|
802
|
+
getItemFieldsBatch,
|
|
803
|
+
itemExists,
|
|
804
|
+
itemsExistBatch,
|
|
805
|
+
getItemVersions,
|
|
806
|
+
getItemWorkflow,
|
|
807
|
+
listArchivedItems,
|
|
808
|
+
deleteItemVersion,
|
|
809
|
+
deleteItem,
|
|
810
|
+
deleteItemTemplate,
|
|
811
|
+
deleteArchivedItem,
|
|
812
|
+
archiveVersion,
|
|
813
|
+
listItemTemplates,
|
|
814
|
+
getChildren,
|
|
815
|
+
updateItemFields,
|
|
816
|
+
renameItem,
|
|
817
|
+
addItemVersion,
|
|
818
|
+
listUsers,
|
|
819
|
+
listRoles,
|
|
820
|
+
getUserDetail,
|
|
821
|
+
deleteUser,
|
|
822
|
+
deleteRole,
|
|
823
|
+
executeWorkflowCommand,
|
|
824
|
+
getWorkflowCommandsForItem,
|
|
825
|
+
};
|
|
826
|
+
};
|
|
827
|
+
exports.createHygieneApiClient = createHygieneApiClient;
|