@contember/cli 2.1.0-beta.2 → 2.2.0-alpha.1
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/CLAUDE.md +14 -1
- package/dist/development/index.cjs +5 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +5 -0
- package/dist/development/index.js.map +1 -0
- package/dist/development/run.cjs +3 -3
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs +3 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.js +3 -1
- package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs +26 -4
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js +26 -4
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs +39 -3
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js +39 -3
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs +3 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js +3 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs +26 -0
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.js +26 -0
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs +28 -0
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js +28 -0
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +23 -0
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js +23 -0
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -0
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs +2 -2
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/development/src/commands/tenant/TenantApplyCommand.cjs +39 -0
- package/dist/development/src/commands/tenant/TenantApplyCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/TenantApplyCommand.js +39 -0
- package/dist/development/src/commands/tenant/TenantApplyCommand.js.map +1 -0
- package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/development/src/consts.cjs +2 -2
- package/dist/development/src/consts.cjs.map +1 -1
- package/dist/development/src/dic.cjs +60 -10
- package/dist/development/src/dic.cjs.map +1 -1
- package/dist/development/src/dic.js +61 -11
- package/dist/development/src/dic.js.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/development/src/lib/VersionChecker.cjs +2 -2
- package/dist/development/src/lib/VersionChecker.cjs.map +1 -1
- package/dist/development/src/lib/VersionChecker.js.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/development/src/lib/fs/DockerComposeManager.cjs +10 -10
- package/dist/development/src/lib/fs/DockerComposeManager.cjs.map +1 -1
- package/dist/development/src/lib/fs/DockerComposeManager.js.map +1 -1
- package/dist/development/src/lib/fs/YamlHandler.cjs.map +1 -1
- package/dist/development/src/lib/fs/YamlHandler.js.map +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.js.map +1 -1
- package/dist/development/src/lib/js/JsCodeRunner.cjs.map +1 -1
- package/dist/development/src/lib/js/JsCodeRunner.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs +78 -18
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js +79 -19
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs +5 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js +5 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs +171 -0
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -0
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js +171 -0
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -0
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectResolver.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityInfo.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityLink.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldLink.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldType.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldType.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/OnDelete.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.js.map +1 -1
- package/dist/development/src/lib/schema/SchemaLoader.cjs +5 -5
- package/dist/development/src/lib/schema/SchemaLoader.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaLoader.js.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationHelper.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.cjs +75 -12
- package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.js +75 -12
- package/dist/development/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs +55 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.js +55 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.js.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.cjs +32 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.js +32 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.js.map +1 -0
- package/dist/development/src/lib/tenant/tenantConfig.cjs +5 -0
- package/dist/development/src/lib/tenant/tenantConfig.cjs.map +1 -0
- package/dist/development/src/lib/tenant/tenantConfig.js +5 -0
- package/dist/development/src/lib/tenant/tenantConfig.js.map +1 -0
- package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs +6 -6
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
- package/dist/development/src/lib/workspace/WorkspaceResolver.js.map +1 -1
- package/dist/production/index.cjs +5 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +5 -0
- package/dist/production/index.js.map +1 -0
- package/dist/production/run.cjs +3 -3
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs +3 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.js +3 -1
- package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs +26 -4
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js +26 -4
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs +39 -3
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js +39 -3
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs +3 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js +3 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs +26 -0
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.js +26 -0
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs +28 -0
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js +28 -0
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +23 -0
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js +23 -0
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -0
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs +2 -2
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/production/src/commands/tenant/TenantApplyCommand.cjs +39 -0
- package/dist/production/src/commands/tenant/TenantApplyCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/TenantApplyCommand.js +39 -0
- package/dist/production/src/commands/tenant/TenantApplyCommand.js.map +1 -0
- package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/production/src/consts.cjs +2 -2
- package/dist/production/src/consts.cjs.map +1 -1
- package/dist/production/src/dic.cjs +60 -10
- package/dist/production/src/dic.cjs.map +1 -1
- package/dist/production/src/dic.js +61 -11
- package/dist/production/src/dic.js.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/production/src/lib/VersionChecker.cjs +2 -2
- package/dist/production/src/lib/VersionChecker.cjs.map +1 -1
- package/dist/production/src/lib/VersionChecker.js.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/production/src/lib/fs/DockerComposeManager.cjs +10 -10
- package/dist/production/src/lib/fs/DockerComposeManager.cjs.map +1 -1
- package/dist/production/src/lib/fs/DockerComposeManager.js.map +1 -1
- package/dist/production/src/lib/fs/YamlHandler.cjs.map +1 -1
- package/dist/production/src/lib/fs/YamlHandler.js.map +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.js.map +1 -1
- package/dist/production/src/lib/js/JsCodeRunner.cjs.map +1 -1
- package/dist/production/src/lib/js/JsCodeRunner.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs +78 -18
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js +79 -19
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs +5 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js +5 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs +171 -0
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -0
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js +171 -0
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -0
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectResolver.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityInfo.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityLink.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldLink.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldType.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldType.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/OnDelete.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -1
- package/dist/production/src/lib/schema/SchemaLoader.cjs +5 -5
- package/dist/production/src/lib/schema/SchemaLoader.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaLoader.js.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationHelper.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.cjs +75 -12
- package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.js +75 -12
- package/dist/production/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs +55 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.js +55 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.js.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.cjs +32 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.js +32 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.js.map +1 -0
- package/dist/production/src/lib/tenant/tenantConfig.cjs +5 -0
- package/dist/production/src/lib/tenant/tenantConfig.cjs.map +1 -0
- package/dist/production/src/lib/tenant/tenantConfig.js +5 -0
- package/dist/production/src/lib/tenant/tenantConfig.js.map +1 -0
- package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs +6 -6
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
- package/dist/production/src/lib/workspace/WorkspaceResolver.js.map +1 -1
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts.map +1 -1
- package/dist/types/commands/deploy/DeployCommand.d.ts +7 -6
- package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -1
- package/dist/types/commands/deploy/index.d.ts +1 -1
- package/dist/types/commands/deploy/index.d.ts.map +1 -1
- package/dist/types/commands/index.d.ts +6 -5
- package/dist/types/commands/index.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts +8 -7
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts +1 -1
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts +8 -5
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts +2 -1
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts +14 -0
- package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts +1 -1
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts +12 -0
- package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts +3 -3
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts +12 -0
- package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/index.d.ts +10 -7
- package/dist/types/commands/migrations/index.d.ts.map +1 -1
- package/dist/types/commands/misc/index.d.ts +1 -1
- package/dist/types/commands/misc/index.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts +1 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectValidateCommand.d.ts +2 -2
- package/dist/types/commands/project/ProjectValidateCommand.d.ts.map +1 -1
- package/dist/types/commands/project/index.d.ts +3 -3
- package/dist/types/commands/project/index.d.ts.map +1 -1
- package/dist/types/commands/tenant/TenantApplyCommand.d.ts +21 -0
- package/dist/types/commands/tenant/TenantApplyCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/index.d.ts +2 -0
- package/dist/types/commands/tenant/index.d.ts.map +1 -0
- package/dist/types/commands/transfer/ExportCommand.d.ts +2 -2
- package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/ImportCommand.d.ts +2 -2
- package/dist/types/commands/transfer/ImportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/TransferCommand.d.ts +2 -2
- package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/index.d.ts +3 -3
- package/dist/types/commands/transfer/index.d.ts.map +1 -1
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts +1 -1
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
- package/dist/types/commands/workspace/index.d.ts +1 -1
- package/dist/types/commands/workspace/index.d.ts.map +1 -1
- package/dist/types/dic.d.ts +54 -32
- package/dist/types/dic.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/SystemClientProvider.d.ts +1 -1
- package/dist/types/lib/SystemClientProvider.d.ts.map +1 -1
- package/dist/types/lib/TenantClientProvider.d.ts +2 -2
- package/dist/types/lib/TenantClientProvider.d.ts.map +1 -1
- package/dist/types/lib/VersionChecker.d.ts +1 -1
- package/dist/types/lib/VersionChecker.d.ts.map +1 -1
- package/dist/types/lib/admin/AdminClient.d.ts +1 -1
- package/dist/types/lib/admin/AdminClient.d.ts.map +1 -1
- package/dist/types/lib/admin/AdminDeployer.d.ts +3 -3
- package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -1
- package/dist/types/lib/fs/DockerComposeManager.d.ts +2 -2
- package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -1
- package/dist/types/lib/fs/YamlHandler.d.ts +2 -2
- package/dist/types/lib/fs/YamlHandler.d.ts.map +1 -1
- package/dist/types/lib/js/EsBuildBuilder.d.ts +1 -1
- package/dist/types/lib/js/EsBuildBuilder.d.ts.map +1 -1
- package/dist/types/lib/js/EvalExecutor.d.ts +1 -1
- package/dist/types/lib/js/EvalExecutor.d.ts.map +1 -1
- package/dist/types/lib/js/JsCodeRunner.d.ts +2 -2
- package/dist/types/lib/js/JsCodeRunner.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts +13 -8
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts +5 -4
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts +28 -0
- package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts.map +1 -0
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +2 -2
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProjectProvider.d.ts +1 -1
- package/dist/types/lib/project/RemoteProjectProvider.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProjectResolver.d.ts +2 -2
- package/dist/types/lib/project/RemoteProjectResolver.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts +1 -1
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/OnDelete.d.ts +1 -1
- package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -1
- package/dist/types/lib/schema/SchemaLoader.d.ts +2 -2
- package/dist/types/lib/schema/SchemaLoader.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantClient.d.ts +15 -0
- package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantConfigApplier.d.ts +18 -0
- package/dist/types/lib/tenant/TenantConfigApplier.d.ts.map +1 -0
- package/dist/types/lib/tenant/TenantConfigLoader.d.ts +16 -0
- package/dist/types/lib/tenant/TenantConfigLoader.d.ts.map +1 -0
- package/dist/types/lib/tenant/tenantConfig.d.ts +74 -0
- package/dist/types/lib/tenant/tenantConfig.d.ts.map +1 -0
- package/dist/types/lib/transfer/DataTransferClient.d.ts +1 -1
- package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts +2 -2
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -15
- package/src/commands/actions/ActionsGetEventCommand.ts +2 -2
- package/src/commands/actions/ActionsListFailedEventsCommand.ts +2 -2
- package/src/commands/actions/ActionsListVariablesCommand.ts +2 -2
- package/src/commands/actions/ActionsRetryEventCommand.ts +2 -2
- package/src/commands/actions/ActionsSetVariablesCommand.ts +2 -2
- package/src/commands/actions/ActionsStopEventCommand.ts +2 -2
- package/src/commands/deploy/DeployCommand.ts +13 -8
- package/src/commands/deploy/index.ts +1 -1
- package/src/commands/index.ts +6 -5
- package/src/commands/migrations/MigrationAmendCommand.ts +38 -10
- package/src/commands/migrations/MigrationDescribeCommand.ts +1 -1
- package/src/commands/migrations/MigrationDiffCommand.ts +50 -6
- package/src/commands/migrations/MigrationExecuteCommand.ts +6 -1
- package/src/commands/migrations/MigrationInitStateCommand.ts +34 -0
- package/src/commands/migrations/MigrationRebaseCommand.ts +1 -1
- package/src/commands/migrations/MigrationSnapshotCommand.ts +34 -0
- package/src/commands/migrations/MigrationStatusCommand.ts +3 -3
- package/src/commands/migrations/MigrationVerifySnapshotCommand.ts +28 -0
- package/src/commands/migrations/index.ts +10 -7
- package/src/commands/misc/index.ts +1 -1
- package/src/commands/project/ProjectGenerateDocumentationCommand.ts +3 -3
- package/src/commands/project/ProjectPrintSchemaCommand.ts +2 -2
- package/src/commands/project/ProjectValidateCommand.ts +3 -3
- package/src/commands/project/index.ts +3 -3
- package/src/commands/tenant/TenantApplyCommand.ts +57 -0
- package/src/commands/tenant/index.ts +1 -0
- package/src/commands/transfer/ExportCommand.ts +4 -4
- package/src/commands/transfer/ImportCommand.ts +6 -6
- package/src/commands/transfer/TransferCommand.ts +6 -6
- package/src/commands/transfer/index.ts +3 -3
- package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +2 -2
- package/src/commands/workspace/index.ts +1 -1
- package/src/dic.ts +103 -37
- package/src/index.ts +1 -0
- package/src/lib/SystemClientProvider.ts +1 -1
- package/src/lib/TenantClientProvider.ts +2 -2
- package/src/lib/VersionChecker.ts +2 -2
- package/src/lib/admin/AdminClient.ts +2 -2
- package/src/lib/admin/AdminDeployer.ts +3 -3
- package/src/lib/fs/DockerComposeManager.ts +2 -2
- package/src/lib/fs/YamlHandler.ts +2 -2
- package/src/lib/js/EsBuildBuilder.ts +1 -1
- package/src/lib/js/EvalExecutor.ts +1 -1
- package/src/lib/js/JsCodeRunner.ts +2 -2
- package/src/lib/migrations/MigrationExecutionFacade.ts +117 -23
- package/src/lib/migrations/MigrationPrinter.ts +1 -1
- package/src/lib/migrations/MigrationRebaseFacade.ts +10 -3
- package/src/lib/migrations/MigrationSnapshotFacade.ts +218 -0
- package/src/lib/migrations/MigrationsStatusFacade.ts +2 -2
- package/src/lib/migrations/MigrationsValidator.ts +1 -1
- package/src/lib/project/RemoteProjectProvider.ts +1 -1
- package/src/lib/project/RemoteProjectResolver.ts +3 -3
- package/src/lib/project/docs/components/EntityInfo.tsx +6 -6
- package/src/lib/project/docs/components/EntityLink.tsx +1 -1
- package/src/lib/project/docs/components/FieldLink.tsx +2 -2
- package/src/lib/project/docs/components/FieldPermissions.tsx +1 -1
- package/src/lib/project/docs/components/FieldType.tsx +2 -2
- package/src/lib/project/docs/components/OnDelete.tsx +3 -3
- package/src/lib/project/docs/components/ProjectInfo.tsx +3 -3
- package/src/lib/project/docs/projectDescribe.tsx +2 -2
- package/src/lib/schema/SchemaLoader.ts +2 -2
- package/src/lib/schema/SchemaValidationHelper.ts +1 -1
- package/src/lib/tenant/TenantClient.ts +123 -14
- package/src/lib/tenant/TenantConfigApplier.ts +72 -0
- package/src/lib/tenant/TenantConfigLoader.ts +41 -0
- package/src/lib/tenant/tenantConfig.ts +101 -0
- package/src/lib/transfer/DataTransferClient.ts +2 -2
- package/src/lib/workspace/WorkspaceResolver.ts +2 -2
- package/src/run.ts +6 -6
- package/src/tsconfig.json +1 -0
- package/tenant.config.example.ts +64 -0
- package/tests/cases/unit/MigrationAmendCommand.test.ts +156 -0
- package/tests/cases/unit/MigrationExecutionFacade.test.ts +81 -0
- package/tests/cases/unit/MigrationRebaseFacade.test.ts +87 -0
- package/tests/cases/unit/MigrationSnapshotFacade.test.ts +243 -0
- package/tests/tenantConfigApplier.test.ts +87 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { afterEach, beforeEach, expect, test } from 'bun:test'
|
|
2
|
+
import * as fs from 'node:fs/promises'
|
|
3
|
+
import * as os from 'node:os'
|
|
4
|
+
import * as path from 'node:path'
|
|
5
|
+
import { createSchema, SchemaDefinition as def } from '@contember/schema-definition'
|
|
6
|
+
import { Schema } from '@contember/schema'
|
|
7
|
+
import { SchemaStateManager } from '@contember/migrations-client'
|
|
8
|
+
import { MigrationExecutionFacade } from '../../../src/lib/migrations/MigrationExecutionFacade.js'
|
|
9
|
+
|
|
10
|
+
namespace BlogModel {
|
|
11
|
+
export class Author {
|
|
12
|
+
name = def.stringColumn()
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const aclWith = (role: string): Schema['acl'] => ({
|
|
17
|
+
roles: { [role]: { variables: {}, stages: '*', entities: {} } },
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
let migrationsDir: string
|
|
21
|
+
|
|
22
|
+
beforeEach(async () => {
|
|
23
|
+
migrationsDir = await fs.mkdtemp(path.join(os.tmpdir(), 'contember-exec-'))
|
|
24
|
+
await new SchemaStateManager(path.join(migrationsDir, 'state')).extractState({ ...createSchema(BlogModel), acl: aclWith('admin') })
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
afterEach(async () => {
|
|
28
|
+
await fs.rm(migrationsDir, { recursive: true, force: true })
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
// Drives MigrationExecutionFacade.execute with a recording migration executor and a real state manager.
|
|
32
|
+
// Returns the schemaState the executor was handed plus everything written to console.log.
|
|
33
|
+
const runExecute = async (opts: { until?: string }) => {
|
|
34
|
+
const schemaStateManager = new SchemaStateManager(path.join(migrationsDir, 'state'))
|
|
35
|
+
let executedSchemaState: unknown = 'not-called'
|
|
36
|
+
const migrationExecutor = {
|
|
37
|
+
executeMigrations: async (args: any) => {
|
|
38
|
+
executedSchemaState = args.schemaState
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
const status = {
|
|
42
|
+
migrationsToExecute: [{ version: '2024-01-01-120000', name: '2024-01-01-120000-init', localMigration: {} }],
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const facade = new MigrationExecutionFacade(
|
|
46
|
+
{ get: () => ({ listExecutedMigrations: async () => [] }) } as any, // systemClientProvider
|
|
47
|
+
{ get: () => ({ createProject: async () => {} }) } as any, // tenantClientProvider
|
|
48
|
+
{ get: () => ({ name: 'p', token: 't', endpoint: 'e' }) } as any, // projectProvider
|
|
49
|
+
{} as any, // schemaVersionBuilder (only used in the describe prompt path)
|
|
50
|
+
{} as any, // migrationPrinter
|
|
51
|
+
migrationExecutor as any,
|
|
52
|
+
{ resolveMigrationsStatus: async () => status } as any,
|
|
53
|
+
schemaStateManager,
|
|
54
|
+
{ getUsableSnapshot: async () => null } as any, // migrationSnapshotFacade — these tests exercise the no-snapshot path
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
const logs: string[] = []
|
|
58
|
+
const original = console.log
|
|
59
|
+
console.log = (...args: any[]) => logs.push(args.join(' '))
|
|
60
|
+
try {
|
|
61
|
+
await facade.execute({ requireConfirmation: false, ...opts })
|
|
62
|
+
} finally {
|
|
63
|
+
console.log = original
|
|
64
|
+
}
|
|
65
|
+
return { executedSchemaState, logs }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
test('does not push schema state when --until targets a specific migration, and warns', async () => {
|
|
69
|
+
const { executedSchemaState, logs } = await runExecute({ until: '2024-01-01-120000' })
|
|
70
|
+
|
|
71
|
+
expect(executedSchemaState).toBeUndefined()
|
|
72
|
+
expect(logs.some(it => it.includes('Warning') && it.includes('--until'))).toBe(true)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
test('pushes schema state when no --until is given', async () => {
|
|
76
|
+
const { executedSchemaState, logs } = await runExecute({})
|
|
77
|
+
|
|
78
|
+
expect(executedSchemaState).toBeDefined()
|
|
79
|
+
expect(Object.keys((executedSchemaState as any).acl.roles)).toStrictEqual(['admin'])
|
|
80
|
+
expect(logs.some(it => it.includes('Warning'))).toBe(false)
|
|
81
|
+
})
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { afterEach, beforeEach, expect, test } from 'bun:test'
|
|
2
|
+
import * as fs from 'node:fs/promises'
|
|
3
|
+
import * as os from 'node:os'
|
|
4
|
+
import * as path from 'node:path'
|
|
5
|
+
import { c, createSchema } from '@contember/schema-definition'
|
|
6
|
+
import { Schema } from '@contember/schema'
|
|
7
|
+
import { emptySchema } from '@contember/schema-utils'
|
|
8
|
+
import {
|
|
9
|
+
JsonLoader,
|
|
10
|
+
MigrationFilesManager,
|
|
11
|
+
MigrationParser,
|
|
12
|
+
MigrationsResolver,
|
|
13
|
+
ModificationHandlerFactory,
|
|
14
|
+
SchemaDiffer,
|
|
15
|
+
SchemaMigrator,
|
|
16
|
+
SchemaStateManager,
|
|
17
|
+
SchemaVersionBuilder,
|
|
18
|
+
VERSION_LATEST,
|
|
19
|
+
} from '@contember/migrations-client'
|
|
20
|
+
import { MigrationRebaseFacade } from '../../../src/lib/migrations/MigrationRebaseFacade.js'
|
|
21
|
+
|
|
22
|
+
namespace BlogModel {
|
|
23
|
+
export class Author {
|
|
24
|
+
name = c.stringColumn()
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const aclWith = (role: string): Schema['acl'] => ({
|
|
29
|
+
roles: { [role]: { variables: {}, stages: '*', entities: {} } },
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
let migrationsDir: string
|
|
33
|
+
|
|
34
|
+
beforeEach(async () => {
|
|
35
|
+
migrationsDir = await fs.mkdtemp(path.join(os.tmpdir(), 'contember-rebase-'))
|
|
36
|
+
const schemaDiffer = new SchemaDiffer(new SchemaMigrator(new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap)))
|
|
37
|
+
const model = createSchema(BlogModel)
|
|
38
|
+
const modifications = schemaDiffer.diffSchemas(emptySchema, model, { skipNonModelDiffers: true })
|
|
39
|
+
await fs.writeFile(
|
|
40
|
+
path.join(migrationsDir, '2024-01-01-120000-init.json'),
|
|
41
|
+
JSON.stringify({ formatVersion: VERSION_LATEST, modifications }, null, '\t'),
|
|
42
|
+
)
|
|
43
|
+
await new SchemaStateManager(path.join(migrationsDir, 'state')).extractState({ ...model, acl: aclWith('admin') })
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
afterEach(async () => {
|
|
47
|
+
await fs.rm(migrationsDir, { recursive: true, force: true })
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
test('rebase re-pushes schema state to the server after rewriting migrations', async () => {
|
|
51
|
+
// migrationModify rebuilds the server schema from migrations, dropping the non-model state;
|
|
52
|
+
// rebase must re-apply it from the state files once the rewrites are done.
|
|
53
|
+
const filesManager = new MigrationFilesManager(migrationsDir, { json: new JsonLoader(new MigrationParser()) })
|
|
54
|
+
const migrationsResolver = new MigrationsResolver(filesManager)
|
|
55
|
+
const schemaMigrator = new SchemaMigrator(new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap))
|
|
56
|
+
const schemaStateManager = new SchemaStateManager(path.join(migrationsDir, 'state'))
|
|
57
|
+
const schemaVersionBuilder = new SchemaVersionBuilder(migrationsResolver, schemaMigrator, schemaStateManager)
|
|
58
|
+
|
|
59
|
+
const calls: Array<{ method: string; args: any[] }> = []
|
|
60
|
+
const systemClientProvider = {
|
|
61
|
+
get: () => ({
|
|
62
|
+
migrationModify: async (...args: any[]) => {
|
|
63
|
+
calls.push({ method: 'migrationModify', args })
|
|
64
|
+
},
|
|
65
|
+
migrate: async (...args: any[]) => {
|
|
66
|
+
calls.push({ method: 'migrate', args })
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
}
|
|
70
|
+
const migrationsValidator = { validate: () => true }
|
|
71
|
+
|
|
72
|
+
const facade = new MigrationRebaseFacade(
|
|
73
|
+
schemaVersionBuilder,
|
|
74
|
+
migrationsValidator as any,
|
|
75
|
+
systemClientProvider as any,
|
|
76
|
+
filesManager,
|
|
77
|
+
schemaStateManager,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
await facade.rebase([...(await migrationsResolver.getSchemaMigrations())])
|
|
81
|
+
|
|
82
|
+
const modifyIndex = calls.findIndex(it => it.method === 'migrationModify')
|
|
83
|
+
expect(modifyIndex).toBeGreaterThanOrEqual(0)
|
|
84
|
+
const restate = calls.slice(modifyIndex + 1).find(it => it.method === 'migrate' && it.args[2])
|
|
85
|
+
expect(restate).toBeDefined()
|
|
86
|
+
expect(Object.keys(restate!.args[2].acl.roles)).toStrictEqual(['admin'])
|
|
87
|
+
})
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
|
|
2
|
+
import * as fs from 'node:fs/promises'
|
|
3
|
+
import * as os from 'node:os'
|
|
4
|
+
import * as path from 'node:path'
|
|
5
|
+
import { c, createSchema } from '@contember/schema-definition'
|
|
6
|
+
import { emptySchema } from '@contember/schema-utils'
|
|
7
|
+
import {
|
|
8
|
+
JsonLoader,
|
|
9
|
+
MigrationFilesManager,
|
|
10
|
+
MigrationParser,
|
|
11
|
+
MigrationsResolver,
|
|
12
|
+
ModificationHandlerFactory,
|
|
13
|
+
SchemaDiffer,
|
|
14
|
+
SchemaMigrator,
|
|
15
|
+
SchemaStateManager,
|
|
16
|
+
SchemaVersionBuilder,
|
|
17
|
+
SnapshotManager,
|
|
18
|
+
VERSION_LATEST,
|
|
19
|
+
} from '@contember/migrations-client'
|
|
20
|
+
import { MigrationSnapshotFacade } from '../../../src/lib/migrations/MigrationSnapshotFacade.js'
|
|
21
|
+
|
|
22
|
+
namespace ModelA {
|
|
23
|
+
export class Author {
|
|
24
|
+
name = c.stringColumn()
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
namespace ModelB {
|
|
29
|
+
export class Author {
|
|
30
|
+
name = c.stringColumn()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class Category {
|
|
34
|
+
title = c.stringColumn()
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
namespace WithRelation {
|
|
39
|
+
export class Author {
|
|
40
|
+
name = c.stringColumn()
|
|
41
|
+
posts = c.oneHasMany(Post, 'author')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export class Post {
|
|
45
|
+
title = c.stringColumn()
|
|
46
|
+
author = c.manyHasOne(Author, 'posts').notNull()
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
namespace WithRelationAndColumn {
|
|
51
|
+
export class Author {
|
|
52
|
+
name = c.stringColumn()
|
|
53
|
+
// added after `posts` already exists — a replay orders Author.fields as [..., posts, nickname]
|
|
54
|
+
// while the collapsed differ emits columns before relations: [..., nickname, posts].
|
|
55
|
+
nickname = c.stringColumn()
|
|
56
|
+
posts = c.oneHasMany(Post, 'author')
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export class Post {
|
|
60
|
+
title = c.stringColumn()
|
|
61
|
+
author = c.manyHasOne(Author, 'posts').notNull()
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const setup = async (migrationsDir: string) => {
|
|
66
|
+
const filesManager = new MigrationFilesManager(migrationsDir, { json: new JsonLoader(new MigrationParser()) })
|
|
67
|
+
const migrationsResolver = new MigrationsResolver(filesManager)
|
|
68
|
+
const schemaMigrator = new SchemaMigrator(new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap))
|
|
69
|
+
const schemaStateManager = new SchemaStateManager(path.join(migrationsDir, 'state'))
|
|
70
|
+
const schemaVersionBuilder = new SchemaVersionBuilder(migrationsResolver, schemaMigrator, schemaStateManager)
|
|
71
|
+
const schemaDiffer = new SchemaDiffer(schemaMigrator)
|
|
72
|
+
const snapshotManager = new SnapshotManager(path.join(migrationsDir, 'snapshot.json'))
|
|
73
|
+
const facade = new MigrationSnapshotFacade(
|
|
74
|
+
migrationsResolver,
|
|
75
|
+
schemaVersionBuilder,
|
|
76
|
+
schemaDiffer,
|
|
77
|
+
schemaMigrator,
|
|
78
|
+
schemaStateManager,
|
|
79
|
+
snapshotManager,
|
|
80
|
+
)
|
|
81
|
+
return { facade, schemaDiffer, snapshotManager }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
describe('MigrationSnapshotFacade', () => {
|
|
85
|
+
let migrationsDir: string
|
|
86
|
+
|
|
87
|
+
// Each call mints a facade with a fresh MigrationFilesManager cache, simulating a new CLI process.
|
|
88
|
+
const freshFacade = async () => (await setup(migrationsDir)).facade
|
|
89
|
+
|
|
90
|
+
beforeEach(async () => {
|
|
91
|
+
migrationsDir = await fs.mkdtemp(path.join(os.tmpdir(), 'contember-snapshot-facade-'))
|
|
92
|
+
const { schemaDiffer } = await setup(migrationsDir)
|
|
93
|
+
|
|
94
|
+
const schemaA = createSchema(ModelA)
|
|
95
|
+
const schemaB = createSchema(ModelB)
|
|
96
|
+
const write = (name: string, content: unknown) => fs.writeFile(path.join(migrationsDir, name), JSON.stringify(content, null, '\t'))
|
|
97
|
+
|
|
98
|
+
await write('2024-01-01-120000-a.json', { formatVersion: VERSION_LATEST, modifications: schemaDiffer.diffSchemas(emptySchema, schemaA) })
|
|
99
|
+
await write('2024-01-02-120000-b.json', { formatVersion: VERSION_LATEST, modifications: schemaDiffer.diffSchemas(schemaA, schemaB) })
|
|
100
|
+
await write('2024-01-03-120000-seed.json', { queries: [{ query: 'query { __typename }' }] })
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
afterEach(async () => {
|
|
104
|
+
await fs.rm(migrationsDir, { recursive: true, force: true })
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
test('create collapses all migrations and records what they cover', async () => {
|
|
108
|
+
const snapshot = await (await freshFacade()).create()
|
|
109
|
+
|
|
110
|
+
expect(snapshot.version).toBe('2024-01-03-120000')
|
|
111
|
+
expect(snapshot.covers.map(it => it.type)).toStrictEqual(['schema', 'schema', 'content'])
|
|
112
|
+
expect(snapshot.covers[0].checksum).toBeString()
|
|
113
|
+
expect(snapshot.covers[2].checksum).toBeNull()
|
|
114
|
+
// the content migration is flagged: its data is not reproduced by the schema snapshot
|
|
115
|
+
expect(snapshot.contentMigrations).toStrictEqual(['2024-01-03-120000'])
|
|
116
|
+
expect(snapshot.snapshot.modifications.length).toBeGreaterThan(0)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
test('a freshly created snapshot verifies against a full replay', async () => {
|
|
120
|
+
await (await freshFacade()).create()
|
|
121
|
+
const result = await (await freshFacade()).verify()
|
|
122
|
+
expect(result.ok).toBe(true)
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
test('verify tolerates schema key-order differences between a replay and the collapsed snapshot', async () => {
|
|
126
|
+
// History adds a column to an entity that already has a relation. A replay orders the entity's
|
|
127
|
+
// fields as [..., relation, column]; the collapsed differ orders them [..., column, relation].
|
|
128
|
+
// The two schemas are deeply equal but their JSON checksums differ — verify must not report a
|
|
129
|
+
// false mismatch (it compares order-insensitively, like SchemaDiffer's own round-trip check).
|
|
130
|
+
const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'contember-snapshot-rel-'))
|
|
131
|
+
try {
|
|
132
|
+
const { schemaDiffer } = await setup(dir)
|
|
133
|
+
const a = createSchema(WithRelation)
|
|
134
|
+
const b = createSchema(WithRelationAndColumn)
|
|
135
|
+
const write = (name: string, content: unknown) => fs.writeFile(path.join(dir, name), JSON.stringify(content, null, '\t'))
|
|
136
|
+
await write('2024-01-01-120000-a.json', { formatVersion: VERSION_LATEST, modifications: schemaDiffer.diffSchemas(emptySchema, a) })
|
|
137
|
+
await write('2024-01-02-120000-b.json', { formatVersion: VERSION_LATEST, modifications: schemaDiffer.diffSchemas(a, b) })
|
|
138
|
+
|
|
139
|
+
await (await setup(dir)).facade.create()
|
|
140
|
+
const result = await (await setup(dir)).facade.verify()
|
|
141
|
+
expect(result.ok).toBe(true)
|
|
142
|
+
} finally {
|
|
143
|
+
await fs.rm(dir, { recursive: true, force: true })
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
test('verify fails when a covered migration changed after the snapshot', async () => {
|
|
148
|
+
await (await freshFacade()).create()
|
|
149
|
+
// tamper with a covered schema migration, then re-read from a fresh process
|
|
150
|
+
await fs.writeFile(
|
|
151
|
+
path.join(migrationsDir, '2024-01-02-120000-b.json'),
|
|
152
|
+
JSON.stringify({ formatVersion: VERSION_LATEST, modifications: [] }, null, '\t'),
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
const result = await (await freshFacade()).verify()
|
|
156
|
+
expect(result.ok).toBe(false)
|
|
157
|
+
expect(result.message).toMatch(/stale/)
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
test('getUsableSnapshot returns the snapshot for an empty project', async () => {
|
|
161
|
+
await (await freshFacade()).create()
|
|
162
|
+
expect(await (await freshFacade()).getUsableSnapshot([])).not.toBeNull()
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
test('getUsableSnapshot returns null when the project already has executed migrations', async () => {
|
|
166
|
+
await (await freshFacade()).create()
|
|
167
|
+
const executed = [{
|
|
168
|
+
version: '2024-01-01-120000',
|
|
169
|
+
name: '2024-01-01-120000-a',
|
|
170
|
+
formatVersion: VERSION_LATEST,
|
|
171
|
+
checksum: 'x',
|
|
172
|
+
executedAt: new Date(),
|
|
173
|
+
}]
|
|
174
|
+
expect(await (await freshFacade()).getUsableSnapshot(executed as any)).toBeNull()
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
test('getUsableSnapshot returns null (with a warning) when a covered migration is stale', async () => {
|
|
178
|
+
await (await freshFacade()).create()
|
|
179
|
+
await fs.rm(path.join(migrationsDir, '2024-01-01-120000-a.json'))
|
|
180
|
+
expect(await (await freshFacade()).getUsableSnapshot([])).toBeNull()
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
test('getUsableSnapshot ignores the snapshot when a migration was added within the covered range', async () => {
|
|
184
|
+
await (await freshFacade()).create()
|
|
185
|
+
// a migration whose version falls between two covered migrations, added without regenerating the
|
|
186
|
+
// snapshot. Bootstrapping would then fail with MUST_FOLLOW_LATEST, so it must fall back to replay.
|
|
187
|
+
await fs.writeFile(
|
|
188
|
+
path.join(migrationsDir, '2024-01-01-130000-inrange.json'),
|
|
189
|
+
JSON.stringify({ formatVersion: VERSION_LATEST, modifications: [] }, null, '\t'),
|
|
190
|
+
)
|
|
191
|
+
expect(await (await freshFacade()).getUsableSnapshot([])).toBeNull()
|
|
192
|
+
|
|
193
|
+
const result = await (await freshFacade()).verify()
|
|
194
|
+
expect(result.ok).toBe(false)
|
|
195
|
+
expect(result.message).toMatch(/within the covered range/)
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
test('verify fails when a covered migration changed type', async () => {
|
|
199
|
+
const { schemaDiffer } = await setup(migrationsDir)
|
|
200
|
+
await (await freshFacade()).create()
|
|
201
|
+
// the seed migration was recorded as a content cover; rewrite it into a schema migration. Its
|
|
202
|
+
// modifications are absent from the collapsed snapshot, so it no longer equals a full replay.
|
|
203
|
+
await fs.writeFile(
|
|
204
|
+
path.join(migrationsDir, '2024-01-03-120000-seed.json'),
|
|
205
|
+
JSON.stringify(
|
|
206
|
+
{ formatVersion: VERSION_LATEST, modifications: schemaDiffer.diffSchemas(createSchema(ModelB), createSchema(ModelA)) },
|
|
207
|
+
null,
|
|
208
|
+
'\t',
|
|
209
|
+
),
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
expect(await (await freshFacade()).getUsableSnapshot([])).toBeNull()
|
|
213
|
+
const result = await (await freshFacade()).verify()
|
|
214
|
+
expect(result.ok).toBe(false)
|
|
215
|
+
expect(result.message).toMatch(/changed type/)
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
test('verify fails when schema state mode was toggled after the snapshot', async () => {
|
|
219
|
+
await (await freshFacade()).create()
|
|
220
|
+
// enabling state mode (migrations:init-state) only creates the state/ dir — it leaves the covered
|
|
221
|
+
// migration files untouched, so without an explicit guard the snapshot would pass unnoticed.
|
|
222
|
+
await fs.mkdir(path.join(migrationsDir, 'state'), { recursive: true })
|
|
223
|
+
|
|
224
|
+
expect(await (await freshFacade()).getUsableSnapshot([])).toBeNull()
|
|
225
|
+
const result = await (await freshFacade()).verify()
|
|
226
|
+
expect(result.ok).toBe(false)
|
|
227
|
+
expect(result.message).toMatch(/state mode changed/)
|
|
228
|
+
})
|
|
229
|
+
|
|
230
|
+
test('buildSnapshotInput maps covered migrations to GraphQL inputs', async () => {
|
|
231
|
+
const facade = await freshFacade()
|
|
232
|
+
const snapshot = await facade.create()
|
|
233
|
+
const input = await facade.buildSnapshotInput(snapshot)
|
|
234
|
+
|
|
235
|
+
expect(input.covers).toHaveLength(3)
|
|
236
|
+
const schemaCover = input.covers[0] as any
|
|
237
|
+
expect(schemaCover.type).toBe('SCHEMA')
|
|
238
|
+
expect(schemaCover.schemaMigration.modifications.length).toBeGreaterThan(0)
|
|
239
|
+
const contentCover = input.covers[2] as any
|
|
240
|
+
expect(contentCover.type).toBe('CONTENT')
|
|
241
|
+
expect(contentCover.contentMigration).toStrictEqual([])
|
|
242
|
+
})
|
|
243
|
+
})
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test'
|
|
2
|
+
import { TenantConfigApplier } from '../src/lib/tenant/TenantConfigApplier.js'
|
|
3
|
+
import type { RemoteIdentityProvider, TenantClient } from '../src/lib/tenant/TenantClient.js'
|
|
4
|
+
|
|
5
|
+
const createClientMock = (existingIdps: RemoteIdentityProvider[] = []) => {
|
|
6
|
+
const calls: string[] = []
|
|
7
|
+
const client = {
|
|
8
|
+
configure: async () => {
|
|
9
|
+
calls.push('configure')
|
|
10
|
+
},
|
|
11
|
+
listIdentityProviders: async () => existingIdps,
|
|
12
|
+
addIdp: async (slug: string) => {
|
|
13
|
+
calls.push(`addIdp:${slug}`)
|
|
14
|
+
},
|
|
15
|
+
updateIdp: async (slug: string) => {
|
|
16
|
+
calls.push(`updateIdp:${slug}`)
|
|
17
|
+
},
|
|
18
|
+
enableIdp: async (slug: string) => {
|
|
19
|
+
calls.push(`enableIdp:${slug}`)
|
|
20
|
+
},
|
|
21
|
+
disableIdp: async (slug: string) => {
|
|
22
|
+
calls.push(`disableIdp:${slug}`)
|
|
23
|
+
},
|
|
24
|
+
addMailTemplate: async (template: { type: string }) => {
|
|
25
|
+
calls.push(`addMailTemplate:${template.type}`)
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
return { client: client as unknown as TenantClient, calls }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe('TenantConfigApplier', () => {
|
|
32
|
+
test('sends configure when global config is present', async () => {
|
|
33
|
+
const { client, calls } = createClientMock()
|
|
34
|
+
await new TenantConfigApplier().apply(client, { config: { password: { minLength: 8 } } })
|
|
35
|
+
expect(calls).toEqual(['configure'])
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
test('adds a new identity provider', async () => {
|
|
39
|
+
const { client, calls } = createClientMock([])
|
|
40
|
+
await new TenantConfigApplier().apply(client, {
|
|
41
|
+
identityProviders: { google: { type: 'oidc', configuration: {} } },
|
|
42
|
+
})
|
|
43
|
+
expect(calls).toEqual(['addIdp:google'])
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
test('updates an existing identity provider', async () => {
|
|
47
|
+
const { client, calls } = createClientMock([{ slug: 'google', type: 'oidc', disabledAt: null }])
|
|
48
|
+
await new TenantConfigApplier().apply(client, {
|
|
49
|
+
identityProviders: { google: { type: 'oidc', configuration: {} } },
|
|
50
|
+
})
|
|
51
|
+
expect(calls).toEqual(['updateIdp:google'])
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
test('disables an enabled provider marked disabled', async () => {
|
|
55
|
+
const { client, calls } = createClientMock([{ slug: 'google', type: 'oidc', disabledAt: null }])
|
|
56
|
+
await new TenantConfigApplier().apply(client, {
|
|
57
|
+
identityProviders: { google: { type: 'oidc', configuration: {}, disabled: true } },
|
|
58
|
+
})
|
|
59
|
+
expect(calls).toEqual(['updateIdp:google', 'disableIdp:google'])
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
test('re-enables a disabled provider no longer marked disabled', async () => {
|
|
63
|
+
const { client, calls } = createClientMock([{ slug: 'google', type: 'oidc', disabledAt: '2024-01-01T00:00:00Z' }])
|
|
64
|
+
await new TenantConfigApplier().apply(client, {
|
|
65
|
+
identityProviders: { google: { type: 'oidc', configuration: {} } },
|
|
66
|
+
})
|
|
67
|
+
expect(calls).toEqual(['updateIdp:google', 'enableIdp:google'])
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
test('upserts mail templates', async () => {
|
|
71
|
+
const { client, calls } = createClientMock()
|
|
72
|
+
await new TenantConfigApplier().apply(client, {
|
|
73
|
+
mailTemplates: [{ type: 'RESET_PASSWORD_REQUEST', subject: 's', content: 'c' }],
|
|
74
|
+
})
|
|
75
|
+
expect(calls).toEqual(['addMailTemplate:RESET_PASSWORD_REQUEST'])
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test('dry run performs no mutations but still reads state', async () => {
|
|
79
|
+
const { client, calls } = createClientMock([])
|
|
80
|
+
await new TenantConfigApplier().apply(client, {
|
|
81
|
+
config: { password: { minLength: 8 } },
|
|
82
|
+
identityProviders: { google: { type: 'oidc', configuration: {} } },
|
|
83
|
+
mailTemplates: [{ type: 'RESET_PASSWORD_REQUEST', subject: 's', content: 'c' }],
|
|
84
|
+
}, { dryRun: true })
|
|
85
|
+
expect(calls).toEqual([])
|
|
86
|
+
})
|
|
87
|
+
})
|