@sitecoreai-labs/sitecoreai-cli 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +67 -0
- package/LICENSE +21 -0
- package/README.md +357 -0
- package/bin/sitecoreai-cli +3 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +358 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +27 -0
- package/dist/commands/deploy/deployments.d.ts +3 -0
- package/dist/commands/deploy/deployments.d.ts.map +1 -0
- package/dist/commands/deploy/deployments.js +58 -0
- package/dist/commands/deploy/editing-host.d.ts +3 -0
- package/dist/commands/deploy/editing-host.d.ts.map +1 -0
- package/dist/commands/deploy/editing-host.js +49 -0
- package/dist/commands/deploy/environments/deployments.d.ts +3 -0
- package/dist/commands/deploy/environments/deployments.d.ts.map +1 -0
- package/dist/commands/deploy/environments/deployments.js +28 -0
- package/dist/commands/deploy/environments/index.d.ts +3 -0
- package/dist/commands/deploy/environments/index.d.ts.map +1 -0
- package/dist/commands/deploy/environments/index.js +29 -0
- package/dist/commands/deploy/environments/mutations.d.ts +9 -0
- package/dist/commands/deploy/environments/mutations.d.ts.map +1 -0
- package/dist/commands/deploy/environments/mutations.js +103 -0
- package/dist/commands/deploy/environments/queries.d.ts +7 -0
- package/dist/commands/deploy/environments/queries.d.ts.map +1 -0
- package/dist/commands/deploy/environments/queries.js +56 -0
- package/dist/commands/deploy/environments/variables.d.ts +3 -0
- package/dist/commands/deploy/environments/variables.d.ts.map +1 -0
- package/dist/commands/deploy/environments/variables.js +40 -0
- package/dist/commands/deploy/environments.d.ts +2 -0
- package/dist/commands/deploy/environments.d.ts.map +1 -0
- package/dist/commands/deploy/environments.js +17 -0
- package/dist/commands/deploy/index.d.ts +3 -0
- package/dist/commands/deploy/index.d.ts.map +1 -0
- package/dist/commands/deploy/index.js +26 -0
- package/dist/commands/deploy/logs.d.ts +3 -0
- package/dist/commands/deploy/logs.d.ts.map +1 -0
- package/dist/commands/deploy/logs.js +39 -0
- package/dist/commands/deploy/organizations.d.ts +3 -0
- package/dist/commands/deploy/organizations.d.ts.map +1 -0
- package/dist/commands/deploy/organizations.js +29 -0
- package/dist/commands/deploy/projects.d.ts +3 -0
- package/dist/commands/deploy/projects.d.ts.map +1 -0
- package/dist/commands/deploy/projects.js +74 -0
- package/dist/commands/deploy/shared.d.ts +3 -0
- package/dist/commands/deploy/shared.d.ts.map +1 -0
- package/dist/commands/deploy/shared.js +12 -0
- package/dist/commands/deploy/site.d.ts +10 -0
- package/dist/commands/deploy/site.d.ts.map +1 -0
- package/dist/commands/deploy/site.js +36 -0
- package/dist/commands/deploy/source-control.d.ts +3 -0
- package/dist/commands/deploy/source-control.d.ts.map +1 -0
- package/dist/commands/deploy/source-control.js +89 -0
- package/dist/commands/deploy.d.ts +2 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +5 -0
- package/dist/commands/history.d.ts +3 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +88 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +32 -0
- package/dist/commands/login.d.ts +3 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +21 -0
- package/dist/commands/logout.d.ts +3 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +18 -0
- package/dist/commands/recipe/index.d.ts +3 -0
- package/dist/commands/recipe/index.d.ts.map +1 -0
- package/dist/commands/recipe/index.js +158 -0
- package/dist/commands/serialization/index.d.ts +3 -0
- package/dist/commands/serialization/index.d.ts.map +1 -0
- package/dist/commands/serialization/index.js +89 -0
- package/dist/commands/serialization/package.d.ts +3 -0
- package/dist/commands/serialization/package.d.ts.map +1 -0
- package/dist/commands/serialization/package.js +36 -0
- package/dist/commands/shared.d.ts +21 -0
- package/dist/commands/shared.d.ts.map +1 -0
- package/dist/commands/shared.js +82 -0
- package/dist/commands/shell.d.ts +10 -0
- package/dist/commands/shell.d.ts.map +1 -0
- package/dist/commands/shell.js +155 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +15 -0
- package/dist/commands/telemetry.d.ts +3 -0
- package/dist/commands/telemetry.d.ts.map +1 -0
- package/dist/commands/telemetry.js +28 -0
- package/dist/config/env-overrides.d.ts +4 -0
- package/dist/config/env-overrides.d.ts.map +1 -0
- package/dist/config/env-overrides.js +199 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +13 -0
- package/dist/config/modules.d.ts +4 -0
- package/dist/config/modules.d.ts.map +1 -0
- package/dist/config/modules.js +152 -0
- package/dist/config/paths.d.ts +2 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +39 -0
- package/dist/config/root-config.d.ts +10 -0
- package/dist/config/root-config.d.ts.map +1 -0
- package/dist/config/root-config.js +159 -0
- package/dist/config/schema.json +278 -0
- package/dist/config/serialization-module.schema.json +127 -0
- package/dist/config/telemetry.schema.json +21 -0
- package/dist/config/types.d.ts +245 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +19 -0
- package/dist/config/validation.d.ts +10 -0
- package/dist/config/validation.d.ts.map +1 -0
- package/dist/config/validation.js +43 -0
- package/dist/deploy/api/common/headers.d.ts +2 -0
- package/dist/deploy/api/common/headers.d.ts.map +1 -0
- package/dist/deploy/api/common/headers.js +10 -0
- package/dist/deploy/api/common/index.d.ts +4 -0
- package/dist/deploy/api/common/index.d.ts.map +1 -0
- package/dist/deploy/api/common/index.js +19 -0
- package/dist/deploy/api/common/request.d.ts +9 -0
- package/dist/deploy/api/common/request.d.ts.map +1 -0
- package/dist/deploy/api/common/request.js +253 -0
- package/dist/deploy/api/common/types.d.ts +44 -0
- package/dist/deploy/api/common/types.d.ts.map +1 -0
- package/dist/deploy/api/common/types.js +5 -0
- package/dist/deploy/api/common.d.ts +2 -0
- package/dist/deploy/api/common.d.ts.map +1 -0
- package/dist/deploy/api/common.js +17 -0
- package/dist/deploy/api/deployment-logs.d.ts +2 -0
- package/dist/deploy/api/deployment-logs.d.ts.map +1 -0
- package/dist/deploy/api/deployment-logs.js +23 -0
- package/dist/deploy/api/deployments.d.ts +9 -0
- package/dist/deploy/api/deployments.d.ts.map +1 -0
- package/dist/deploy/api/deployments.js +61 -0
- package/dist/deploy/api/environments.d.ts +21 -0
- package/dist/deploy/api/environments.d.ts.map +1 -0
- package/dist/deploy/api/environments.js +67 -0
- package/dist/deploy/api/index.d.ts +9 -0
- package/dist/deploy/api/index.d.ts.map +1 -0
- package/dist/deploy/api/index.js +24 -0
- package/dist/deploy/api/logs.d.ts +8 -0
- package/dist/deploy/api/logs.d.ts.map +1 -0
- package/dist/deploy/api/logs.js +29 -0
- package/dist/deploy/api/organizations.d.ts +6 -0
- package/dist/deploy/api/organizations.d.ts.map +1 -0
- package/dist/deploy/api/organizations.js +18 -0
- package/dist/deploy/api/projects.d.ts +13 -0
- package/dist/deploy/api/projects.d.ts.map +1 -0
- package/dist/deploy/api/projects.js +42 -0
- package/dist/deploy/api/source-control.d.ts +15 -0
- package/dist/deploy/api/source-control.d.ts.map +1 -0
- package/dist/deploy/api/source-control.js +71 -0
- package/dist/deploy/api.d.ts +2 -0
- package/dist/deploy/api.d.ts.map +1 -0
- package/dist/deploy/api.js +17 -0
- package/dist/deploy/tasks/deployment-result.d.ts +6 -0
- package/dist/deploy/tasks/deployment-result.d.ts.map +1 -0
- package/dist/deploy/tasks/deployment-result.js +36 -0
- package/dist/deploy/tasks/deployments.d.ts +10 -0
- package/dist/deploy/tasks/deployments.d.ts.map +1 -0
- package/dist/deploy/tasks/deployments.js +201 -0
- package/dist/deploy/tasks/editing-host.d.ts +28 -0
- package/dist/deploy/tasks/editing-host.d.ts.map +1 -0
- package/dist/deploy/tasks/editing-host.js +216 -0
- package/dist/deploy/tasks/environments.d.ts +20 -0
- package/dist/deploy/tasks/environments.d.ts.map +1 -0
- package/dist/deploy/tasks/environments.js +364 -0
- package/dist/deploy/tasks/index.d.ts +10 -0
- package/dist/deploy/tasks/index.d.ts.map +1 -0
- package/dist/deploy/tasks/index.js +25 -0
- package/dist/deploy/tasks/logs.d.ts +5 -0
- package/dist/deploy/tasks/logs.d.ts.map +1 -0
- package/dist/deploy/tasks/logs.js +56 -0
- package/dist/deploy/tasks/organizations.d.ts +6 -0
- package/dist/deploy/tasks/organizations.d.ts.map +1 -0
- package/dist/deploy/tasks/organizations.js +51 -0
- package/dist/deploy/tasks/projects.d.ts +11 -0
- package/dist/deploy/tasks/projects.d.ts.map +1 -0
- package/dist/deploy/tasks/projects.js +246 -0
- package/dist/deploy/tasks/shared.d.ts +63 -0
- package/dist/deploy/tasks/shared.d.ts.map +1 -0
- package/dist/deploy/tasks/shared.js +261 -0
- package/dist/deploy/tasks/site-bind.d.ts +21 -0
- package/dist/deploy/tasks/site-bind.d.ts.map +1 -0
- package/dist/deploy/tasks/site-bind.js +142 -0
- package/dist/deploy/tasks/site.d.ts +14 -0
- package/dist/deploy/tasks/site.d.ts.map +1 -0
- package/dist/deploy/tasks/site.js +29 -0
- package/dist/deploy/tasks/source-control.d.ts +14 -0
- package/dist/deploy/tasks/source-control.d.ts.map +1 -0
- package/dist/deploy/tasks/source-control.js +173 -0
- package/dist/deploy/tasks/types.d.ts +204 -0
- package/dist/deploy/tasks/types.d.ts.map +1 -0
- package/dist/deploy/tasks/types.js +7 -0
- package/dist/deploy/tasks.d.ts +3 -0
- package/dist/deploy/tasks.d.ts.map +1 -0
- package/dist/deploy/tasks.js +18 -0
- package/dist/recipe/api/auth.d.ts +9 -0
- package/dist/recipe/api/auth.d.ts.map +1 -0
- package/dist/recipe/api/auth.js +12 -0
- package/dist/recipe/api/authoring-client.d.ts +37 -0
- package/dist/recipe/api/authoring-client.d.ts.map +1 -0
- package/dist/recipe/api/authoring-client.js +495 -0
- package/dist/recipe/api/client.d.ts +99 -0
- package/dist/recipe/api/client.d.ts.map +1 -0
- package/dist/recipe/api/client.js +17 -0
- package/dist/recipe/api/graphql.d.ts +15 -0
- package/dist/recipe/api/graphql.d.ts.map +1 -0
- package/dist/recipe/api/graphql.js +38 -0
- package/dist/recipe/api/ref-encoding.d.ts +38 -0
- package/dist/recipe/api/ref-encoding.d.ts.map +1 -0
- package/dist/recipe/api/ref-encoding.js +160 -0
- package/dist/recipe/api/site-discovery.d.ts +49 -0
- package/dist/recipe/api/site-discovery.d.ts.map +1 -0
- package/dist/recipe/api/site-discovery.js +127 -0
- package/dist/recipe/api/sites-client.d.ts +48 -0
- package/dist/recipe/api/sites-client.d.ts.map +1 -0
- package/dist/recipe/api/sites-client.js +19 -0
- package/dist/recipe/cache.d.ts +36 -0
- package/dist/recipe/cache.d.ts.map +1 -0
- package/dist/recipe/cache.js +114 -0
- package/dist/recipe/compile/component-section.d.ts +46 -0
- package/dist/recipe/compile/component-section.d.ts.map +1 -0
- package/dist/recipe/compile/component-section.js +143 -0
- package/dist/recipe/compile/component-template.d.ts +34 -0
- package/dist/recipe/compile/component-template.d.ts.map +1 -0
- package/dist/recipe/compile/component-template.js +709 -0
- package/dist/recipe/compile/content-item.d.ts +31 -0
- package/dist/recipe/compile/content-item.d.ts.map +1 -0
- package/dist/recipe/compile/content-item.js +189 -0
- package/dist/recipe/compile/content-template.d.ts +18 -0
- package/dist/recipe/compile/content-template.d.ts.map +1 -0
- package/dist/recipe/compile/content-template.js +52 -0
- package/dist/recipe/compile/enumeration.d.ts +59 -0
- package/dist/recipe/compile/enumeration.d.ts.map +1 -0
- package/dist/recipe/compile/enumeration.js +236 -0
- package/dist/recipe/compile/page-design.d.ts +22 -0
- package/dist/recipe/compile/page-design.d.ts.map +1 -0
- package/dist/recipe/compile/page-design.js +93 -0
- package/dist/recipe/compile/parameters-template.d.ts +14 -0
- package/dist/recipe/compile/parameters-template.d.ts.map +1 -0
- package/dist/recipe/compile/parameters-template.js +92 -0
- package/dist/recipe/compile/partial-design.d.ts +18 -0
- package/dist/recipe/compile/partial-design.d.ts.map +1 -0
- package/dist/recipe/compile/partial-design.js +76 -0
- package/dist/recipe/compile/section-definition.d.ts +18 -0
- package/dist/recipe/compile/section-definition.d.ts.map +1 -0
- package/dist/recipe/compile/section-definition.js +26 -0
- package/dist/recipe/compile/shared.d.ts +442 -0
- package/dist/recipe/compile/shared.d.ts.map +1 -0
- package/dist/recipe/compile/shared.js +843 -0
- package/dist/recipe/compile/site-template.d.ts +52 -0
- package/dist/recipe/compile/site-template.d.ts.map +1 -0
- package/dist/recipe/compile/site-template.js +140 -0
- package/dist/recipe/compile/site.d.ts +44 -0
- package/dist/recipe/compile/site.d.ts.map +1 -0
- package/dist/recipe/compile/site.js +127 -0
- package/dist/recipe/compile.d.ts +93 -0
- package/dist/recipe/compile.d.ts.map +1 -0
- package/dist/recipe/compile.js +741 -0
- package/dist/recipe/execute.d.ts +119 -0
- package/dist/recipe/execute.d.ts.map +1 -0
- package/dist/recipe/execute.js +273 -0
- package/dist/recipe/guids.d.ts +400 -0
- package/dist/recipe/guids.d.ts.map +1 -0
- package/dist/recipe/guids.js +488 -0
- package/dist/recipe/index.d.ts +32 -0
- package/dist/recipe/index.d.ts.map +1 -0
- package/dist/recipe/index.js +156 -0
- package/dist/recipe/io.d.ts +21 -0
- package/dist/recipe/io.d.ts.map +1 -0
- package/dist/recipe/io.js +147 -0
- package/dist/recipe/ir/operations.d.ts +692 -0
- package/dist/recipe/ir/operations.d.ts.map +1 -0
- package/dist/recipe/ir/operations.js +347 -0
- package/dist/recipe/ir/sitecore-templates.d.ts +455 -0
- package/dist/recipe/ir/sitecore-templates.d.ts.map +1 -0
- package/dist/recipe/ir/sitecore-templates.js +465 -0
- package/dist/recipe/layout/emit.d.ts +101 -0
- package/dist/recipe/layout/emit.d.ts.map +1 -0
- package/dist/recipe/layout/emit.js +127 -0
- package/dist/recipe/layout/templates-mapping.d.ts +28 -0
- package/dist/recipe/layout/templates-mapping.d.ts.map +1 -0
- package/dist/recipe/layout/templates-mapping.js +29 -0
- package/dist/recipe/plan.d.ts +134 -0
- package/dist/recipe/plan.d.ts.map +1 -0
- package/dist/recipe/plan.js +565 -0
- package/dist/recipe/policy.d.ts +43 -0
- package/dist/recipe/policy.d.ts.map +1 -0
- package/dist/recipe/policy.js +75 -0
- package/dist/recipe/rollback.d.ts +72 -0
- package/dist/recipe/rollback.d.ts.map +1 -0
- package/dist/recipe/rollback.js +130 -0
- package/dist/recipe/schema/field-types.d.ts +72 -0
- package/dist/recipe/schema/field-types.d.ts.map +1 -0
- package/dist/recipe/schema/field-types.js +118 -0
- package/dist/recipe/schema/recipe.d.ts +1545 -0
- package/dist/recipe/schema/recipe.d.ts.map +1 -0
- package/dist/recipe/schema/recipe.js +1175 -0
- package/dist/recipe/schema/source-fields.d.ts +48 -0
- package/dist/recipe/schema/source-fields.d.ts.map +1 -0
- package/dist/recipe/schema/source-fields.js +79 -0
- package/dist/recipe/tasks/compile.d.ts +14 -0
- package/dist/recipe/tasks/compile.d.ts.map +1 -0
- package/dist/recipe/tasks/compile.js +89 -0
- package/dist/recipe/tasks/diff.d.ts +17 -0
- package/dist/recipe/tasks/diff.d.ts.map +1 -0
- package/dist/recipe/tasks/diff.js +6 -0
- package/dist/recipe/tasks/index.d.ts +9 -0
- package/dist/recipe/tasks/index.d.ts.map +1 -0
- package/dist/recipe/tasks/index.js +13 -0
- package/dist/recipe/tasks/placeholder-allow.d.ts +53 -0
- package/dist/recipe/tasks/placeholder-allow.d.ts.map +1 -0
- package/dist/recipe/tasks/placeholder-allow.js +218 -0
- package/dist/recipe/tasks/plan.d.ts +11 -0
- package/dist/recipe/tasks/plan.d.ts.map +1 -0
- package/dist/recipe/tasks/plan.js +72 -0
- package/dist/recipe/tasks/prune-defaults.d.ts +90 -0
- package/dist/recipe/tasks/prune-defaults.d.ts.map +1 -0
- package/dist/recipe/tasks/prune-defaults.js +184 -0
- package/dist/recipe/tasks/push.d.ts +18 -0
- package/dist/recipe/tasks/push.d.ts.map +1 -0
- package/dist/recipe/tasks/push.js +417 -0
- package/dist/recipe/tasks/shared.d.ts +152 -0
- package/dist/recipe/tasks/shared.d.ts.map +1 -0
- package/dist/recipe/tasks/shared.js +94 -0
- package/dist/recipe/validate.d.ts +103 -0
- package/dist/recipe/validate.d.ts.map +1 -0
- package/dist/recipe/validate.js +297 -0
- package/dist/serialization/commands.d.ts +48 -0
- package/dist/serialization/commands.d.ts.map +1 -0
- package/dist/serialization/commands.js +175 -0
- package/dist/serialization/compare.d.ts +29 -0
- package/dist/serialization/compare.d.ts.map +1 -0
- package/dist/serialization/compare.js +124 -0
- package/dist/serialization/field-filter.d.ts +7 -0
- package/dist/serialization/field-filter.d.ts.map +1 -0
- package/dist/serialization/field-filter.js +20 -0
- package/dist/serialization/filesystem-store/constants.d.ts +3 -0
- package/dist/serialization/filesystem-store/constants.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/constants.js +5 -0
- package/dist/serialization/filesystem-store/index.d.ts +4 -0
- package/dist/serialization/filesystem-store/index.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/index.js +15 -0
- package/dist/serialization/filesystem-store/items.d.ts +10 -0
- package/dist/serialization/filesystem-store/items.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/items.js +64 -0
- package/dist/serialization/filesystem-store/roles.d.ts +6 -0
- package/dist/serialization/filesystem-store/roles.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/roles.js +46 -0
- package/dist/serialization/filesystem-store/users.d.ts +6 -0
- package/dist/serialization/filesystem-store/users.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/users.js +46 -0
- package/dist/serialization/filesystem-store/utils.d.ts +2 -0
- package/dist/serialization/filesystem-store/utils.d.ts.map +1 -0
- package/dist/serialization/filesystem-store/utils.js +17 -0
- package/dist/serialization/filesystem-store.d.ts +2 -0
- package/dist/serialization/filesystem-store.d.ts.map +1 -0
- package/dist/serialization/filesystem-store.js +17 -0
- package/dist/serialization/item-path.d.ts +32 -0
- package/dist/serialization/item-path.d.ts.map +1 -0
- package/dist/serialization/item-path.js +123 -0
- package/dist/serialization/path-provider.d.ts +12 -0
- package/dist/serialization/path-provider.d.ts.map +1 -0
- package/dist/serialization/path-provider.js +271 -0
- package/dist/serialization/signature.d.ts +4 -0
- package/dist/serialization/signature.d.ts.map +1 -0
- package/dist/serialization/signature.js +71 -0
- package/dist/serialization/sitecore-api/auth.d.ts +31 -0
- package/dist/serialization/sitecore-api/auth.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/auth.js +319 -0
- package/dist/serialization/sitecore-api/graphql.d.ts +12 -0
- package/dist/serialization/sitecore-api/graphql.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/graphql.js +20 -0
- package/dist/serialization/sitecore-api/history.d.ts +9 -0
- package/dist/serialization/sitecore-api/history.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/history.js +36 -0
- package/dist/serialization/sitecore-api/index.d.ts +7 -0
- package/dist/serialization/sitecore-api/index.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/index.js +22 -0
- package/dist/serialization/sitecore-api/items.d.ts +8 -0
- package/dist/serialization/sitecore-api/items.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/items.js +132 -0
- package/dist/serialization/sitecore-api/publish.d.ts +14 -0
- package/dist/serialization/sitecore-api/publish.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/publish.js +43 -0
- package/dist/serialization/sitecore-api/roles.d.ts +9 -0
- package/dist/serialization/sitecore-api/roles.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/roles.js +42 -0
- package/dist/serialization/sitecore-api/users.d.ts +9 -0
- package/dist/serialization/sitecore-api/users.d.ts.map +1 -0
- package/dist/serialization/sitecore-api/users.js +62 -0
- package/dist/serialization/sitecore-api.d.ts +2 -0
- package/dist/serialization/sitecore-api.d.ts.map +1 -0
- package/dist/serialization/sitecore-api.js +17 -0
- package/dist/serialization/tasks/diff.d.ts +3 -0
- package/dist/serialization/tasks/diff.d.ts.map +1 -0
- package/dist/serialization/tasks/diff.js +109 -0
- package/dist/serialization/tasks/env/constants.d.ts +2 -0
- package/dist/serialization/tasks/env/constants.d.ts.map +1 -0
- package/dist/serialization/tasks/env/constants.js +4 -0
- package/dist/serialization/tasks/env/deploy-token.d.ts +3 -0
- package/dist/serialization/tasks/env/deploy-token.d.ts.map +1 -0
- package/dist/serialization/tasks/env/deploy-token.js +128 -0
- package/dist/serialization/tasks/env/index.d.ts +5 -0
- package/dist/serialization/tasks/env/index.d.ts.map +1 -0
- package/dist/serialization/tasks/env/index.js +11 -0
- package/dist/serialization/tasks/env/init/auth.d.ts +24 -0
- package/dist/serialization/tasks/env/init/auth.d.ts.map +1 -0
- package/dist/serialization/tasks/env/init/auth.js +122 -0
- package/dist/serialization/tasks/env/init/deploy-lookup.d.ts +22 -0
- package/dist/serialization/tasks/env/init/deploy-lookup.d.ts.map +1 -0
- package/dist/serialization/tasks/env/init/deploy-lookup.js +244 -0
- package/dist/serialization/tasks/env/init.d.ts +3 -0
- package/dist/serialization/tasks/env/init.d.ts.map +1 -0
- package/dist/serialization/tasks/env/init.js +253 -0
- package/dist/serialization/tasks/env/logout.d.ts +3 -0
- package/dist/serialization/tasks/env/logout.d.ts.map +1 -0
- package/dist/serialization/tasks/env/logout.js +61 -0
- package/dist/serialization/tasks/env/status.d.ts +3 -0
- package/dist/serialization/tasks/env/status.d.ts.map +1 -0
- package/dist/serialization/tasks/env/status.js +149 -0
- package/dist/serialization/tasks/env.d.ts +2 -0
- package/dist/serialization/tasks/env.d.ts.map +1 -0
- package/dist/serialization/tasks/env.js +17 -0
- package/dist/serialization/tasks/helpers/collect.d.ts +8 -0
- package/dist/serialization/tasks/helpers/collect.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/collect.js +29 -0
- package/dist/serialization/tasks/helpers/commands.d.ts +5 -0
- package/dist/serialization/tasks/helpers/commands.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/commands.js +14 -0
- package/dist/serialization/tasks/helpers/filesystem.d.ts +6 -0
- package/dist/serialization/tasks/helpers/filesystem.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/filesystem.js +27 -0
- package/dist/serialization/tasks/helpers/index.d.ts +6 -0
- package/dist/serialization/tasks/helpers/index.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/index.js +13 -0
- package/dist/serialization/tasks/helpers/items.d.ts +3 -0
- package/dist/serialization/tasks/helpers/items.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/items.js +5 -0
- package/dist/serialization/tasks/helpers/sitecore.d.ts +5 -0
- package/dist/serialization/tasks/helpers/sitecore.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers/sitecore.js +109 -0
- package/dist/serialization/tasks/helpers.d.ts +2 -0
- package/dist/serialization/tasks/helpers.d.ts.map +1 -0
- package/dist/serialization/tasks/helpers.js +17 -0
- package/dist/serialization/tasks/index.d.ts +8 -0
- package/dist/serialization/tasks/index.d.ts.map +1 -0
- package/dist/serialization/tasks/index.js +19 -0
- package/dist/serialization/tasks/info.d.ts +4 -0
- package/dist/serialization/tasks/info.d.ts.map +1 -0
- package/dist/serialization/tasks/info.js +82 -0
- package/dist/serialization/tasks/package.d.ts +4 -0
- package/dist/serialization/tasks/package.d.ts.map +1 -0
- package/dist/serialization/tasks/package.js +171 -0
- package/dist/serialization/tasks/pull.d.ts +3 -0
- package/dist/serialization/tasks/pull.d.ts.map +1 -0
- package/dist/serialization/tasks/pull.js +82 -0
- package/dist/serialization/tasks/push.d.ts +3 -0
- package/dist/serialization/tasks/push.d.ts.map +1 -0
- package/dist/serialization/tasks/push.js +101 -0
- package/dist/serialization/tasks/roles.d.ts +6 -0
- package/dist/serialization/tasks/roles.d.ts.map +1 -0
- package/dist/serialization/tasks/roles.js +103 -0
- package/dist/serialization/tasks/shared.d.ts +19 -0
- package/dist/serialization/tasks/shared.d.ts.map +1 -0
- package/dist/serialization/tasks/shared.js +59 -0
- package/dist/serialization/tasks/types.d.ts +73 -0
- package/dist/serialization/tasks/types.d.ts.map +1 -0
- package/dist/serialization/tasks/types.js +8 -0
- package/dist/serialization/tasks/users.d.ts +5 -0
- package/dist/serialization/tasks/users.d.ts.map +1 -0
- package/dist/serialization/tasks/users.js +90 -0
- package/dist/serialization/tasks/validate.d.ts +5 -0
- package/dist/serialization/tasks/validate.d.ts.map +1 -0
- package/dist/serialization/tasks/validate.js +50 -0
- package/dist/serialization/tasks/watch.d.ts +3 -0
- package/dist/serialization/tasks/watch.d.ts.map +1 -0
- package/dist/serialization/tasks/watch.js +75 -0
- package/dist/serialization/tasks.d.ts +4 -0
- package/dist/serialization/tasks.d.ts.map +1 -0
- package/dist/serialization/tasks.js +19 -0
- package/dist/serialization/tree-spec.d.ts +51 -0
- package/dist/serialization/tree-spec.d.ts.map +1 -0
- package/dist/serialization/tree-spec.js +241 -0
- package/dist/serialization/types.d.ts +75 -0
- package/dist/serialization/types.d.ts.map +1 -0
- package/dist/serialization/types.js +2 -0
- package/dist/serialization/wildcard.d.ts +3 -0
- package/dist/serialization/wildcard.d.ts.map +1 -0
- package/dist/serialization/wildcard.js +24 -0
- package/dist/serialization/yaml.d.ts +9 -0
- package/dist/serialization/yaml.d.ts.map +1 -0
- package/dist/serialization/yaml.js +307 -0
- package/dist/shared/browser.d.ts +2 -0
- package/dist/shared/browser.d.ts.map +1 -0
- package/dist/shared/browser.js +36 -0
- package/dist/shared/cli-options.d.ts +17 -0
- package/dist/shared/cli-options.d.ts.map +1 -0
- package/dist/shared/cli-options.js +8 -0
- package/dist/shared/cli-tasks.d.ts +38 -0
- package/dist/shared/cli-tasks.d.ts.map +1 -0
- package/dist/shared/cli-tasks.js +108 -0
- package/dist/shared/config-template.d.ts +23 -0
- package/dist/shared/config-template.d.ts.map +1 -0
- package/dist/shared/config-template.js +38 -0
- package/dist/shared/env.d.ts +28 -0
- package/dist/shared/env.d.ts.map +1 -0
- package/dist/shared/env.js +38 -0
- package/dist/shared/errors.d.ts +21 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +59 -0
- package/dist/shared/graphql.d.ts +76 -0
- package/dist/shared/graphql.d.ts.map +1 -0
- package/dist/shared/graphql.js +222 -0
- package/dist/shared/history.d.ts +12 -0
- package/dist/shared/history.d.ts.map +1 -0
- package/dist/shared/history.js +62 -0
- package/dist/shared/keychain.d.ts +15 -0
- package/dist/shared/keychain.d.ts.map +1 -0
- package/dist/shared/keychain.js +177 -0
- package/dist/shared/logger.d.ts +24 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/logger.js +157 -0
- package/dist/shared/output.d.ts +7 -0
- package/dist/shared/output.d.ts.map +1 -0
- package/dist/shared/output.js +21 -0
- package/dist/shared/prompt.d.ts +5 -0
- package/dist/shared/prompt.d.ts.map +1 -0
- package/dist/shared/prompt.js +87 -0
- package/dist/shared/redact.d.ts +3 -0
- package/dist/shared/redact.d.ts.map +1 -0
- package/dist/shared/redact.js +47 -0
- package/dist/shared/spinner.d.ts +5 -0
- package/dist/shared/spinner.d.ts.map +1 -0
- package/dist/shared/spinner.js +89 -0
- package/dist/shared/style.d.ts +2 -0
- package/dist/shared/style.d.ts.map +1 -0
- package/dist/shared/style.js +61 -0
- package/dist/shared/telemetry.d.ts +21 -0
- package/dist/shared/telemetry.d.ts.map +1 -0
- package/dist/shared/telemetry.js +226 -0
- package/dist/shared/validate.d.ts +3 -0
- package/dist/shared/validate.d.ts.map +1 -0
- package/dist/shared/validate.js +32 -0
- package/dist/sites/api/collections.d.ts +25 -0
- package/dist/sites/api/collections.d.ts.map +1 -0
- package/dist/sites/api/collections.js +21 -0
- package/dist/sites/api/index.d.ts +26 -0
- package/dist/sites/api/index.d.ts.map +1 -0
- package/dist/sites/api/index.js +55 -0
- package/dist/sites/api/jobs.d.ts +31 -0
- package/dist/sites/api/jobs.d.ts.map +1 -0
- package/dist/sites/api/jobs.js +10 -0
- package/dist/sites/api/languages.d.ts +22 -0
- package/dist/sites/api/languages.d.ts.map +1 -0
- package/dist/sites/api/languages.js +18 -0
- package/dist/sites/api/request.d.ts +24 -0
- package/dist/sites/api/request.d.ts.map +1 -0
- package/dist/sites/api/request.js +99 -0
- package/dist/sites/api/sites.d.ts +53 -0
- package/dist/sites/api/sites.d.ts.map +1 -0
- package/dist/sites/api/sites.js +41 -0
- package/dist/sites/api/types.d.ts +29 -0
- package/dist/sites/api/types.d.ts.map +1 -0
- package/dist/sites/api/types.js +4 -0
- package/package.json +109 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveDeployLookup = void 0;
|
|
4
|
+
const api_1 = require("../../../../deploy/api");
|
|
5
|
+
const cli_tasks_1 = require("../../../../shared/cli-tasks");
|
|
6
|
+
const shared_1 = require("../../../../deploy/tasks/shared");
|
|
7
|
+
const prompt_1 = require("../../../../shared/prompt");
|
|
8
|
+
const errors_1 = require("../../../../shared/errors");
|
|
9
|
+
const hasProjectRepository = (value) => {
|
|
10
|
+
if (!value || typeof value !== "object") {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const record = value;
|
|
14
|
+
const candidates = [
|
|
15
|
+
record.repositoryId,
|
|
16
|
+
record.repositoryName,
|
|
17
|
+
record.repositoryRelativePath,
|
|
18
|
+
record.repositoryUrl,
|
|
19
|
+
record.sourceControlIntegrationId,
|
|
20
|
+
record.sourceControlIntegration,
|
|
21
|
+
record.repository,
|
|
22
|
+
record.repo,
|
|
23
|
+
];
|
|
24
|
+
for (const candidate of candidates) {
|
|
25
|
+
if (typeof candidate === "string" && candidate.trim().length > 0) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
if (candidate && typeof candidate === "object") {
|
|
29
|
+
const nested = candidate;
|
|
30
|
+
const nestedCandidates = [
|
|
31
|
+
nested.id,
|
|
32
|
+
nested.name,
|
|
33
|
+
nested.repositoryId,
|
|
34
|
+
nested.repositoryName,
|
|
35
|
+
nested.url,
|
|
36
|
+
];
|
|
37
|
+
if (nestedCandidates.some((entry) => typeof entry === "string" && entry.trim().length > 0)) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
};
|
|
44
|
+
const resolveDeployLookup = async (input) => {
|
|
45
|
+
const { options, runWizard, deployToken, updated, existing, baseEnv, host, projectSelection, environmentSelection, logger, } = input;
|
|
46
|
+
if (!deployToken) {
|
|
47
|
+
throw (0, errors_1.createCliError)("Deploy API access token is required. Provide --deploy-token or deploy credentials.", "AUTH_REQUIRED", {
|
|
48
|
+
hint: "Provide --deploy-token, or run 'scai login' to store credentials.",
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const deployOptions = { accessToken: deployToken };
|
|
52
|
+
let resolvedEnvironment;
|
|
53
|
+
let nextHost = host;
|
|
54
|
+
try {
|
|
55
|
+
const organization = await (0, api_1.fetchOrganization)(deployOptions);
|
|
56
|
+
const orgId = organization.id ?? organization.organizationId ?? options.organizationId;
|
|
57
|
+
const projects = await (0, api_1.fetchProjects)(deployOptions);
|
|
58
|
+
let resolvedProject;
|
|
59
|
+
let environments = [];
|
|
60
|
+
let resolvedProjectId = "";
|
|
61
|
+
let resolvedProjectLabel = "selected project";
|
|
62
|
+
let projectDetails;
|
|
63
|
+
let selectedProjectValue = projectSelection;
|
|
64
|
+
while (true) {
|
|
65
|
+
if (!selectedProjectValue && runWizard && projects.length > 1) {
|
|
66
|
+
resolvedProject = await (0, cli_tasks_1.selectFromList)(logger, "Project", projects);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
resolvedProject = (0, cli_tasks_1.selectMatch)(projects, "Project", selectedProjectValue);
|
|
70
|
+
}
|
|
71
|
+
resolvedProjectId = resolvedProject.id ?? resolvedProject.projectId ?? "";
|
|
72
|
+
resolvedProjectLabel =
|
|
73
|
+
resolvedProject.name ??
|
|
74
|
+
resolvedProject.id ??
|
|
75
|
+
resolvedProject.projectId ??
|
|
76
|
+
"selected project";
|
|
77
|
+
environments = await (0, api_1.fetchProjectEnvironments)(deployOptions, resolvedProjectId);
|
|
78
|
+
if (environments.length > 0) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
if (!runWizard) {
|
|
82
|
+
throw (0, cli_tasks_1.inputError)(`No environments were returned for project '${resolvedProjectLabel}'.`);
|
|
83
|
+
}
|
|
84
|
+
if (!projectDetails) {
|
|
85
|
+
try {
|
|
86
|
+
projectDetails = await (0, api_1.fetchProject)(deployOptions, resolvedProjectId);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
const cliError = (0, errors_1.toCliError)(error);
|
|
90
|
+
logger.warn(`Unable to verify repository linkage. ${cliError.message}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (!hasProjectRepository(projectDetails ?? resolvedProject)) {
|
|
94
|
+
logger.warn(`Project '${resolvedProjectLabel}' is not linked to a repository. Environment creation requires a repository.`);
|
|
95
|
+
if (projects.length > 1) {
|
|
96
|
+
const chooseAnother = await (0, prompt_1.promptConfirm)("Select a different project?", true);
|
|
97
|
+
if (chooseAnother) {
|
|
98
|
+
selectedProjectValue = undefined;
|
|
99
|
+
projectDetails = undefined;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
let environmentId = updated.environmentId ??
|
|
104
|
+
existing.environmentId ??
|
|
105
|
+
baseEnv.environmentId ??
|
|
106
|
+
options.environment;
|
|
107
|
+
if (!environmentId) {
|
|
108
|
+
environmentId = await (0, prompt_1.promptText)("Environment ID (Deploy)");
|
|
109
|
+
}
|
|
110
|
+
if (!environmentId) {
|
|
111
|
+
throw (0, cli_tasks_1.inputError)("Environment ID is required. Use --environment <id>.");
|
|
112
|
+
}
|
|
113
|
+
resolvedEnvironment = await (0, api_1.fetchEnvironment)(deployOptions, environmentId);
|
|
114
|
+
const projectIdFromEnvironment = (0, shared_1.resolveProjectIdValue)(resolvedEnvironment.projectId);
|
|
115
|
+
if (projectIdFromEnvironment) {
|
|
116
|
+
resolvedProject = {
|
|
117
|
+
...(resolvedProject ?? {}),
|
|
118
|
+
id: projectIdFromEnvironment,
|
|
119
|
+
projectId: projectIdFromEnvironment,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
const shouldCreate = await (0, prompt_1.promptConfirm)(`No environments found for project '${resolvedProjectLabel}'. Create one now?`, false);
|
|
125
|
+
if (shouldCreate) {
|
|
126
|
+
const name = await (0, prompt_1.promptText)("Environment name");
|
|
127
|
+
if (!name) {
|
|
128
|
+
throw (0, cli_tasks_1.inputError)("Environment name is required. Use --name.");
|
|
129
|
+
}
|
|
130
|
+
const cmOnly = await (0, prompt_1.promptConfirm)("Create a CM-only environment?", true);
|
|
131
|
+
let tenantType;
|
|
132
|
+
while (tenantType === undefined) {
|
|
133
|
+
const tenantInput = await (0, prompt_1.promptText)("Tenant type (prod/nonprod)", "nonprod");
|
|
134
|
+
const resolvedTenantType = (0, shared_1.resolveTenantTypeValue)(tenantInput);
|
|
135
|
+
if (resolvedTenantType !== undefined) {
|
|
136
|
+
tenantType = resolvedTenantType;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
logger.warn("Invalid tenant type. Use 'prod' or 'nonprod'.");
|
|
140
|
+
}
|
|
141
|
+
const body = { name };
|
|
142
|
+
if (tenantType !== undefined) {
|
|
143
|
+
body.tenantType = tenantType;
|
|
144
|
+
}
|
|
145
|
+
body.type = cmOnly ? "cm" : "combined";
|
|
146
|
+
try {
|
|
147
|
+
const created = (await (0, api_1.createProjectEnvironment)(deployOptions, resolvedProjectId, body));
|
|
148
|
+
resolvedEnvironment = created;
|
|
149
|
+
environments = await (0, api_1.fetchProjectEnvironments)(deployOptions, resolvedProjectId);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
const cliError = (0, errors_1.toCliError)(error);
|
|
154
|
+
logger.warn(`Environment creation failed. ${cliError.message}`);
|
|
155
|
+
if (projects.length > 1) {
|
|
156
|
+
const chooseAnother = await (0, prompt_1.promptConfirm)("Select a different project?", true);
|
|
157
|
+
if (chooseAnother) {
|
|
158
|
+
selectedProjectValue = undefined;
|
|
159
|
+
projectDetails = undefined;
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (projects.length <= 1) {
|
|
167
|
+
throw (0, cli_tasks_1.inputError)(`No environments were returned for project '${resolvedProjectLabel}'.`);
|
|
168
|
+
}
|
|
169
|
+
selectedProjectValue = undefined;
|
|
170
|
+
}
|
|
171
|
+
const cmEnvironments = environments.filter((environment) => {
|
|
172
|
+
const type = (0, shared_1.getEnvironmentType)(environment);
|
|
173
|
+
return type ? type.toLowerCase().includes("cm") : false;
|
|
174
|
+
});
|
|
175
|
+
const selectionPool = !environmentSelection && cmEnvironments.length > 0 ? cmEnvironments : environments;
|
|
176
|
+
const environmentLabel = !environmentSelection && cmEnvironments.length > 0 ? "Environment (CM)" : "Environment";
|
|
177
|
+
if (!resolvedEnvironment) {
|
|
178
|
+
if (!environmentSelection && runWizard && selectionPool.length > 1) {
|
|
179
|
+
resolvedEnvironment = await (0, cli_tasks_1.selectFromList)(logger, environmentLabel, selectionPool);
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
resolvedEnvironment = (0, cli_tasks_1.selectMatch)(selectionPool, "Environment", environmentSelection);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const editingHostEnvironmentIds = environments
|
|
186
|
+
.filter((environment) => {
|
|
187
|
+
const type = (0, shared_1.getEnvironmentType)(environment);
|
|
188
|
+
return type ? type.toLowerCase().includes("eh") : false;
|
|
189
|
+
})
|
|
190
|
+
.map((environment) => environment.id ?? environment.environmentId)
|
|
191
|
+
.filter((value) => Boolean(value));
|
|
192
|
+
updated.organizationId = orgId ?? updated.organizationId;
|
|
193
|
+
updated.projectId = resolvedProject.id ?? resolvedProject.projectId ?? updated.projectId;
|
|
194
|
+
updated.environmentId =
|
|
195
|
+
resolvedEnvironment.id ?? resolvedEnvironment.environmentId ?? updated.environmentId;
|
|
196
|
+
updated.tenantId = resolvedEnvironment.tenantId ?? updated.tenantId ?? organization.tenantId;
|
|
197
|
+
const resolvedType = (0, shared_1.getEnvironmentType)(resolvedEnvironment);
|
|
198
|
+
if (resolvedType === "cm" || resolvedType === "eh") {
|
|
199
|
+
updated.environmentType = resolvedType;
|
|
200
|
+
}
|
|
201
|
+
if (editingHostEnvironmentIds.length > 0) {
|
|
202
|
+
updated.editingHostEnvironmentIds = editingHostEnvironmentIds;
|
|
203
|
+
}
|
|
204
|
+
if (!nextHost) {
|
|
205
|
+
nextHost = (0, api_1.resolveHostFromEnvironment)(resolvedEnvironment);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
if (!runWizard) {
|
|
210
|
+
throw error;
|
|
211
|
+
}
|
|
212
|
+
const cliError = (0, errors_1.toCliError)(error);
|
|
213
|
+
const isEnvScoped = /environment[- ]scoped/i.test(cliError.message);
|
|
214
|
+
const warning = isEnvScoped
|
|
215
|
+
? "Deploy lookup failed. Environment-scoped credentials require an environment ID."
|
|
216
|
+
: `Deploy lookup failed. ${cliError.message}`;
|
|
217
|
+
logger.warn(warning);
|
|
218
|
+
let environmentId = updated.environmentId ??
|
|
219
|
+
existing.environmentId ??
|
|
220
|
+
baseEnv.environmentId ??
|
|
221
|
+
options.environment;
|
|
222
|
+
if (!environmentId) {
|
|
223
|
+
environmentId = await (0, prompt_1.promptText)("Environment ID (Deploy)");
|
|
224
|
+
}
|
|
225
|
+
if (!environmentId) {
|
|
226
|
+
throw (0, cli_tasks_1.inputError)("Environment ID is required for environment-scoped credentials. Use --environment <id>.");
|
|
227
|
+
}
|
|
228
|
+
resolvedEnvironment = await (0, api_1.fetchEnvironment)(deployOptions, environmentId);
|
|
229
|
+
logger.warn("Environment-scoped credentials can limit some CLI operations (org/project lookups).");
|
|
230
|
+
updated.environmentId =
|
|
231
|
+
resolvedEnvironment.id ?? resolvedEnvironment.environmentId ?? updated.environmentId;
|
|
232
|
+
updated.projectId = (0, shared_1.resolveProjectIdValue)(resolvedEnvironment.projectId) ?? updated.projectId;
|
|
233
|
+
updated.tenantId = resolvedEnvironment.tenantId ?? updated.tenantId;
|
|
234
|
+
const resolvedType = (0, shared_1.getEnvironmentType)(resolvedEnvironment);
|
|
235
|
+
if (resolvedType === "cm" || resolvedType === "eh") {
|
|
236
|
+
updated.environmentType = resolvedType;
|
|
237
|
+
}
|
|
238
|
+
if (!nextHost) {
|
|
239
|
+
nextHost = (0, api_1.resolveHostFromEnvironment)(resolvedEnvironment);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return { host: nextHost, updated };
|
|
243
|
+
};
|
|
244
|
+
exports.resolveDeployLookup = resolveDeployLookup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/serialization/tasks/env/init.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI/C,eAAO,MAAM,OAAO,GAAU,SAAS,cAAc,KAAG,OAAO,CAAC,IAAI,CA8QnE,CAAC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// TODO(recipe-init): when the wizard runs in a non-default project layout,
|
|
3
|
+
// auto-detect `*.recipe.ts` files and offer to set the `recipes` glob in
|
|
4
|
+
// sitecoreai.cli.json accordingly. Today the default config template ships
|
|
5
|
+
// `recipes: ["recipes/**/*.recipe.ts"]`; users with recipes elsewhere edit
|
|
6
|
+
// the file by hand. Worth adding once orchestrator-mediated installs land
|
|
7
|
+
// (Phase 3) — until then, agent-mediated installs control the layout.
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.runInit = void 0;
|
|
13
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
14
|
+
const config_1 = require("../../../config");
|
|
15
|
+
const validate_1 = require("../../../shared/validate");
|
|
16
|
+
const config_template_1 = require("../../../shared/config-template");
|
|
17
|
+
const keychain_1 = require("../../../shared/keychain");
|
|
18
|
+
const prompt_1 = require("../../../shared/prompt");
|
|
19
|
+
const errors_1 = require("../../../shared/errors");
|
|
20
|
+
const shared_1 = require("../shared");
|
|
21
|
+
const auth_1 = require("./init/auth");
|
|
22
|
+
const deploy_lookup_1 = require("./init/deploy-lookup");
|
|
23
|
+
const runInit = async (options) => {
|
|
24
|
+
const logger = (0, shared_1.toLogger)(options);
|
|
25
|
+
const isInteractive = process.stdin.isTTY && process.stdout.isTTY && process.env.SITECOREAI_NON_INTERACTIVE !== "1";
|
|
26
|
+
const hasExplicitInput = Boolean(options.environmentName ||
|
|
27
|
+
options.cm ||
|
|
28
|
+
options.host ||
|
|
29
|
+
options.ref ||
|
|
30
|
+
options.allowWrite !== undefined ||
|
|
31
|
+
options.organizationId ||
|
|
32
|
+
options.tenantId ||
|
|
33
|
+
options.organization ||
|
|
34
|
+
options.project ||
|
|
35
|
+
options.environment ||
|
|
36
|
+
options.deployToken ||
|
|
37
|
+
options.clientId ||
|
|
38
|
+
options.clientSecret ||
|
|
39
|
+
options.useClientCredentials !== undefined ||
|
|
40
|
+
options.setDefault);
|
|
41
|
+
const runWizard = Boolean(options.wizard || !hasExplicitInput);
|
|
42
|
+
if (runWizard && !isInteractive) {
|
|
43
|
+
(0, prompt_1.assertInteractive)("Wizard mode requires a TTY. Provide flags instead.", "Provide flags instead.");
|
|
44
|
+
}
|
|
45
|
+
let envName = options.environmentName;
|
|
46
|
+
const reservedName = "default";
|
|
47
|
+
if (!envName) {
|
|
48
|
+
if (!runWizard) {
|
|
49
|
+
throw (0, shared_1.inputError)("Environment name is required. Use --environment-name.");
|
|
50
|
+
}
|
|
51
|
+
envName = await (0, prompt_1.promptText)("Environment name (local label; does not need to match SitecoreAI)");
|
|
52
|
+
if (!envName) {
|
|
53
|
+
throw (0, shared_1.inputError)("Environment name is required.");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (runWizard && envName.toLowerCase() === reservedName) {
|
|
57
|
+
envName = "";
|
|
58
|
+
}
|
|
59
|
+
const configPath = options.config ?? process.cwd();
|
|
60
|
+
const targetPath = (0, config_template_1.resolveTargetPath)(configPath);
|
|
61
|
+
if (!node_fs_1.default.existsSync(targetPath)) {
|
|
62
|
+
(0, config_template_1.writeConfigTemplate)(targetPath);
|
|
63
|
+
logger.info(`Created ${targetPath}`, "green");
|
|
64
|
+
}
|
|
65
|
+
let rootConfigFile;
|
|
66
|
+
try {
|
|
67
|
+
rootConfigFile = (0, config_1.readRootConfigurationFile)(configPath);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
const cliError = (0, errors_1.toCliError)(error);
|
|
71
|
+
if (cliError.code === "CONFIG_INVALID" && runWizard && isInteractive) {
|
|
72
|
+
const recreate = await (0, prompt_1.promptConfirm)(`Configuration file at ${targetPath} is invalid. Recreate it?`, false);
|
|
73
|
+
if (!recreate) {
|
|
74
|
+
logger.info("Init cancelled. No changes were made.");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (node_fs_1.default.existsSync(targetPath)) {
|
|
78
|
+
const timestamp = new Date().toISOString().replace(/[-:.TZ]/g, "");
|
|
79
|
+
const backupPath = `${targetPath}.invalid-${timestamp}`;
|
|
80
|
+
node_fs_1.default.renameSync(targetPath, backupPath);
|
|
81
|
+
logger.warn(`Backed up invalid config to ${backupPath}`);
|
|
82
|
+
}
|
|
83
|
+
(0, config_template_1.writeConfigTemplate)(targetPath);
|
|
84
|
+
logger.info(`Recreated ${targetPath}`, "green");
|
|
85
|
+
rootConfigFile = (0, config_1.readRootConfigurationFile)(configPath);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const envProfiles = rootConfigFile.config.envProfiles ?? {};
|
|
92
|
+
let root = (0, config_1.readRootConfiguration)(configPath, envName);
|
|
93
|
+
let existing = envProfiles[envName] ?? {};
|
|
94
|
+
let envExists = Boolean(envProfiles[envName]);
|
|
95
|
+
let baseEnv = root.environments[envName] ?? {};
|
|
96
|
+
const hasOtherChanges = Boolean(options.cm || options.host || options.organization || options.project || options.environment) ||
|
|
97
|
+
Boolean(options.deployToken || options.clientId || options.clientSecret) ||
|
|
98
|
+
Boolean(options.useClientCredentials || options.ref || options.allowWrite) ||
|
|
99
|
+
Boolean(options.organizationId || options.tenantId);
|
|
100
|
+
if (envExists && runWizard) {
|
|
101
|
+
while (envExists || envName.toLowerCase() === reservedName) {
|
|
102
|
+
if (envName.toLowerCase() === reservedName) {
|
|
103
|
+
const newName = await (0, prompt_1.promptText)("Environment name cannot be 'default'. Choose another name");
|
|
104
|
+
if (!newName) {
|
|
105
|
+
logger.info("Init cancelled. No changes were made.");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
envName = newName;
|
|
109
|
+
root = (0, config_1.readRootConfiguration)(configPath, envName);
|
|
110
|
+
existing = envProfiles[envName] ?? {};
|
|
111
|
+
envExists = Boolean(envProfiles[envName]);
|
|
112
|
+
baseEnv = root.environments[envName] ?? {};
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const overwrite = await (0, prompt_1.promptConfirm)(`Environment '${envName}' already exists. Overwrite?`, false);
|
|
116
|
+
if (overwrite) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
const newName = await (0, prompt_1.promptText)("Choose a different environment name (local label; does not need to match SitecoreAI)");
|
|
120
|
+
if (!newName) {
|
|
121
|
+
logger.info("Init cancelled. No changes were made.");
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
envName = newName;
|
|
125
|
+
root = (0, config_1.readRootConfiguration)(configPath, envName);
|
|
126
|
+
existing = envProfiles[envName] ?? {};
|
|
127
|
+
envExists = Boolean(envProfiles[envName]);
|
|
128
|
+
baseEnv = root.environments[envName] ?? {};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else if (envExists && !runWizard && hasOtherChanges) {
|
|
132
|
+
logger.warn(`Environment '${envName}' already exists and will be updated.`);
|
|
133
|
+
}
|
|
134
|
+
if (options.setDefault && !hasOtherChanges) {
|
|
135
|
+
if (!envProfiles[envName]) {
|
|
136
|
+
throw (0, errors_1.createCliError)(`Environment '${envName}' does not exist. Configure it before setting default.`, "ENV_NOT_FOUND");
|
|
137
|
+
}
|
|
138
|
+
rootConfigFile.config.defaultEnvProfile = envName;
|
|
139
|
+
(0, config_1.writeRootConfigurationFile)(configPath, rootConfigFile.config);
|
|
140
|
+
logger.info(`Default environment set to '${envName}'.`, "green");
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (options.ref) {
|
|
144
|
+
const refEnv = envProfiles[options.ref];
|
|
145
|
+
if (!refEnv) {
|
|
146
|
+
throw (0, errors_1.createCliError)(`Referenced environment '${options.ref}' was not found.`, "ENV_NOT_FOUND");
|
|
147
|
+
}
|
|
148
|
+
if (refEnv.ref) {
|
|
149
|
+
throw (0, shared_1.inputError)(`Referenced environment '${options.ref}' cannot itself reference another environment.`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const updated = { ...existing };
|
|
153
|
+
let host = options.cm ?? options.host ?? existing.host;
|
|
154
|
+
let projectSelection = options.project;
|
|
155
|
+
let environmentSelection = options.environment;
|
|
156
|
+
const skipDeployLookup = Boolean(options.skipDeployLookup) || process.env.SITECOREAI_SKIP_DEPLOY_LOOKUP === "1";
|
|
157
|
+
let needsDeployLookup = Boolean(options.organization || projectSelection || environmentSelection);
|
|
158
|
+
if (skipDeployLookup) {
|
|
159
|
+
needsDeployLookup = false;
|
|
160
|
+
}
|
|
161
|
+
if (runWizard && !needsDeployLookup && !skipDeployLookup) {
|
|
162
|
+
needsDeployLookup = true;
|
|
163
|
+
}
|
|
164
|
+
let needsDeployToken = needsDeployLookup || Boolean(options.deployToken || options.clientId || options.clientSecret);
|
|
165
|
+
if (runWizard) {
|
|
166
|
+
needsDeployToken = true;
|
|
167
|
+
}
|
|
168
|
+
const auth = await (0, auth_1.resolveDeployAuth)({
|
|
169
|
+
options,
|
|
170
|
+
envName,
|
|
171
|
+
existing,
|
|
172
|
+
baseEnv,
|
|
173
|
+
runWizard,
|
|
174
|
+
isInteractive,
|
|
175
|
+
needsDeployToken,
|
|
176
|
+
updated,
|
|
177
|
+
logger,
|
|
178
|
+
});
|
|
179
|
+
let deployToken = auth.deployToken;
|
|
180
|
+
const loginAuthority = auth.loginAuthority;
|
|
181
|
+
const loginClientId = auth.loginClientId;
|
|
182
|
+
const wantsClientCredentials = auth.wantsClientCredentials;
|
|
183
|
+
const shouldPersistClientId = auth.shouldPersistClientId;
|
|
184
|
+
if (needsDeployLookup) {
|
|
185
|
+
const lookup = await (0, deploy_lookup_1.resolveDeployLookup)({
|
|
186
|
+
options,
|
|
187
|
+
runWizard,
|
|
188
|
+
deployToken,
|
|
189
|
+
updated,
|
|
190
|
+
existing,
|
|
191
|
+
baseEnv,
|
|
192
|
+
host,
|
|
193
|
+
projectSelection,
|
|
194
|
+
environmentSelection,
|
|
195
|
+
logger,
|
|
196
|
+
});
|
|
197
|
+
host = lookup.host;
|
|
198
|
+
}
|
|
199
|
+
if (needsDeployToken && deployToken) {
|
|
200
|
+
const stored = await (0, keychain_1.setDeployToken)(envName, deployToken);
|
|
201
|
+
if (!stored) {
|
|
202
|
+
logger.warn("Unable to store the Deploy token in the OS keychain. Use SITECOREAI_DEPLOY_TOKEN if needed.");
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (!host && runWizard) {
|
|
206
|
+
host = await (0, prompt_1.promptText)("CM host (base URL)", host);
|
|
207
|
+
}
|
|
208
|
+
if (!host) {
|
|
209
|
+
throw (0, shared_1.inputError)("Environment host is required. Use --cm/--host or select it via Deploy.");
|
|
210
|
+
}
|
|
211
|
+
(0, validate_1.assertValidHost)(host, "CM host");
|
|
212
|
+
updated.host = host;
|
|
213
|
+
if (!updated.authority) {
|
|
214
|
+
updated.authority = loginAuthority;
|
|
215
|
+
}
|
|
216
|
+
if (loginClientId) {
|
|
217
|
+
if (wantsClientCredentials) {
|
|
218
|
+
updated.clientId = loginClientId;
|
|
219
|
+
}
|
|
220
|
+
else if (!updated.clientId && shouldPersistClientId) {
|
|
221
|
+
updated.clientId = loginClientId;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
(0, shared_1.applyIfDefined)(updated, "ref", options.ref);
|
|
225
|
+
if (options.allowWrite !== undefined) {
|
|
226
|
+
updated.allowWrite = options.allowWrite;
|
|
227
|
+
}
|
|
228
|
+
else if (runWizard) {
|
|
229
|
+
updated.allowWrite = await (0, prompt_1.promptConfirm)("Allow write operations?", false);
|
|
230
|
+
}
|
|
231
|
+
(0, shared_1.applyIfDefined)(updated, "organizationId", options.organizationId);
|
|
232
|
+
(0, shared_1.applyIfDefined)(updated, "tenantId", options.tenantId);
|
|
233
|
+
(0, shared_1.applyIfDefined)(updated, "clientId", options.clientId);
|
|
234
|
+
if (wantsClientCredentials) {
|
|
235
|
+
updated.useClientCredentials = true;
|
|
236
|
+
}
|
|
237
|
+
rootConfigFile.config.envProfiles = {
|
|
238
|
+
...envProfiles,
|
|
239
|
+
[envName]: updated,
|
|
240
|
+
};
|
|
241
|
+
if (options.setDefault || (!rootConfigFile.config.defaultEnvProfile && !runWizard)) {
|
|
242
|
+
rootConfigFile.config.defaultEnvProfile = envName;
|
|
243
|
+
}
|
|
244
|
+
else if (runWizard) {
|
|
245
|
+
const shouldSetDefault = await (0, prompt_1.promptConfirm)("Set as default environment?", !rootConfigFile.config.defaultEnvProfile);
|
|
246
|
+
if (shouldSetDefault) {
|
|
247
|
+
rootConfigFile.config.defaultEnvProfile = envName;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
(0, config_1.writeRootConfigurationFile)(configPath, rootConfigFile.config);
|
|
251
|
+
logger.info(`Initialized environment '${envName}' in sitecoreai.cli.json`, "green");
|
|
252
|
+
};
|
|
253
|
+
exports.runInit = runInit;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/serialization/tasks/env/logout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,SAAS,GAAU,SAAS,aAAa,KAAG,OAAO,CAAC,IAAI,CAyDpE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runLogout = void 0;
|
|
4
|
+
const config_1 = require("../../../config");
|
|
5
|
+
const keychain_1 = require("../../../shared/keychain");
|
|
6
|
+
const errors_1 = require("../../../shared/errors");
|
|
7
|
+
const shared_1 = require("../shared");
|
|
8
|
+
const runLogout = async (options) => {
|
|
9
|
+
const logger = (0, shared_1.toLogger)(options);
|
|
10
|
+
const configPath = options.config ?? process.cwd();
|
|
11
|
+
const rootConfigFile = (0, config_1.readRootConfigurationFile)(configPath);
|
|
12
|
+
const envProfiles = rootConfigFile.config.envProfiles ?? {};
|
|
13
|
+
const names = Object.keys(envProfiles);
|
|
14
|
+
if (options.all) {
|
|
15
|
+
for (const name of names) {
|
|
16
|
+
const env = envProfiles[name];
|
|
17
|
+
envProfiles[name] = {
|
|
18
|
+
...env,
|
|
19
|
+
accessToken: undefined,
|
|
20
|
+
refreshToken: undefined,
|
|
21
|
+
refreshTokenParameters: undefined,
|
|
22
|
+
expiresIn: undefined,
|
|
23
|
+
lastUpdated: undefined,
|
|
24
|
+
deployToken: undefined,
|
|
25
|
+
deployTokenExpiresIn: undefined,
|
|
26
|
+
deployTokenLastUpdated: undefined,
|
|
27
|
+
};
|
|
28
|
+
await (0, keychain_1.clearCmTokens)(name);
|
|
29
|
+
await (0, keychain_1.clearDeployToken)(name);
|
|
30
|
+
}
|
|
31
|
+
rootConfigFile.config.envProfiles = envProfiles;
|
|
32
|
+
(0, config_1.writeRootConfigurationFile)(configPath, rootConfigFile.config);
|
|
33
|
+
logger.info("Cleared stored tokens for all environments.", "green");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const envName = options.environmentName;
|
|
37
|
+
if (!envName) {
|
|
38
|
+
throw (0, errors_1.createCliError)("Environment name is required. Use --environment-name or --all.", "INPUT_INVALID");
|
|
39
|
+
}
|
|
40
|
+
const env = envProfiles[envName];
|
|
41
|
+
if (!env) {
|
|
42
|
+
throw (0, errors_1.createCliError)(`Environment '${envName}' does not exist.`, "ENV_NOT_FOUND");
|
|
43
|
+
}
|
|
44
|
+
envProfiles[envName] = {
|
|
45
|
+
...env,
|
|
46
|
+
accessToken: undefined,
|
|
47
|
+
refreshToken: undefined,
|
|
48
|
+
refreshTokenParameters: undefined,
|
|
49
|
+
expiresIn: undefined,
|
|
50
|
+
lastUpdated: undefined,
|
|
51
|
+
deployToken: undefined,
|
|
52
|
+
deployTokenExpiresIn: undefined,
|
|
53
|
+
deployTokenLastUpdated: undefined,
|
|
54
|
+
};
|
|
55
|
+
await (0, keychain_1.clearCmTokens)(envName);
|
|
56
|
+
await (0, keychain_1.clearDeployToken)(envName);
|
|
57
|
+
rootConfigFile.config.envProfiles = envProfiles;
|
|
58
|
+
(0, config_1.writeRootConfigurationFile)(configPath, rootConfigFile.config);
|
|
59
|
+
logger.info(`Cleared stored tokens for environment '${envName}'.`, "green");
|
|
60
|
+
};
|
|
61
|
+
exports.runLogout = runLogout;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/serialization/tasks/env/status.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,SAAS,GAAU,SAAS,aAAa,KAAG,OAAO,CAAC,IAAI,CAwJpE,CAAC"}
|