@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,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared environment-resolution helper. Replaces the three near-duplicate
|
|
3
|
+
* implementations that grew up across `recipe/tasks/shared.ts:resolveTenant`,
|
|
4
|
+
* `deploy/tasks/shared.ts:getDeployContext`, and the hand-copied
|
|
5
|
+
* `resolveAuthoringEnvironment` blocks in `deploy/tasks/site.ts` and
|
|
6
|
+
* `deploy/tasks/site-bind.ts` — all doing the same
|
|
7
|
+
* readRoot → defaultEnvProfile → environment-or-throw dance with slightly
|
|
8
|
+
* different error messages and return shapes.
|
|
9
|
+
*
|
|
10
|
+
* Domain-specific wrappers (recipe `resolveTenant`, deploy
|
|
11
|
+
* `getDeployContext`) compose this and add their own decoration
|
|
12
|
+
* (auth client, deploy token lookup, etc.).
|
|
13
|
+
*/
|
|
14
|
+
import { type EnvironmentConfiguration, type RootConfiguration } from "../config";
|
|
15
|
+
export interface ResolvedEnvironment {
|
|
16
|
+
envName: string;
|
|
17
|
+
environment: EnvironmentConfiguration;
|
|
18
|
+
root: RootConfiguration;
|
|
19
|
+
/** Tenant API client timeout in ms, derived from
|
|
20
|
+
* `settings.apiClientTimeoutInMinutes`. `undefined` when unset/invalid. */
|
|
21
|
+
timeoutMs: number | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface ResolveEnvironmentOptions {
|
|
24
|
+
config?: string;
|
|
25
|
+
environmentName?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const resolveEnvironment: (options: ResolveEnvironmentOptions) => ResolvedEnvironment;
|
|
28
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/shared/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,iBAAiB,EAGvB,MAAM,UAAU,CAAC;AAIlB,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,wBAAwB,CAAC;IACtC,IAAI,EAAE,iBAAiB,CAAC;IACxB;gFAC4E;IAC5E,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,kBAAkB,GAAI,SAAS,yBAAyB,KAAG,mBAiBvE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared environment-resolution helper. Replaces the three near-duplicate
|
|
4
|
+
* implementations that grew up across `recipe/tasks/shared.ts:resolveTenant`,
|
|
5
|
+
* `deploy/tasks/shared.ts:getDeployContext`, and the hand-copied
|
|
6
|
+
* `resolveAuthoringEnvironment` blocks in `deploy/tasks/site.ts` and
|
|
7
|
+
* `deploy/tasks/site-bind.ts` — all doing the same
|
|
8
|
+
* readRoot → defaultEnvProfile → environment-or-throw dance with slightly
|
|
9
|
+
* different error messages and return shapes.
|
|
10
|
+
*
|
|
11
|
+
* Domain-specific wrappers (recipe `resolveTenant`, deploy
|
|
12
|
+
* `getDeployContext`) compose this and add their own decoration
|
|
13
|
+
* (auth client, deploy token lookup, etc.).
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.resolveEnvironment = void 0;
|
|
17
|
+
const config_1 = require("../config");
|
|
18
|
+
const errors_1 = require("../shared/errors");
|
|
19
|
+
const cli_tasks_1 = require("./cli-tasks");
|
|
20
|
+
const resolveEnvironment = (options) => {
|
|
21
|
+
const configPath = options.config ?? process.cwd();
|
|
22
|
+
const rootFile = (0, config_1.readRootConfigurationFile)(configPath);
|
|
23
|
+
const envName = options.environmentName ?? rootFile.config.defaultEnvProfile;
|
|
24
|
+
if (!envName) {
|
|
25
|
+
throw (0, errors_1.createCliError)("Environment name is required.", "INPUT_INVALID", {
|
|
26
|
+
hint: "Pass --environment-name or set defaultEnvProfile in the config.",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const root = (0, config_1.readRootConfiguration)(configPath, envName);
|
|
30
|
+
const environment = root.environments[envName];
|
|
31
|
+
if (!environment) {
|
|
32
|
+
throw (0, errors_1.createCliError)(`Environment '${envName}' is not configured.`, "ENV_NOT_FOUND", {
|
|
33
|
+
hint: "Run 'scai init' to configure the environment.",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return { envName, environment, root, timeoutMs: (0, cli_tasks_1.resolveApiTimeoutMs)(root) };
|
|
37
|
+
};
|
|
38
|
+
exports.resolveEnvironment = resolveEnvironment;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type CliErrorCode = "CONFIG_NOT_FOUND" | "CONFIG_INVALID" | "INPUT_INVALID" | "AUTH_REQUIRED" | "NETWORK" | "ENV_NOT_FOUND" | "DEPLOY_FAILED" | "SITES_API_FAILED" | "UNKNOWN";
|
|
2
|
+
export declare class CliError extends Error {
|
|
3
|
+
code: CliErrorCode;
|
|
4
|
+
exitCode: number;
|
|
5
|
+
hint?: string;
|
|
6
|
+
details?: string[];
|
|
7
|
+
constructor(message: string, options?: {
|
|
8
|
+
code?: CliErrorCode;
|
|
9
|
+
exitCode?: number;
|
|
10
|
+
hint?: string;
|
|
11
|
+
details?: string[];
|
|
12
|
+
cause?: unknown;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export declare const toCliError: (error: unknown) => CliError;
|
|
16
|
+
export declare const withHint: (error: CliError, hint: string) => CliError;
|
|
17
|
+
export declare const createCliError: (message: string, code: CliErrorCode, options?: {
|
|
18
|
+
hint?: string;
|
|
19
|
+
details?: string[];
|
|
20
|
+
}) => CliError;
|
|
21
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/shared/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,kBAAkB,GAClB,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,SAAS,GACT,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,SAAS,CAAC;AAEd,qBAAa,QAAS,SAAQ,KAAK;IACjC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;gBAGjB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;QACP,IAAI,CAAC,EAAE,YAAY,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,KAAK,CAAC,EAAE,OAAO,CAAC;KACZ;CAYT;AAuBD,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,QAM3C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,QAAQ,EAAE,MAAM,MAAM,KAAG,QAMrD,CAAC;AAEL,eAAO,MAAM,cAAc,GACzB,SAAS,MAAM,EACf,MAAM,YAAY,EAClB,UAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,KAClD,QAMC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCliError = exports.withHint = exports.toCliError = exports.CliError = void 0;
|
|
4
|
+
class CliError extends Error {
|
|
5
|
+
constructor(message, options = {}) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "CliError";
|
|
8
|
+
this.code = options.code ?? "UNKNOWN";
|
|
9
|
+
this.exitCode = options.exitCode ?? 1;
|
|
10
|
+
this.hint = options.hint;
|
|
11
|
+
this.details = options.details;
|
|
12
|
+
if (options.cause !== undefined) {
|
|
13
|
+
this.cause = options.cause;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.CliError = CliError;
|
|
18
|
+
const exitCodeFor = (code) => {
|
|
19
|
+
switch (code) {
|
|
20
|
+
case "CONFIG_NOT_FOUND":
|
|
21
|
+
case "CONFIG_INVALID":
|
|
22
|
+
case "INPUT_INVALID":
|
|
23
|
+
return 2;
|
|
24
|
+
case "AUTH_REQUIRED":
|
|
25
|
+
return 3;
|
|
26
|
+
case "NETWORK":
|
|
27
|
+
return 4;
|
|
28
|
+
case "ENV_NOT_FOUND":
|
|
29
|
+
return 5;
|
|
30
|
+
case "DEPLOY_FAILED":
|
|
31
|
+
return 6;
|
|
32
|
+
case "SITES_API_FAILED":
|
|
33
|
+
return 7;
|
|
34
|
+
default:
|
|
35
|
+
return 1;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const toCliError = (error) => {
|
|
39
|
+
if (error instanceof CliError) {
|
|
40
|
+
return error;
|
|
41
|
+
}
|
|
42
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
43
|
+
return new CliError(message, { code: "UNKNOWN", exitCode: exitCodeFor("UNKNOWN") });
|
|
44
|
+
};
|
|
45
|
+
exports.toCliError = toCliError;
|
|
46
|
+
const withHint = (error, hint) => new CliError(error.message, {
|
|
47
|
+
code: error.code,
|
|
48
|
+
exitCode: error.exitCode,
|
|
49
|
+
hint,
|
|
50
|
+
details: error.details,
|
|
51
|
+
});
|
|
52
|
+
exports.withHint = withHint;
|
|
53
|
+
const createCliError = (message, code, options = {}) => new CliError(message, {
|
|
54
|
+
code,
|
|
55
|
+
exitCode: exitCodeFor(code),
|
|
56
|
+
hint: options.hint,
|
|
57
|
+
details: options.details,
|
|
58
|
+
});
|
|
59
|
+
exports.createCliError = createCliError;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared GraphQL transport for Sitecore tenant APIs.
|
|
3
|
+
*
|
|
4
|
+
* Two near-identical transports — the Authoring API (used by `recipe`)
|
|
5
|
+
* and the Management API (used by `serialization`) — used to ship as
|
|
6
|
+
* separate copies of timeout/abort/error/redaction plumbing. They live
|
|
7
|
+
* in different modules because they target different Sitecore endpoints
|
|
8
|
+
* with different auth contracts, but everything *except* the endpoint
|
|
9
|
+
* URL, the human-readable label, and whether the bearer token is
|
|
10
|
+
* required vs optional was duplicated.
|
|
11
|
+
*
|
|
12
|
+
* This module owns the wire protocol; `recipe/api/graphql.ts` and
|
|
13
|
+
* `serialization/sitecore-api/graphql.ts` are thin wrappers that supply
|
|
14
|
+
* the per-API constants.
|
|
15
|
+
*/
|
|
16
|
+
import type { EnvironmentConfiguration } from "../config";
|
|
17
|
+
type GetAccessToken = (environment: EnvironmentConfiguration) => Promise<string | undefined>;
|
|
18
|
+
export interface GraphQLRequestOptions {
|
|
19
|
+
timeoutMs?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Override retry behaviour for transient failures (429 throttling, 502/503/504,
|
|
22
|
+
* network blips, abort-but-not-timeout). Defaults to 5 attempts with
|
|
23
|
+
* exponential backoff + jitter, honoring `Retry-After` on 429/503.
|
|
24
|
+
*/
|
|
25
|
+
retry?: RetryOptions;
|
|
26
|
+
}
|
|
27
|
+
export interface RetryOptions {
|
|
28
|
+
/** Total attempts including the initial one. Default 5. */
|
|
29
|
+
maxAttempts?: number;
|
|
30
|
+
/** Base delay in ms; doubled per retry, jittered ±50%. Default 500ms. */
|
|
31
|
+
baseDelayMs?: number;
|
|
32
|
+
/** Cap on a single backoff delay. Default 15s. */
|
|
33
|
+
maxDelayMs?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Which HTTP status codes are retryable. Defaults to the conservative
|
|
36
|
+
* "definite-throttle / never-reached-origin" set: 408, 425, 429, 503.
|
|
37
|
+
* Read-only callers can pass a wider set (`READ_RETRYABLE_STATUSES`)
|
|
38
|
+
* that includes ambiguous 5xx codes like 500/502/504; mutation callers
|
|
39
|
+
* keep the conservative default so a transient 5xx-after-success
|
|
40
|
+
* doesn't trigger a duplicate-write retry. Network blips
|
|
41
|
+
* (`TypeError: fetch failed`) are always retryable regardless of this
|
|
42
|
+
* set since no request was sent.
|
|
43
|
+
*/
|
|
44
|
+
retryableStatuses?: ReadonlySet<number>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Read-only callers can opt in to a broader retry set that includes
|
|
48
|
+
* ambiguous 5xx codes. Safe for GETs since reads are idempotent — a
|
|
49
|
+
* second fetch is harmless. Unsafe for mutations because 500/502/504
|
|
50
|
+
* may indicate the server processed the request but failed to respond,
|
|
51
|
+
* and retrying would create a duplicate.
|
|
52
|
+
*/
|
|
53
|
+
export declare const READ_RETRYABLE_STATUSES: Set<number>;
|
|
54
|
+
export interface GraphQLTransportConfig {
|
|
55
|
+
/** URL path appended to `environment.host`. */
|
|
56
|
+
servicePath: string;
|
|
57
|
+
/** Human-readable label used in error messages — e.g. `"Authoring"` or `"Management"`. */
|
|
58
|
+
label: string;
|
|
59
|
+
/**
|
|
60
|
+
* When `true`, the call throws `AUTH_REQUIRED` if no token is available
|
|
61
|
+
* (Authoring API). When `false`, the request is sent without the
|
|
62
|
+
* Authorization header (Management API — anonymous access valid for
|
|
63
|
+
* some queries).
|
|
64
|
+
*/
|
|
65
|
+
requireToken: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Strategy for fetching a Bearer token for the request. Wrappers pass
|
|
68
|
+
* this in so the shared module doesn't reach across layer boundaries
|
|
69
|
+
* to import auth, and so tests can mock auth at the wrapper's seam
|
|
70
|
+
* without crossing layers.
|
|
71
|
+
*/
|
|
72
|
+
getAccessToken: GetAccessToken;
|
|
73
|
+
}
|
|
74
|
+
export declare const runSitecoreGraphQL: <T>(environment: EnvironmentConfiguration, query: string, variables: Record<string, unknown> | undefined, transport: GraphQLTransportConfig, options?: GraphQLRequestOptions) => Promise<T>;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=graphql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../src/shared/graphql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAIzD,KAAK,cAAc,GAAG,CAAC,WAAW,EAAE,wBAAwB,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAO7F,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;OASG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACzC;AAiBD;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,aAA+C,CAAC;AA6CpF,MAAM,WAAW,sBAAsB;IACrC,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,cAAc,EAAE,cAAc,CAAC;CAChC;AAoBD,eAAO,MAAM,kBAAkB,GAAU,CAAC,EACxC,aAAa,wBAAwB,EACrC,OAAO,MAAM,EACb,WAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC9C,WAAW,sBAAsB,EACjC,UAAU,qBAAqB,KAC9B,OAAO,CAAC,CAAC,CAyJX,CAAC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared GraphQL transport for Sitecore tenant APIs.
|
|
4
|
+
*
|
|
5
|
+
* Two near-identical transports — the Authoring API (used by `recipe`)
|
|
6
|
+
* and the Management API (used by `serialization`) — used to ship as
|
|
7
|
+
* separate copies of timeout/abort/error/redaction plumbing. They live
|
|
8
|
+
* in different modules because they target different Sitecore endpoints
|
|
9
|
+
* with different auth contracts, but everything *except* the endpoint
|
|
10
|
+
* URL, the human-readable label, and whether the bearer token is
|
|
11
|
+
* required vs optional was duplicated.
|
|
12
|
+
*
|
|
13
|
+
* This module owns the wire protocol; `recipe/api/graphql.ts` and
|
|
14
|
+
* `serialization/sitecore-api/graphql.ts` are thin wrappers that supply
|
|
15
|
+
* the per-API constants.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.runSitecoreGraphQL = exports.READ_RETRYABLE_STATUSES = void 0;
|
|
19
|
+
const errors_1 = require("./errors");
|
|
20
|
+
const redact_1 = require("./redact");
|
|
21
|
+
/**
|
|
22
|
+
* Default to one attempt — no retry — so existing callers (serialization,
|
|
23
|
+
* deploy) keep their current "fail fast on first error" semantics. Hot
|
|
24
|
+
* paths that benefit from retry (the recipe executor's parallel batched
|
|
25
|
+
* reads + applies) opt in via `retry: { maxAttempts: N }`. This keeps the
|
|
26
|
+
* shared transport's error-mapping tests stable while letting the recipe
|
|
27
|
+
* path get throttle-aware behavior for free.
|
|
28
|
+
*/
|
|
29
|
+
const DEFAULT_RETRY = {
|
|
30
|
+
maxAttempts: 1,
|
|
31
|
+
baseDelayMs: 500,
|
|
32
|
+
maxDelayMs: 15000,
|
|
33
|
+
retryableStatuses: new Set([408, 425, 429, 503]),
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Read-only callers can opt in to a broader retry set that includes
|
|
37
|
+
* ambiguous 5xx codes. Safe for GETs since reads are idempotent — a
|
|
38
|
+
* second fetch is harmless. Unsafe for mutations because 500/502/504
|
|
39
|
+
* may indicate the server processed the request but failed to respond,
|
|
40
|
+
* and retrying would create a duplicate.
|
|
41
|
+
*/
|
|
42
|
+
exports.READ_RETRYABLE_STATUSES = new Set([408, 425, 429, 500, 502, 503, 504]);
|
|
43
|
+
/** Sleep with abort-on-signal so a Ctrl-C during backoff still exits promptly. */
|
|
44
|
+
const sleep = (ms, signal) => new Promise((resolve, reject) => {
|
|
45
|
+
if (signal?.aborted) {
|
|
46
|
+
reject(new Error("aborted"));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const timer = setTimeout(() => {
|
|
50
|
+
signal?.removeEventListener("abort", onAbort);
|
|
51
|
+
resolve();
|
|
52
|
+
}, ms);
|
|
53
|
+
const onAbort = () => {
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
reject(new Error("aborted"));
|
|
56
|
+
};
|
|
57
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
58
|
+
});
|
|
59
|
+
const jitter = (n) => n * (0.5 + Math.random());
|
|
60
|
+
const computeBackoff = (attempt, cfg, retryAfterSeconds) => {
|
|
61
|
+
if (retryAfterSeconds && Number.isFinite(retryAfterSeconds) && retryAfterSeconds > 0) {
|
|
62
|
+
return Math.min(retryAfterSeconds * 1000, cfg.maxDelayMs);
|
|
63
|
+
}
|
|
64
|
+
const exp = cfg.baseDelayMs * 2 ** attempt;
|
|
65
|
+
return Math.min(jitter(exp), cfg.maxDelayMs);
|
|
66
|
+
};
|
|
67
|
+
const parseRetryAfter = (value) => {
|
|
68
|
+
if (!value)
|
|
69
|
+
return undefined;
|
|
70
|
+
const seconds = Number(value);
|
|
71
|
+
if (Number.isFinite(seconds))
|
|
72
|
+
return seconds;
|
|
73
|
+
const httpDate = Date.parse(value);
|
|
74
|
+
if (!Number.isNaN(httpDate)) {
|
|
75
|
+
return Math.max(0, (httpDate - Date.now()) / 1000);
|
|
76
|
+
}
|
|
77
|
+
return undefined;
|
|
78
|
+
};
|
|
79
|
+
const parseJsonIfPossible = async (response) => {
|
|
80
|
+
const text = await response.text();
|
|
81
|
+
if (!text) {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
return JSON.parse(text);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return text;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const normalizeHostUrl = (host) => {
|
|
92
|
+
const withScheme = host.startsWith("http://") || host.startsWith("https://") ? host : `https://${host}`;
|
|
93
|
+
return withScheme.endsWith("/") ? withScheme.slice(0, -1) : withScheme;
|
|
94
|
+
};
|
|
95
|
+
const runSitecoreGraphQL = async (environment, query, variables, transport, options) => {
|
|
96
|
+
if (!environment.host) {
|
|
97
|
+
throw (0, errors_1.createCliError)("Environment host is not configured.", "INPUT_INVALID", {
|
|
98
|
+
hint: "Set a CM host with 'scai init' or pass --host.",
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
const hostUrl = normalizeHostUrl(environment.host);
|
|
102
|
+
const url = `${hostUrl}${transport.servicePath}`;
|
|
103
|
+
const token = await transport.getAccessToken(environment);
|
|
104
|
+
if (transport.requireToken && !token) {
|
|
105
|
+
throw (0, errors_1.createCliError)(`Sitecore ${transport.label} API requires an access token.`, "AUTH_REQUIRED", { hint: "Run 'scai login' to authenticate." });
|
|
106
|
+
}
|
|
107
|
+
const retryCfg = {
|
|
108
|
+
...DEFAULT_RETRY,
|
|
109
|
+
...(options?.retry ?? {}),
|
|
110
|
+
};
|
|
111
|
+
const sendOnce = async () => {
|
|
112
|
+
const controller = options?.timeoutMs ? new AbortController() : undefined;
|
|
113
|
+
const timeout = controller
|
|
114
|
+
? setTimeout(() => controller.abort(), Math.max(options?.timeoutMs ?? 0, 0))
|
|
115
|
+
: undefined;
|
|
116
|
+
try {
|
|
117
|
+
const response = await fetch(url, {
|
|
118
|
+
method: "POST",
|
|
119
|
+
headers: {
|
|
120
|
+
"Content-Type": "application/json",
|
|
121
|
+
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
|
122
|
+
},
|
|
123
|
+
body: JSON.stringify({ query, variables }),
|
|
124
|
+
signal: controller?.signal,
|
|
125
|
+
});
|
|
126
|
+
if (!response.ok) {
|
|
127
|
+
const body = await parseJsonIfPossible(response);
|
|
128
|
+
const message = typeof body === "string"
|
|
129
|
+
? body
|
|
130
|
+
: body && typeof body === "object"
|
|
131
|
+
? JSON.stringify(body)
|
|
132
|
+
: undefined;
|
|
133
|
+
const httpError = new HttpError(response.status,
|
|
134
|
+
// Test mocks of `Response` may omit `headers`; defensive access
|
|
135
|
+
// avoids `Cannot read properties of undefined`. Production
|
|
136
|
+
// `fetch` always populates a `Headers` object.
|
|
137
|
+
parseRetryAfter(response.headers?.get?.("retry-after") ?? null), (0, redact_1.redactSecrets)(`Sitecore ${transport.label} API request failed (${response.status}).${message ? ` ${message}` : ""}`));
|
|
138
|
+
throw httpError;
|
|
139
|
+
}
|
|
140
|
+
const parsed = await parseJsonIfPossible(response);
|
|
141
|
+
if (!parsed || typeof parsed !== "object") {
|
|
142
|
+
throw (0, errors_1.createCliError)(`${transport.label} GraphQL response did not contain JSON data.`, "NETWORK");
|
|
143
|
+
}
|
|
144
|
+
const result = parsed;
|
|
145
|
+
if (result.errors?.length) {
|
|
146
|
+
const message = result.errors.map((error) => error.message).join("; ");
|
|
147
|
+
throw (0, errors_1.createCliError)((0, redact_1.redactSecrets)(`${transport.label} GraphQL errors: ${message}`), "NETWORK");
|
|
148
|
+
}
|
|
149
|
+
if (!result.data) {
|
|
150
|
+
throw (0, errors_1.createCliError)(`${transport.label} GraphQL response did not contain data.`, "NETWORK");
|
|
151
|
+
}
|
|
152
|
+
return result.data;
|
|
153
|
+
}
|
|
154
|
+
finally {
|
|
155
|
+
if (timeout)
|
|
156
|
+
clearTimeout(timeout);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
let lastError;
|
|
160
|
+
for (let attempt = 0; attempt < retryCfg.maxAttempts; attempt += 1) {
|
|
161
|
+
try {
|
|
162
|
+
return await sendOnce();
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
lastError = error;
|
|
166
|
+
if (error instanceof HttpError && retryCfg.retryableStatuses.has(error.status)) {
|
|
167
|
+
if (attempt < retryCfg.maxAttempts - 1) {
|
|
168
|
+
await sleep(computeBackoff(attempt, retryCfg, error.retryAfterSeconds));
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else if (error instanceof Error &&
|
|
173
|
+
error.name === "AbortError" &&
|
|
174
|
+
attempt < retryCfg.maxAttempts - 1 &&
|
|
175
|
+
// Honor explicit per-call timeoutMs as a hard cap — if the caller
|
|
176
|
+
// set one, an abort means "took longer than the budget", and
|
|
177
|
+
// silently retrying behind their back violates their intent.
|
|
178
|
+
// Without timeoutMs, an abort is most likely a transient
|
|
179
|
+
// upstream cancellation (proxy hiccup) — safe to retry.
|
|
180
|
+
options?.timeoutMs === undefined) {
|
|
181
|
+
await sleep(computeBackoff(attempt, retryCfg));
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
else if (
|
|
185
|
+
// `fetch` failures from network blips (DNS, ECONNRESET, EAI_AGAIN, etc.)
|
|
186
|
+
// surface as `TypeError: fetch failed` in Node's undici. Retry these.
|
|
187
|
+
error instanceof TypeError &&
|
|
188
|
+
attempt < retryCfg.maxAttempts - 1) {
|
|
189
|
+
await sleep(computeBackoff(attempt, retryCfg));
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Final mapping to CliError. HttpError → NETWORK; AbortError → timeout hint;
|
|
196
|
+
// everything else → generic NETWORK with the original message.
|
|
197
|
+
if (lastError instanceof HttpError) {
|
|
198
|
+
throw (0, errors_1.createCliError)(lastError.message, "NETWORK");
|
|
199
|
+
}
|
|
200
|
+
if (lastError instanceof Error && lastError.name === "AbortError") {
|
|
201
|
+
throw (0, errors_1.createCliError)(`Sitecore ${transport.label} API request timed out.`, "NETWORK", {
|
|
202
|
+
hint: "Increase settings.apiClientTimeoutInMinutes if needed.",
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
if (lastError instanceof Error) {
|
|
206
|
+
if ("code" in lastError && lastError.code) {
|
|
207
|
+
// Already a CliError-shaped object — re-throw as-is.
|
|
208
|
+
throw lastError;
|
|
209
|
+
}
|
|
210
|
+
throw (0, errors_1.createCliError)((0, redact_1.redactSecrets)(`Sitecore ${transport.label} API request failed: ${lastError.message}`), "NETWORK");
|
|
211
|
+
}
|
|
212
|
+
throw (0, errors_1.createCliError)((0, redact_1.redactSecrets)(`Sitecore ${transport.label} API request failed: ${String(lastError)}`), "NETWORK");
|
|
213
|
+
};
|
|
214
|
+
exports.runSitecoreGraphQL = runSitecoreGraphQL;
|
|
215
|
+
class HttpError extends Error {
|
|
216
|
+
constructor(status, retryAfterSeconds, message) {
|
|
217
|
+
super(message);
|
|
218
|
+
this.status = status;
|
|
219
|
+
this.retryAfterSeconds = retryAfterSeconds;
|
|
220
|
+
this.name = "HttpError";
|
|
221
|
+
}
|
|
222
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type HistoryEntry = {
|
|
2
|
+
event: "start" | "success" | "error";
|
|
3
|
+
command: string;
|
|
4
|
+
args: string[];
|
|
5
|
+
cwd: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
timestamp?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const recordHistory: (entry: HistoryEntry) => Promise<void>;
|
|
10
|
+
export declare const getHistoryPath: () => string;
|
|
11
|
+
export declare const ensureHistoryFile: () => Promise<void>;
|
|
12
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/shared/history.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAyBF,eAAO,MAAM,aAAa,GAAU,OAAO,YAAY,KAAG,OAAO,CAAC,IAAI,CAkBrE,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,MAA8B,CAAC;AAEjE,eAAO,MAAM,iBAAiB,QAAa,OAAO,CAAC,IAAI,CAUtD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ensureHistoryFile = exports.getHistoryPath = exports.recordHistory = void 0;
|
|
7
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
10
|
+
const consola_1 = require("consola");
|
|
11
|
+
const redact_1 = require("./redact");
|
|
12
|
+
const resolveHistoryPath = () => process.env.SITECOREAI_HISTORY_PATH ?? node_path_1.default.join(node_os_1.default.homedir(), ".sitecoreai", "cli-history.log");
|
|
13
|
+
const resolveMaxHistoryBytes = () => Math.max(0, Number(process.env.SITECOREAI_HISTORY_MAX_BYTES ?? 10 * 1024 * 1024));
|
|
14
|
+
const rotateIfNeeded = async (filePath) => {
|
|
15
|
+
const maxBytes = resolveMaxHistoryBytes();
|
|
16
|
+
if (maxBytes === 0) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const stats = await promises_1.default.stat(filePath);
|
|
21
|
+
if (stats.size < maxBytes) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const rotated = `${filePath}.${Date.now()}`;
|
|
25
|
+
await promises_1.default.rename(filePath, rotated);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// ignore rotation failures
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const recordHistory = async (entry) => {
|
|
32
|
+
const filePath = resolveHistoryPath();
|
|
33
|
+
const sanitizedArgs = (0, redact_1.redactArgs)(entry.args ?? []);
|
|
34
|
+
const payload = {
|
|
35
|
+
...entry,
|
|
36
|
+
args: sanitizedArgs,
|
|
37
|
+
error: entry.error ? (0, redact_1.redactSecrets)(entry.error) : undefined,
|
|
38
|
+
timestamp: entry.timestamp ?? new Date().toISOString(),
|
|
39
|
+
};
|
|
40
|
+
try {
|
|
41
|
+
await promises_1.default.mkdir(node_path_1.default.dirname(filePath), { recursive: true });
|
|
42
|
+
await rotateIfNeeded(filePath);
|
|
43
|
+
await promises_1.default.appendFile(filePath, `${JSON.stringify(payload)}\n`, "utf8");
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
consola_1.consola.debug(`Unable to write history log: ${error instanceof Error ? error.message : String(error)}`);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
exports.recordHistory = recordHistory;
|
|
50
|
+
const getHistoryPath = () => resolveHistoryPath();
|
|
51
|
+
exports.getHistoryPath = getHistoryPath;
|
|
52
|
+
const ensureHistoryFile = async () => {
|
|
53
|
+
const filePath = resolveHistoryPath();
|
|
54
|
+
try {
|
|
55
|
+
await promises_1.default.mkdir(node_path_1.default.dirname(filePath), { recursive: true });
|
|
56
|
+
await promises_1.default.appendFile(filePath, "", "utf8");
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
consola_1.consola.debug(`Unable to create history log: ${error instanceof Error ? error.message : String(error)}`);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.ensureHistoryFile = ensureHistoryFile;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type CmTokenBundle = {
|
|
2
|
+
accessToken?: string;
|
|
3
|
+
refreshToken?: string;
|
|
4
|
+
refreshTokenParameters?: Record<string, string>;
|
|
5
|
+
expiresIn?: number | null;
|
|
6
|
+
lastUpdated?: string | null;
|
|
7
|
+
};
|
|
8
|
+
export declare const getDeployToken: (envName: string) => Promise<string | undefined>;
|
|
9
|
+
export declare const setDeployToken: (envName: string, token: string) => Promise<boolean>;
|
|
10
|
+
export declare const clearDeployToken: (envName: string) => Promise<boolean>;
|
|
11
|
+
export declare const getCmTokens: (envName: string) => Promise<CmTokenBundle | undefined>;
|
|
12
|
+
export declare const setCmTokens: (envName: string, tokens: CmTokenBundle) => Promise<boolean>;
|
|
13
|
+
export declare const clearCmTokens: (envName: string) => Promise<boolean>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=keychain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../../src/shared/keychain.ts"],"names":[],"mappings":"AAUA,KAAK,aAAa,GAAG;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AA6DF,eAAO,MAAM,cAAc,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAchF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAU,SAAS,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CAYpF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAWvE,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAepF,CAAC;AAEF,eAAO,MAAM,WAAW,GAAU,SAAS,MAAM,EAAE,QAAQ,aAAa,KAAG,OAAO,CAAC,OAAO,CAgBzF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAWpE,CAAC"}
|