@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 @@
|
|
|
1
|
+
{"version":3,"file":"wildcard.d.ts","sourceRoot":"","sources":["../../src/serialization/wildcard.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,KAAG,OAM9C,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,OAAO,MAAM,EACb,WAAW,MAAM,EACjB,uBAAqB,KACpB,OAaF,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isWildcardMatch = exports.isWildcard = void 0;
|
|
4
|
+
const errors_1 = require("../shared/errors");
|
|
5
|
+
const isWildcard = (candidate) => {
|
|
6
|
+
if (candidate == null) {
|
|
7
|
+
throw (0, errors_1.createCliError)("Wildcard candidate is null or undefined.", "INPUT_INVALID");
|
|
8
|
+
}
|
|
9
|
+
return candidate.includes("*") || candidate.includes("?");
|
|
10
|
+
};
|
|
11
|
+
exports.isWildcard = isWildcard;
|
|
12
|
+
const isWildcardMatch = (input, wildcards, caseSensitive = false) => {
|
|
13
|
+
if (input == null) {
|
|
14
|
+
throw (0, errors_1.createCliError)("Input is null or undefined.", "INPUT_INVALID");
|
|
15
|
+
}
|
|
16
|
+
if ((0, exports.isWildcard)(wildcards)) {
|
|
17
|
+
const escaped = wildcards.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
18
|
+
const regex = "^" + escaped.replace(/\\\*/g, ".*").replace(/\\\?/g, ".") + "$";
|
|
19
|
+
const flags = caseSensitive ? "" : "i";
|
|
20
|
+
return new RegExp(regex, flags).test(input);
|
|
21
|
+
}
|
|
22
|
+
return caseSensitive ? input === wildcards : input.toLowerCase() === wildcards.toLowerCase();
|
|
23
|
+
};
|
|
24
|
+
exports.isWildcardMatch = isWildcardMatch;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ItemData, RoleData, UserData } from "./types";
|
|
2
|
+
export declare const readItemYamlFromString: (content: string) => ItemData;
|
|
3
|
+
export declare const readItemYaml: (filePath: string) => Promise<ItemData>;
|
|
4
|
+
export declare const writeItemYaml: (item: ItemData) => string;
|
|
5
|
+
export declare const writeRoleYaml: (role: RoleData) => string;
|
|
6
|
+
export declare const readRoleYamlFromString: (content: string, serializedItemId?: string) => RoleData;
|
|
7
|
+
export declare const readUserYamlFromString: (content: string, serializedItemId?: string) => UserData;
|
|
8
|
+
export declare const writeUserYaml: (user: UserData) => string;
|
|
9
|
+
//# sourceMappingURL=yaml.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../src/serialization/yaml.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EAIR,QAAQ,EACR,QAAQ,EAET,MAAM,SAAS,CAAC;AAkHjB,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,KAAG,QA8BxD,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,QAAQ,CAGrE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,QAAQ,KAAG,MA4F9C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,QAAQ,KAAG,MAe9C,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,EAAE,mBAAmB,MAAM,KAAG,QAUnF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,EAAE,mBAAmB,MAAM,KAAG,QA+BnF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,QAAQ,KAAG,MAmC9C,CAAC"}
|
|
@@ -0,0 +1,307 @@
|
|
|
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.writeUserYaml = exports.readUserYamlFromString = exports.readRoleYamlFromString = exports.writeRoleYaml = exports.writeItemYaml = exports.readItemYaml = exports.readItemYamlFromString = void 0;
|
|
7
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
8
|
+
const yaml_1 = __importDefault(require("yaml"));
|
|
9
|
+
const errors_1 = require("../shared/errors");
|
|
10
|
+
const item_path_1 = require("./item-path");
|
|
11
|
+
const signature_1 = require("./signature");
|
|
12
|
+
class YamlWriter {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.indent = 0;
|
|
15
|
+
this.chunks = [];
|
|
16
|
+
}
|
|
17
|
+
writeBeginNewDocument() {
|
|
18
|
+
this.chunks.push("---\n");
|
|
19
|
+
}
|
|
20
|
+
increaseIndent() {
|
|
21
|
+
this.indent += YamlWriter.indentSpaces;
|
|
22
|
+
}
|
|
23
|
+
decreaseIndent() {
|
|
24
|
+
this.indent = Math.max(0, this.indent - YamlWriter.indentSpaces);
|
|
25
|
+
}
|
|
26
|
+
writeMap(key, value) {
|
|
27
|
+
const prefix = " ".repeat(this.indent);
|
|
28
|
+
if (value === undefined) {
|
|
29
|
+
this.chunks.push(`${prefix}${key}:\n`);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (value.includes("\n") ||
|
|
33
|
+
value.includes("\r") ||
|
|
34
|
+
value.includes('"') ||
|
|
35
|
+
value.includes("\\")) {
|
|
36
|
+
this.chunks.push(`${prefix}${key}: |\n`);
|
|
37
|
+
const indented = value
|
|
38
|
+
.split(/\r\n|\r|\n/)
|
|
39
|
+
.map((line) => " ".repeat(this.indent + YamlWriter.indentSpaces) + line)
|
|
40
|
+
.join("\n");
|
|
41
|
+
this.chunks.push(indented + "\n");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const specialChars = ['"', ":", "[", "]", "{", "}", "!", "?", "-", "\\"];
|
|
45
|
+
const encoded = specialChars.some((char) => value.includes(char))
|
|
46
|
+
? `"${value.replace(/"/g, '\\"')}"`
|
|
47
|
+
: value;
|
|
48
|
+
this.chunks.push(`${prefix}${key}: ${encoded}\n`);
|
|
49
|
+
}
|
|
50
|
+
writeBeginListItem(key, value) {
|
|
51
|
+
if (this.indent < YamlWriter.indentSpaces) {
|
|
52
|
+
throw (0, errors_1.createCliError)("Indent is at minimum. You must indent to support a list.", "UNKNOWN");
|
|
53
|
+
}
|
|
54
|
+
const prefix = " ".repeat(this.indent - YamlWriter.indentSpaces);
|
|
55
|
+
this.chunks.push(`${prefix}- ${key}: ${value}\n`);
|
|
56
|
+
}
|
|
57
|
+
toString() {
|
|
58
|
+
return this.chunks.join("");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
YamlWriter.indentSpaces = 2;
|
|
62
|
+
const normalizeField = (field) => ({
|
|
63
|
+
fieldId: field.fieldId ?? "",
|
|
64
|
+
nameHint: field.nameHint,
|
|
65
|
+
value: field.value ?? "",
|
|
66
|
+
blobId: field.blobId ?? null,
|
|
67
|
+
});
|
|
68
|
+
const parseItemFields = (fields) => {
|
|
69
|
+
if (!Array.isArray(fields)) {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
return fields.map((entry) => normalizeField({
|
|
73
|
+
fieldId: String(entry["ID"] ?? ""),
|
|
74
|
+
nameHint: entry["Hint"],
|
|
75
|
+
value: String(entry["Value"] ?? ""),
|
|
76
|
+
blobId: entry["BlobID"],
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
const parseLanguages = (languages) => {
|
|
80
|
+
if (!Array.isArray(languages)) {
|
|
81
|
+
return { unversioned: [], versions: [] };
|
|
82
|
+
}
|
|
83
|
+
const unversioned = [];
|
|
84
|
+
const versions = [];
|
|
85
|
+
for (const entry of languages) {
|
|
86
|
+
const language = String(entry["Language"] ?? "");
|
|
87
|
+
const fields = parseItemFields(entry["Fields"]);
|
|
88
|
+
if (fields.length > 0) {
|
|
89
|
+
unversioned.push({ language, fields });
|
|
90
|
+
}
|
|
91
|
+
const versionEntries = entry["Versions"];
|
|
92
|
+
if (Array.isArray(versionEntries)) {
|
|
93
|
+
for (const versionEntry of versionEntries) {
|
|
94
|
+
const versionNumber = Number(versionEntry["Version"] ?? 0);
|
|
95
|
+
const versionFields = parseItemFields(versionEntry["Fields"]);
|
|
96
|
+
versions.push({ language, version: versionNumber, fields: versionFields });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return { unversioned, versions };
|
|
101
|
+
};
|
|
102
|
+
const readItemYamlFromString = (content) => {
|
|
103
|
+
const doc = yaml_1.default.parse(content);
|
|
104
|
+
const id = String(doc["ID"] ?? "");
|
|
105
|
+
const parentId = String(doc["Parent"] ?? "");
|
|
106
|
+
const templateId = String(doc["Template"] ?? "");
|
|
107
|
+
const pathValue = String(doc["Path"] ?? "");
|
|
108
|
+
const branchId = doc["BranchID"] ? String(doc["BranchID"]) : null;
|
|
109
|
+
const sharedFields = parseItemFields(doc["SharedFields"]);
|
|
110
|
+
const { unversioned, versions } = parseLanguages(doc["Languages"]);
|
|
111
|
+
const database = doc["DB"] ? String(doc["DB"]) : undefined;
|
|
112
|
+
const itemPath = item_path_1.ItemPath.fromPathString(pathValue);
|
|
113
|
+
const item = {
|
|
114
|
+
id,
|
|
115
|
+
parentId,
|
|
116
|
+
templateId,
|
|
117
|
+
path: itemPath,
|
|
118
|
+
dataSignature: "",
|
|
119
|
+
name: itemPath.itemName ?? "",
|
|
120
|
+
database,
|
|
121
|
+
branchId,
|
|
122
|
+
sharedFields,
|
|
123
|
+
unversionedFields: unversioned,
|
|
124
|
+
versions,
|
|
125
|
+
};
|
|
126
|
+
const signatureBase = (0, signature_1.createDataSignatureBase)(item);
|
|
127
|
+
item.dataSignature = (0, signature_1.createSignature)(signatureBase) ?? "";
|
|
128
|
+
return item;
|
|
129
|
+
};
|
|
130
|
+
exports.readItemYamlFromString = readItemYamlFromString;
|
|
131
|
+
const readItemYaml = async (filePath) => {
|
|
132
|
+
const content = await promises_1.default.readFile(filePath, "utf8");
|
|
133
|
+
return (0, exports.readItemYamlFromString)(content);
|
|
134
|
+
};
|
|
135
|
+
exports.readItemYaml = readItemYaml;
|
|
136
|
+
const writeItemYaml = (item) => {
|
|
137
|
+
const writer = new YamlWriter();
|
|
138
|
+
writer.writeBeginNewDocument();
|
|
139
|
+
writer.writeMap("ID", item.id);
|
|
140
|
+
writer.writeMap("Parent", item.parentId);
|
|
141
|
+
writer.writeMap("Template", item.templateId);
|
|
142
|
+
writer.writeMap("Path", item.path.toPathString());
|
|
143
|
+
if (item.branchId) {
|
|
144
|
+
writer.writeMap("BranchID", item.branchId);
|
|
145
|
+
}
|
|
146
|
+
if (item.sharedFields.length > 0) {
|
|
147
|
+
writer.writeMap("SharedFields");
|
|
148
|
+
writer.increaseIndent();
|
|
149
|
+
const fields = [...item.sharedFields].sort((a, b) => a.fieldId.localeCompare(b.fieldId));
|
|
150
|
+
for (const field of fields) {
|
|
151
|
+
writer.writeBeginListItem("ID", field.fieldId);
|
|
152
|
+
writer.writeMap("Hint", field.nameHint ?? undefined);
|
|
153
|
+
if (field.blobId) {
|
|
154
|
+
writer.writeMap("BlobID", field.blobId);
|
|
155
|
+
}
|
|
156
|
+
writer.writeMap("Value", field.value ?? "");
|
|
157
|
+
}
|
|
158
|
+
writer.decreaseIndent();
|
|
159
|
+
}
|
|
160
|
+
if (item.unversionedFields.length > 0 || item.versions.length > 0) {
|
|
161
|
+
writer.writeMap("Languages");
|
|
162
|
+
writer.increaseIndent();
|
|
163
|
+
const languages = [...item.unversionedFields].map((language) => language.language);
|
|
164
|
+
for (const version of item.versions) {
|
|
165
|
+
if (!languages.includes(version.language)) {
|
|
166
|
+
languages.push(version.language);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
languages.sort((a, b) => a.localeCompare(b));
|
|
170
|
+
for (const language of languages) {
|
|
171
|
+
const unversioned = item.unversionedFields.find((entry) => entry.language === language);
|
|
172
|
+
const languageVersions = item.versions
|
|
173
|
+
.filter((entry) => entry.language === language)
|
|
174
|
+
.sort((a, b) => a.version - b.version);
|
|
175
|
+
writer.writeBeginListItem("Language", language);
|
|
176
|
+
if (unversioned && unversioned.fields.length > 0) {
|
|
177
|
+
writer.writeMap("Fields");
|
|
178
|
+
writer.increaseIndent();
|
|
179
|
+
for (const field of unversioned.fields.sort((a, b) => a.fieldId.localeCompare(b.fieldId))) {
|
|
180
|
+
writer.writeBeginListItem("ID", field.fieldId);
|
|
181
|
+
if (field.nameHint) {
|
|
182
|
+
writer.writeMap("Hint", field.nameHint);
|
|
183
|
+
}
|
|
184
|
+
if (field.blobId) {
|
|
185
|
+
writer.writeMap("BlobID", field.blobId);
|
|
186
|
+
}
|
|
187
|
+
writer.writeMap("Value", field.value ?? "");
|
|
188
|
+
}
|
|
189
|
+
writer.decreaseIndent();
|
|
190
|
+
}
|
|
191
|
+
writer.writeMap("Versions");
|
|
192
|
+
writer.increaseIndent();
|
|
193
|
+
for (const version of languageVersions) {
|
|
194
|
+
writer.writeBeginListItem("Version", version.version.toString());
|
|
195
|
+
if (version.fields.length > 0) {
|
|
196
|
+
writer.writeMap("Fields");
|
|
197
|
+
writer.increaseIndent();
|
|
198
|
+
for (const field of version.fields.sort((a, b) => a.fieldId.localeCompare(b.fieldId))) {
|
|
199
|
+
writer.writeBeginListItem("ID", field.fieldId);
|
|
200
|
+
if (field.nameHint) {
|
|
201
|
+
writer.writeMap("Hint", field.nameHint);
|
|
202
|
+
}
|
|
203
|
+
if (field.blobId) {
|
|
204
|
+
writer.writeMap("BlobID", field.blobId);
|
|
205
|
+
}
|
|
206
|
+
writer.writeMap("Value", field.value ?? "");
|
|
207
|
+
}
|
|
208
|
+
writer.decreaseIndent();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
writer.decreaseIndent();
|
|
212
|
+
}
|
|
213
|
+
writer.decreaseIndent();
|
|
214
|
+
}
|
|
215
|
+
if (item.database) {
|
|
216
|
+
writer.writeMap("DB", item.database);
|
|
217
|
+
}
|
|
218
|
+
return writer.toString();
|
|
219
|
+
};
|
|
220
|
+
exports.writeItemYaml = writeItemYaml;
|
|
221
|
+
const writeRoleYaml = (role) => {
|
|
222
|
+
const writer = new YamlWriter();
|
|
223
|
+
writer.writeBeginNewDocument();
|
|
224
|
+
writer.writeMap("Role", role.roleName);
|
|
225
|
+
if (role.memberOfRoles.length > 0) {
|
|
226
|
+
writer.writeMap("MemberOf");
|
|
227
|
+
writer.increaseIndent();
|
|
228
|
+
for (const member of role.memberOfRoles) {
|
|
229
|
+
writer.writeBeginListItem("Role", member);
|
|
230
|
+
}
|
|
231
|
+
writer.decreaseIndent();
|
|
232
|
+
}
|
|
233
|
+
return writer.toString();
|
|
234
|
+
};
|
|
235
|
+
exports.writeRoleYaml = writeRoleYaml;
|
|
236
|
+
const readRoleYamlFromString = (content, serializedItemId) => {
|
|
237
|
+
const doc = yaml_1.default.parse(content);
|
|
238
|
+
const roleName = String(doc["Role"] ?? "");
|
|
239
|
+
const memberOf = Array.isArray(doc["MemberOf"])
|
|
240
|
+
? doc["MemberOf"].map((entry) => String(entry["Role"] ?? entry ?? ""))
|
|
241
|
+
: [];
|
|
242
|
+
return { roleName, memberOfRoles: memberOf, serializedItemId };
|
|
243
|
+
};
|
|
244
|
+
exports.readRoleYamlFromString = readRoleYamlFromString;
|
|
245
|
+
const readUserYamlFromString = (content, serializedItemId) => {
|
|
246
|
+
const doc = yaml_1.default.parse(content);
|
|
247
|
+
const roles = Array.isArray(doc["Roles"])
|
|
248
|
+
? doc["Roles"].map((entry) => String(entry["MemberOf"] ?? entry ?? ""))
|
|
249
|
+
: [];
|
|
250
|
+
const properties = [];
|
|
251
|
+
if (Array.isArray(doc["Properties"])) {
|
|
252
|
+
for (const entry of doc["Properties"]) {
|
|
253
|
+
const record = entry;
|
|
254
|
+
properties.push({
|
|
255
|
+
name: String(record["Key"] ?? ""),
|
|
256
|
+
content: String(record["Value"] ?? ""),
|
|
257
|
+
contentType: String(record["ValueType"] ?? ""),
|
|
258
|
+
isCustomProperty: Boolean(record["IsCustomProperty"]),
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return {
|
|
263
|
+
userName: String(doc["UserName"] ?? ""),
|
|
264
|
+
email: doc["Email"] ? String(doc["Email"]) : undefined,
|
|
265
|
+
comment: doc["Comment"] ? String(doc["Comment"]) : undefined,
|
|
266
|
+
creationDate: String(doc["Created"] ?? ""),
|
|
267
|
+
isApproved: String(doc["IsApproved"] ?? "false").toLowerCase() === "true",
|
|
268
|
+
roles,
|
|
269
|
+
profileProperties: properties,
|
|
270
|
+
serializedItemId,
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
exports.readUserYamlFromString = readUserYamlFromString;
|
|
274
|
+
const writeUserYaml = (user) => {
|
|
275
|
+
const writer = new YamlWriter();
|
|
276
|
+
writer.writeBeginNewDocument();
|
|
277
|
+
writer.writeMap("UserName", user.userName);
|
|
278
|
+
if (user.email) {
|
|
279
|
+
writer.writeMap("Email", user.email);
|
|
280
|
+
}
|
|
281
|
+
if (user.comment) {
|
|
282
|
+
writer.writeMap("Comment", user.comment);
|
|
283
|
+
}
|
|
284
|
+
writer.writeMap("Created", user.creationDate);
|
|
285
|
+
writer.writeMap("IsApproved", user.isApproved ? "true" : "false");
|
|
286
|
+
if (user.profileProperties.length > 0) {
|
|
287
|
+
writer.writeMap("Properties");
|
|
288
|
+
writer.increaseIndent();
|
|
289
|
+
for (const property of user.profileProperties) {
|
|
290
|
+
writer.writeBeginListItem("Key", property.name);
|
|
291
|
+
writer.writeMap("Value", property.content);
|
|
292
|
+
writer.writeMap("ValueType", property.contentType);
|
|
293
|
+
writer.writeMap("IsCustomProperty", property.isCustomProperty ? "true" : "false");
|
|
294
|
+
}
|
|
295
|
+
writer.decreaseIndent();
|
|
296
|
+
}
|
|
297
|
+
if (user.roles.length > 0) {
|
|
298
|
+
writer.writeMap("Roles");
|
|
299
|
+
writer.increaseIndent();
|
|
300
|
+
for (const role of user.roles) {
|
|
301
|
+
writer.writeBeginListItem("MemberOf", role);
|
|
302
|
+
}
|
|
303
|
+
writer.decreaseIndent();
|
|
304
|
+
}
|
|
305
|
+
return writer.toString();
|
|
306
|
+
};
|
|
307
|
+
exports.writeUserYaml = writeUserYaml;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/shared/browser.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,OA2BzC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openBrowser = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const openBrowser = (url) => {
|
|
6
|
+
try {
|
|
7
|
+
let command = "";
|
|
8
|
+
let args = [];
|
|
9
|
+
let shell = false;
|
|
10
|
+
if (process.platform === "darwin") {
|
|
11
|
+
command = "open";
|
|
12
|
+
args = [url];
|
|
13
|
+
}
|
|
14
|
+
else if (process.platform === "win32") {
|
|
15
|
+
command = "cmd";
|
|
16
|
+
args = ["/c", "start", "", url];
|
|
17
|
+
shell = true;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
command = "xdg-open";
|
|
21
|
+
args = [url];
|
|
22
|
+
}
|
|
23
|
+
const child = (0, node_child_process_1.spawn)(command, args, {
|
|
24
|
+
stdio: "ignore",
|
|
25
|
+
detached: true,
|
|
26
|
+
shell,
|
|
27
|
+
windowsHide: true,
|
|
28
|
+
});
|
|
29
|
+
child.unref();
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.openBrowser = openBrowser;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Neutral CLI option types shared across every command family
|
|
3
|
+
* (serialization, deploy, recipe, env). Family-specific option
|
|
4
|
+
* shapes live next to their tasks (`src/deploy/tasks/types.ts`,
|
|
5
|
+
* `src/serialization/tasks/types.ts`, etc.) and extend `CommonOptions`.
|
|
6
|
+
*/
|
|
7
|
+
export type CommonOptions = {
|
|
8
|
+
config?: string;
|
|
9
|
+
include?: string[];
|
|
10
|
+
exclude?: string[];
|
|
11
|
+
verbose?: boolean;
|
|
12
|
+
trace?: boolean;
|
|
13
|
+
json?: boolean;
|
|
14
|
+
quiet?: boolean;
|
|
15
|
+
logFile?: string;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=cli-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-options.d.ts","sourceRoot":"","sources":["../../src/shared/cli-options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Neutral CLI option types shared across every command family
|
|
4
|
+
* (serialization, deploy, recipe, env). Family-specific option
|
|
5
|
+
* shapes live next to their tasks (`src/deploy/tasks/types.ts`,
|
|
6
|
+
* `src/serialization/tasks/types.ts`, etc.) and extend `CommonOptions`.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Neutral helpers shared across every CLI task family. Anything
|
|
3
|
+
* deploy-specific belongs in `src/deploy/tasks/shared.ts`; anything
|
|
4
|
+
* serialization-specific belongs in `src/serialization/tasks/shared.ts`.
|
|
5
|
+
*/
|
|
6
|
+
import type { RootConfiguration } from "../config";
|
|
7
|
+
import { Logger } from "../shared/logger";
|
|
8
|
+
import type { CommonOptions } from "./cli-options";
|
|
9
|
+
export declare const toLogger: (options: CommonOptions) => Logger;
|
|
10
|
+
export declare const applyIfDefined: <T>(target: T, key: keyof T, value: T[keyof T] | undefined) => void;
|
|
11
|
+
export declare const inputError: (message: string, hint?: string) => Error;
|
|
12
|
+
export declare const confirmDestructive: (message: string, force?: boolean) => Promise<boolean>;
|
|
13
|
+
export declare const selectMatch: <T extends {
|
|
14
|
+
id?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
projectId?: string;
|
|
17
|
+
environmentId?: string;
|
|
18
|
+
}>(list: T[], label: string, selection?: string) => T;
|
|
19
|
+
export declare const selectFromList: <T extends {
|
|
20
|
+
id?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
projectId?: string;
|
|
23
|
+
environmentId?: string;
|
|
24
|
+
}>(logger: Logger, label: string, list: T[]) => Promise<T>;
|
|
25
|
+
export declare const resolveApiTimeoutMs: (root: RootConfiguration) => number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* `Promise.all`-style fan-out, but with a concurrency cap. Use this when
|
|
28
|
+
* mapping over an unbounded list (recipe files, environment fetches,
|
|
29
|
+
* etc.) where `Promise.all(items.map(fn))` would race N parallel
|
|
30
|
+
* I/O calls — fine for small N, a footgun for workspaces with hundreds
|
|
31
|
+
* of items. Order of the returned array matches the input order.
|
|
32
|
+
*
|
|
33
|
+
* Defaults to 8: enough to saturate the file-system on a normal laptop,
|
|
34
|
+
* conservative enough not to thrash a slow disk or thunder-herd a remote
|
|
35
|
+
* API. Pass a lower limit when each task hits the same upstream.
|
|
36
|
+
*/
|
|
37
|
+
export declare const mapWithConcurrency: <T, R>(items: readonly T[], fn: (item: T, index: number) => Promise<R>, concurrency?: number) => Promise<R[]>;
|
|
38
|
+
//# sourceMappingURL=cli-tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-tasks.d.ts","sourceRoot":"","sources":["../../src/shared/cli-tasks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,eAAO,MAAM,QAAQ,GAAI,SAAS,aAAa,KAAG,MASjD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,QAAQ,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,KAAG,IAI1F,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,KAAG,KACI,CAAC;AAEjE,eAAO,MAAM,kBAAkB,GAAU,SAAS,MAAM,EAAE,QAAQ,OAAO,KAAG,OAAO,CAAC,OAAO,CAU1F,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,CAAC,SAAS;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,EAEpF,MAAM,CAAC,EAAE,EACT,OAAO,MAAM,EACb,YAAY,MAAM,KACjB,CAsBF,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,CAAC,SAAS;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,EAEpF,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,MAAM,CAAC,EAAE,KACR,OAAO,CAAC,CAAC,CAgBX,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,MAAM,iBAAiB,KAAG,MAAM,GAAG,SAMtE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAU,CAAC,EAAE,CAAC,EAC3C,OAAO,SAAS,CAAC,EAAE,EACnB,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,EAC1C,oBAAe,KACd,OAAO,CAAC,CAAC,EAAE,CAcb,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Neutral helpers shared across every CLI task family. Anything
|
|
4
|
+
* deploy-specific belongs in `src/deploy/tasks/shared.ts`; anything
|
|
5
|
+
* serialization-specific belongs in `src/serialization/tasks/shared.ts`.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.mapWithConcurrency = exports.resolveApiTimeoutMs = exports.selectFromList = exports.selectMatch = exports.confirmDestructive = exports.inputError = exports.applyIfDefined = exports.toLogger = void 0;
|
|
9
|
+
const logger_1 = require("../shared/logger");
|
|
10
|
+
const prompt_1 = require("../shared/prompt");
|
|
11
|
+
const errors_1 = require("../shared/errors");
|
|
12
|
+
const toLogger = (options) => {
|
|
13
|
+
const logFile = options.logFile ?? process.env.SITECOREAI_LOG_FILE;
|
|
14
|
+
return new logger_1.Logger(Boolean(options.verbose), Boolean(options.trace), Boolean(options.json), Boolean(options.quiet), logFile);
|
|
15
|
+
};
|
|
16
|
+
exports.toLogger = toLogger;
|
|
17
|
+
const applyIfDefined = (target, key, value) => {
|
|
18
|
+
if (value !== undefined) {
|
|
19
|
+
target[key] = value;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.applyIfDefined = applyIfDefined;
|
|
23
|
+
const inputError = (message, hint) => (0, errors_1.createCliError)(message, "INPUT_INVALID", hint ? { hint } : {});
|
|
24
|
+
exports.inputError = inputError;
|
|
25
|
+
const confirmDestructive = async (message, force) => {
|
|
26
|
+
if (force) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
30
|
+
throw (0, errors_1.createCliError)("Confirmation required for destructive action.", "INPUT_INVALID", {
|
|
31
|
+
hint: "Re-run with --force to skip the confirmation prompt.",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return (0, prompt_1.promptConfirm)(message, false);
|
|
35
|
+
};
|
|
36
|
+
exports.confirmDestructive = confirmDestructive;
|
|
37
|
+
const selectMatch = (list, label, selection) => {
|
|
38
|
+
if (!selection) {
|
|
39
|
+
if (list.length === 1) {
|
|
40
|
+
return list[0];
|
|
41
|
+
}
|
|
42
|
+
throw (0, exports.inputError)(`${label} must be specified when multiple results are available: ${list
|
|
43
|
+
.map((item) => item.name ?? item.id ?? item.projectId ?? item.environmentId ?? "(unknown)")
|
|
44
|
+
.join(", ")}`);
|
|
45
|
+
}
|
|
46
|
+
const match = list.find((item) => item.id === selection ||
|
|
47
|
+
item.projectId === selection ||
|
|
48
|
+
item.environmentId === selection ||
|
|
49
|
+
(item.name && item.name.toLowerCase() === selection.toLowerCase()));
|
|
50
|
+
if (!match) {
|
|
51
|
+
throw (0, exports.inputError)(`${label} '${selection}' was not found.`);
|
|
52
|
+
}
|
|
53
|
+
return match;
|
|
54
|
+
};
|
|
55
|
+
exports.selectMatch = selectMatch;
|
|
56
|
+
const selectFromList = async (logger, label, list) => {
|
|
57
|
+
if (list.length === 1) {
|
|
58
|
+
return list[0];
|
|
59
|
+
}
|
|
60
|
+
logger.info(`${label} choices:`, "cyan");
|
|
61
|
+
list.forEach((item, index) => {
|
|
62
|
+
const id = item.id ?? item.projectId ?? item.environmentId ?? "-";
|
|
63
|
+
const name = item.name ?? id;
|
|
64
|
+
logger.info(` ${index + 1}) ${name} (${id})`);
|
|
65
|
+
});
|
|
66
|
+
const selection = await (0, prompt_1.promptText)(`${label} (number or id/name)`);
|
|
67
|
+
const index = Number(selection);
|
|
68
|
+
if (!Number.isNaN(index) && index >= 1 && index <= list.length) {
|
|
69
|
+
return list[index - 1];
|
|
70
|
+
}
|
|
71
|
+
return (0, exports.selectMatch)(list, label, selection);
|
|
72
|
+
};
|
|
73
|
+
exports.selectFromList = selectFromList;
|
|
74
|
+
const resolveApiTimeoutMs = (root) => {
|
|
75
|
+
const minutes = root.settings.apiClientTimeoutInMinutes;
|
|
76
|
+
if (!Number.isFinite(minutes) || minutes <= 0) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
return minutes * 60 * 1000;
|
|
80
|
+
};
|
|
81
|
+
exports.resolveApiTimeoutMs = resolveApiTimeoutMs;
|
|
82
|
+
/**
|
|
83
|
+
* `Promise.all`-style fan-out, but with a concurrency cap. Use this when
|
|
84
|
+
* mapping over an unbounded list (recipe files, environment fetches,
|
|
85
|
+
* etc.) where `Promise.all(items.map(fn))` would race N parallel
|
|
86
|
+
* I/O calls — fine for small N, a footgun for workspaces with hundreds
|
|
87
|
+
* of items. Order of the returned array matches the input order.
|
|
88
|
+
*
|
|
89
|
+
* Defaults to 8: enough to saturate the file-system on a normal laptop,
|
|
90
|
+
* conservative enough not to thrash a slow disk or thunder-herd a remote
|
|
91
|
+
* API. Pass a lower limit when each task hits the same upstream.
|
|
92
|
+
*/
|
|
93
|
+
const mapWithConcurrency = async (items, fn, concurrency = 8) => {
|
|
94
|
+
const results = new Array(items.length);
|
|
95
|
+
let cursor = 0;
|
|
96
|
+
const workers = Array.from({ length: Math.min(concurrency, items.length) }, async () => {
|
|
97
|
+
while (true) {
|
|
98
|
+
const index = cursor++;
|
|
99
|
+
if (index >= items.length) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
results[index] = await fn(items[index], index);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
await Promise.all(workers);
|
|
106
|
+
return results;
|
|
107
|
+
};
|
|
108
|
+
exports.mapWithConcurrency = mapWithConcurrency;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const SCHEMA_BASE_URL = "https://schemas.sitecoreai.dev/v1";
|
|
2
|
+
export declare const DEFAULT_CONFIG: {
|
|
3
|
+
$schema: string;
|
|
4
|
+
modules: string[];
|
|
5
|
+
recipes: string[];
|
|
6
|
+
serialization: {
|
|
7
|
+
defaultMaxRelativeItemPathLength: number;
|
|
8
|
+
defaultModuleRelativeSerializationPath: string;
|
|
9
|
+
removeOrphansForRoles: boolean;
|
|
10
|
+
removeOrphansForUsers: boolean;
|
|
11
|
+
continueOnItemFailure: boolean;
|
|
12
|
+
excludedFields: never[];
|
|
13
|
+
};
|
|
14
|
+
settings: {
|
|
15
|
+
cacheAuthenticationToken: boolean;
|
|
16
|
+
versionComparisonEnabled: boolean;
|
|
17
|
+
apiClientTimeoutInMinutes: number;
|
|
18
|
+
};
|
|
19
|
+
envProfiles: {};
|
|
20
|
+
};
|
|
21
|
+
export declare const resolveTargetPath: (value?: string) => string;
|
|
22
|
+
export declare const writeConfigTemplate: (targetPath: string) => void;
|
|
23
|
+
//# sourceMappingURL=config-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-template.d.ts","sourceRoot":"","sources":["../../src/shared/config-template.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,sCAAsC,CAAC;AAEnE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;CAkB1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,MAGlD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,YAAY,MAAM,KAAG,IAGxD,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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.writeConfigTemplate = exports.resolveTargetPath = exports.DEFAULT_CONFIG = exports.SCHEMA_BASE_URL = void 0;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
exports.SCHEMA_BASE_URL = "https://schemas.sitecoreai.dev/v1";
|
|
10
|
+
exports.DEFAULT_CONFIG = {
|
|
11
|
+
$schema: `${exports.SCHEMA_BASE_URL}/sitecoreai.cli.json`,
|
|
12
|
+
modules: ["./**/*.module.json"],
|
|
13
|
+
recipes: ["recipes/**/*.recipe.ts"],
|
|
14
|
+
serialization: {
|
|
15
|
+
defaultMaxRelativeItemPathLength: 120,
|
|
16
|
+
defaultModuleRelativeSerializationPath: "serialization",
|
|
17
|
+
removeOrphansForRoles: true,
|
|
18
|
+
removeOrphansForUsers: true,
|
|
19
|
+
continueOnItemFailure: false,
|
|
20
|
+
excludedFields: [],
|
|
21
|
+
},
|
|
22
|
+
settings: {
|
|
23
|
+
cacheAuthenticationToken: true,
|
|
24
|
+
versionComparisonEnabled: true,
|
|
25
|
+
apiClientTimeoutInMinutes: 5,
|
|
26
|
+
},
|
|
27
|
+
envProfiles: {},
|
|
28
|
+
};
|
|
29
|
+
const resolveTargetPath = (value) => {
|
|
30
|
+
const target = value ? node_path_1.default.resolve(value) : process.cwd();
|
|
31
|
+
return node_path_1.default.extname(target) === ".json" ? target : node_path_1.default.join(target, "sitecoreai.cli.json");
|
|
32
|
+
};
|
|
33
|
+
exports.resolveTargetPath = resolveTargetPath;
|
|
34
|
+
const writeConfigTemplate = (targetPath) => {
|
|
35
|
+
node_fs_1.default.mkdirSync(node_path_1.default.dirname(targetPath), { recursive: true });
|
|
36
|
+
node_fs_1.default.writeFileSync(targetPath, JSON.stringify(exports.DEFAULT_CONFIG, null, 2), "utf8");
|
|
37
|
+
};
|
|
38
|
+
exports.writeConfigTemplate = writeConfigTemplate;
|