@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,319 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccessToken = exports.requestPasswordToken = exports.requestClientCredentialsToken = exports.DEFAULT_SITECORE_API_AUDIENCE = exports.pollDeviceToken = exports.requestDeviceAuthorization = void 0;
|
|
4
|
+
const keychain_1 = require("../../shared/keychain");
|
|
5
|
+
const errors_1 = require("../../shared/errors");
|
|
6
|
+
const DISCOVERY_TIMEOUT_MS = Math.max(0, Number(process.env.SITECOREAI_AUTH_DISCOVERY_TIMEOUT_MS ?? 5000));
|
|
7
|
+
const fetchDiscovery = async (authority) => {
|
|
8
|
+
const url = `${authority.replace(/\/$/, "")}/.well-known/openid-configuration`;
|
|
9
|
+
const controller = new AbortController();
|
|
10
|
+
const timeout = setTimeout(() => controller.abort(), DISCOVERY_TIMEOUT_MS);
|
|
11
|
+
try {
|
|
12
|
+
return await fetch(url, { signal: controller.signal });
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (error instanceof Error && error.name === "AbortError") {
|
|
16
|
+
throw (0, errors_1.createCliError)("Identity discovery timed out.", "NETWORK", {
|
|
17
|
+
hint: "Check network connectivity or set SITECOREAI_AUTH_DISCOVERY_TIMEOUT_MS.",
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
throw (0, errors_1.createCliError)(`Identity discovery failed: ${error instanceof Error ? error.message : String(error)}`, "NETWORK");
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
clearTimeout(timeout);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const getTokenEndpoint = async (authority) => {
|
|
27
|
+
const response = await fetchDiscovery(authority);
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
throw (0, errors_1.createCliError)(`Failed to discover token endpoint from ${authority}.`, "NETWORK");
|
|
30
|
+
}
|
|
31
|
+
const json = (await response.json());
|
|
32
|
+
if (!json.token_endpoint) {
|
|
33
|
+
throw (0, errors_1.createCliError)("Token endpoint not found in discovery document.", "NETWORK");
|
|
34
|
+
}
|
|
35
|
+
return json.token_endpoint;
|
|
36
|
+
};
|
|
37
|
+
const getDeviceAuthorizationEndpoint = async (authority) => {
|
|
38
|
+
const response = await fetchDiscovery(authority);
|
|
39
|
+
if (!response.ok) {
|
|
40
|
+
throw (0, errors_1.createCliError)(`Failed to discover device authorization endpoint from ${authority}.`, "NETWORK");
|
|
41
|
+
}
|
|
42
|
+
const json = (await response.json());
|
|
43
|
+
if (json.device_authorization_endpoint) {
|
|
44
|
+
return json.device_authorization_endpoint;
|
|
45
|
+
}
|
|
46
|
+
return `${authority.replace(/\/$/, "")}/oauth/device/code`;
|
|
47
|
+
};
|
|
48
|
+
const requestToken = async (authority, params) => {
|
|
49
|
+
const tokenEndpoint = await getTokenEndpoint(authority);
|
|
50
|
+
const response = await fetch(tokenEndpoint, {
|
|
51
|
+
method: "POST",
|
|
52
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
53
|
+
body: params.toString(),
|
|
54
|
+
});
|
|
55
|
+
if (!response.ok) {
|
|
56
|
+
const bodyText = await response.text();
|
|
57
|
+
let detail = bodyText;
|
|
58
|
+
try {
|
|
59
|
+
const parsed = JSON.parse(bodyText);
|
|
60
|
+
detail = parsed.error_description ?? parsed.error ?? parsed.message ?? bodyText;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// keep raw body text
|
|
64
|
+
}
|
|
65
|
+
throw (0, errors_1.createCliError)(`Failed to obtain access token (${response.status}): ${detail || "Unknown error"}`, "AUTH_REQUIRED");
|
|
66
|
+
}
|
|
67
|
+
const json = (await response.json());
|
|
68
|
+
if (!json.access_token) {
|
|
69
|
+
throw (0, errors_1.createCliError)("Access token was not returned by the identity server.", "AUTH_REQUIRED");
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
accessToken: json.access_token,
|
|
73
|
+
refreshToken: json.refresh_token,
|
|
74
|
+
expiresIn: json.expires_in,
|
|
75
|
+
tokenType: json.token_type,
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
const requestDeviceAuthorization = async (environment, scope) => {
|
|
79
|
+
if (!environment.authority || !environment.clientId) {
|
|
80
|
+
throw (0, errors_1.createCliError)("Authority and clientId are required for device login.", "AUTH_REQUIRED");
|
|
81
|
+
}
|
|
82
|
+
const endpoint = await getDeviceAuthorizationEndpoint(environment.authority);
|
|
83
|
+
const params = new URLSearchParams({
|
|
84
|
+
client_id: environment.clientId,
|
|
85
|
+
});
|
|
86
|
+
if (environment.audience) {
|
|
87
|
+
params.set("audience", environment.audience);
|
|
88
|
+
}
|
|
89
|
+
if (scope) {
|
|
90
|
+
params.set("scope", scope);
|
|
91
|
+
}
|
|
92
|
+
const response = await fetch(endpoint, {
|
|
93
|
+
method: "POST",
|
|
94
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
95
|
+
body: params.toString(),
|
|
96
|
+
});
|
|
97
|
+
if (!response.ok) {
|
|
98
|
+
const bodyText = await response.text();
|
|
99
|
+
let detail = bodyText;
|
|
100
|
+
try {
|
|
101
|
+
const parsed = JSON.parse(bodyText);
|
|
102
|
+
detail = parsed.error_description ?? parsed.error ?? parsed.message ?? bodyText;
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// keep raw body text
|
|
106
|
+
}
|
|
107
|
+
throw (0, errors_1.createCliError)(`Failed to start device login (${response.status}): ${detail || "Unknown error"}`, "AUTH_REQUIRED");
|
|
108
|
+
}
|
|
109
|
+
const json = (await response.json());
|
|
110
|
+
if (!json.device_code || !json.verification_uri) {
|
|
111
|
+
throw (0, errors_1.createCliError)("Device authorization response was missing required fields.", "AUTH_REQUIRED");
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
deviceCode: json.device_code,
|
|
115
|
+
userCode: json.user_code,
|
|
116
|
+
verificationUri: json.verification_uri,
|
|
117
|
+
verificationUriComplete: json.verification_uri_complete,
|
|
118
|
+
expiresIn: json.expires_in ?? 900,
|
|
119
|
+
interval: json.interval ?? 5,
|
|
120
|
+
message: json.message,
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
exports.requestDeviceAuthorization = requestDeviceAuthorization;
|
|
124
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
125
|
+
setTimeout(resolve, ms);
|
|
126
|
+
});
|
|
127
|
+
const pollDeviceToken = async (environment, device) => {
|
|
128
|
+
if (!environment.authority || !environment.clientId) {
|
|
129
|
+
throw (0, errors_1.createCliError)("Authority and clientId are required for device login.", "AUTH_REQUIRED");
|
|
130
|
+
}
|
|
131
|
+
const tokenEndpoint = await getTokenEndpoint(environment.authority);
|
|
132
|
+
const deadline = Date.now() + device.expiresIn * 1000;
|
|
133
|
+
let intervalMs = Math.max(1, device.interval) * 1000;
|
|
134
|
+
while (Date.now() < deadline) {
|
|
135
|
+
const params = new URLSearchParams({
|
|
136
|
+
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
137
|
+
device_code: device.deviceCode,
|
|
138
|
+
client_id: environment.clientId,
|
|
139
|
+
});
|
|
140
|
+
if (environment.clientSecret) {
|
|
141
|
+
params.set("client_secret", environment.clientSecret);
|
|
142
|
+
}
|
|
143
|
+
const response = await fetch(tokenEndpoint, {
|
|
144
|
+
method: "POST",
|
|
145
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
146
|
+
body: params.toString(),
|
|
147
|
+
});
|
|
148
|
+
const bodyText = await response.text();
|
|
149
|
+
if (response.ok) {
|
|
150
|
+
const json = JSON.parse(bodyText);
|
|
151
|
+
if (!json.access_token) {
|
|
152
|
+
throw (0, errors_1.createCliError)("Access token was not returned by the identity server.", "AUTH_REQUIRED");
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
accessToken: json.access_token,
|
|
156
|
+
refreshToken: json.refresh_token,
|
|
157
|
+
expiresIn: json.expires_in,
|
|
158
|
+
tokenType: json.token_type,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
let errorCode;
|
|
162
|
+
let detail = bodyText;
|
|
163
|
+
try {
|
|
164
|
+
const parsed = JSON.parse(bodyText);
|
|
165
|
+
errorCode = parsed.error;
|
|
166
|
+
detail = parsed.error_description ?? parsed.error ?? parsed.message ?? bodyText;
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
// keep raw body text
|
|
170
|
+
}
|
|
171
|
+
if (errorCode === "authorization_pending") {
|
|
172
|
+
await delay(intervalMs);
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (errorCode === "slow_down") {
|
|
176
|
+
intervalMs += 5000;
|
|
177
|
+
await delay(intervalMs);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (errorCode === "access_denied") {
|
|
181
|
+
throw (0, errors_1.createCliError)("Device login was cancelled.", "AUTH_REQUIRED");
|
|
182
|
+
}
|
|
183
|
+
if (errorCode === "expired_token") {
|
|
184
|
+
throw (0, errors_1.createCliError)("Device login expired. Try again.", "AUTH_REQUIRED");
|
|
185
|
+
}
|
|
186
|
+
throw (0, errors_1.createCliError)(`Failed to obtain access token (${response.status}): ${detail || "Unknown error"}`, "AUTH_REQUIRED");
|
|
187
|
+
}
|
|
188
|
+
throw (0, errors_1.createCliError)("Device login expired. Try again.", "AUTH_REQUIRED");
|
|
189
|
+
};
|
|
190
|
+
exports.pollDeviceToken = pollDeviceToken;
|
|
191
|
+
/**
|
|
192
|
+
* Default OAuth audience for Sitecore Cloud APIs (Deploy + Authoring +
|
|
193
|
+
* Sites). When the env profile doesn't pin an explicit `audience`,
|
|
194
|
+
* Auth0 falls back to whatever default is configured for the M2M
|
|
195
|
+
* client. Some org-scoped clients are configured with internal-only
|
|
196
|
+
* audiences they aren't authorized to mint tokens for, so we always
|
|
197
|
+
* send this audience explicitly on the request.
|
|
198
|
+
*/
|
|
199
|
+
exports.DEFAULT_SITECORE_API_AUDIENCE = "https://api.sitecorecloud.io";
|
|
200
|
+
const requestClientCredentialsToken = async (environment, scope) => {
|
|
201
|
+
if (!environment.authority || !environment.clientId || !environment.clientSecret) {
|
|
202
|
+
throw (0, errors_1.createCliError)("Authority, clientId, and clientSecret are required for client credentials.", "AUTH_REQUIRED");
|
|
203
|
+
}
|
|
204
|
+
const params = new URLSearchParams({
|
|
205
|
+
grant_type: "client_credentials",
|
|
206
|
+
client_id: environment.clientId,
|
|
207
|
+
client_secret: environment.clientSecret,
|
|
208
|
+
audience: environment.audience ?? exports.DEFAULT_SITECORE_API_AUDIENCE,
|
|
209
|
+
});
|
|
210
|
+
if (scope) {
|
|
211
|
+
params.set("scope", scope);
|
|
212
|
+
}
|
|
213
|
+
return requestToken(environment.authority, params);
|
|
214
|
+
};
|
|
215
|
+
exports.requestClientCredentialsToken = requestClientCredentialsToken;
|
|
216
|
+
const requestPasswordToken = async (environment, username, password, scope) => {
|
|
217
|
+
if (!environment.authority || !environment.clientId) {
|
|
218
|
+
throw (0, errors_1.createCliError)("Authority and clientId are required for username/password login.", "AUTH_REQUIRED");
|
|
219
|
+
}
|
|
220
|
+
const params = new URLSearchParams({
|
|
221
|
+
grant_type: "password",
|
|
222
|
+
client_id: environment.clientId,
|
|
223
|
+
username,
|
|
224
|
+
password,
|
|
225
|
+
});
|
|
226
|
+
if (environment.clientSecret) {
|
|
227
|
+
params.set("client_secret", environment.clientSecret);
|
|
228
|
+
}
|
|
229
|
+
if (environment.audience) {
|
|
230
|
+
params.set("audience", environment.audience);
|
|
231
|
+
}
|
|
232
|
+
if (scope) {
|
|
233
|
+
params.set("scope", scope);
|
|
234
|
+
}
|
|
235
|
+
return requestToken(environment.authority, params);
|
|
236
|
+
};
|
|
237
|
+
exports.requestPasswordToken = requestPasswordToken;
|
|
238
|
+
const requestRefreshToken = async (environment) => {
|
|
239
|
+
if (!environment.authority || !environment.refreshToken) {
|
|
240
|
+
return undefined;
|
|
241
|
+
}
|
|
242
|
+
const params = new URLSearchParams({
|
|
243
|
+
grant_type: "refresh_token",
|
|
244
|
+
refresh_token: environment.refreshToken,
|
|
245
|
+
});
|
|
246
|
+
if (environment.refreshTokenParameters) {
|
|
247
|
+
for (const [key, value] of Object.entries(environment.refreshTokenParameters)) {
|
|
248
|
+
params.set(key, String(value));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (!params.has("client_id") && environment.clientId) {
|
|
252
|
+
params.set("client_id", environment.clientId);
|
|
253
|
+
}
|
|
254
|
+
if (environment.clientSecret) {
|
|
255
|
+
params.set("client_secret", environment.clientSecret);
|
|
256
|
+
}
|
|
257
|
+
if (environment.audience && !params.has("audience")) {
|
|
258
|
+
params.set("audience", environment.audience);
|
|
259
|
+
}
|
|
260
|
+
return requestToken(environment.authority, params);
|
|
261
|
+
};
|
|
262
|
+
const getAccessToken = async (environment) => {
|
|
263
|
+
const envName = environment.name;
|
|
264
|
+
const shouldCache = environment.cacheAuthenticationToken !== false && Boolean(envName);
|
|
265
|
+
const cached = shouldCache && envName ? await (0, keychain_1.getCmTokens)(envName) : undefined;
|
|
266
|
+
if (cached?.accessToken) {
|
|
267
|
+
return cached.accessToken;
|
|
268
|
+
}
|
|
269
|
+
if (cached?.refreshToken) {
|
|
270
|
+
const refreshed = await requestRefreshToken({
|
|
271
|
+
...environment,
|
|
272
|
+
refreshToken: cached.refreshToken,
|
|
273
|
+
refreshTokenParameters: cached.refreshTokenParameters,
|
|
274
|
+
});
|
|
275
|
+
if (refreshed?.accessToken) {
|
|
276
|
+
if (shouldCache && envName) {
|
|
277
|
+
await (0, keychain_1.setCmTokens)(envName, {
|
|
278
|
+
accessToken: refreshed.accessToken,
|
|
279
|
+
refreshToken: refreshed.refreshToken ?? cached.refreshToken,
|
|
280
|
+
refreshTokenParameters: cached.refreshTokenParameters,
|
|
281
|
+
expiresIn: refreshed.expiresIn,
|
|
282
|
+
lastUpdated: new Date().toISOString(),
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
return refreshed.accessToken;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (environment.accessToken) {
|
|
289
|
+
return environment.accessToken;
|
|
290
|
+
}
|
|
291
|
+
const refreshed = await requestRefreshToken(environment);
|
|
292
|
+
if (refreshed?.accessToken) {
|
|
293
|
+
if (shouldCache && envName) {
|
|
294
|
+
await (0, keychain_1.setCmTokens)(envName, {
|
|
295
|
+
accessToken: refreshed.accessToken,
|
|
296
|
+
refreshToken: refreshed.refreshToken ?? environment.refreshToken,
|
|
297
|
+
refreshTokenParameters: environment.refreshTokenParameters,
|
|
298
|
+
expiresIn: refreshed.expiresIn,
|
|
299
|
+
lastUpdated: new Date().toISOString(),
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
return refreshed.accessToken;
|
|
303
|
+
}
|
|
304
|
+
if (environment.useClientCredentials) {
|
|
305
|
+
const token = await (0, exports.requestClientCredentialsToken)(environment);
|
|
306
|
+
if (shouldCache && envName) {
|
|
307
|
+
await (0, keychain_1.setCmTokens)(envName, {
|
|
308
|
+
accessToken: token.accessToken,
|
|
309
|
+
refreshToken: token.refreshToken,
|
|
310
|
+
refreshTokenParameters: environment.refreshTokenParameters,
|
|
311
|
+
expiresIn: token.expiresIn,
|
|
312
|
+
lastUpdated: new Date().toISOString(),
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
return token.accessToken;
|
|
316
|
+
}
|
|
317
|
+
return undefined;
|
|
318
|
+
};
|
|
319
|
+
exports.getAccessToken = getAccessToken;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Management GraphQL transport for serialization commands.
|
|
3
|
+
*
|
|
4
|
+
* Thin wrapper over `src/shared/graphql.ts` — supplies the Management
|
|
5
|
+
* service path and label. Parallels `src/recipe/api/graphql.ts` which
|
|
6
|
+
* targets the Authoring endpoint.
|
|
7
|
+
*/
|
|
8
|
+
import type { EnvironmentConfiguration } from "../../config";
|
|
9
|
+
import { type GraphQLRequestOptions } from "../../shared/graphql";
|
|
10
|
+
export type { GraphQLRequestOptions };
|
|
11
|
+
export declare const runGraphQL: <T>(environment: EnvironmentConfiguration, query: string, variables?: Record<string, unknown>, options?: GraphQLRequestOptions) => Promise<T>;
|
|
12
|
+
//# sourceMappingURL=graphql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/serialization/sitecore-api/graphql.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAsB,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAKlF,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,eAAO,MAAM,UAAU,GAAI,CAAC,EAC1B,aAAa,wBAAwB,EACrC,OAAO,MAAM,EACb,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,UAAU,qBAAqB,KAC9B,OAAO,CAAC,CAAC,CAYT,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Management GraphQL transport for serialization commands.
|
|
4
|
+
*
|
|
5
|
+
* Thin wrapper over `src/shared/graphql.ts` — supplies the Management
|
|
6
|
+
* service path and label. Parallels `src/recipe/api/graphql.ts` which
|
|
7
|
+
* targets the Authoring endpoint.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.runGraphQL = void 0;
|
|
11
|
+
const graphql_1 = require("../../shared/graphql");
|
|
12
|
+
const auth_1 = require("./auth");
|
|
13
|
+
const SERVICE_PATH = "/sitecore/api/management";
|
|
14
|
+
const runGraphQL = (environment, query, variables, options) => (0, graphql_1.runSitecoreGraphQL)(environment, query, variables, {
|
|
15
|
+
servicePath: SERVICE_PATH,
|
|
16
|
+
label: "Management",
|
|
17
|
+
requireToken: false,
|
|
18
|
+
getAccessToken: auth_1.getAccessToken,
|
|
19
|
+
}, options);
|
|
20
|
+
exports.runGraphQL = runGraphQL;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EnvironmentConfiguration } from "../../config";
|
|
2
|
+
import { HistoryEntry } from "../types";
|
|
3
|
+
import { GraphQLRequestOptions } from "./graphql";
|
|
4
|
+
export declare const fetchHistoryTimestamp: (environment: EnvironmentConfiguration, options?: GraphQLRequestOptions) => Promise<string>;
|
|
5
|
+
export declare const fetchHistoryEntries: (environment: EnvironmentConfiguration, timestamp: string, options?: GraphQLRequestOptions) => Promise<{
|
|
6
|
+
timestamp: string;
|
|
7
|
+
entries: HistoryEntry[];
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/serialization/sitecore-api/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAc,MAAM,WAAW,CAAC;AAuB9D,eAAO,MAAM,qBAAqB,GAChC,aAAa,wBAAwB,EACrC,UAAU,qBAAqB,KAC9B,OAAO,CAAC,MAAM,CAQhB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,aAAa,wBAAwB,EACrC,WAAW,MAAM,EACjB,UAAU,qBAAqB,KAC9B,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,YAAY,EAAE,CAAA;CAAE,CAYxD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchHistoryEntries = exports.fetchHistoryTimestamp = void 0;
|
|
4
|
+
const graphql_1 = require("./graphql");
|
|
5
|
+
const historyTimestampQuery = `
|
|
6
|
+
{
|
|
7
|
+
history {
|
|
8
|
+
currentTimestamp
|
|
9
|
+
}
|
|
10
|
+
}`;
|
|
11
|
+
const historyEntriesQuery = `
|
|
12
|
+
query Entries($timestamp: String!) {
|
|
13
|
+
history {
|
|
14
|
+
currentTimestamp
|
|
15
|
+
entries(timestamp: $timestamp) {
|
|
16
|
+
id
|
|
17
|
+
path
|
|
18
|
+
database
|
|
19
|
+
oldPath
|
|
20
|
+
changeType
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}`;
|
|
24
|
+
const fetchHistoryTimestamp = async (environment, options) => {
|
|
25
|
+
const data = await (0, graphql_1.runGraphQL)(environment, historyTimestampQuery, undefined, options);
|
|
26
|
+
return data.history.currentTimestamp;
|
|
27
|
+
};
|
|
28
|
+
exports.fetchHistoryTimestamp = fetchHistoryTimestamp;
|
|
29
|
+
const fetchHistoryEntries = async (environment, timestamp, options) => {
|
|
30
|
+
const data = await (0, graphql_1.runGraphQL)(environment, historyEntriesQuery, { timestamp }, options);
|
|
31
|
+
return {
|
|
32
|
+
timestamp: data.history.currentTimestamp,
|
|
33
|
+
entries: data.history.entries ?? [],
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
exports.fetchHistoryEntries = fetchHistoryEntries;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/serialization/sitecore-api/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./auth"), exports);
|
|
18
|
+
__exportStar(require("./items"), exports);
|
|
19
|
+
__exportStar(require("./history"), exports);
|
|
20
|
+
__exportStar(require("./roles"), exports);
|
|
21
|
+
__exportStar(require("./users"), exports);
|
|
22
|
+
__exportStar(require("./publish"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ItemData, ItemMetadata } from "../types";
|
|
2
|
+
import { EnvironmentConfiguration } from "../../config";
|
|
3
|
+
import { FieldFilterSet } from "../field-filter";
|
|
4
|
+
import { GraphQLRequestOptions } from "./graphql";
|
|
5
|
+
export declare const fetchItemMetadata: (environment: EnvironmentConfiguration, database: string, pathOrId: string, scope: string, fieldFilter: FieldFilterSet, useDebugSignatures: boolean, options?: GraphQLRequestOptions) => Promise<ItemMetadata[]>;
|
|
6
|
+
export declare const fetchItemData: (environment: EnvironmentConfiguration, database: string, pathOrId: string, scope: string, fieldFilter: FieldFilterSet, options?: GraphQLRequestOptions) => Promise<ItemData[]>;
|
|
7
|
+
export declare const executeSerializationCommands: (environment: EnvironmentConfiguration, commands: unknown[], minimumLogLevel: string, options?: GraphQLRequestOptions) => Promise<unknown[]>;
|
|
8
|
+
//# sourceMappingURL=items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../src/serialization/sitecore-api/items.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAc,MAAM,WAAW,CAAC;AAqG9D,eAAO,MAAM,iBAAiB,GAC5B,aAAa,wBAAwB,EACrC,UAAU,MAAM,EAChB,UAAU,MAAM,EAChB,OAAO,MAAM,EACb,aAAa,cAAc,EAC3B,oBAAoB,OAAO,EAC3B,UAAU,qBAAqB,KAC9B,OAAO,CAAC,YAAY,EAAE,CAmCxB,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,aAAa,wBAAwB,EACrC,UAAU,MAAM,EAChB,UAAU,MAAM,EAChB,OAAO,MAAM,EACb,aAAa,cAAc,EAC3B,UAAU,qBAAqB,KAC9B,OAAO,CAAC,QAAQ,EAAE,CAgBpB,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,aAAa,wBAAwB,EACrC,UAAU,OAAO,EAAE,EACnB,iBAAiB,MAAM,EACvB,UAAU,qBAAqB,KAC9B,OAAO,CAAC,OAAO,EAAE,CAWnB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeSerializationCommands = exports.fetchItemData = exports.fetchItemMetadata = void 0;
|
|
4
|
+
const item_path_1 = require("../item-path");
|
|
5
|
+
const signature_1 = require("../signature");
|
|
6
|
+
const errors_1 = require("../../shared/errors");
|
|
7
|
+
const graphql_1 = require("./graphql");
|
|
8
|
+
const serializeMetadataFragment = `
|
|
9
|
+
serialize(path: $path, database: $database, scope: $scope, excludedFieldIds: $excludedFieldIds) {
|
|
10
|
+
id
|
|
11
|
+
parentId
|
|
12
|
+
templateId
|
|
13
|
+
path
|
|
14
|
+
hasChildren
|
|
15
|
+
dataSignature
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
const serializeMetadataDebugFragment = serializeMetadataFragment.replace("dataSignature", "dataSignature(debug: true)");
|
|
19
|
+
const serializeDataFragment = `
|
|
20
|
+
serialize(path: $path, database: $database, scope: $scope, excludedFieldIds: $excludedFieldIds) {
|
|
21
|
+
data
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
const executeSerializationCommandsMutation = `
|
|
25
|
+
mutation($commands: [ItemCommand], $minimumLogLevel: LogLevel) {
|
|
26
|
+
executeSerializationCommands(commands: $commands, minimumLogLevel: $minimumLogLevel) {
|
|
27
|
+
success
|
|
28
|
+
name
|
|
29
|
+
messages {
|
|
30
|
+
logLevel
|
|
31
|
+
eventID { id name }
|
|
32
|
+
message
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}`;
|
|
36
|
+
const mapScope = (scope) => {
|
|
37
|
+
if (scope.toLowerCase() === "singleitem") {
|
|
38
|
+
return "SingleItem";
|
|
39
|
+
}
|
|
40
|
+
if (scope.toLowerCase() === "itemandchildren") {
|
|
41
|
+
return "ItemAndChildren";
|
|
42
|
+
}
|
|
43
|
+
if (scope.toLowerCase() === "descendantsonly") {
|
|
44
|
+
return "DescendantsOnly";
|
|
45
|
+
}
|
|
46
|
+
return "ItemAndDescendants";
|
|
47
|
+
};
|
|
48
|
+
const parseItemData = (data, database) => {
|
|
49
|
+
if (!data || typeof data !== "string") {
|
|
50
|
+
throw (0, errors_1.createCliError)("GraphQL response did not contain serialized item data.", "UNKNOWN");
|
|
51
|
+
}
|
|
52
|
+
const parsed = JSON.parse(data);
|
|
53
|
+
const versions = parsed.versions?.map((version) => ({
|
|
54
|
+
language: version.language,
|
|
55
|
+
version: version.version,
|
|
56
|
+
fields: version.fields.map((field) => ({
|
|
57
|
+
fieldId: field.fieldId,
|
|
58
|
+
nameHint: field.nameHint,
|
|
59
|
+
value: field.value ?? "",
|
|
60
|
+
blobId: field.blobId ?? null,
|
|
61
|
+
})),
|
|
62
|
+
})) ?? [];
|
|
63
|
+
const item = {
|
|
64
|
+
id: parsed.id,
|
|
65
|
+
parentId: parsed.parentId,
|
|
66
|
+
templateId: parsed.templateId,
|
|
67
|
+
path: item_path_1.ItemPath.fromPathString(parsed.path.toString()),
|
|
68
|
+
name: parsed.name,
|
|
69
|
+
branchId: parsed.branchId,
|
|
70
|
+
database,
|
|
71
|
+
sharedFields: parsed.sharedFields.map((field) => ({
|
|
72
|
+
fieldId: field.fieldId,
|
|
73
|
+
nameHint: field.nameHint,
|
|
74
|
+
value: field.value ?? "",
|
|
75
|
+
blobId: field.blobId ?? null,
|
|
76
|
+
})),
|
|
77
|
+
unversionedFields: parsed.unversionedFields.map((language) => ({
|
|
78
|
+
language: language.language,
|
|
79
|
+
fields: language.fields.map((field) => ({
|
|
80
|
+
fieldId: field.fieldId,
|
|
81
|
+
nameHint: field.nameHint,
|
|
82
|
+
value: field.value ?? "",
|
|
83
|
+
blobId: field.blobId ?? null,
|
|
84
|
+
})),
|
|
85
|
+
})),
|
|
86
|
+
versions,
|
|
87
|
+
dataSignature: parsed.dataSignature,
|
|
88
|
+
};
|
|
89
|
+
if (!item.dataSignature) {
|
|
90
|
+
const base = (0, signature_1.createDataSignatureBase)(item);
|
|
91
|
+
item.dataSignature = (0, signature_1.createSignature)(base) ?? "";
|
|
92
|
+
}
|
|
93
|
+
return item;
|
|
94
|
+
};
|
|
95
|
+
const fetchItemMetadata = async (environment, database, pathOrId, scope, fieldFilter, useDebugSignatures, options) => {
|
|
96
|
+
const query = `query($path: String!, $database: String!, $scope: TreeScope!, $excludedFieldIds: [String]) { ${useDebugSignatures ? serializeMetadataDebugFragment : serializeMetadataFragment} }`;
|
|
97
|
+
const data = await (0, graphql_1.runGraphQL)(environment, query, {
|
|
98
|
+
path: pathOrId,
|
|
99
|
+
database,
|
|
100
|
+
scope: mapScope(scope),
|
|
101
|
+
excludedFieldIds: Array.from(fieldFilter.excludes),
|
|
102
|
+
}, options);
|
|
103
|
+
return data.serialize.map((item) => ({
|
|
104
|
+
id: item.id,
|
|
105
|
+
parentId: item.parentId,
|
|
106
|
+
templateId: item.templateId,
|
|
107
|
+
path: item_path_1.ItemPath.fromPathString(item.path),
|
|
108
|
+
hasChildren: item.hasChildren,
|
|
109
|
+
dataSignature: item.dataSignature,
|
|
110
|
+
database,
|
|
111
|
+
}));
|
|
112
|
+
};
|
|
113
|
+
exports.fetchItemMetadata = fetchItemMetadata;
|
|
114
|
+
const fetchItemData = async (environment, database, pathOrId, scope, fieldFilter, options) => {
|
|
115
|
+
const query = `query($path: String!, $database: String!, $scope: TreeScope!, $excludedFieldIds: [String]) { ${serializeDataFragment} }`;
|
|
116
|
+
const data = await (0, graphql_1.runGraphQL)(environment, query, {
|
|
117
|
+
path: pathOrId,
|
|
118
|
+
database,
|
|
119
|
+
scope: mapScope(scope),
|
|
120
|
+
excludedFieldIds: Array.from(fieldFilter.excludes),
|
|
121
|
+
}, options);
|
|
122
|
+
return data.serialize.map((entry) => parseItemData(entry.data, database));
|
|
123
|
+
};
|
|
124
|
+
exports.fetchItemData = fetchItemData;
|
|
125
|
+
const executeSerializationCommands = async (environment, commands, minimumLogLevel, options) => {
|
|
126
|
+
const data = await (0, graphql_1.runGraphQL)(environment, executeSerializationCommandsMutation, {
|
|
127
|
+
commands,
|
|
128
|
+
minimumLogLevel,
|
|
129
|
+
}, options);
|
|
130
|
+
return data.executeSerializationCommands;
|
|
131
|
+
};
|
|
132
|
+
exports.executeSerializationCommands = executeSerializationCommands;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EnvironmentConfiguration } from "../../config";
|
|
2
|
+
import { GraphQLRequestOptions } from "./graphql";
|
|
3
|
+
export declare const publishItems: (environment: EnvironmentConfiguration, itemIds: string[], target?: string, options?: GraphQLRequestOptions) => Promise<{
|
|
4
|
+
id: string;
|
|
5
|
+
processedCount: number;
|
|
6
|
+
stateName: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const checkPublishStatus: (environment: EnvironmentConfiguration, publishId: string, options?: GraphQLRequestOptions) => Promise<{
|
|
9
|
+
id: string;
|
|
10
|
+
processedCount: number;
|
|
11
|
+
stateName: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const fetchPublishingTargets: (environment: EnvironmentConfiguration, options?: GraphQLRequestOptions) => Promise<string[]>;
|
|
14
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/serialization/sitecore-api/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAc,MAAM,WAAW,CAAC;AA6B9D,eAAO,MAAM,YAAY,GACvB,aAAa,wBAAwB,EACrC,SAAS,MAAM,EAAE,EACjB,SAAS,MAAM,EACf,UAAU,qBAAqB,KAC9B,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAKnE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,aAAa,wBAAwB,EACrC,WAAW,MAAM,EACjB,UAAU,qBAAqB,KAC9B,OAAO,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAKnE,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,aAAa,wBAAwB,EACrC,UAAU,qBAAqB,KAC9B,OAAO,CAAC,MAAM,EAAE,CAQlB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchPublishingTargets = exports.checkPublishStatus = exports.publishItems = void 0;
|
|
4
|
+
const graphql_1 = require("./graphql");
|
|
5
|
+
const publishMutation = `
|
|
6
|
+
mutation($path: String, $languages: [String] , $itemIds : [String], $republish : Boolean, $target : String) {
|
|
7
|
+
publish(path: $path, languages: $languages, itemIds :$itemIds, republish :$republish, target :$target) {
|
|
8
|
+
id
|
|
9
|
+
processedCount
|
|
10
|
+
stateCode
|
|
11
|
+
stateName
|
|
12
|
+
}
|
|
13
|
+
}`;
|
|
14
|
+
const publishStatusQuery = `
|
|
15
|
+
query($id: String)
|
|
16
|
+
{
|
|
17
|
+
publishingStatus(id: $id)
|
|
18
|
+
{
|
|
19
|
+
id
|
|
20
|
+
processedCount
|
|
21
|
+
stateCode
|
|
22
|
+
stateName
|
|
23
|
+
}
|
|
24
|
+
}`;
|
|
25
|
+
const listTargetsQuery = `
|
|
26
|
+
query {
|
|
27
|
+
listOfTargets
|
|
28
|
+
}`;
|
|
29
|
+
const publishItems = async (environment, itemIds, target, options) => {
|
|
30
|
+
const data = await (0, graphql_1.runGraphQL)(environment, publishMutation, { itemIds, target }, options);
|
|
31
|
+
return data.publish;
|
|
32
|
+
};
|
|
33
|
+
exports.publishItems = publishItems;
|
|
34
|
+
const checkPublishStatus = async (environment, publishId, options) => {
|
|
35
|
+
const data = await (0, graphql_1.runGraphQL)(environment, publishStatusQuery, { id: publishId }, options);
|
|
36
|
+
return data.publishingStatus;
|
|
37
|
+
};
|
|
38
|
+
exports.checkPublishStatus = checkPublishStatus;
|
|
39
|
+
const fetchPublishingTargets = async (environment, options) => {
|
|
40
|
+
const data = await (0, graphql_1.runGraphQL)(environment, listTargetsQuery, undefined, options);
|
|
41
|
+
return data.listOfTargets ?? [];
|
|
42
|
+
};
|
|
43
|
+
exports.fetchPublishingTargets = fetchPublishingTargets;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EnvironmentConfiguration } from "../../config";
|
|
2
|
+
import { RoleData } from "../types";
|
|
3
|
+
import { GraphQLRequestOptions } from "./graphql";
|
|
4
|
+
export declare const fetchRoles: (environment: EnvironmentConfiguration, predicates: Array<{
|
|
5
|
+
domain: string;
|
|
6
|
+
pattern: string;
|
|
7
|
+
}>, options?: GraphQLRequestOptions) => Promise<RoleData[]>;
|
|
8
|
+
export declare const pushRoleCommands: (environment: EnvironmentConfiguration, commands: unknown[], options?: GraphQLRequestOptions) => Promise<unknown[]>;
|
|
9
|
+
//# sourceMappingURL=roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../src/serialization/sitecore-api/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAc,MAAM,WAAW,CAAC;AA4B9D,eAAO,MAAM,UAAU,GACrB,aAAa,wBAAwB,EACrC,YAAY,KAAK,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,EACtD,UAAU,qBAAqB,KAC9B,OAAO,CAAC,QAAQ,EAAE,CAUpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,aAAa,wBAAwB,EACrC,UAAU,OAAO,EAAE,EACnB,UAAU,qBAAqB,KAC9B,OAAO,CAAC,OAAO,EAAE,CAUnB,CAAC"}
|