@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,5 @@
|
|
|
1
|
+
import { readRootConfiguration, SerializationModuleConfiguration } from "../../config";
|
|
2
|
+
import { Logger } from "../../shared/logger";
|
|
3
|
+
export declare const syncUsersPull: (root: ReturnType<typeof readRootConfiguration>, module: SerializationModuleConfiguration, environmentName: string, logger: Logger) => Promise<void>;
|
|
4
|
+
export declare const syncUsersPush: (root: ReturnType<typeof readRootConfiguration>, module: SerializationModuleConfiguration, environmentName: string, logger: Logger) => Promise<void>;
|
|
5
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/serialization/tasks/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAmCzC,eAAO,MAAM,aAAa,GACxB,MAAM,UAAU,CAAC,OAAO,qBAAqB,CAAC,EAC9C,QAAQ,gCAAgC,EACxC,iBAAiB,MAAM,EACvB,QAAQ,MAAM,KACb,OAAO,CAAC,IAAI,CA8Bd,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,MAAM,UAAU,CAAC,OAAO,qBAAqB,CAAC,EAC9C,QAAQ,gCAAgC,EACxC,iBAAiB,MAAM,EACvB,QAAQ,MAAM,KACb,OAAO,CAAC,IAAI,CAyCd,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.syncUsersPush = exports.syncUsersPull = void 0;
|
|
4
|
+
const sitecore_api_1 = require("../sitecore-api");
|
|
5
|
+
const filesystem_store_1 = require("../filesystem-store");
|
|
6
|
+
const shared_1 = require("./shared");
|
|
7
|
+
const roles_1 = require("./roles");
|
|
8
|
+
const profilePropsEqual = (left, right) => {
|
|
9
|
+
const serialize = (props) => [...props]
|
|
10
|
+
.map((prop) => `${prop.name}:${prop.content}:${prop.contentType}:${prop.isCustomProperty}`)
|
|
11
|
+
.sort();
|
|
12
|
+
const leftSerialized = serialize(left);
|
|
13
|
+
const rightSerialized = serialize(right);
|
|
14
|
+
if (leftSerialized.length !== rightSerialized.length) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return leftSerialized.every((value, idx) => value === rightSerialized[idx]);
|
|
18
|
+
};
|
|
19
|
+
const usersEqual = (left, right) => left.userName.toLowerCase() === right.userName.toLowerCase() &&
|
|
20
|
+
(left.email ?? "") === (right.email ?? "") &&
|
|
21
|
+
(left.comment ?? "") === (right.comment ?? "") &&
|
|
22
|
+
left.isApproved === right.isApproved &&
|
|
23
|
+
(0, roles_1.rolesEqual)(left.roles, right.roles) &&
|
|
24
|
+
profilePropsEqual(left.profileProperties, right.profileProperties);
|
|
25
|
+
const syncUsersPull = async (root, module, environmentName, logger) => {
|
|
26
|
+
if (module.users.length === 0) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const apiTimeoutMs = (0, shared_1.resolveApiTimeoutMs)(root);
|
|
30
|
+
const predicates = module.users.map((user) => ({ domain: user.domain, pattern: user.pattern }));
|
|
31
|
+
const sourceUsers = await (0, sitecore_api_1.fetchUsers)(root.environments[environmentName], predicates, {
|
|
32
|
+
timeoutMs: apiTimeoutMs,
|
|
33
|
+
});
|
|
34
|
+
const destUsers = await (0, filesystem_store_1.readUsersFromFilesystem)(root, module);
|
|
35
|
+
const destMap = new Map(destUsers.map((user) => [user.userName.toLowerCase(), user]));
|
|
36
|
+
for (const user of sourceUsers) {
|
|
37
|
+
const existing = destMap.get(user.userName.toLowerCase());
|
|
38
|
+
if (!existing || !usersEqual(existing, user)) {
|
|
39
|
+
await (0, filesystem_store_1.writeUserToFilesystem)(root, module, user);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (root.serialization.removeOrphansForUsers) {
|
|
43
|
+
const sourceNames = new Set(sourceUsers.map((user) => user.userName.toLowerCase()));
|
|
44
|
+
for (const dest of destUsers) {
|
|
45
|
+
if (!sourceNames.has(dest.userName.toLowerCase())) {
|
|
46
|
+
await (0, filesystem_store_1.removeUserFromFilesystem)(dest.serializedItemId);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
logger.info(`[users] Synced ${sourceUsers.length} users`, "green");
|
|
51
|
+
};
|
|
52
|
+
exports.syncUsersPull = syncUsersPull;
|
|
53
|
+
const syncUsersPush = async (root, module, environmentName, logger) => {
|
|
54
|
+
if (module.users.length === 0) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const apiTimeoutMs = (0, shared_1.resolveApiTimeoutMs)(root);
|
|
58
|
+
const predicates = module.users.map((user) => ({ domain: user.domain, pattern: user.pattern }));
|
|
59
|
+
const sourceUsers = await (0, filesystem_store_1.readUsersFromFilesystem)(root, module);
|
|
60
|
+
const destinationUsers = await (0, sitecore_api_1.fetchUsers)(root.environments[environmentName], predicates, {
|
|
61
|
+
timeoutMs: apiTimeoutMs,
|
|
62
|
+
});
|
|
63
|
+
const destMap = new Map(destinationUsers.map((user) => [user.userName.toLowerCase(), user]));
|
|
64
|
+
const commands = [];
|
|
65
|
+
for (const user of sourceUsers) {
|
|
66
|
+
const dest = destMap.get(user.userName.toLowerCase());
|
|
67
|
+
if (!dest) {
|
|
68
|
+
commands.push({ userData: user, userCommandType: "ADD" });
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (!usersEqual(user, dest)) {
|
|
72
|
+
commands.push({ userData: user, userCommandType: "UPDATE" });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (root.serialization.removeOrphansForUsers) {
|
|
76
|
+
const sourceNames = new Set(sourceUsers.map((user) => user.userName.toLowerCase()));
|
|
77
|
+
for (const user of destinationUsers) {
|
|
78
|
+
if (!sourceNames.has(user.userName.toLowerCase())) {
|
|
79
|
+
commands.push({ userData: user, userCommandType: "REMOVE" });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (commands.length > 0) {
|
|
84
|
+
await (0, sitecore_api_1.pushUserCommands)(root.environments[environmentName], commands, {
|
|
85
|
+
timeoutMs: apiTimeoutMs,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
logger.info(`[users] Synced ${commands.length} user changes`, "green");
|
|
89
|
+
};
|
|
90
|
+
exports.syncUsersPush = syncUsersPush;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/serialization/tasks/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,WAAW,GAAU,SAAS,aAAa,GAAG;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,KAAG,OAAO,CAAC,IAAI,CAgD1F,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runValidate = void 0;
|
|
4
|
+
const filesystem_store_1 = require("../filesystem-store");
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
|
+
const runValidate = async (options) => {
|
|
7
|
+
const logger = (0, shared_1.toLogger)(options);
|
|
8
|
+
const { modules } = await (0, shared_1.loadConfigAndModules)(options);
|
|
9
|
+
const subtrees = modules.flatMap((module) => module.items.includes);
|
|
10
|
+
const { metadata } = await (0, filesystem_store_1.loadFilesystemItems)(subtrees);
|
|
11
|
+
const seenIds = new Set();
|
|
12
|
+
let hasErrors = false;
|
|
13
|
+
let duplicateCount = 0;
|
|
14
|
+
for (const item of metadata) {
|
|
15
|
+
const id = item.id.toLowerCase();
|
|
16
|
+
if (seenIds.has(id)) {
|
|
17
|
+
logger.error(`Duplicate serialized item id detected: ${item.id}`);
|
|
18
|
+
hasErrors = true;
|
|
19
|
+
duplicateCount += 1;
|
|
20
|
+
if (!options.fix) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
seenIds.add(id);
|
|
25
|
+
}
|
|
26
|
+
if (hasErrors) {
|
|
27
|
+
if (logger.isJson()) {
|
|
28
|
+
logger.json({
|
|
29
|
+
command: "serialization.validate",
|
|
30
|
+
duplicates: duplicateCount,
|
|
31
|
+
fixed: Boolean(options.fix),
|
|
32
|
+
hasErrors: true,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
throw (0, shared_1.inputError)(options.fix
|
|
36
|
+
? "Unresolvable errors were detected. Review logs for details."
|
|
37
|
+
: "Errors were detected, but no attempt was made to fix them. Pass --fix to attempt fixing.");
|
|
38
|
+
}
|
|
39
|
+
if (logger.isJson()) {
|
|
40
|
+
logger.json({
|
|
41
|
+
command: "serialization.validate",
|
|
42
|
+
duplicates: 0,
|
|
43
|
+
fixed: Boolean(options.fix),
|
|
44
|
+
hasErrors: false,
|
|
45
|
+
});
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
logger.info("No errors were detected.", "green");
|
|
49
|
+
};
|
|
50
|
+
exports.runValidate = runValidate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../../src/serialization/tasks/watch.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C,eAAO,MAAM,QAAQ,GAAU,SAAS,YAAY,KAAG,OAAO,CAAC,IAAI,CAgFlE,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runWatch = void 0;
|
|
4
|
+
const path_provider_1 = require("../path-provider");
|
|
5
|
+
const item_path_1 = require("../item-path");
|
|
6
|
+
const field_filter_1 = require("../field-filter");
|
|
7
|
+
const sitecore_api_1 = require("../sitecore-api");
|
|
8
|
+
const filesystem_store_1 = require("../filesystem-store");
|
|
9
|
+
const shared_1 = require("./shared");
|
|
10
|
+
const pull_1 = require("./pull");
|
|
11
|
+
const runWatch = async (options) => {
|
|
12
|
+
const logger = (0, shared_1.toLogger)(options);
|
|
13
|
+
const { root, modules } = await (0, shared_1.loadConfigAndModules)(options);
|
|
14
|
+
const envName = options.environmentName ?? root.defaultEnvironment;
|
|
15
|
+
const apiTimeoutMs = (0, shared_1.resolveApiTimeoutMs)(root);
|
|
16
|
+
if (!options.skipPull) {
|
|
17
|
+
await (0, pull_1.runPull)({ ...options, environmentName: envName });
|
|
18
|
+
}
|
|
19
|
+
const subtreesByDb = (0, shared_1.groupSubtreesByDatabase)(modules);
|
|
20
|
+
const pathProviders = new Map();
|
|
21
|
+
for (const [database, subtrees] of subtreesByDb) {
|
|
22
|
+
pathProviders.set(database, new path_provider_1.FilesystemPathProvider(subtrees));
|
|
23
|
+
}
|
|
24
|
+
let timestamp = await (0, sitecore_api_1.fetchHistoryTimestamp)(root.environments[envName], {
|
|
25
|
+
timeoutMs: apiTimeoutMs,
|
|
26
|
+
});
|
|
27
|
+
logger.info("Watcher is online! Changes made to serialized items will be automatically pulled.", "magenta");
|
|
28
|
+
while (true) {
|
|
29
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
30
|
+
const result = await (0, sitecore_api_1.fetchHistoryEntries)(root.environments[envName], timestamp, {
|
|
31
|
+
timeoutMs: apiTimeoutMs,
|
|
32
|
+
});
|
|
33
|
+
timestamp = result.timestamp;
|
|
34
|
+
if (!result.entries.length) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
for (const entry of result.entries) {
|
|
38
|
+
const provider = pathProviders.get(entry.database);
|
|
39
|
+
if (!provider) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const itemPath = item_path_1.ItemPath.fromPathString(entry.path);
|
|
43
|
+
const subtrees = subtreesByDb.get(entry.database) ?? [];
|
|
44
|
+
const matched = subtrees.some((subtree) => subtree.includesPath(itemPath));
|
|
45
|
+
if (!matched) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (entry.changeType === "Recycle") {
|
|
49
|
+
const metadata = {
|
|
50
|
+
id: entry.id,
|
|
51
|
+
parentId: "",
|
|
52
|
+
templateId: "",
|
|
53
|
+
path: itemPath,
|
|
54
|
+
};
|
|
55
|
+
await (0, filesystem_store_1.removeItemFromFilesystem)(provider, metadata);
|
|
56
|
+
if (entry.oldPath) {
|
|
57
|
+
const oldItemPath = item_path_1.ItemPath.fromPathString(entry.oldPath);
|
|
58
|
+
await (0, filesystem_store_1.removeItemFromFilesystem)(provider, {
|
|
59
|
+
id: entry.id,
|
|
60
|
+
parentId: "",
|
|
61
|
+
templateId: "",
|
|
62
|
+
path: oldItemPath,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const filter = (0, field_filter_1.createFieldFilterSet)(root.serialization.excludedFields, []);
|
|
68
|
+
const data = await (0, sitecore_api_1.fetchItemData)(root.environments[envName], entry.database, entry.id, "SingleItem", filter, { timeoutMs: apiTimeoutMs });
|
|
69
|
+
if (data.length > 0) {
|
|
70
|
+
await (0, filesystem_store_1.writeItemToFilesystem)(provider, data[0]);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
exports.runWatch = runWatch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/serialization/tasks.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./tasks/env"), exports);
|
|
18
|
+
__exportStar(require("./tasks/index"), exports);
|
|
19
|
+
__exportStar(require("./tasks/types"), exports);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ItemPath, ItemPathMatchLike } from "./item-path";
|
|
2
|
+
export declare enum TreeScope {
|
|
3
|
+
SingleItem = "SingleItem",
|
|
4
|
+
ItemAndChildren = "ItemAndChildren",
|
|
5
|
+
ItemAndDescendants = "ItemAndDescendants",
|
|
6
|
+
DescendantsOnly = "DescendantsOnly"
|
|
7
|
+
}
|
|
8
|
+
export declare enum TreeRuleScope {
|
|
9
|
+
Ignored = "Ignored",
|
|
10
|
+
SingleItem = "SingleItem",
|
|
11
|
+
ItemAndChildren = "ItemAndChildren",
|
|
12
|
+
ItemAndDescendants = "ItemAndDescendants"
|
|
13
|
+
}
|
|
14
|
+
export declare enum AllowedPushOperations {
|
|
15
|
+
CreateUpdateAndDelete = "CreateUpdateAndDelete",
|
|
16
|
+
CreateAndUpdate = "CreateAndUpdate",
|
|
17
|
+
CreateOnly = "CreateOnly"
|
|
18
|
+
}
|
|
19
|
+
export declare class TreeSpecRule {
|
|
20
|
+
path: ItemPathMatchLike;
|
|
21
|
+
scope?: TreeRuleScope;
|
|
22
|
+
allowedPushOperations?: AllowedPushOperations | null;
|
|
23
|
+
validate(parent: TreeSpec): void;
|
|
24
|
+
protected validateInternal(parent: TreeSpec, validateScopes: boolean): void;
|
|
25
|
+
private validateScopes;
|
|
26
|
+
private validateItemPath;
|
|
27
|
+
private validateItemPathMatch;
|
|
28
|
+
}
|
|
29
|
+
export declare class FilesystemTreeSpecRule extends TreeSpecRule {
|
|
30
|
+
alias?: string;
|
|
31
|
+
validate(parent: TreeSpec): void;
|
|
32
|
+
}
|
|
33
|
+
export declare class TreeSpec {
|
|
34
|
+
path: ItemPath;
|
|
35
|
+
scope: TreeScope;
|
|
36
|
+
allowedPushOperations: AllowedPushOperations;
|
|
37
|
+
rules: FilesystemTreeSpecRule[];
|
|
38
|
+
validate(): void;
|
|
39
|
+
includesPath(path: ItemPath, logger?: (message: string) => void): boolean;
|
|
40
|
+
getAllowedPushOperationsForItem(path: ItemPath): AllowedPushOperations;
|
|
41
|
+
protected getRulesThatApplyTo(relativePath: ItemPath): FilesystemTreeSpecRule[];
|
|
42
|
+
}
|
|
43
|
+
export declare class FilesystemTreeSpec extends TreeSpec {
|
|
44
|
+
name: string;
|
|
45
|
+
database: string;
|
|
46
|
+
physicalPath: string;
|
|
47
|
+
maxRelativePathLength?: number;
|
|
48
|
+
validate(): void;
|
|
49
|
+
}
|
|
50
|
+
export declare const parseItemPathMatch: (value: string) => ItemPathMatchLike;
|
|
51
|
+
//# sourceMappingURL=tree-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-spec.d.ts","sourceRoot":"","sources":["../../src/serialization/tree-spec.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAiB,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGzE,oBAAY,SAAS;IACnB,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;CACpC;AAED,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,kBAAkB,uBAAuB;CAC1C;AAED,oBAAY,qBAAqB;IAC/B,qBAAqB,0BAA0B;IAC/C,eAAe,oBAAoB;IACnC,UAAU,eAAe;CAC1B;AAED,qBAAa,YAAY;IACvB,IAAI,EAAG,iBAAiB,CAAC;IACzB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,qBAAqB,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAErD,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI;IAIhC,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,GAAG,IAAI;IAsB3E,OAAO,CAAC,cAAc;IA2BtB,OAAO,CAAC,gBAAgB;IAqCxB,OAAO,CAAC,qBAAqB;CAgB9B;AAED,qBAAa,sBAAuB,SAAQ,YAAY;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEN,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI;CAiC1C;AAED,qBAAa,QAAQ;IACnB,IAAI,EAAG,QAAQ,CAAC;IAChB,KAAK,EAAE,SAAS,CAAgC;IAChD,qBAAqB,EAAE,qBAAqB,CAA+C;IAC3F,KAAK,EAAE,sBAAsB,EAAE,CAAM;IAErC,QAAQ,IAAI,IAAI;IAchB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO;IA2DzE,+BAA+B,CAAC,IAAI,EAAE,QAAQ,GAAG,qBAAqB;IAetE,SAAS,CAAC,mBAAmB,CAAC,YAAY,EAAE,QAAQ,GAAG,sBAAsB,EAAE;CAOhF;AAED,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,IAAI,EAAG,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAY;IAC5B,YAAY,EAAG,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAEtB,QAAQ,IAAI,IAAI;CAmC1B;AAED,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,iBAMlD,CAAC"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseItemPathMatch = exports.FilesystemTreeSpec = exports.TreeSpec = exports.FilesystemTreeSpecRule = exports.TreeSpecRule = exports.AllowedPushOperations = exports.TreeRuleScope = exports.TreeScope = void 0;
|
|
4
|
+
const errors_1 = require("../shared/errors");
|
|
5
|
+
const item_path_1 = require("./item-path");
|
|
6
|
+
const wildcard_1 = require("./wildcard");
|
|
7
|
+
var TreeScope;
|
|
8
|
+
(function (TreeScope) {
|
|
9
|
+
TreeScope["SingleItem"] = "SingleItem";
|
|
10
|
+
TreeScope["ItemAndChildren"] = "ItemAndChildren";
|
|
11
|
+
TreeScope["ItemAndDescendants"] = "ItemAndDescendants";
|
|
12
|
+
TreeScope["DescendantsOnly"] = "DescendantsOnly";
|
|
13
|
+
})(TreeScope || (exports.TreeScope = TreeScope = {}));
|
|
14
|
+
var TreeRuleScope;
|
|
15
|
+
(function (TreeRuleScope) {
|
|
16
|
+
TreeRuleScope["Ignored"] = "Ignored";
|
|
17
|
+
TreeRuleScope["SingleItem"] = "SingleItem";
|
|
18
|
+
TreeRuleScope["ItemAndChildren"] = "ItemAndChildren";
|
|
19
|
+
TreeRuleScope["ItemAndDescendants"] = "ItemAndDescendants";
|
|
20
|
+
})(TreeRuleScope || (exports.TreeRuleScope = TreeRuleScope = {}));
|
|
21
|
+
var AllowedPushOperations;
|
|
22
|
+
(function (AllowedPushOperations) {
|
|
23
|
+
AllowedPushOperations["CreateUpdateAndDelete"] = "CreateUpdateAndDelete";
|
|
24
|
+
AllowedPushOperations["CreateAndUpdate"] = "CreateAndUpdate";
|
|
25
|
+
AllowedPushOperations["CreateOnly"] = "CreateOnly";
|
|
26
|
+
})(AllowedPushOperations || (exports.AllowedPushOperations = AllowedPushOperations = {}));
|
|
27
|
+
class TreeSpecRule {
|
|
28
|
+
validate(parent) {
|
|
29
|
+
this.validateInternal(parent, true);
|
|
30
|
+
}
|
|
31
|
+
validateInternal(parent, validateScopes) {
|
|
32
|
+
if (!parent) {
|
|
33
|
+
throw (0, errors_1.createCliError)("TreeSpecRule parent is required.", "CONFIG_INVALID");
|
|
34
|
+
}
|
|
35
|
+
if (validateScopes) {
|
|
36
|
+
this.validateScopes(parent);
|
|
37
|
+
}
|
|
38
|
+
if (this.path instanceof item_path_1.ItemPath) {
|
|
39
|
+
this.validateItemPath(parent, this.path);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (this.path instanceof item_path_1.ItemPathMatch) {
|
|
43
|
+
this.validateItemPathMatch(parent, this.path);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
throw (0, errors_1.createCliError)(`Subtree ${parent.path} has a rule with no path.`, "CONFIG_INVALID");
|
|
47
|
+
}
|
|
48
|
+
validateScopes(parent) {
|
|
49
|
+
if (!this.scope) {
|
|
50
|
+
throw (0, errors_1.createCliError)(`${parent.path} has rule ${this.path?.toPathString()} without scope.`, "CONFIG_INVALID");
|
|
51
|
+
}
|
|
52
|
+
if (parent.scope === TreeScope.SingleItem) {
|
|
53
|
+
throw (0, errors_1.createCliError)(`${parent.path} has scope ${TreeScope.SingleItem} and rules are defined.`, "CONFIG_INVALID");
|
|
54
|
+
}
|
|
55
|
+
if (parent.scope === TreeScope.ItemAndChildren &&
|
|
56
|
+
(this.scope === TreeRuleScope.ItemAndDescendants ||
|
|
57
|
+
this.scope === TreeRuleScope.ItemAndChildren)) {
|
|
58
|
+
throw (0, errors_1.createCliError)(`${parent.path} has scope ${TreeScope.ItemAndChildren} and rule ${this.path.toPathString()} has scope ${this.scope}.`, "CONFIG_INVALID");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
validateItemPath(parent, itemPath) {
|
|
62
|
+
if (itemPath.isDescendantOrSelfOf(parent.path)) {
|
|
63
|
+
throw (0, errors_1.createCliError)(`Subtree path ${parent.path} contained rule for ${this.path.toPathString()}, which is absolute.`, "CONFIG_INVALID");
|
|
64
|
+
}
|
|
65
|
+
if (itemPath.count === 0) {
|
|
66
|
+
throw (0, errors_1.createCliError)(`Subtree path ${parent.path} contained rule for /, which is the root item.`, "CONFIG_INVALID");
|
|
67
|
+
}
|
|
68
|
+
const parentRelative = itemPath.createParentPath();
|
|
69
|
+
if (!parentRelative) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
let currentParentPath = parent.path.concatenate(parentRelative);
|
|
73
|
+
while (!currentParentPath.equals(parent.path) && currentParentPath.count > 0) {
|
|
74
|
+
if (!parent.includesPath(currentParentPath)) {
|
|
75
|
+
throw (0, errors_1.createCliError)(`Subtree path ${parent.path} contained rule for ${this.path.toPathString()}, but ancestor path ${currentParentPath} was not included.`, "CONFIG_INVALID");
|
|
76
|
+
}
|
|
77
|
+
const nextParent = currentParentPath.createParentPath();
|
|
78
|
+
if (!nextParent) {
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
currentParentPath = nextParent;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
validateItemPathMatch(parent, itemPathMatch) {
|
|
85
|
+
const matchValue = itemPathMatch.toPathString();
|
|
86
|
+
if (!matchValue.endsWith("*")) {
|
|
87
|
+
throw (0, errors_1.createCliError)(`Subtree ${parent.path} contained path match rule ${matchValue} without trailing '*'.`, "CONFIG_INVALID");
|
|
88
|
+
}
|
|
89
|
+
if (this.scope === TreeRuleScope.SingleItem || this.scope === TreeRuleScope.ItemAndChildren) {
|
|
90
|
+
throw (0, errors_1.createCliError)(`Subtree ${parent.path} contained wildcard rule ${matchValue} with invalid scope ${this.scope}.`, "CONFIG_INVALID");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.TreeSpecRule = TreeSpecRule;
|
|
95
|
+
class FilesystemTreeSpecRule extends TreeSpecRule {
|
|
96
|
+
validate(parent) {
|
|
97
|
+
if (!parent) {
|
|
98
|
+
throw (0, errors_1.createCliError)("FilesystemTreeSpecRule parent is required.", "CONFIG_INVALID");
|
|
99
|
+
}
|
|
100
|
+
if (!this.alias) {
|
|
101
|
+
super.validate(parent);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.validateInternal(parent, false);
|
|
105
|
+
if (this.scope) {
|
|
106
|
+
throw (0, errors_1.createCliError)(`Subtree ${parent.path} contained rule for ${this.path.toPathString()} with alias and scope.`, "CONFIG_INVALID");
|
|
107
|
+
}
|
|
108
|
+
if (this.path instanceof item_path_1.ItemPathMatch) {
|
|
109
|
+
throw (0, errors_1.createCliError)(`Subtree ${parent.path} contained match rule ${this.path.toPathString()} that also had an alias.`, "CONFIG_INVALID");
|
|
110
|
+
}
|
|
111
|
+
if (!/^[A-Za-z0-9 \-_]+$/.test(this.alias)) {
|
|
112
|
+
throw (0, errors_1.createCliError)(`Subtree ${parent.path} rule for ${this.path.toPathString()} has invalid alias '${this.alias}'.`, "CONFIG_INVALID");
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.FilesystemTreeSpecRule = FilesystemTreeSpecRule;
|
|
117
|
+
class TreeSpec {
|
|
118
|
+
constructor() {
|
|
119
|
+
this.scope = TreeScope.ItemAndDescendants;
|
|
120
|
+
this.allowedPushOperations = AllowedPushOperations.CreateUpdateAndDelete;
|
|
121
|
+
this.rules = [];
|
|
122
|
+
}
|
|
123
|
+
validate() {
|
|
124
|
+
if (!this.path || this.path.count === 0) {
|
|
125
|
+
throw (0, errors_1.createCliError)("TreeSpec path is null or empty.", "CONFIG_INVALID");
|
|
126
|
+
}
|
|
127
|
+
for (const rule of this.rules) {
|
|
128
|
+
if (!rule.path) {
|
|
129
|
+
throw (0, errors_1.createCliError)("TreeSpec rule path is null or empty.", "CONFIG_INVALID");
|
|
130
|
+
}
|
|
131
|
+
rule.validate(this);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
includesPath(path, logger) {
|
|
135
|
+
const relativePath = path.createRelativePathFrom(this.path);
|
|
136
|
+
if (!relativePath) {
|
|
137
|
+
logger?.("Path was not relative to subtree");
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
if (this.scope === TreeScope.SingleItem && relativePath.count > 0) {
|
|
141
|
+
logger?.("Tree scope is SingleItem, and item is a descendant");
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
if (this.scope === TreeScope.ItemAndChildren && relativePath.count > 1) {
|
|
145
|
+
logger?.("Tree scope is ItemAndChildren, and item is a grandchild or deeper");
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
if (this.scope === TreeScope.DescendantsOnly && relativePath.count === 0) {
|
|
149
|
+
logger?.("Tree scope is DescendantsOnly and item is the root item");
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
for (const rule of this.getRulesThatApplyTo(relativePath)) {
|
|
153
|
+
switch (rule.scope) {
|
|
154
|
+
case TreeRuleScope.Ignored:
|
|
155
|
+
logger?.(`Rule ${rule.path.toPathString()} excluded item`);
|
|
156
|
+
return false;
|
|
157
|
+
case TreeRuleScope.ItemAndDescendants:
|
|
158
|
+
logger?.(`Rule ${rule.path.toPathString()} included item`);
|
|
159
|
+
return true;
|
|
160
|
+
case TreeRuleScope.SingleItem:
|
|
161
|
+
case TreeRuleScope.ItemAndChildren: {
|
|
162
|
+
if (!(rule.path instanceof item_path_1.ItemPath)) {
|
|
163
|
+
throw (0, errors_1.createCliError)("Cannot determine relative path to wildcard.", "CONFIG_INVALID");
|
|
164
|
+
}
|
|
165
|
+
const ruleRelativePath = relativePath.createRelativePathFrom(rule.path);
|
|
166
|
+
if (!ruleRelativePath) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
if (rule.scope === TreeRuleScope.SingleItem && ruleRelativePath.count > 0) {
|
|
170
|
+
logger?.("Rule scope SingleItem and item is a descendant");
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
if (rule.scope === TreeRuleScope.ItemAndChildren && ruleRelativePath.count > 1) {
|
|
174
|
+
logger?.("Rule scope ItemAndChildren and item is a grandchild or deeper");
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
default:
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
logger?.(`Item path matches subtree scope ${this.scope}.`);
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
getAllowedPushOperationsForItem(path) {
|
|
187
|
+
const relativePath = path.createRelativePathFrom(this.path);
|
|
188
|
+
if (!relativePath) {
|
|
189
|
+
return AllowedPushOperations.CreateOnly;
|
|
190
|
+
}
|
|
191
|
+
for (const rule of this.getRulesThatApplyTo(relativePath)) {
|
|
192
|
+
if (rule.allowedPushOperations) {
|
|
193
|
+
return rule.allowedPushOperations;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return this.allowedPushOperations;
|
|
197
|
+
}
|
|
198
|
+
getRulesThatApplyTo(relativePath) {
|
|
199
|
+
if (this.rules.length === 0 || relativePath.count === 0) {
|
|
200
|
+
return [];
|
|
201
|
+
}
|
|
202
|
+
return this.rules.filter((rule) => relativePath.isDescendantOrSelfOf(rule.path));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
exports.TreeSpec = TreeSpec;
|
|
206
|
+
class FilesystemTreeSpec extends TreeSpec {
|
|
207
|
+
constructor() {
|
|
208
|
+
super(...arguments);
|
|
209
|
+
this.database = "master";
|
|
210
|
+
}
|
|
211
|
+
validate() {
|
|
212
|
+
super.validate();
|
|
213
|
+
if (!this.name) {
|
|
214
|
+
throw (0, errors_1.createCliError)(`Subtree name was null or empty for path ${this.path}.`, "CONFIG_INVALID");
|
|
215
|
+
}
|
|
216
|
+
if (!this.database) {
|
|
217
|
+
throw (0, errors_1.createCliError)(`Subtree ${this.name} database was null or empty.`, "CONFIG_INVALID");
|
|
218
|
+
}
|
|
219
|
+
if (!this.physicalPath) {
|
|
220
|
+
throw (0, errors_1.createCliError)(`Subtree ${this.name} physicalPath was null or empty.`, "CONFIG_INVALID");
|
|
221
|
+
}
|
|
222
|
+
const aliasSet = new Set();
|
|
223
|
+
for (const rule of this.rules) {
|
|
224
|
+
if (!rule.alias) {
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
if (aliasSet.has(rule.alias.toLowerCase())) {
|
|
228
|
+
throw (0, errors_1.createCliError)(`Duplicate path alias '${rule.alias}' in subtree ${this.name}.`, "CONFIG_INVALID");
|
|
229
|
+
}
|
|
230
|
+
aliasSet.add(rule.alias.toLowerCase());
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
exports.FilesystemTreeSpec = FilesystemTreeSpec;
|
|
235
|
+
const parseItemPathMatch = (value) => {
|
|
236
|
+
if ((0, wildcard_1.isWildcard)(value)) {
|
|
237
|
+
return item_path_1.ItemPathMatch.fromPathMatch(value);
|
|
238
|
+
}
|
|
239
|
+
return item_path_1.ItemPath.fromPathString(value);
|
|
240
|
+
};
|
|
241
|
+
exports.parseItemPathMatch = parseItemPathMatch;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ItemPath } from "./item-path";
|
|
2
|
+
export type FieldFilter = {
|
|
3
|
+
fieldId: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
};
|
|
6
|
+
export type ItemFieldValue = {
|
|
7
|
+
fieldId: string;
|
|
8
|
+
nameHint?: string;
|
|
9
|
+
value: string;
|
|
10
|
+
blobId?: string | null;
|
|
11
|
+
};
|
|
12
|
+
export type ItemLanguage = {
|
|
13
|
+
language: string;
|
|
14
|
+
fields: ItemFieldValue[];
|
|
15
|
+
};
|
|
16
|
+
export type ItemVersion = {
|
|
17
|
+
language: string;
|
|
18
|
+
version: number;
|
|
19
|
+
fields: ItemFieldValue[];
|
|
20
|
+
};
|
|
21
|
+
export type ItemMetadata = {
|
|
22
|
+
id: string;
|
|
23
|
+
parentId: string;
|
|
24
|
+
templateId: string;
|
|
25
|
+
path: ItemPath;
|
|
26
|
+
dataSignature?: string;
|
|
27
|
+
hasChildren?: boolean;
|
|
28
|
+
database?: string;
|
|
29
|
+
};
|
|
30
|
+
export type ItemData = ItemMetadata & {
|
|
31
|
+
name: string;
|
|
32
|
+
branchId?: string | null;
|
|
33
|
+
sharedFields: ItemFieldValue[];
|
|
34
|
+
unversionedFields: ItemLanguage[];
|
|
35
|
+
versions: ItemVersion[];
|
|
36
|
+
};
|
|
37
|
+
export type RolePredicateItem = {
|
|
38
|
+
domain: string;
|
|
39
|
+
pattern: string;
|
|
40
|
+
moduleSourceIdentifier?: string;
|
|
41
|
+
};
|
|
42
|
+
export type UserPredicateItem = {
|
|
43
|
+
domain: string;
|
|
44
|
+
pattern: string;
|
|
45
|
+
moduleSourceIdentifier?: string;
|
|
46
|
+
};
|
|
47
|
+
export type RoleData = {
|
|
48
|
+
roleName: string;
|
|
49
|
+
memberOfRoles: string[];
|
|
50
|
+
serializedItemId?: string;
|
|
51
|
+
};
|
|
52
|
+
export type ProfileProperty = {
|
|
53
|
+
name: string;
|
|
54
|
+
content: string;
|
|
55
|
+
contentType: string;
|
|
56
|
+
isCustomProperty: boolean;
|
|
57
|
+
};
|
|
58
|
+
export type UserData = {
|
|
59
|
+
userName: string;
|
|
60
|
+
email?: string;
|
|
61
|
+
comment?: string;
|
|
62
|
+
creationDate: string;
|
|
63
|
+
isApproved: boolean;
|
|
64
|
+
roles: string[];
|
|
65
|
+
profileProperties: ProfileProperty[];
|
|
66
|
+
serializedItemId?: string;
|
|
67
|
+
};
|
|
68
|
+
export type HistoryEntry = {
|
|
69
|
+
id: string;
|
|
70
|
+
path: string;
|
|
71
|
+
database: string;
|
|
72
|
+
oldPath?: string | null;
|
|
73
|
+
changeType: "Create" | "UpdateOrRename" | "Move" | "Recycle";
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/serialization/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,cAAc,EAAE,CAAC;IAC/B,iBAAiB,EAAE,YAAY,EAAE,CAAC;IAClC,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iBAAiB,EAAE,eAAe,EAAE,CAAC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,QAAQ,GAAG,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAAC;CAC9D,CAAC"}
|