@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransferCommand.js","sources":["../../../../../../packages/cli/src/commands/transfer/TransferCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { confirmImport } from './utils'\nimport { maskToken } from '../../lib/maskToken'\nimport { printProgressLine } from '../../lib/transfer/stdio'\nimport { readStream } from '../../lib/stream'\nimport { createGunzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient'\nimport { Duplex, Readable } from 'node:stream'\n\ntype Args = {\n\tsource: string\n\ttarget: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t'no-gzip-transfer'?: boolean\n\tyes: boolean\n\t'exclude-table'?: string[]\n}\n\nexport class TransferCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Transfer data between projects')\n\t\tconfiguration.argument('source')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst source = input.getArgument('source')\n\t\tconst sourceProject = await this.remoteProjectResolver.resolve(source)\n\t\tif (!sourceProject) {\n\t\t\tthrow `Source project not defined`\n\t\t}\n\n\t\tconst target = input.getArgument('target')\n\t\tconst targetProject = await this.remoteProjectResolver.resolve(target)\n\t\tif (!targetProject) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Transferring data between projects:')\n\t\tconsole.log('')\n\t\tconsole.log(`Source project name: ${sourceProject.name}`)\n\t\tconsole.log(`Source API URL: ${sourceProject.endpoint}`)\n\t\tconsole.log(`Source token: ${maskToken(sourceProject.token)}`)\n\t\tconsole.log('')\n\t\tconsole.log(`Target project name: ${targetProject.name}`)\n\t\tconsole.log(`Target API URL: ${targetProject.endpoint}`)\n\t\tconsole.log(`Target token: ${maskToken(targetProject.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst exportResponse = await this.dataTransferClient.dataExport({\n\t\t\tproject: sourceProject,\n\t\t\tincludeSystem,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconst stream = Readable.fromWeb(exportResponse.body! as any)\n\t\tconst importResponse = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject: targetProject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\n\t\tconst responseData = await importResponse.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Transfer done.')\n\t\t} else {\n\t\t\tconsole.error('Transfer failed:')\n\t\t\tconsole.log(responseData)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,wBAAwB,QAAuB;AAAA,EAC3D,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,gCAAgC;AAC1D,kBAAc,SAAS,QAAQ;AAC/B,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,gBAAgB,EAAE,UAAA;AACvC,kBAAc,OAAO,kBAAkB,EAAE,UAAA;AACzC,kBAAc,OAAO,KAAK,EAAE,UAAA;AAC5B,kBAAc,OAAO,eAAe,EAAE,WAAA;AAAA,EACvC;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAC5E,UAAM,SAAS,MAAM,YAAY,QAAQ;AACzC,UAAM,gBAAgB,MAAM,KAAK,sBAAsB,QAAQ,MAAM;AACrE,QAAI,CAAC,eAAe;AACnB,YAAM;AAAA,IACP;AAEA,UAAM,SAAS,MAAM,YAAY,QAAQ;AACzC,UAAM,gBAAgB,MAAM,KAAK,sBAAsB,QAAQ,MAAM;AACrE,QAAI,CAAC,eAAe;AACnB,YAAM;AAAA,IACP;AAEA,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,qCAAqC;AACjD,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,wBAAwB,cAAc,IAAI,EAAE;AACxD,YAAQ,IAAI,mBAAmB,cAAc,QAAQ,EAAE;AACvD,YAAQ,IAAI,iBAAiB,UAAU,cAAc,KAAK,CAAC,EAAE;AAC7D,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,wBAAwB,cAAc,IAAI,EAAE;AACxD,YAAQ,IAAI,mBAAmB,cAAc,QAAQ,EAAE;AACvD,YAAQ,IAAI,iBAAiB,UAAU,cAAc,KAAK,CAAC,EAAE;AAC7D,YAAQ,IAAI,EAAE;AACd,QAAI,CAAC,MAAM,cAAc,KAAK,GAAG;AAChC,aAAO;AAAA,IACR;AAEA,UAAM,gBAAgB,MAAM,UAAU,gBAAgB,MAAM;AAC5D,UAAM,eAAe,CAAC,MAAM,UAAU,kBAAkB;AACxD,UAAM,iBAAiB,MAAM,KAAK,mBAAmB,WAAW;AAAA,MAC/D,SAAS;AAAA,MACT;AAAA,MACA,eAAe,MAAM,UAAU,eAAe,KAAK,CAAA;AAAA,MACnD,MAAM;AAAA,IAAA,CACN;AACD,UAAM,SAAS,SAAS,QAAQ,eAAe,IAAY;AAC3D,UAAM,iBAAiB,MAAM,KAAK,mBAAmB,WAAW;AAAA,MAC/D;AAAA,MACA,SAAS;AAAA,MACT,eAAe;AAAA,MACf,MAAM;AAAA,IAAA,CACN;AACD,YAAQ,IAAI,EAAE;AAEd,UAAM,eAAe,MAAM,eAAe,KAAA;AAC1C,QAAI,aAAa,IAAI;AACpB,cAAQ,IAAI,gBAAgB;AAAA,IAC7B,OAAO;AACN,cAAQ,MAAM,kBAAkB;AAChC,cAAQ,IAAI,YAAY;AAAA,IACzB;AAAA,EACD;AACD;"}
|
|
1
|
+
{"version":3,"file":"TransferCommand.js","sources":["../../../../../../packages/cli/src/commands/transfer/TransferCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { confirmImport } from './utils.js'\nimport { maskToken } from '../../lib/maskToken.js'\nimport { printProgressLine } from '../../lib/transfer/stdio.js'\nimport { readStream } from '../../lib/stream.js'\nimport { createGunzip } from 'node:zlib'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'\nimport { DataTransferClient } from '../../lib/transfer/DataTransferClient.js'\nimport { Duplex, Readable } from 'node:stream'\n\ntype Args = {\n\tsource: string\n\ttarget: string\n}\ntype Options = {\n\t'include-system'?: boolean\n\t'no-gzip-transfer'?: boolean\n\tyes: boolean\n\t'exclude-table'?: string[]\n}\n\nexport class TransferCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly dataTransferClient: DataTransferClient,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Transfer data between projects')\n\t\tconfiguration.argument('source')\n\t\tconfiguration.argument('target').optional()\n\t\tconfiguration.option('include-system').valueNone()\n\t\tconfiguration.option('no-gzip-transfer').valueNone()\n\t\tconfiguration.option('yes').valueNone()\n\t\tconfiguration.option('exclude-table').valueArray()\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\t\tconst source = input.getArgument('source')\n\t\tconst sourceProject = await this.remoteProjectResolver.resolve(source)\n\t\tif (!sourceProject) {\n\t\t\tthrow `Source project not defined`\n\t\t}\n\n\t\tconst target = input.getArgument('target')\n\t\tconst targetProject = await this.remoteProjectResolver.resolve(target)\n\t\tif (!targetProject) {\n\t\t\tthrow `Target project not defined`\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Transferring data between projects:')\n\t\tconsole.log('')\n\t\tconsole.log(`Source project name: ${sourceProject.name}`)\n\t\tconsole.log(`Source API URL: ${sourceProject.endpoint}`)\n\t\tconsole.log(`Source token: ${maskToken(sourceProject.token)}`)\n\t\tconsole.log('')\n\t\tconsole.log(`Target project name: ${targetProject.name}`)\n\t\tconsole.log(`Target API URL: ${targetProject.endpoint}`)\n\t\tconsole.log(`Target token: ${maskToken(targetProject.token)}`)\n\t\tconsole.log('')\n\t\tif (!await confirmImport(input)) {\n\t\t\treturn 1\n\t\t}\n\n\t\tconst includeSystem = input.getOption('include-system') === true\n\t\tconst gzipTransfer = !input.getOption('no-gzip-transfer')\n\t\tconst exportResponse = await this.dataTransferClient.dataExport({\n\t\t\tproject: sourceProject,\n\t\t\tincludeSystem,\n\t\t\texcludeTables: input.getOption('exclude-table') ?? [],\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconst stream = Readable.fromWeb(exportResponse.body! as any)\n\t\tconst importResponse = await this.dataTransferClient.dataImport({\n\t\t\tstream: stream,\n\t\t\tproject: targetProject,\n\t\t\tprintProgress: printProgressLine,\n\t\t\tgzip: gzipTransfer,\n\t\t})\n\t\tconsole.log('')\n\n\t\tconst responseData = await importResponse.json()\n\t\tif (responseData.ok) {\n\t\t\tconsole.log('Transfer done.')\n\t\t} else {\n\t\t\tconsole.error('Transfer failed:')\n\t\t\tconsole.log(responseData)\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,wBAAwB,QAAuB;AAAA,EAC3D,YACkB,uBACA,oBAChB;AACD,UAAA;AAHiB,SAAA,wBAAA;AACA,SAAA,qBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,gCAAgC;AAC1D,kBAAc,SAAS,QAAQ;AAC/B,kBAAc,SAAS,QAAQ,EAAE,SAAA;AACjC,kBAAc,OAAO,gBAAgB,EAAE,UAAA;AACvC,kBAAc,OAAO,kBAAkB,EAAE,UAAA;AACzC,kBAAc,OAAO,KAAK,EAAE,UAAA;AAC5B,kBAAc,OAAO,eAAe,EAAE,WAAA;AAAA,EACvC;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAC5E,UAAM,SAAS,MAAM,YAAY,QAAQ;AACzC,UAAM,gBAAgB,MAAM,KAAK,sBAAsB,QAAQ,MAAM;AACrE,QAAI,CAAC,eAAe;AACnB,YAAM;AAAA,IACP;AAEA,UAAM,SAAS,MAAM,YAAY,QAAQ;AACzC,UAAM,gBAAgB,MAAM,KAAK,sBAAsB,QAAQ,MAAM;AACrE,QAAI,CAAC,eAAe;AACnB,YAAM;AAAA,IACP;AAEA,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,qCAAqC;AACjD,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,wBAAwB,cAAc,IAAI,EAAE;AACxD,YAAQ,IAAI,mBAAmB,cAAc,QAAQ,EAAE;AACvD,YAAQ,IAAI,iBAAiB,UAAU,cAAc,KAAK,CAAC,EAAE;AAC7D,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,wBAAwB,cAAc,IAAI,EAAE;AACxD,YAAQ,IAAI,mBAAmB,cAAc,QAAQ,EAAE;AACvD,YAAQ,IAAI,iBAAiB,UAAU,cAAc,KAAK,CAAC,EAAE;AAC7D,YAAQ,IAAI,EAAE;AACd,QAAI,CAAC,MAAM,cAAc,KAAK,GAAG;AAChC,aAAO;AAAA,IACR;AAEA,UAAM,gBAAgB,MAAM,UAAU,gBAAgB,MAAM;AAC5D,UAAM,eAAe,CAAC,MAAM,UAAU,kBAAkB;AACxD,UAAM,iBAAiB,MAAM,KAAK,mBAAmB,WAAW;AAAA,MAC/D,SAAS;AAAA,MACT;AAAA,MACA,eAAe,MAAM,UAAU,eAAe,KAAK,CAAA;AAAA,MACnD,MAAM;AAAA,IAAA,CACN;AACD,UAAM,SAAS,SAAS,QAAQ,eAAe,IAAY;AAC3D,UAAM,iBAAiB,MAAM,KAAK,mBAAmB,WAAW;AAAA,MAC/D;AAAA,MACA,SAAS;AAAA,MACT,eAAe;AAAA,MACf,MAAM;AAAA,IAAA,CACN;AACD,YAAQ,IAAI,EAAE;AAEd,UAAM,eAAe,MAAM,eAAe,KAAA;AAC1C,QAAI,aAAa,IAAI;AACpB,cAAQ,IAAI,gBAAgB;AAAA,IAC7B,OAAO;AACN,cAAQ,MAAM,kBAAkB;AAChC,cAAQ,IAAI,YAAY;AAAA,IACzB;AAAA,EACD;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceUpdateApiCommand.cjs","sources":["../../../../../../packages/cli/src/commands/workspace/WorkspaceUpdateApiCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from '../../lib/fs/DockerComposeManager'\nimport { contemberDockerImages } from '../../consts'\n\ntype Args = {\n\tversion: string\n}\n\ntype Options = {}\n\nexport class WorkspaceUpdateApiCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Updates Contember API version and all related packages')\n\t\tconfiguration.argument('version')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst version = input.getArgument('version')\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tawait packageWorkspace.updateEverywhere({\n\t\t\t'@contember/schema': version,\n\t\t\t'@contember/schema-definition': version,\n\t\t\t'@contember/cli': version,\n\t\t})\n\n\t\tconsole.log('Updating docker-compose')\n\t\tconst getNewImage = (currentImage: string): string | null => {\n\t\t\tfor (const candidate of contemberDockerImages) {\n\t\t\t\tif (currentImage.startsWith(`${candidate}:`)) {\n\t\t\t\t\treturn `${candidate.replace(/-ee$/, '')}:${version}`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t}\n\t\tawait this.dockerComposeManager.updateMainDockerComposeConfig(data => ({\n\t\t\t...data,\n\t\t\tservices: Object.fromEntries(\n\t\t\t\tObject.entries(data?.services ?? {}).map(([name, service]: [string, any]) => {\n\t\t\t\t\tconst newImage = getNewImage(service.image)\n\t\t\t\t\tif (newImage) {\n\t\t\t\t\t\tconsole.log(`docker-compose service ${name} updated`)\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\t\timage: newImage,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\treturn [name, service]\n\t\t\t\t}),\n\t\t\t),\n\t\t}))\n\t\tconsole.log('API versions updated')\n\t\tconsole.log('Restart server to apply changes')\n\t}\n}\n"],"names":["Command","contemberDockerImages"],"mappings":";;;;AAUO,MAAM,kCAAkCA,UAAAA,QAAuB;AAAA,EACrE,YACkB,0BACA,sBAChB;AACD,UAAA;AAHiB,SAAA,2BAAA;AACA,SAAA,uBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,wDAAwD;AAClF,kBAAc,SAAS,SAAS;AAAA,EACjC;AAAA,EAEA,MAAgB,QAAQ,OAA4C;AACnE,UAAM,UAAU,MAAM,YAAY,SAAS;AAC3C,UAAM,mBAAmB,MAAM,KAAK,yBAAyB,QAAA;AAE7D,UAAM,iBAAiB,iBAAiB;AAAA,MACvC,qBAAqB;AAAA,MACrB,gCAAgC;AAAA,MAChC,kBAAkB;AAAA,IAAA,CAClB;AAED,YAAQ,IAAI,yBAAyB;AACrC,UAAM,cAAc,CAAC,iBAAwC;AAC5D,iBAAW,aAAaC,8BAAuB;AAC9C,YAAI,aAAa,WAAW,GAAG,SAAS,GAAG,GAAG;AAC7C,iBAAO,GAAG,UAAU,QAAQ,QAAQ,EAAE,CAAC,IAAI,OAAO;AAAA,QACnD;AAAA,MACD;AACA,aAAO;AAAA,IACR;AACA,UAAM,KAAK,qBAAqB,8BAA8B,CAAA,UAAS;AAAA,MACtE,GAAG;AAAA,MACH,UAAU,OAAO;AAAA,QAChB,OAAO,QAAQ,MAAM,YAAY,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,MAAM,OAAO,MAAqB;AAC5E,gBAAM,WAAW,YAAY,QAAQ,KAAK;AAC1C,cAAI,UAAU;AACb,oBAAQ,IAAI,0BAA0B,IAAI,UAAU;AACpD,mBAAO;AAAA,cACN;AAAA,cACA;AAAA,gBACC,GAAG;AAAA,gBACH,OAAO;AAAA,cAAA;AAAA,YACR;AAAA,UAEF;AACA,iBAAO,CAAC,MAAM,OAAO;AAAA,QACtB,CAAC;AAAA,MAAA;AAAA,IACF,EACC;AACF,YAAQ,IAAI,sBAAsB;AAClC,YAAQ,IAAI,iCAAiC;AAAA,EAC9C;AACD;;"}
|
|
1
|
+
{"version":3,"file":"WorkspaceUpdateApiCommand.cjs","sources":["../../../../../../packages/cli/src/commands/workspace/WorkspaceUpdateApiCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from '../../lib/fs/DockerComposeManager.js'\nimport { contemberDockerImages } from '../../consts.js'\n\ntype Args = {\n\tversion: string\n}\n\ntype Options = {}\n\nexport class WorkspaceUpdateApiCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Updates Contember API version and all related packages')\n\t\tconfiguration.argument('version')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst version = input.getArgument('version')\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tawait packageWorkspace.updateEverywhere({\n\t\t\t'@contember/schema': version,\n\t\t\t'@contember/schema-definition': version,\n\t\t\t'@contember/cli': version,\n\t\t})\n\n\t\tconsole.log('Updating docker-compose')\n\t\tconst getNewImage = (currentImage: string): string | null => {\n\t\t\tfor (const candidate of contemberDockerImages) {\n\t\t\t\tif (currentImage.startsWith(`${candidate}:`)) {\n\t\t\t\t\treturn `${candidate.replace(/-ee$/, '')}:${version}`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t}\n\t\tawait this.dockerComposeManager.updateMainDockerComposeConfig(data => ({\n\t\t\t...data,\n\t\t\tservices: Object.fromEntries(\n\t\t\t\tObject.entries(data?.services ?? {}).map(([name, service]: [string, any]) => {\n\t\t\t\t\tconst newImage = getNewImage(service.image)\n\t\t\t\t\tif (newImage) {\n\t\t\t\t\t\tconsole.log(`docker-compose service ${name} updated`)\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\t\timage: newImage,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\treturn [name, service]\n\t\t\t\t}),\n\t\t\t),\n\t\t}))\n\t\tconsole.log('API versions updated')\n\t\tconsole.log('Restart server to apply changes')\n\t}\n}\n"],"names":["Command","contemberDockerImages"],"mappings":";;;;AAUO,MAAM,kCAAkCA,UAAAA,QAAuB;AAAA,EACrE,YACkB,0BACA,sBAChB;AACD,UAAA;AAHiB,SAAA,2BAAA;AACA,SAAA,uBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,wDAAwD;AAClF,kBAAc,SAAS,SAAS;AAAA,EACjC;AAAA,EAEA,MAAgB,QAAQ,OAA4C;AACnE,UAAM,UAAU,MAAM,YAAY,SAAS;AAC3C,UAAM,mBAAmB,MAAM,KAAK,yBAAyB,QAAA;AAE7D,UAAM,iBAAiB,iBAAiB;AAAA,MACvC,qBAAqB;AAAA,MACrB,gCAAgC;AAAA,MAChC,kBAAkB;AAAA,IAAA,CAClB;AAED,YAAQ,IAAI,yBAAyB;AACrC,UAAM,cAAc,CAAC,iBAAwC;AAC5D,iBAAW,aAAaC,8BAAuB;AAC9C,YAAI,aAAa,WAAW,GAAG,SAAS,GAAG,GAAG;AAC7C,iBAAO,GAAG,UAAU,QAAQ,QAAQ,EAAE,CAAC,IAAI,OAAO;AAAA,QACnD;AAAA,MACD;AACA,aAAO;AAAA,IACR;AACA,UAAM,KAAK,qBAAqB,8BAA8B,CAAA,UAAS;AAAA,MACtE,GAAG;AAAA,MACH,UAAU,OAAO;AAAA,QAChB,OAAO,QAAQ,MAAM,YAAY,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,MAAM,OAAO,MAAqB;AAC5E,gBAAM,WAAW,YAAY,QAAQ,KAAK;AAC1C,cAAI,UAAU;AACb,oBAAQ,IAAI,0BAA0B,IAAI,UAAU;AACpD,mBAAO;AAAA,cACN;AAAA,cACA;AAAA,gBACC,GAAG;AAAA,gBACH,OAAO;AAAA,cAAA;AAAA,YACR;AAAA,UAEF;AACA,iBAAO,CAAC,MAAM,OAAO;AAAA,QACtB,CAAC;AAAA,MAAA;AAAA,IACF,EACC;AACF,YAAQ,IAAI,sBAAsB;AAClC,YAAQ,IAAI,iCAAiC;AAAA,EAC9C;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceUpdateApiCommand.js","sources":["../../../../../../packages/cli/src/commands/workspace/WorkspaceUpdateApiCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from '../../lib/fs/DockerComposeManager'\nimport { contemberDockerImages } from '../../consts'\n\ntype Args = {\n\tversion: string\n}\n\ntype Options = {}\n\nexport class WorkspaceUpdateApiCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Updates Contember API version and all related packages')\n\t\tconfiguration.argument('version')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst version = input.getArgument('version')\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tawait packageWorkspace.updateEverywhere({\n\t\t\t'@contember/schema': version,\n\t\t\t'@contember/schema-definition': version,\n\t\t\t'@contember/cli': version,\n\t\t})\n\n\t\tconsole.log('Updating docker-compose')\n\t\tconst getNewImage = (currentImage: string): string | null => {\n\t\t\tfor (const candidate of contemberDockerImages) {\n\t\t\t\tif (currentImage.startsWith(`${candidate}:`)) {\n\t\t\t\t\treturn `${candidate.replace(/-ee$/, '')}:${version}`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t}\n\t\tawait this.dockerComposeManager.updateMainDockerComposeConfig(data => ({\n\t\t\t...data,\n\t\t\tservices: Object.fromEntries(\n\t\t\t\tObject.entries(data?.services ?? {}).map(([name, service]: [string, any]) => {\n\t\t\t\t\tconst newImage = getNewImage(service.image)\n\t\t\t\t\tif (newImage) {\n\t\t\t\t\t\tconsole.log(`docker-compose service ${name} updated`)\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\t\timage: newImage,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\treturn [name, service]\n\t\t\t\t}),\n\t\t\t),\n\t\t}))\n\t\tconsole.log('API versions updated')\n\t\tconsole.log('Restart server to apply changes')\n\t}\n}\n"],"names":[],"mappings":";;AAUO,MAAM,kCAAkC,QAAuB;AAAA,EACrE,YACkB,0BACA,sBAChB;AACD,UAAA;AAHiB,SAAA,2BAAA;AACA,SAAA,uBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,wDAAwD;AAClF,kBAAc,SAAS,SAAS;AAAA,EACjC;AAAA,EAEA,MAAgB,QAAQ,OAA4C;AACnE,UAAM,UAAU,MAAM,YAAY,SAAS;AAC3C,UAAM,mBAAmB,MAAM,KAAK,yBAAyB,QAAA;AAE7D,UAAM,iBAAiB,iBAAiB;AAAA,MACvC,qBAAqB;AAAA,MACrB,gCAAgC;AAAA,MAChC,kBAAkB;AAAA,IAAA,CAClB;AAED,YAAQ,IAAI,yBAAyB;AACrC,UAAM,cAAc,CAAC,iBAAwC;AAC5D,iBAAW,aAAa,uBAAuB;AAC9C,YAAI,aAAa,WAAW,GAAG,SAAS,GAAG,GAAG;AAC7C,iBAAO,GAAG,UAAU,QAAQ,QAAQ,EAAE,CAAC,IAAI,OAAO;AAAA,QACnD;AAAA,MACD;AACA,aAAO;AAAA,IACR;AACA,UAAM,KAAK,qBAAqB,8BAA8B,CAAA,UAAS;AAAA,MACtE,GAAG;AAAA,MACH,UAAU,OAAO;AAAA,QAChB,OAAO,QAAQ,MAAM,YAAY,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,MAAM,OAAO,MAAqB;AAC5E,gBAAM,WAAW,YAAY,QAAQ,KAAK;AAC1C,cAAI,UAAU;AACb,oBAAQ,IAAI,0BAA0B,IAAI,UAAU;AACpD,mBAAO;AAAA,cACN;AAAA,cACA;AAAA,gBACC,GAAG;AAAA,gBACH,OAAO;AAAA,cAAA;AAAA,YACR;AAAA,UAEF;AACA,iBAAO,CAAC,MAAM,OAAO;AAAA,QACtB,CAAC;AAAA,MAAA;AAAA,IACF,EACC;AACF,YAAQ,IAAI,sBAAsB;AAClC,YAAQ,IAAI,iCAAiC;AAAA,EAC9C;AACD;"}
|
|
1
|
+
{"version":3,"file":"WorkspaceUpdateApiCommand.js","sources":["../../../../../../packages/cli/src/commands/workspace/WorkspaceUpdateApiCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input, PackageWorkspaceResolver } from '@contember/cli-common'\nimport { DockerComposeManager } from '../../lib/fs/DockerComposeManager.js'\nimport { contemberDockerImages } from '../../consts.js'\n\ntype Args = {\n\tversion: string\n}\n\ntype Options = {}\n\nexport class WorkspaceUpdateApiCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly packageWorkspaceResolver: PackageWorkspaceResolver,\n\t\tprivate readonly dockerComposeManager: DockerComposeManager,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Updates Contember API version and all related packages')\n\t\tconfiguration.argument('version')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void> {\n\t\tconst version = input.getArgument('version')\n\t\tconst packageWorkspace = await this.packageWorkspaceResolver.resolve()\n\n\t\tawait packageWorkspace.updateEverywhere({\n\t\t\t'@contember/schema': version,\n\t\t\t'@contember/schema-definition': version,\n\t\t\t'@contember/cli': version,\n\t\t})\n\n\t\tconsole.log('Updating docker-compose')\n\t\tconst getNewImage = (currentImage: string): string | null => {\n\t\t\tfor (const candidate of contemberDockerImages) {\n\t\t\t\tif (currentImage.startsWith(`${candidate}:`)) {\n\t\t\t\t\treturn `${candidate.replace(/-ee$/, '')}:${version}`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null\n\t\t}\n\t\tawait this.dockerComposeManager.updateMainDockerComposeConfig(data => ({\n\t\t\t...data,\n\t\t\tservices: Object.fromEntries(\n\t\t\t\tObject.entries(data?.services ?? {}).map(([name, service]: [string, any]) => {\n\t\t\t\t\tconst newImage = getNewImage(service.image)\n\t\t\t\t\tif (newImage) {\n\t\t\t\t\t\tconsole.log(`docker-compose service ${name} updated`)\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t...service,\n\t\t\t\t\t\t\t\timage: newImage,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t\treturn [name, service]\n\t\t\t\t}),\n\t\t\t),\n\t\t}))\n\t\tconsole.log('API versions updated')\n\t\tconsole.log('Restart server to apply changes')\n\t}\n}\n"],"names":[],"mappings":";;AAUO,MAAM,kCAAkC,QAAuB;AAAA,EACrE,YACkB,0BACA,sBAChB;AACD,UAAA;AAHiB,SAAA,2BAAA;AACA,SAAA,uBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,wDAAwD;AAClF,kBAAc,SAAS,SAAS;AAAA,EACjC;AAAA,EAEA,MAAgB,QAAQ,OAA4C;AACnE,UAAM,UAAU,MAAM,YAAY,SAAS;AAC3C,UAAM,mBAAmB,MAAM,KAAK,yBAAyB,QAAA;AAE7D,UAAM,iBAAiB,iBAAiB;AAAA,MACvC,qBAAqB;AAAA,MACrB,gCAAgC;AAAA,MAChC,kBAAkB;AAAA,IAAA,CAClB;AAED,YAAQ,IAAI,yBAAyB;AACrC,UAAM,cAAc,CAAC,iBAAwC;AAC5D,iBAAW,aAAa,uBAAuB;AAC9C,YAAI,aAAa,WAAW,GAAG,SAAS,GAAG,GAAG;AAC7C,iBAAO,GAAG,UAAU,QAAQ,QAAQ,EAAE,CAAC,IAAI,OAAO;AAAA,QACnD;AAAA,MACD;AACA,aAAO;AAAA,IACR;AACA,UAAM,KAAK,qBAAqB,8BAA8B,CAAA,UAAS;AAAA,MACtE,GAAG;AAAA,MACH,UAAU,OAAO;AAAA,QAChB,OAAO,QAAQ,MAAM,YAAY,CAAA,CAAE,EAAE,IAAI,CAAC,CAAC,MAAM,OAAO,MAAqB;AAC5E,gBAAM,WAAW,YAAY,QAAQ,KAAK;AAC1C,cAAI,UAAU;AACb,oBAAQ,IAAI,0BAA0B,IAAI,UAAU;AACpD,mBAAO;AAAA,cACN;AAAA,cACA;AAAA,gBACC,GAAG;AAAA,gBACH,OAAO;AAAA,cAAA;AAAA,YACR;AAAA,UAEF;AACA,iBAAO,CAAC,MAAM,OAAO;AAAA,QACtB,CAAC;AAAA,MAAA;AAAA,IACF,EACC;AACF,YAAQ,IAAI,sBAAsB;AAClC,YAAQ,IAAI,iCAAiC;AAAA,EAC9C;AACD;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const cliCommon = require("@contember/cli-common");
|
|
4
|
-
const
|
|
4
|
+
const path = require("node:path");
|
|
5
5
|
const node_url = require("node:url");
|
|
6
6
|
var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
|
|
7
|
-
const currentFilePath =
|
|
7
|
+
const currentFilePath = path.dirname(node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("cli/src/consts.cjs", document.baseURI).href));
|
|
8
8
|
const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || cliCommon.findPackageRoot(currentFilePath);
|
|
9
9
|
const contemberDockerImages = ["contember/engine", "contember/engine-ee", "contember/cli"];
|
|
10
10
|
exports.contemberDockerImages = contemberDockerImages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.cjs","sources":["../../../../packages/cli/src/consts.ts"],"sourcesContent":["import { findPackageRoot } from '@contember/cli-common'\nimport { dirname } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst currentFilePath = dirname(fileURLToPath(import.meta.url))\nexport const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)\nexport const contemberDockerImages = ['contember/engine', 'contember/engine-ee', 'contember/cli']\n"],"names":["dirname","fileURLToPath","findPackageRoot"],"mappings":";;;;;;AAIA,MAAM,kBAAkBA,
|
|
1
|
+
{"version":3,"file":"consts.cjs","sources":["../../../../packages/cli/src/consts.ts"],"sourcesContent":["import { findPackageRoot } from '@contember/cli-common'\nimport { dirname } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst currentFilePath = dirname(fileURLToPath(import.meta.url))\nexport const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)\nexport const contemberDockerImages = ['contember/engine', 'contember/engine-ee', 'contember/cli']\n"],"names":["dirname","fileURLToPath","findPackageRoot"],"mappings":";;;;;;AAIA,MAAM,kBAAkBA,KAAAA,QAAQC,uBAAc,OAAA,aAAA,cAAA,QAAA,KAAA,EAAA,cAAA,UAAA,EAAA,OAAA,0BAAA,uBAAA,QAAA,YAAA,MAAA,YAAA,uBAAA,OAAA,IAAA,IAAA,sBAAA,SAAA,OAAA,EAAA,IAAe,CAAC;AACvD,MAAM,cAAc,QAAQ,IAAI,8BAA8BC,UAAAA,gBAAgB,eAAe;AAC7F,MAAM,wBAAwB,CAAC,oBAAoB,uBAAuB,eAAe;;;"}
|
|
@@ -17,15 +17,20 @@ const MigrationBlankCommand = require("./commands/migrations/MigrationBlankComma
|
|
|
17
17
|
const MigrationDescribeCommand = require("./commands/migrations/MigrationDescribeCommand.cjs");
|
|
18
18
|
const MigrationDiffCommand = require("./commands/migrations/MigrationDiffCommand.cjs");
|
|
19
19
|
const MigrationExecuteCommand = require("./commands/migrations/MigrationExecuteCommand.cjs");
|
|
20
|
+
const MigrationInitStateCommand = require("./commands/migrations/MigrationInitStateCommand.cjs");
|
|
20
21
|
const MigrationStatusCommand = require("./commands/migrations/MigrationStatusCommand.cjs");
|
|
21
22
|
const MigrationRebaseCommand = require("./commands/migrations/MigrationRebaseCommand.cjs");
|
|
23
|
+
const MigrationSnapshotCommand = require("./commands/migrations/MigrationSnapshotCommand.cjs");
|
|
24
|
+
const MigrationVerifySnapshotCommand = require("./commands/migrations/MigrationVerifySnapshotCommand.cjs");
|
|
22
25
|
const VersionCommand = require("./commands/misc/VersionCommand.cjs");
|
|
23
26
|
const ProjectGenerateDocumentationCommand = require("./commands/project/ProjectGenerateDocumentationCommand.cjs");
|
|
24
27
|
const ProjectPrintSchemaCommand = require("./commands/project/ProjectPrintSchemaCommand.cjs");
|
|
25
28
|
const ProjectValidateCommand = require("./commands/project/ProjectValidateCommand.cjs");
|
|
29
|
+
const TenantApplyCommand = require("./commands/tenant/TenantApplyCommand.cjs");
|
|
26
30
|
const WorkspaceUpdateApiCommand = require("./commands/workspace/WorkspaceUpdateApiCommand.cjs");
|
|
27
31
|
const MigrationExecutionFacade = require("./lib/migrations/MigrationExecutionFacade.cjs");
|
|
28
32
|
const MigrationPrinter = require("./lib/migrations/MigrationPrinter.cjs");
|
|
33
|
+
const MigrationSnapshotFacade = require("./lib/migrations/MigrationSnapshotFacade.cjs");
|
|
29
34
|
const MigrationsStatusFacade = require("./lib/migrations/MigrationsStatusFacade.cjs");
|
|
30
35
|
const SchemaLoader = require("./lib/schema/SchemaLoader.cjs");
|
|
31
36
|
const MigrationsValidator = require("./lib/migrations/MigrationsValidator.cjs");
|
|
@@ -46,6 +51,8 @@ const ActionsListFailedEventsCommand = require("./commands/actions/ActionsListFa
|
|
|
46
51
|
const ActionsRetryEventCommand = require("./commands/actions/ActionsRetryEventCommand.cjs");
|
|
47
52
|
const ActionsGetEventCommand = require("./commands/actions/ActionsGetEventCommand.cjs");
|
|
48
53
|
const ActionsStopEventCommand = require("./commands/actions/ActionsStopEventCommand.cjs");
|
|
54
|
+
const TenantConfigLoader = require("./lib/tenant/TenantConfigLoader.cjs");
|
|
55
|
+
const TenantConfigApplier = require("./lib/tenant/TenantConfigApplier.cjs");
|
|
49
56
|
const jsSample = `
|
|
50
57
|
export const query = \`\`
|
|
51
58
|
export const variables = {}
|
|
@@ -83,13 +90,26 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
83
90
|
}).addService(
|
|
84
91
|
"dockerComposeManager",
|
|
85
92
|
({ workspace: workspace2, env: env2, fs, yamlHandler }) => new DockerComposeManager.DockerComposeManager(workspace2.baseDir, env2.dockerComposeFile, fs, yamlHandler)
|
|
86
|
-
).addService("modificationHandlerFactory", () => new migrationsClient.ModificationHandlerFactory(migrationsClient.ModificationHandlerFactory.defaultFactoryMap)).addService("schemaMigrator", ({ modificationHandlerFactory }) => new migrationsClient.SchemaMigrator(modificationHandlerFactory)).addService("migrationsResolver", ({ migrationFilesManager }) => new migrationsClient.MigrationsResolver(migrationFilesManager)).addService("
|
|
93
|
+
).addService("modificationHandlerFactory", () => new migrationsClient.ModificationHandlerFactory(migrationsClient.ModificationHandlerFactory.defaultFactoryMap)).addService("schemaMigrator", ({ modificationHandlerFactory }) => new migrationsClient.SchemaMigrator(modificationHandlerFactory)).addService("migrationsResolver", ({ migrationFilesManager }) => new migrationsClient.MigrationsResolver(migrationFilesManager)).addService("schemaStateManager", ({ workspace: workspace2 }) => new migrationsClient.SchemaStateManager(workspace2.migrationsDir + "/state")).addService("snapshotManager", ({ workspace: workspace2 }) => new migrationsClient.SnapshotManager(workspace2.migrationsDir + "/snapshot.json")).addService(
|
|
94
|
+
"schemaVersionBuilder",
|
|
95
|
+
({ migrationsResolver, schemaMigrator, schemaStateManager }) => new migrationsClient.SchemaVersionBuilder(migrationsResolver, schemaMigrator, schemaStateManager)
|
|
96
|
+
).addService("schemaDiffer", ({ schemaMigrator }) => new migrationsClient.SchemaDiffer(schemaMigrator, {
|
|
87
97
|
maxPatchSize: env.migrationsOptions?.maxPatchSize
|
|
88
98
|
})).addService("migrationCreator", ({ migrationFilesManager, schemaDiffer }) => new migrationsClient.MigrationCreator(migrationFilesManager, schemaDiffer, {
|
|
89
99
|
json: JSON.stringify({ formatVersion: migrationsClient.VERSION_LATEST, modifications: [] }, void 0, " ") + "\n",
|
|
90
100
|
ts: jsSample,
|
|
91
101
|
js: jsSample
|
|
92
102
|
})).addService("migrationDescriber", ({ modificationHandlerFactory }) => new migrationsClient.MigrationDescriber(modificationHandlerFactory)).addService("migrationPrinter", ({ migrationDescriber }) => new MigrationPrinter.MigrationPrinter(migrationDescriber)).addService("migrationsExecutor", () => new migrationsClient.MigrationExecutor()).addService("migrationsStatusResolver", () => new migrationsClient.MigrationsStatusResolver()).addService(
|
|
103
|
+
"migrationSnapshotFacade",
|
|
104
|
+
({ migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager }) => new MigrationSnapshotFacade.MigrationSnapshotFacade(
|
|
105
|
+
migrationsResolver,
|
|
106
|
+
schemaVersionBuilder,
|
|
107
|
+
schemaDiffer,
|
|
108
|
+
schemaMigrator,
|
|
109
|
+
schemaStateManager,
|
|
110
|
+
snapshotManager
|
|
111
|
+
)
|
|
112
|
+
).addService(
|
|
93
113
|
"migrationsStatusFacade",
|
|
94
114
|
({ systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter }) => new MigrationsStatusFacade.MigrationsStatusFacade(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter)
|
|
95
115
|
).addService(
|
|
@@ -101,7 +121,9 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
101
121
|
schemaVersionBuilder,
|
|
102
122
|
migrationPrinter,
|
|
103
123
|
migrationsExecutor,
|
|
104
|
-
migrationsStatusFacade
|
|
124
|
+
migrationsStatusFacade,
|
|
125
|
+
schemaStateManager,
|
|
126
|
+
migrationSnapshotFacade
|
|
105
127
|
}) => new MigrationExecutionFacade.MigrationExecutionFacade(
|
|
106
128
|
systemClientProvider,
|
|
107
129
|
tenantClientProvider,
|
|
@@ -109,11 +131,13 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
109
131
|
schemaVersionBuilder,
|
|
110
132
|
migrationPrinter,
|
|
111
133
|
migrationsExecutor,
|
|
112
|
-
migrationsStatusFacade
|
|
134
|
+
migrationsStatusFacade,
|
|
135
|
+
schemaStateManager,
|
|
136
|
+
migrationSnapshotFacade
|
|
113
137
|
)
|
|
114
138
|
).addService("migrationsValidator", ({ migrationDescriber, schemaMigrator }) => new MigrationsValidator.MigrationsValidator(migrationDescriber, schemaMigrator)).addService(
|
|
115
139
|
"migrationRebaseFacade",
|
|
116
|
-
({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager }) => new MigrationRebaseFacade.MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager)
|
|
140
|
+
({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager }) => new MigrationRebaseFacade.MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager)
|
|
117
141
|
).addService(
|
|
118
142
|
"schemaLoader",
|
|
119
143
|
({ workspace: workspace2, jsCodeRunner, runtime: runtime2 }) => runtime2 === "bun" ? new SchemaLoader.ImportSchemaLoader(workspace2) : new SchemaLoader.TranspilingSchemaLoader(workspace2, jsCodeRunner)
|
|
@@ -131,7 +155,8 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
131
155
|
migrationCreator,
|
|
132
156
|
migrationsValidator,
|
|
133
157
|
migrationPrinter,
|
|
134
|
-
schemaMigrator
|
|
158
|
+
schemaMigrator,
|
|
159
|
+
schemaStateManager
|
|
135
160
|
}) => new MigrationAmendCommand.MigrationAmendCommand(
|
|
136
161
|
migrationsResolver,
|
|
137
162
|
systemClientProvider,
|
|
@@ -141,17 +166,32 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
141
166
|
migrationCreator,
|
|
142
167
|
migrationsValidator,
|
|
143
168
|
migrationPrinter,
|
|
144
|
-
schemaMigrator
|
|
169
|
+
schemaMigrator,
|
|
170
|
+
schemaStateManager
|
|
145
171
|
)
|
|
146
172
|
).addService("migrationBlankCommand", ({ migrationCreator }) => new MigrationBlankCommand.MigrationBlankCommand(migrationCreator)).addService(
|
|
147
173
|
"migrationDescribeCommand",
|
|
148
174
|
({ migrationPrinter, schemaVersionBuilder, migrationsResolver }) => new MigrationDescribeCommand.MigrationDescribeCommand(migrationPrinter, schemaVersionBuilder, migrationsResolver)
|
|
149
175
|
).addService(
|
|
150
176
|
"migrationDiffCommand",
|
|
151
|
-
({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade }) => new MigrationDiffCommand.MigrationDiffCommand(
|
|
177
|
+
({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade, schemaStateManager, migrationsResolver }) => new MigrationDiffCommand.MigrationDiffCommand(
|
|
178
|
+
schemaLoader,
|
|
179
|
+
schemaVersionBuilder,
|
|
180
|
+
migrationCreator,
|
|
181
|
+
migrationPrinter,
|
|
182
|
+
migrationExecutionFacade,
|
|
183
|
+
schemaStateManager,
|
|
184
|
+
migrationsResolver
|
|
185
|
+
)
|
|
152
186
|
).addService("migrationExecuteCommand", ({ migrationExecutionFacade }) => new MigrationExecuteCommand.MigrationExecuteCommand(migrationExecutionFacade)).addService(
|
|
187
|
+
"migrationInitStateCommand",
|
|
188
|
+
({ schemaLoader, schemaStateManager }) => new MigrationInitStateCommand.MigrationInitStateCommand(schemaLoader, schemaStateManager)
|
|
189
|
+
).addService(
|
|
153
190
|
"migrationRebaseCommand",
|
|
154
191
|
({ migrationsResolver, migrationRebaseFacade }) => new MigrationRebaseCommand.MigrationRebaseCommand(migrationsResolver, migrationRebaseFacade)
|
|
192
|
+
).addService("migrationSnapshotCommand", ({ migrationSnapshotFacade }) => new MigrationSnapshotCommand.MigrationSnapshotCommand(migrationSnapshotFacade)).addService(
|
|
193
|
+
"migrationVerifySnapshotCommand",
|
|
194
|
+
({ migrationSnapshotFacade }) => new MigrationVerifySnapshotCommand.MigrationVerifySnapshotCommand(migrationSnapshotFacade)
|
|
155
195
|
).addService(
|
|
156
196
|
"migrationStatusCommand",
|
|
157
197
|
({ migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter }) => new MigrationStatusCommand.MigrationStatusCommand(migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter)
|
|
@@ -167,7 +207,13 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
167
207
|
).addService("exportCommand", ({ dataTransferClient, remoteProjectResolver }) => new ExportCommand.ExportCommand(remoteProjectResolver, dataTransferClient)).addService("importCommand", ({ dataTransferClient, remoteProjectResolver }) => new ImportCommand.ImportCommand(remoteProjectResolver, dataTransferClient)).addService("transferCommand", ({ dataTransferClient, remoteProjectResolver }) => new TransferCommand.TransferCommand(remoteProjectResolver, dataTransferClient)).addService(
|
|
168
208
|
"workspaceUpdateCommand",
|
|
169
209
|
({ packageWorkspaceResolver, dockerComposeManager }) => new WorkspaceUpdateApiCommand.WorkspaceUpdateApiCommand(packageWorkspaceResolver, dockerComposeManager)
|
|
170
|
-
).addService("actionsListVariables", ({ remoteProjectResolver }) => new ActionsListVariablesCommand.ActionsListVariablesCommand(remoteProjectResolver)).addService("actionsSetVariables", ({ remoteProjectResolver }) => new ActionsSetVariablesCommand.ActionsSetVariablesCommand(remoteProjectResolver)).addService("actionsListFailedEvents", ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand.ActionsListFailedEventsCommand(remoteProjectResolver)).addService("actionsRetryEvent", ({ remoteProjectResolver }) => new ActionsRetryEventCommand.ActionsRetryEventCommand(remoteProjectResolver)).addService("actionsGetEvent", ({ remoteProjectResolver }) => new ActionsGetEventCommand.ActionsGetEventCommand(remoteProjectResolver)).addService("actionsStopEvent", ({ remoteProjectResolver }) => new ActionsStopEventCommand.ActionsStopEventCommand(remoteProjectResolver)).addService(
|
|
210
|
+
).addService("actionsListVariables", ({ remoteProjectResolver }) => new ActionsListVariablesCommand.ActionsListVariablesCommand(remoteProjectResolver)).addService("actionsSetVariables", ({ remoteProjectResolver }) => new ActionsSetVariablesCommand.ActionsSetVariablesCommand(remoteProjectResolver)).addService("actionsListFailedEvents", ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand.ActionsListFailedEventsCommand(remoteProjectResolver)).addService("actionsRetryEvent", ({ remoteProjectResolver }) => new ActionsRetryEventCommand.ActionsRetryEventCommand(remoteProjectResolver)).addService("actionsGetEvent", ({ remoteProjectResolver }) => new ActionsGetEventCommand.ActionsGetEventCommand(remoteProjectResolver)).addService("actionsStopEvent", ({ remoteProjectResolver }) => new ActionsStopEventCommand.ActionsStopEventCommand(remoteProjectResolver)).addService(
|
|
211
|
+
"tenantConfigLoader",
|
|
212
|
+
({ jsCodeRunner }) => runtime === "bun" ? new TenantConfigLoader.ImportTenantConfigLoader() : new TenantConfigLoader.TranspilingTenantConfigLoader(jsCodeRunner)
|
|
213
|
+
).addService("tenantConfigApplier", () => new TenantConfigApplier.TenantConfigApplier()).addService(
|
|
214
|
+
"tenantApplyCommand",
|
|
215
|
+
({ remoteProjectResolver, tenantConfigLoader, tenantConfigApplier }) => new TenantApplyCommand.TenantApplyCommand(remoteProjectResolver, tenantConfigLoader, tenantConfigApplier)
|
|
216
|
+
).addService("commandList", (dic2) => {
|
|
171
217
|
const commands = {
|
|
172
218
|
["deploy"]: () => dic2.deployCommand,
|
|
173
219
|
["version"]: () => dic2.versionCommand,
|
|
@@ -177,9 +223,12 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
177
223
|
["migrations:diff"]: () => dic2.migrationDiffCommand,
|
|
178
224
|
["migrations:amend"]: () => dic2.migrationAmendCommand,
|
|
179
225
|
["migrations:blank"]: () => dic2.migrationBlankCommand,
|
|
226
|
+
["migrations:init-state"]: () => dic2.migrationInitStateCommand,
|
|
180
227
|
["migrations:describe"]: () => dic2.migrationDescribeCommand,
|
|
181
228
|
["migrations:execute"]: () => dic2.migrationExecuteCommand,
|
|
182
229
|
["migrations:rebase"]: () => dic2.migrationRebaseCommand,
|
|
230
|
+
["migrations:snapshot"]: () => dic2.migrationSnapshotCommand,
|
|
231
|
+
["migrations:verify-snapshot"]: () => dic2.migrationVerifySnapshotCommand,
|
|
183
232
|
["migrations:status"]: () => dic2.migrationStatusCommand,
|
|
184
233
|
["workspace:update:api"]: () => dic2.workspaceUpdateCommand,
|
|
185
234
|
["project:validate"]: () => dic2.projectValidateCommand,
|
|
@@ -190,7 +239,8 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
190
239
|
["actions:failed-events"]: () => dic2.actionsListFailedEvents,
|
|
191
240
|
["actions:retry-event"]: () => dic2.actionsRetryEvent,
|
|
192
241
|
["actions:get-event"]: () => dic2.actionsGetEvent,
|
|
193
|
-
["actions:stop-event"]: () => dic2.actionsStopEvent
|
|
242
|
+
["actions:stop-event"]: () => dic2.actionsStopEvent,
|
|
243
|
+
["tenant:apply"]: () => dic2.tenantApplyCommand
|
|
194
244
|
};
|
|
195
245
|
return commands;
|
|
196
246
|
}).addService("commandManager", ({ commandList }) => new cliCommon.CommandManager(commandList)).addService(
|
|
@@ -202,7 +252,7 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
202
252
|
`Contember CLI version ${version}`,
|
|
203
253
|
{
|
|
204
254
|
beforeRun: async ({ name }) => {
|
|
205
|
-
if (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !["deploy", "version", "data:export", "data:import", "data:transfer"].includes(name)) {
|
|
255
|
+
if (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !["deploy", "version", "data:export", "data:import", "data:transfer", "tenant:apply"].includes(name)) {
|
|
206
256
|
await versionChecker.checkVersions();
|
|
207
257
|
}
|
|
208
258
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dic.cjs","sources":["../../../../packages/cli/src/dic.ts"],"sourcesContent":["import { Builder } from '@contember/dic'\nimport {\n\tJsLoader,\n\tJsonLoader,\n\tMigrationCreator,\n\tMigrationDescriber,\n\tMigrationExecutor,\n\tMigrationFilesManager,\n\tMigrationParser,\n\tMigrationsResolver,\n\tMigrationsStatusResolver,\n\tModificationHandlerFactory,\n\tSchemaDiffer,\n\tSchemaMigrator,\n\tSchemaVersionBuilder,\n\tVERSION_LATEST,\n} from '@contember/migrations-client'\nimport { JsCodeRunner } from './lib/js/JsCodeRunner'\nimport { EsBuildBuilder } from './lib/js/EsBuildBuilder'\nimport { EvalExecutor } from './lib/js/EvalExecutor'\nimport { AdminDeployer } from './lib/admin/AdminDeployer'\nimport { RemoteProjectResolver } from './lib/project/RemoteProjectResolver'\nimport { CliEnv } from './lib/env'\nimport { AdminClient } from './lib/admin/AdminClient'\nimport { FileSystem } from './lib/fs/FileSystem'\nimport { WorkspaceResolver } from './lib/workspace/WorkspaceResolver'\nimport { YamlHandler } from './lib/fs/YamlHandler'\nimport {\n\tDeployCommand,\n\tMigrationAmendCommand,\n\tMigrationBlankCommand,\n\tMigrationDescribeCommand,\n\tMigrationDiffCommand,\n\tMigrationExecuteCommand,\n\tMigrationRebaseCommand,\n\tMigrationStatusCommand,\n\tProjectGenerateDocumentationCommand,\n\tProjectPrintSchemaCommand,\n\tProjectValidateCommand,\n\tVersionCommand,\n\tWorkspaceUpdateApiCommand,\n} from './commands'\nimport { MigrationExecutionFacade } from './lib/migrations/MigrationExecutionFacade'\nimport { MigrationPrinter } from './lib/migrations/MigrationPrinter'\nimport { MigrationsStatusFacade } from './lib/migrations/MigrationsStatusFacade'\nimport { ImportSchemaLoader, SchemaLoader, TranspilingSchemaLoader } from './lib/schema/SchemaLoader'\nimport { MigrationsValidator } from './lib/migrations/MigrationsValidator'\nimport { MigrationRebaseFacade } from './lib/migrations/MigrationRebaseFacade'\nimport { DataTransferClient } from './lib/transfer/DataTransferClient'\nimport { ExportCommand, ImportCommand, TransferCommand } from './commands/transfer'\nimport {\n\tApplication,\n\tBun,\n\tCommandFactoryList,\n\tCommandManager,\n\tCommandRunner,\n\tNpm,\n\tPackageWorkspaceResolver,\n\tPnpm,\n\tYarn,\n\tYarnClassic,\n} from '@contember/cli-common'\nimport { VersionChecker } from './lib/VersionChecker'\nimport { DockerComposeManager } from './lib/fs/DockerComposeManager'\nimport { RemoteProjectProvider } from './lib/project/RemoteProjectProvider'\nimport { SystemClientProvider } from './lib/SystemClientProvider'\nimport { TenantClientProvider } from './lib/TenantClientProvider'\nimport { Workspace } from './lib/workspace/Workspace'\nimport { ActionsListVariablesCommand } from './commands/actions/ActionsListVariablesCommand'\nimport { ActionsSetVariablesCommand } from './commands/actions/ActionsSetVariablesCommand'\nimport { ActionsListFailedEventsCommand } from './commands/actions/ActionsListFailedEventsCommand'\nimport { ActionsRetryEventCommand } from './commands/actions/ActionsRetryEventCommand'\nimport { ActionsGetEventCommand } from './commands/actions/ActionsGetEventCommand'\nimport { ActionsStopEventCommand } from './commands/actions/ActionsStopEventCommand'\n\nconst jsSample = `\nexport const query = \\`\\`\nexport const variables = {}\n\n// or multiple queries\n// export const queries = []\n\n// or a factory\n// export default async () => ({ queries: [] })\n`\n\nexport const createContainer = ({ env, version, runtime, workspace }: {\n\tworkspace: Workspace\n\tenv: CliEnv\n\tversion: string\n\truntime: 'node' | 'bun'\n}) => {\n\treturn new Builder({})\n\t\t.addService('env', () => env)\n\t\t.addService('version', () => version)\n\t\t.addService('runtime', () => runtime)\n\t\t.addService('workspace', () => workspace)\n\t\t.addService('fs', () => new FileSystem())\n\t\t.addService('yamlHandler', ({ fs }) => new YamlHandler(fs))\n\t\t.addService('jsExecutor', () => new EvalExecutor())\n\t\t.addService('jsBuilder', () => new EsBuildBuilder())\n\t\t.addService('jsCodeRunner', ({ jsExecutor, jsBuilder }) => new JsCodeRunner(jsBuilder, jsExecutor))\n\t\t.addService('workspaceResolver', ({ yamlHandler }) => new WorkspaceResolver(yamlHandler))\n\t\t.addService('remoteProjectResolver', ({ env }) => new RemoteProjectResolver(env))\n\t\t.addService('remoteProjectProvider', ({ remoteProjectResolver }) => {\n\t\t\tconst provider = new RemoteProjectProvider()\n\t\t\tconst remoteProject = remoteProjectResolver.resolve()\n\t\t\tif (remoteProject) {\n\t\t\t\tprovider.setRemoteProject(remoteProject)\n\t\t\t}\n\t\t\treturn provider\n\t\t})\n\t\t.addService('systemClientProvider', ({ remoteProjectProvider }) => new SystemClientProvider(remoteProjectProvider))\n\t\t.addService('tenantClientProvider', ({ remoteProjectProvider }) => new TenantClientProvider(remoteProjectProvider))\n\t\t.addService('adminClient', ({ remoteProjectProvider }) => new AdminClient(remoteProjectProvider))\n\t\t.addService('migrationFilesManager', ({ jsCodeRunner, workspace }) => {\n\t\t\tconst runJs = runtime === 'bun' ? (file: string) => import(file) : jsCodeRunner.run\n\t\t\treturn new MigrationFilesManager(workspace.migrationsDir, {\n\t\t\t\tjson: new JsonLoader(new MigrationParser()),\n\t\t\t\tts: new JsLoader(new MigrationParser(), runJs),\n\t\t\t\tjs: new JsLoader(new MigrationParser(), runJs),\n\t\t\t})\n\t\t})\n\t\t.addService('packageWorkspaceResolver', ({ workspace, fs }) => {\n\t\t\tconst commandRunner = new CommandRunner()\n\t\t\treturn new PackageWorkspaceResolver(workspace.baseDir, fs, [\n\t\t\t\tnew Yarn(fs, commandRunner),\n\t\t\t\tnew YarnClassic(fs, commandRunner),\n\t\t\t\tnew Pnpm(fs, commandRunner),\n\t\t\t\tnew Npm(fs, commandRunner),\n\t\t\t\tnew Bun(fs, commandRunner),\n\t\t\t])\n\t\t})\n\t\t.addService(\n\t\t\t'dockerComposeManager',\n\t\t\t({ workspace, env, fs, yamlHandler }) => new DockerComposeManager(workspace.baseDir, env.dockerComposeFile, fs, yamlHandler),\n\t\t)\n\t\t.addService('modificationHandlerFactory', () => new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap))\n\t\t.addService('schemaMigrator', ({ modificationHandlerFactory }) => new SchemaMigrator(modificationHandlerFactory))\n\t\t.addService('migrationsResolver', ({ migrationFilesManager }) => new MigrationsResolver(migrationFilesManager))\n\t\t.addService('schemaVersionBuilder', ({ migrationsResolver, schemaMigrator }) => new SchemaVersionBuilder(migrationsResolver, schemaMigrator))\n\t\t.addService('schemaDiffer', ({ schemaMigrator }) =>\n\t\t\tnew SchemaDiffer(schemaMigrator, {\n\t\t\t\tmaxPatchSize: env.migrationsOptions?.maxPatchSize,\n\t\t\t}))\n\t\t.addService('migrationCreator', ({ migrationFilesManager, schemaDiffer }) =>\n\t\t\tnew MigrationCreator(migrationFilesManager, schemaDiffer, {\n\t\t\t\tjson: JSON.stringify({ formatVersion: VERSION_LATEST, modifications: [] }, undefined, '\\t') + '\\n',\n\t\t\t\tts: jsSample,\n\t\t\t\tjs: jsSample,\n\t\t\t}))\n\t\t.addService('migrationDescriber', ({ modificationHandlerFactory }) => new MigrationDescriber(modificationHandlerFactory))\n\t\t.addService('migrationPrinter', ({ migrationDescriber }) => new MigrationPrinter(migrationDescriber))\n\t\t.addService('migrationsExecutor', () => new MigrationExecutor())\n\t\t.addService('migrationsStatusResolver', () => new MigrationsStatusResolver())\n\t\t.addService(\n\t\t\t'migrationsStatusFacade',\n\t\t\t({ systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter }) =>\n\t\t\t\tnew MigrationsStatusFacade(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationExecutionFacade',\n\t\t\t({\n\t\t\t\tsystemClientProvider,\n\t\t\t\ttenantClientProvider,\n\t\t\t\tremoteProjectProvider,\n\t\t\t\tschemaVersionBuilder,\n\t\t\t\tmigrationPrinter,\n\t\t\t\tmigrationsExecutor,\n\t\t\t\tmigrationsStatusFacade,\n\t\t\t}) =>\n\t\t\t\tnew MigrationExecutionFacade(\n\t\t\t\t\tsystemClientProvider,\n\t\t\t\t\ttenantClientProvider,\n\t\t\t\t\tremoteProjectProvider,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tmigrationsExecutor,\n\t\t\t\t\tmigrationsStatusFacade,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationsValidator', ({ migrationDescriber, schemaMigrator }) => new MigrationsValidator(migrationDescriber, schemaMigrator))\n\t\t.addService(\n\t\t\t'migrationRebaseFacade',\n\t\t\t({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager }) =>\n\t\t\t\tnew MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager),\n\t\t)\n\t\t.addService(\n\t\t\t'schemaLoader',\n\t\t\t({ workspace, jsCodeRunner, runtime }) =>\n\t\t\t\truntime === 'bun' ? new ImportSchemaLoader(workspace) : new TranspilingSchemaLoader(workspace, jsCodeRunner),\n\t\t)\n\t\t.addService('adminDeployer', ({ remoteProjectProvider, adminClient, fs }) => new AdminDeployer(remoteProjectProvider, adminClient, fs))\n\t\t.addService('dataTransferClient', () => new DataTransferClient())\n\t\t.addService(\n\t\t\t'deployCommand',\n\t\t\t({ adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace }) =>\n\t\t\t\tnew DeployCommand(adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationAmendCommand',\n\t\t\t({\n\t\t\t\tmigrationsResolver,\n\t\t\t\tsystemClientProvider,\n\t\t\t\tmigrationsStatusFacade,\n\t\t\t\tschemaLoader,\n\t\t\t\tschemaVersionBuilder,\n\t\t\t\tmigrationCreator,\n\t\t\t\tmigrationsValidator,\n\t\t\t\tmigrationPrinter,\n\t\t\t\tschemaMigrator,\n\t\t\t}) =>\n\t\t\t\tnew MigrationAmendCommand(\n\t\t\t\t\tmigrationsResolver,\n\t\t\t\t\tsystemClientProvider,\n\t\t\t\t\tmigrationsStatusFacade,\n\t\t\t\t\tschemaLoader,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationCreator,\n\t\t\t\t\tmigrationsValidator,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tschemaMigrator,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationBlankCommand', ({ migrationCreator }) => new MigrationBlankCommand(migrationCreator))\n\t\t.addService(\n\t\t\t'migrationDescribeCommand',\n\t\t\t({ migrationPrinter, schemaVersionBuilder, migrationsResolver }) =>\n\t\t\t\tnew MigrationDescribeCommand(migrationPrinter, schemaVersionBuilder, migrationsResolver),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationDiffCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade }) =>\n\t\t\t\tnew MigrationDiffCommand(schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade),\n\t\t)\n\t\t.addService('migrationExecuteCommand', ({ migrationExecutionFacade }) => new MigrationExecuteCommand(migrationExecutionFacade))\n\t\t.addService(\n\t\t\t'migrationRebaseCommand',\n\t\t\t({ migrationsResolver, migrationRebaseFacade }) => new MigrationRebaseCommand(migrationsResolver, migrationRebaseFacade),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationStatusCommand',\n\t\t\t({ migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter }) =>\n\t\t\t\tnew MigrationStatusCommand(migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter),\n\t\t)\n\t\t.addService('versionCommand', ({ version }) => new VersionCommand(version))\n\t\t.addService(\n\t\t\t'projectGenerateDocumentationCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder }) => new ProjectGenerateDocumentationCommand(schemaLoader, schemaVersionBuilder),\n\t\t)\n\t\t.addService(\n\t\t\t'projectPrintSchemaCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder }) => new ProjectPrintSchemaCommand(schemaLoader, schemaVersionBuilder),\n\t\t)\n\t\t.addService(\n\t\t\t'projectValidateCommand',\n\t\t\t({ schemaLoader, migrationsValidator, migrationsResolver, schemaDiffer, schemaVersionBuilder }) =>\n\t\t\t\tnew ProjectValidateCommand(schemaLoader, migrationsValidator, migrationsResolver, schemaDiffer, schemaVersionBuilder),\n\t\t)\n\t\t.addService('exportCommand', ({ dataTransferClient, remoteProjectResolver }) => new ExportCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService('importCommand', ({ dataTransferClient, remoteProjectResolver }) => new ImportCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService('transferCommand', ({ dataTransferClient, remoteProjectResolver }) => new TransferCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService(\n\t\t\t'workspaceUpdateCommand',\n\t\t\t({ packageWorkspaceResolver, dockerComposeManager }) => new WorkspaceUpdateApiCommand(packageWorkspaceResolver, dockerComposeManager),\n\t\t)\n\t\t.addService('actionsListVariables', ({ remoteProjectResolver }) => new ActionsListVariablesCommand(remoteProjectResolver))\n\t\t.addService('actionsSetVariables', ({ remoteProjectResolver }) => new ActionsSetVariablesCommand(remoteProjectResolver))\n\t\t.addService('actionsListFailedEvents', ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand(remoteProjectResolver))\n\t\t.addService('actionsRetryEvent', ({ remoteProjectResolver }) => new ActionsRetryEventCommand(remoteProjectResolver))\n\t\t.addService('actionsGetEvent', ({ remoteProjectResolver }) => new ActionsGetEventCommand(remoteProjectResolver))\n\t\t.addService('actionsStopEvent', ({ remoteProjectResolver }) => new ActionsStopEventCommand(remoteProjectResolver))\n\t\t.addService('commandList', dic => {\n\t\t\tconst commands: CommandFactoryList = {\n\t\t\t\t['deploy']: () => dic.deployCommand,\n\t\t\t\t['version']: () => dic.versionCommand,\n\t\t\t\t['data:export']: () => dic.exportCommand,\n\t\t\t\t['data:import']: () => dic.importCommand,\n\t\t\t\t['data:transfer']: () => dic.transferCommand,\n\t\t\t\t['migrations:diff']: () => dic.migrationDiffCommand,\n\t\t\t\t['migrations:amend']: () => dic.migrationAmendCommand,\n\t\t\t\t['migrations:blank']: () => dic.migrationBlankCommand,\n\t\t\t\t['migrations:describe']: () => dic.migrationDescribeCommand,\n\t\t\t\t['migrations:execute']: () => dic.migrationExecuteCommand,\n\t\t\t\t['migrations:rebase']: () => dic.migrationRebaseCommand,\n\t\t\t\t['migrations:status']: () => dic.migrationStatusCommand,\n\t\t\t\t['workspace:update:api']: () => dic.workspaceUpdateCommand,\n\t\t\t\t['project:validate']: () => dic.projectValidateCommand,\n\t\t\t\t['project:print-schema']: () => dic.projectPrintSchemaCommand,\n\t\t\t\t['project:generate-doc']: () => dic.projectGenerateDocumentationCommand,\n\t\t\t\t['actions:list-variables']: () => dic.actionsListVariables,\n\t\t\t\t['actions:set-variables']: () => dic.actionsSetVariables,\n\t\t\t\t['actions:failed-events']: () => dic.actionsListFailedEvents,\n\t\t\t\t['actions:retry-event']: () => dic.actionsRetryEvent,\n\t\t\t\t['actions:get-event']: () => dic.actionsGetEvent,\n\t\t\t\t['actions:stop-event']: () => dic.actionsStopEvent,\n\t\t\t}\n\t\t\treturn commands\n\t\t})\n\t\t.addService('commandManager', ({ commandList }) => new CommandManager(commandList))\n\t\t.addService(\n\t\t\t'versionChecker',\n\t\t\t({ version, workspace, packageWorkspaceResolver, dockerComposeManager }) =>\n\t\t\t\tnew VersionChecker(version, workspace.baseDir, packageWorkspaceResolver, dockerComposeManager),\n\t\t)\n\t\t.addService('application', ({ commandManager, versionChecker }) => {\n\t\t\tconst app = new Application(\n\t\t\t\tcommandManager,\n\t\t\t\t`Contember CLI version ${version}`,\n\t\t\t\t{\n\t\t\t\t\tbeforeRun: async ({ name }) => {\n\t\t\t\t\t\tif (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !['deploy', 'version', 'data:export', 'data:import', 'data:transfer'].includes(name)) {\n\t\t\t\t\t\t\tawait versionChecker.checkVersions()\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn app\n\t\t})\n\t\t.build()\n}\n"],"names":["Builder","FileSystem","YamlHandler","EvalExecutor","EsBuildBuilder","JsCodeRunner","WorkspaceResolver","env","RemoteProjectResolver","RemoteProjectProvider","SystemClientProvider","TenantClientProvider","AdminClient","workspace","MigrationFilesManager","JsonLoader","MigrationParser","JsLoader","CommandRunner","PackageWorkspaceResolver","Yarn","YarnClassic","Pnpm","Npm","Bun","DockerComposeManager","ModificationHandlerFactory","SchemaMigrator","MigrationsResolver","SchemaVersionBuilder","SchemaDiffer","MigrationCreator","VERSION_LATEST","MigrationDescriber","MigrationPrinter","MigrationExecutor","MigrationsStatusResolver","MigrationsStatusFacade","MigrationExecutionFacade","MigrationsValidator","MigrationRebaseFacade","runtime","ImportSchemaLoader","TranspilingSchemaLoader","AdminDeployer","DataTransferClient","DeployCommand","MigrationAmendCommand","MigrationBlankCommand","MigrationDescribeCommand","MigrationDiffCommand","MigrationExecuteCommand","MigrationRebaseCommand","MigrationStatusCommand","version","VersionCommand","ProjectGenerateDocumentationCommand","ProjectPrintSchemaCommand","ProjectValidateCommand","ExportCommand","ImportCommand","TransferCommand","WorkspaceUpdateApiCommand","ActionsListVariablesCommand","ActionsSetVariablesCommand","ActionsListFailedEventsCommand","ActionsRetryEventCommand","ActionsGetEventCommand","ActionsStopEventCommand","dic","CommandManager","VersionChecker","Application"],"mappings":";;;;;;;;;;;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G,MAAMA,KAAI;AAAA,MACpC,CAAC,kBAAkB,GAAG,MAAMA,KAAI;AAAA,MAChC,CAAC,sBAAsB,GAAG,MAAMA,KAAI;AAAA,MACpC,CAAC,sBAAsB,GAAG,MAAMA,KAAI;AAAA,MACpC,CAAC,wBAAwB,GAAG,MAAMA,KAAI;AAAA,MACtC,CAAC,uBAAuB,GAAG,MAAMA,KAAI;AAAA,MACrC,CAAC,uBAAuB,GAAG,MAAMA,KAAI;AAAA,MACrC,CAAC,qBAAqB,GAAG,MAAMA,KAAI;AAAA,MACnC,CAAC,mBAAmB,GAAG,MAAMA,KAAI;AAAA,MACjC,CAAC,oBAAoB,GAAG,MAAMA,KAAI;AAAA,IAAA;AAEnC,WAAO;AAAA,EACR,CAAC,EACA,WAAW,kBAAkB,CAAC,EAAE,YAAA,MAAkB,IAAIC,UAAAA,eAAe,WAAW,CAAC,EACjF;AAAA,IACA;AAAA,IACA,CAAC,EAAE,SAAAhB,UAAS,WAAAzC,YAAW,0BAA0B,2BAChD,IAAI0D,eAAAA,eAAejB,UAASzC,WAAU,SAAS,0BAA0B,oBAAoB;AAAA,EAAA,EAE9F,WAAW,eAAe,CAAC,EAAE,gBAAgB,qBAAqB;AAClE,UAAM,MAAM,IAAI2D,UAAAA;AAAAA,MACf;AAAA,MACA,yBAAyB,OAAO;AAAA,MAChC;AAAA,QACC,WAAW,OAAO,EAAE,WAAW;AAC9B,cAAI,CAAC,QAAQ,IAAI,gCAAgC,CAAC,CAAC,UAAU,WAAW,eAAe,eAAe,eAAe,EAAE,SAAS,IAAI,GAAG;AACtI,kBAAM,eAAe,cAAA;AAAA,UACtB;AAAA,QACD;AAAA,MAAA;AAAA,IACD;AAED,WAAO;AAAA,EACR,CAAC,EACA,MAAA;AACH;;"}
|
|
1
|
+
{"version":3,"file":"dic.cjs","sources":["../../../../packages/cli/src/dic.ts"],"sourcesContent":["import { Builder } from '@contember/dic'\nimport {\n\tJsLoader,\n\tJsonLoader,\n\tMigrationCreator,\n\tMigrationDescriber,\n\tMigrationExecutor,\n\tMigrationFilesManager,\n\tMigrationParser,\n\tMigrationsResolver,\n\tMigrationsStatusResolver,\n\tModificationHandlerFactory,\n\tSchemaDiffer,\n\tSchemaMigrator,\n\tSchemaStateManager,\n\tSchemaVersionBuilder,\n\tSnapshotManager,\n\tVERSION_LATEST,\n} from '@contember/migrations-client'\nimport { JsCodeRunner } from './lib/js/JsCodeRunner.js'\nimport { EsBuildBuilder } from './lib/js/EsBuildBuilder.js'\nimport { EvalExecutor } from './lib/js/EvalExecutor.js'\nimport { AdminDeployer } from './lib/admin/AdminDeployer.js'\nimport { RemoteProjectResolver } from './lib/project/RemoteProjectResolver.js'\nimport { CliEnv } from './lib/env.js'\nimport { AdminClient } from './lib/admin/AdminClient.js'\nimport { FileSystem } from './lib/fs/FileSystem.js'\nimport { WorkspaceResolver } from './lib/workspace/WorkspaceResolver.js'\nimport { YamlHandler } from './lib/fs/YamlHandler.js'\nimport {\n\tDeployCommand,\n\tMigrationAmendCommand,\n\tMigrationBlankCommand,\n\tMigrationDescribeCommand,\n\tMigrationDiffCommand,\n\tMigrationExecuteCommand,\n\tMigrationInitStateCommand,\n\tMigrationRebaseCommand,\n\tMigrationSnapshotCommand,\n\tMigrationStatusCommand,\n\tMigrationVerifySnapshotCommand,\n\tProjectGenerateDocumentationCommand,\n\tProjectPrintSchemaCommand,\n\tProjectValidateCommand,\n\tVersionCommand,\n\tWorkspaceUpdateApiCommand,\n} from './commands/index.js'\nimport { MigrationExecutionFacade } from './lib/migrations/MigrationExecutionFacade.js'\nimport { MigrationPrinter } from './lib/migrations/MigrationPrinter.js'\nimport { MigrationSnapshotFacade } from './lib/migrations/MigrationSnapshotFacade.js'\nimport { MigrationsStatusFacade } from './lib/migrations/MigrationsStatusFacade.js'\nimport { ImportSchemaLoader, SchemaLoader, TranspilingSchemaLoader } from './lib/schema/SchemaLoader.js'\nimport { MigrationsValidator } from './lib/migrations/MigrationsValidator.js'\nimport { MigrationRebaseFacade } from './lib/migrations/MigrationRebaseFacade.js'\nimport { DataTransferClient } from './lib/transfer/DataTransferClient.js'\nimport { ExportCommand, ImportCommand, TransferCommand } from './commands/transfer/index.js'\nimport {\n\tApplication,\n\tBun,\n\tCommandFactoryList,\n\tCommandManager,\n\tCommandRunner,\n\tNpm,\n\tPackageWorkspaceResolver,\n\tPnpm,\n\tYarn,\n\tYarnClassic,\n} from '@contember/cli-common'\nimport { VersionChecker } from './lib/VersionChecker.js'\nimport { DockerComposeManager } from './lib/fs/DockerComposeManager.js'\nimport { RemoteProjectProvider } from './lib/project/RemoteProjectProvider.js'\nimport { SystemClientProvider } from './lib/SystemClientProvider.js'\nimport { TenantClientProvider } from './lib/TenantClientProvider.js'\nimport { Workspace } from './lib/workspace/Workspace.js'\nimport { ActionsListVariablesCommand } from './commands/actions/ActionsListVariablesCommand.js'\nimport { ActionsSetVariablesCommand } from './commands/actions/ActionsSetVariablesCommand.js'\nimport { ActionsListFailedEventsCommand } from './commands/actions/ActionsListFailedEventsCommand.js'\nimport { ActionsRetryEventCommand } from './commands/actions/ActionsRetryEventCommand.js'\nimport { ActionsGetEventCommand } from './commands/actions/ActionsGetEventCommand.js'\nimport { ActionsStopEventCommand } from './commands/actions/ActionsStopEventCommand.js'\nimport { TenantApplyCommand } from './commands/tenant/index.js'\nimport { ImportTenantConfigLoader, TranspilingTenantConfigLoader } from './lib/tenant/TenantConfigLoader.js'\nimport { TenantConfigApplier } from './lib/tenant/TenantConfigApplier.js'\n\nconst jsSample = `\nexport const query = \\`\\`\nexport const variables = {}\n\n// or multiple queries\n// export const queries = []\n\n// or a factory\n// export default async () => ({ queries: [] })\n`\n\nexport const createContainer = ({ env, version, runtime, workspace }: {\n\tworkspace: Workspace\n\tenv: CliEnv\n\tversion: string\n\truntime: 'node' | 'bun'\n}) => {\n\treturn new Builder({})\n\t\t.addService('env', () => env)\n\t\t.addService('version', () => version)\n\t\t.addService('runtime', () => runtime)\n\t\t.addService('workspace', () => workspace)\n\t\t.addService('fs', () => new FileSystem())\n\t\t.addService('yamlHandler', ({ fs }) => new YamlHandler(fs))\n\t\t.addService('jsExecutor', () => new EvalExecutor())\n\t\t.addService('jsBuilder', () => new EsBuildBuilder())\n\t\t.addService('jsCodeRunner', ({ jsExecutor, jsBuilder }) => new JsCodeRunner(jsBuilder, jsExecutor))\n\t\t.addService('workspaceResolver', ({ yamlHandler }) => new WorkspaceResolver(yamlHandler))\n\t\t.addService('remoteProjectResolver', ({ env }) => new RemoteProjectResolver(env))\n\t\t.addService('remoteProjectProvider', ({ remoteProjectResolver }) => {\n\t\t\tconst provider = new RemoteProjectProvider()\n\t\t\tconst remoteProject = remoteProjectResolver.resolve()\n\t\t\tif (remoteProject) {\n\t\t\t\tprovider.setRemoteProject(remoteProject)\n\t\t\t}\n\t\t\treturn provider\n\t\t})\n\t\t.addService('systemClientProvider', ({ remoteProjectProvider }) => new SystemClientProvider(remoteProjectProvider))\n\t\t.addService('tenantClientProvider', ({ remoteProjectProvider }) => new TenantClientProvider(remoteProjectProvider))\n\t\t.addService('adminClient', ({ remoteProjectProvider }) => new AdminClient(remoteProjectProvider))\n\t\t.addService('migrationFilesManager', ({ jsCodeRunner, workspace }) => {\n\t\t\tconst runJs = runtime === 'bun' ? (file: string) => import(file) : jsCodeRunner.run\n\t\t\treturn new MigrationFilesManager(workspace.migrationsDir, {\n\t\t\t\tjson: new JsonLoader(new MigrationParser()),\n\t\t\t\tts: new JsLoader(new MigrationParser(), runJs),\n\t\t\t\tjs: new JsLoader(new MigrationParser(), runJs),\n\t\t\t})\n\t\t})\n\t\t.addService('packageWorkspaceResolver', ({ workspace, fs }) => {\n\t\t\tconst commandRunner = new CommandRunner()\n\t\t\treturn new PackageWorkspaceResolver(workspace.baseDir, fs, [\n\t\t\t\tnew Yarn(fs, commandRunner),\n\t\t\t\tnew YarnClassic(fs, commandRunner),\n\t\t\t\tnew Pnpm(fs, commandRunner),\n\t\t\t\tnew Npm(fs, commandRunner),\n\t\t\t\tnew Bun(fs, commandRunner),\n\t\t\t])\n\t\t})\n\t\t.addService(\n\t\t\t'dockerComposeManager',\n\t\t\t({ workspace, env, fs, yamlHandler }) => new DockerComposeManager(workspace.baseDir, env.dockerComposeFile, fs, yamlHandler),\n\t\t)\n\t\t.addService('modificationHandlerFactory', () => new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap))\n\t\t.addService('schemaMigrator', ({ modificationHandlerFactory }) => new SchemaMigrator(modificationHandlerFactory))\n\t\t.addService('migrationsResolver', ({ migrationFilesManager }) => new MigrationsResolver(migrationFilesManager))\n\t\t.addService('schemaStateManager', ({ workspace }) => new SchemaStateManager(workspace.migrationsDir + '/state'))\n\t\t.addService('snapshotManager', ({ workspace }) => new SnapshotManager(workspace.migrationsDir + '/snapshot.json'))\n\t\t.addService(\n\t\t\t'schemaVersionBuilder',\n\t\t\t({ migrationsResolver, schemaMigrator, schemaStateManager }) => new SchemaVersionBuilder(migrationsResolver, schemaMigrator, schemaStateManager),\n\t\t)\n\t\t.addService('schemaDiffer', ({ schemaMigrator }) =>\n\t\t\tnew SchemaDiffer(schemaMigrator, {\n\t\t\t\tmaxPatchSize: env.migrationsOptions?.maxPatchSize,\n\t\t\t}))\n\t\t.addService('migrationCreator', ({ migrationFilesManager, schemaDiffer }) =>\n\t\t\tnew MigrationCreator(migrationFilesManager, schemaDiffer, {\n\t\t\t\tjson: JSON.stringify({ formatVersion: VERSION_LATEST, modifications: [] }, undefined, '\\t') + '\\n',\n\t\t\t\tts: jsSample,\n\t\t\t\tjs: jsSample,\n\t\t\t}))\n\t\t.addService('migrationDescriber', ({ modificationHandlerFactory }) => new MigrationDescriber(modificationHandlerFactory))\n\t\t.addService('migrationPrinter', ({ migrationDescriber }) => new MigrationPrinter(migrationDescriber))\n\t\t.addService('migrationsExecutor', () => new MigrationExecutor())\n\t\t.addService('migrationsStatusResolver', () => new MigrationsStatusResolver())\n\t\t.addService(\n\t\t\t'migrationSnapshotFacade',\n\t\t\t({ migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager }) =>\n\t\t\t\tnew MigrationSnapshotFacade(\n\t\t\t\t\tmigrationsResolver,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tschemaDiffer,\n\t\t\t\t\tschemaMigrator,\n\t\t\t\t\tschemaStateManager,\n\t\t\t\t\tsnapshotManager,\n\t\t\t\t),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationsStatusFacade',\n\t\t\t({ systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter }) =>\n\t\t\t\tnew MigrationsStatusFacade(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationExecutionFacade',\n\t\t\t({\n\t\t\t\tsystemClientProvider,\n\t\t\t\ttenantClientProvider,\n\t\t\t\tremoteProjectProvider,\n\t\t\t\tschemaVersionBuilder,\n\t\t\t\tmigrationPrinter,\n\t\t\t\tmigrationsExecutor,\n\t\t\t\tmigrationsStatusFacade,\n\t\t\t\tschemaStateManager,\n\t\t\t\tmigrationSnapshotFacade,\n\t\t\t}) =>\n\t\t\t\tnew MigrationExecutionFacade(\n\t\t\t\t\tsystemClientProvider,\n\t\t\t\t\ttenantClientProvider,\n\t\t\t\t\tremoteProjectProvider,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tmigrationsExecutor,\n\t\t\t\t\tmigrationsStatusFacade,\n\t\t\t\t\tschemaStateManager,\n\t\t\t\t\tmigrationSnapshotFacade,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationsValidator', ({ migrationDescriber, schemaMigrator }) => new MigrationsValidator(migrationDescriber, schemaMigrator))\n\t\t.addService(\n\t\t\t'migrationRebaseFacade',\n\t\t\t({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager }) =>\n\t\t\t\tnew MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager),\n\t\t)\n\t\t.addService(\n\t\t\t'schemaLoader',\n\t\t\t({ workspace, jsCodeRunner, runtime }) =>\n\t\t\t\truntime === 'bun' ? new ImportSchemaLoader(workspace) : new TranspilingSchemaLoader(workspace, jsCodeRunner),\n\t\t)\n\t\t.addService('adminDeployer', ({ remoteProjectProvider, adminClient, fs }) => new AdminDeployer(remoteProjectProvider, adminClient, fs))\n\t\t.addService('dataTransferClient', () => new DataTransferClient())\n\t\t.addService(\n\t\t\t'deployCommand',\n\t\t\t({ adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace }) =>\n\t\t\t\tnew DeployCommand(adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationAmendCommand',\n\t\t\t({\n\t\t\t\tmigrationsResolver,\n\t\t\t\tsystemClientProvider,\n\t\t\t\tmigrationsStatusFacade,\n\t\t\t\tschemaLoader,\n\t\t\t\tschemaVersionBuilder,\n\t\t\t\tmigrationCreator,\n\t\t\t\tmigrationsValidator,\n\t\t\t\tmigrationPrinter,\n\t\t\t\tschemaMigrator,\n\t\t\t\tschemaStateManager,\n\t\t\t}) =>\n\t\t\t\tnew MigrationAmendCommand(\n\t\t\t\t\tmigrationsResolver,\n\t\t\t\t\tsystemClientProvider,\n\t\t\t\t\tmigrationsStatusFacade,\n\t\t\t\t\tschemaLoader,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationCreator,\n\t\t\t\t\tmigrationsValidator,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tschemaMigrator,\n\t\t\t\t\tschemaStateManager,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationBlankCommand', ({ migrationCreator }) => new MigrationBlankCommand(migrationCreator))\n\t\t.addService(\n\t\t\t'migrationDescribeCommand',\n\t\t\t({ migrationPrinter, schemaVersionBuilder, migrationsResolver }) =>\n\t\t\t\tnew MigrationDescribeCommand(migrationPrinter, schemaVersionBuilder, migrationsResolver),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationDiffCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade, schemaStateManager, migrationsResolver }) =>\n\t\t\t\tnew MigrationDiffCommand(\n\t\t\t\t\tschemaLoader,\n\t\t\t\t\tschemaVersionBuilder,\n\t\t\t\t\tmigrationCreator,\n\t\t\t\t\tmigrationPrinter,\n\t\t\t\t\tmigrationExecutionFacade,\n\t\t\t\t\tschemaStateManager,\n\t\t\t\t\tmigrationsResolver,\n\t\t\t\t),\n\t\t)\n\t\t.addService('migrationExecuteCommand', ({ migrationExecutionFacade }) => new MigrationExecuteCommand(migrationExecutionFacade))\n\t\t.addService(\n\t\t\t'migrationInitStateCommand',\n\t\t\t({ schemaLoader, schemaStateManager }) => new MigrationInitStateCommand(schemaLoader, schemaStateManager),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationRebaseCommand',\n\t\t\t({ migrationsResolver, migrationRebaseFacade }) => new MigrationRebaseCommand(migrationsResolver, migrationRebaseFacade),\n\t\t)\n\t\t.addService('migrationSnapshotCommand', ({ migrationSnapshotFacade }) => new MigrationSnapshotCommand(migrationSnapshotFacade))\n\t\t.addService(\n\t\t\t'migrationVerifySnapshotCommand',\n\t\t\t({ migrationSnapshotFacade }) => new MigrationVerifySnapshotCommand(migrationSnapshotFacade),\n\t\t)\n\t\t.addService(\n\t\t\t'migrationStatusCommand',\n\t\t\t({ migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter }) =>\n\t\t\t\tnew MigrationStatusCommand(migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter),\n\t\t)\n\t\t.addService('versionCommand', ({ version }) => new VersionCommand(version))\n\t\t.addService(\n\t\t\t'projectGenerateDocumentationCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder }) => new ProjectGenerateDocumentationCommand(schemaLoader, schemaVersionBuilder),\n\t\t)\n\t\t.addService(\n\t\t\t'projectPrintSchemaCommand',\n\t\t\t({ schemaLoader, schemaVersionBuilder }) => new ProjectPrintSchemaCommand(schemaLoader, schemaVersionBuilder),\n\t\t)\n\t\t.addService(\n\t\t\t'projectValidateCommand',\n\t\t\t({ schemaLoader, migrationsValidator, migrationsResolver, schemaDiffer, schemaVersionBuilder }) =>\n\t\t\t\tnew ProjectValidateCommand(schemaLoader, migrationsValidator, migrationsResolver, schemaDiffer, schemaVersionBuilder),\n\t\t)\n\t\t.addService('exportCommand', ({ dataTransferClient, remoteProjectResolver }) => new ExportCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService('importCommand', ({ dataTransferClient, remoteProjectResolver }) => new ImportCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService('transferCommand', ({ dataTransferClient, remoteProjectResolver }) => new TransferCommand(remoteProjectResolver, dataTransferClient))\n\t\t.addService(\n\t\t\t'workspaceUpdateCommand',\n\t\t\t({ packageWorkspaceResolver, dockerComposeManager }) => new WorkspaceUpdateApiCommand(packageWorkspaceResolver, dockerComposeManager),\n\t\t)\n\t\t.addService('actionsListVariables', ({ remoteProjectResolver }) => new ActionsListVariablesCommand(remoteProjectResolver))\n\t\t.addService('actionsSetVariables', ({ remoteProjectResolver }) => new ActionsSetVariablesCommand(remoteProjectResolver))\n\t\t.addService('actionsListFailedEvents', ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand(remoteProjectResolver))\n\t\t.addService('actionsRetryEvent', ({ remoteProjectResolver }) => new ActionsRetryEventCommand(remoteProjectResolver))\n\t\t.addService('actionsGetEvent', ({ remoteProjectResolver }) => new ActionsGetEventCommand(remoteProjectResolver))\n\t\t.addService('actionsStopEvent', ({ remoteProjectResolver }) => new ActionsStopEventCommand(remoteProjectResolver))\n\t\t.addService(\n\t\t\t'tenantConfigLoader',\n\t\t\t({ jsCodeRunner }) => runtime === 'bun' ? new ImportTenantConfigLoader() : new TranspilingTenantConfigLoader(jsCodeRunner),\n\t\t)\n\t\t.addService('tenantConfigApplier', () => new TenantConfigApplier())\n\t\t.addService(\n\t\t\t'tenantApplyCommand',\n\t\t\t({ remoteProjectResolver, tenantConfigLoader, tenantConfigApplier }) =>\n\t\t\t\tnew TenantApplyCommand(remoteProjectResolver, tenantConfigLoader, tenantConfigApplier),\n\t\t)\n\t\t.addService('commandList', dic => {\n\t\t\tconst commands: CommandFactoryList = {\n\t\t\t\t['deploy']: () => dic.deployCommand,\n\t\t\t\t['version']: () => dic.versionCommand,\n\t\t\t\t['data:export']: () => dic.exportCommand,\n\t\t\t\t['data:import']: () => dic.importCommand,\n\t\t\t\t['data:transfer']: () => dic.transferCommand,\n\t\t\t\t['migrations:diff']: () => dic.migrationDiffCommand,\n\t\t\t\t['migrations:amend']: () => dic.migrationAmendCommand,\n\t\t\t\t['migrations:blank']: () => dic.migrationBlankCommand,\n\t\t\t\t['migrations:init-state']: () => dic.migrationInitStateCommand,\n\t\t\t\t['migrations:describe']: () => dic.migrationDescribeCommand,\n\t\t\t\t['migrations:execute']: () => dic.migrationExecuteCommand,\n\t\t\t\t['migrations:rebase']: () => dic.migrationRebaseCommand,\n\t\t\t\t['migrations:snapshot']: () => dic.migrationSnapshotCommand,\n\t\t\t\t['migrations:verify-snapshot']: () => dic.migrationVerifySnapshotCommand,\n\t\t\t\t['migrations:status']: () => dic.migrationStatusCommand,\n\t\t\t\t['workspace:update:api']: () => dic.workspaceUpdateCommand,\n\t\t\t\t['project:validate']: () => dic.projectValidateCommand,\n\t\t\t\t['project:print-schema']: () => dic.projectPrintSchemaCommand,\n\t\t\t\t['project:generate-doc']: () => dic.projectGenerateDocumentationCommand,\n\t\t\t\t['actions:list-variables']: () => dic.actionsListVariables,\n\t\t\t\t['actions:set-variables']: () => dic.actionsSetVariables,\n\t\t\t\t['actions:failed-events']: () => dic.actionsListFailedEvents,\n\t\t\t\t['actions:retry-event']: () => dic.actionsRetryEvent,\n\t\t\t\t['actions:get-event']: () => dic.actionsGetEvent,\n\t\t\t\t['actions:stop-event']: () => dic.actionsStopEvent,\n\t\t\t\t['tenant:apply']: () => dic.tenantApplyCommand,\n\t\t\t}\n\t\t\treturn commands\n\t\t})\n\t\t.addService('commandManager', ({ commandList }) => new CommandManager(commandList))\n\t\t.addService(\n\t\t\t'versionChecker',\n\t\t\t({ version, workspace, packageWorkspaceResolver, dockerComposeManager }) =>\n\t\t\t\tnew VersionChecker(version, workspace.baseDir, packageWorkspaceResolver, dockerComposeManager),\n\t\t)\n\t\t.addService('application', ({ commandManager, versionChecker }) => {\n\t\t\tconst app = new Application(\n\t\t\t\tcommandManager,\n\t\t\t\t`Contember CLI version ${version}`,\n\t\t\t\t{\n\t\t\t\t\tbeforeRun: async ({ name }) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t!process.env.CONTEMBER_SKIP_VERSION_CHECK\n\t\t\t\t\t\t\t&& !['deploy', 'version', 'data:export', 'data:import', 'data:transfer', 'tenant:apply'].includes(name)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tawait versionChecker.checkVersions()\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn app\n\t\t})\n\t\t.build()\n}\n"],"names":["Builder","FileSystem","YamlHandler","EvalExecutor","EsBuildBuilder","JsCodeRunner","WorkspaceResolver","env","RemoteProjectResolver","RemoteProjectProvider","SystemClientProvider","TenantClientProvider","AdminClient","workspace","MigrationFilesManager","JsonLoader","MigrationParser","JsLoader","CommandRunner","PackageWorkspaceResolver","Yarn","YarnClassic","Pnpm","Npm","Bun","DockerComposeManager","ModificationHandlerFactory","SchemaMigrator","MigrationsResolver","SchemaStateManager","SnapshotManager","SchemaVersionBuilder","SchemaDiffer","MigrationCreator","VERSION_LATEST","MigrationDescriber","MigrationPrinter","MigrationExecutor","MigrationsStatusResolver","MigrationSnapshotFacade","MigrationsStatusFacade","MigrationExecutionFacade","MigrationsValidator","MigrationRebaseFacade","runtime","ImportSchemaLoader","TranspilingSchemaLoader","AdminDeployer","DataTransferClient","DeployCommand","MigrationAmendCommand","MigrationBlankCommand","MigrationDescribeCommand","MigrationDiffCommand","MigrationExecuteCommand","MigrationInitStateCommand","MigrationRebaseCommand","MigrationSnapshotCommand","MigrationVerifySnapshotCommand","MigrationStatusCommand","version","VersionCommand","ProjectGenerateDocumentationCommand","ProjectPrintSchemaCommand","ProjectValidateCommand","ExportCommand","ImportCommand","TransferCommand","WorkspaceUpdateApiCommand","ActionsListVariablesCommand","ActionsSetVariablesCommand","ActionsListFailedEventsCommand","ActionsRetryEventCommand","ActionsGetEventCommand","ActionsStopEventCommand","ImportTenantConfigLoader","TranspilingTenantConfigLoader","TenantConfigApplier","TenantApplyCommand","dic","CommandManager","VersionChecker","Application"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWV,MAAM,kBAAkB,CAAC,EAAE,KAAK,SAAS,SAAS,gBAKnD;AACL,SAAO,IAAIA,IAAAA,QAAQ,EAAE,EACnB,WAAW,OAAO,MAAM,GAAG,EAC3B,WAAW,WAAW,MAAM,OAAO,EACnC,WAAW,WAAW,MAAM,OAAO,EACnC,WAAW,aAAa,MAAM,SAAS,EACvC,WAAW,MAAM,MAAM,IAAIC,WAAAA,YAAY,EACvC,WAAW,eAAe,CAAC,EAAE,SAAS,IAAIC,YAAAA,YAAY,EAAE,CAAC,EACzD,WAAW,cAAc,MAAM,IAAIC,aAAAA,aAAA,CAAc,EACjD,WAAW,aAAa,MAAM,IAAIC,eAAAA,eAAA,CAAgB,EAClD,WAAW,gBAAgB,CAAC,EAAE,YAAY,UAAA,MAAgB,IAAIC,aAAAA,aAAa,WAAW,UAAU,CAAC,EACjG,WAAW,qBAAqB,CAAC,EAAE,kBAAkB,IAAIC,kBAAAA,kBAAkB,WAAW,CAAC,EACvF,WAAW,yBAA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AE,SAAApB,UAAS,WAAA/C,YAAW,0BAA0B,2BAChD,IAAIoE,eAAAA,eAAerB,UAAS/C,WAAU,SAAS,0BAA0B,oBAAoB;AAAA,EAAA,EAE9F,WAAW,eAAe,CAAC,EAAE,gBAAgB,qBAAqB;AAClE,UAAM,MAAM,IAAIqE,UAAAA;AAAAA,MACf;AAAA,MACA,yBAAyB,OAAO;AAAA,MAChC;AAAA,QACC,WAAW,OAAO,EAAE,WAAW;AAC9B,cACC,CAAC,QAAQ,IAAI,gCACV,CAAC,CAAC,UAAU,WAAW,eAAe,eAAe,iBAAiB,cAAc,EAAE,SAAS,IAAI,GACrG;AACD,kBAAM,eAAe,cAAA;AAAA,UACtB;AAAA,QACD;AAAA,MAAA;AAAA,IACD;AAED,WAAO;AAAA,EACR,CAAC,EACA,MAAA;AACH;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Builder } from "@contember/dic";
|
|
2
|
-
import { MigrationFilesManager, JsLoader, JsonLoader, MigrationParser, ModificationHandlerFactory, SchemaMigrator, MigrationsResolver, SchemaVersionBuilder, SchemaDiffer, MigrationCreator, VERSION_LATEST, MigrationDescriber, MigrationExecutor, MigrationsStatusResolver } from "@contember/migrations-client";
|
|
2
|
+
import { MigrationFilesManager, JsLoader, JsonLoader, MigrationParser, ModificationHandlerFactory, SchemaMigrator, MigrationsResolver, SchemaStateManager, SnapshotManager, SchemaVersionBuilder, SchemaDiffer, MigrationCreator, VERSION_LATEST, MigrationDescriber, MigrationExecutor, MigrationsStatusResolver } from "@contember/migrations-client";
|
|
3
3
|
import { JsCodeRunner } from "./lib/js/JsCodeRunner.js";
|
|
4
4
|
import { EsBuildBuilder } from "./lib/js/EsBuildBuilder.js";
|
|
5
5
|
import { EvalExecutor } from "./lib/js/EvalExecutor.js";
|
|
@@ -15,15 +15,20 @@ import { MigrationBlankCommand } from "./commands/migrations/MigrationBlankComma
|
|
|
15
15
|
import { MigrationDescribeCommand } from "./commands/migrations/MigrationDescribeCommand.js";
|
|
16
16
|
import { MigrationDiffCommand } from "./commands/migrations/MigrationDiffCommand.js";
|
|
17
17
|
import { MigrationExecuteCommand } from "./commands/migrations/MigrationExecuteCommand.js";
|
|
18
|
+
import { MigrationInitStateCommand } from "./commands/migrations/MigrationInitStateCommand.js";
|
|
18
19
|
import { MigrationStatusCommand } from "./commands/migrations/MigrationStatusCommand.js";
|
|
19
20
|
import { MigrationRebaseCommand } from "./commands/migrations/MigrationRebaseCommand.js";
|
|
21
|
+
import { MigrationSnapshotCommand } from "./commands/migrations/MigrationSnapshotCommand.js";
|
|
22
|
+
import { MigrationVerifySnapshotCommand } from "./commands/migrations/MigrationVerifySnapshotCommand.js";
|
|
20
23
|
import { VersionCommand } from "./commands/misc/VersionCommand.js";
|
|
21
24
|
import { ProjectGenerateDocumentationCommand } from "./commands/project/ProjectGenerateDocumentationCommand.js";
|
|
22
25
|
import { ProjectPrintSchemaCommand } from "./commands/project/ProjectPrintSchemaCommand.js";
|
|
23
26
|
import { ProjectValidateCommand } from "./commands/project/ProjectValidateCommand.js";
|
|
27
|
+
import { TenantApplyCommand } from "./commands/tenant/TenantApplyCommand.js";
|
|
24
28
|
import { WorkspaceUpdateApiCommand } from "./commands/workspace/WorkspaceUpdateApiCommand.js";
|
|
25
29
|
import { MigrationExecutionFacade } from "./lib/migrations/MigrationExecutionFacade.js";
|
|
26
30
|
import { MigrationPrinter } from "./lib/migrations/MigrationPrinter.js";
|
|
31
|
+
import { MigrationSnapshotFacade } from "./lib/migrations/MigrationSnapshotFacade.js";
|
|
27
32
|
import { MigrationsStatusFacade } from "./lib/migrations/MigrationsStatusFacade.js";
|
|
28
33
|
import { ImportSchemaLoader, TranspilingSchemaLoader } from "./lib/schema/SchemaLoader.js";
|
|
29
34
|
import { MigrationsValidator } from "./lib/migrations/MigrationsValidator.js";
|
|
@@ -44,6 +49,8 @@ import { ActionsListFailedEventsCommand } from "./commands/actions/ActionsListFa
|
|
|
44
49
|
import { ActionsRetryEventCommand } from "./commands/actions/ActionsRetryEventCommand.js";
|
|
45
50
|
import { ActionsGetEventCommand } from "./commands/actions/ActionsGetEventCommand.js";
|
|
46
51
|
import { ActionsStopEventCommand } from "./commands/actions/ActionsStopEventCommand.js";
|
|
52
|
+
import { ImportTenantConfigLoader, TranspilingTenantConfigLoader } from "./lib/tenant/TenantConfigLoader.js";
|
|
53
|
+
import { TenantConfigApplier } from "./lib/tenant/TenantConfigApplier.js";
|
|
47
54
|
const jsSample = `
|
|
48
55
|
export const query = \`\`
|
|
49
56
|
export const variables = {}
|
|
@@ -81,13 +88,26 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
81
88
|
}).addService(
|
|
82
89
|
"dockerComposeManager",
|
|
83
90
|
({ workspace: workspace2, env: env2, fs, yamlHandler }) => new DockerComposeManager(workspace2.baseDir, env2.dockerComposeFile, fs, yamlHandler)
|
|
84
|
-
).addService("modificationHandlerFactory", () => new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap)).addService("schemaMigrator", ({ modificationHandlerFactory }) => new SchemaMigrator(modificationHandlerFactory)).addService("migrationsResolver", ({ migrationFilesManager }) => new MigrationsResolver(migrationFilesManager)).addService("
|
|
91
|
+
).addService("modificationHandlerFactory", () => new ModificationHandlerFactory(ModificationHandlerFactory.defaultFactoryMap)).addService("schemaMigrator", ({ modificationHandlerFactory }) => new SchemaMigrator(modificationHandlerFactory)).addService("migrationsResolver", ({ migrationFilesManager }) => new MigrationsResolver(migrationFilesManager)).addService("schemaStateManager", ({ workspace: workspace2 }) => new SchemaStateManager(workspace2.migrationsDir + "/state")).addService("snapshotManager", ({ workspace: workspace2 }) => new SnapshotManager(workspace2.migrationsDir + "/snapshot.json")).addService(
|
|
92
|
+
"schemaVersionBuilder",
|
|
93
|
+
({ migrationsResolver, schemaMigrator, schemaStateManager }) => new SchemaVersionBuilder(migrationsResolver, schemaMigrator, schemaStateManager)
|
|
94
|
+
).addService("schemaDiffer", ({ schemaMigrator }) => new SchemaDiffer(schemaMigrator, {
|
|
85
95
|
maxPatchSize: env.migrationsOptions?.maxPatchSize
|
|
86
96
|
})).addService("migrationCreator", ({ migrationFilesManager, schemaDiffer }) => new MigrationCreator(migrationFilesManager, schemaDiffer, {
|
|
87
97
|
json: JSON.stringify({ formatVersion: VERSION_LATEST, modifications: [] }, void 0, " ") + "\n",
|
|
88
98
|
ts: jsSample,
|
|
89
99
|
js: jsSample
|
|
90
100
|
})).addService("migrationDescriber", ({ modificationHandlerFactory }) => new MigrationDescriber(modificationHandlerFactory)).addService("migrationPrinter", ({ migrationDescriber }) => new MigrationPrinter(migrationDescriber)).addService("migrationsExecutor", () => new MigrationExecutor()).addService("migrationsStatusResolver", () => new MigrationsStatusResolver()).addService(
|
|
101
|
+
"migrationSnapshotFacade",
|
|
102
|
+
({ migrationsResolver, schemaVersionBuilder, schemaDiffer, schemaMigrator, schemaStateManager, snapshotManager }) => new MigrationSnapshotFacade(
|
|
103
|
+
migrationsResolver,
|
|
104
|
+
schemaVersionBuilder,
|
|
105
|
+
schemaDiffer,
|
|
106
|
+
schemaMigrator,
|
|
107
|
+
schemaStateManager,
|
|
108
|
+
snapshotManager
|
|
109
|
+
)
|
|
110
|
+
).addService(
|
|
91
111
|
"migrationsStatusFacade",
|
|
92
112
|
({ systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter }) => new MigrationsStatusFacade(systemClientProvider, migrationsResolver, migrationsStatusResolver, migrationPrinter)
|
|
93
113
|
).addService(
|
|
@@ -99,7 +119,9 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
99
119
|
schemaVersionBuilder,
|
|
100
120
|
migrationPrinter,
|
|
101
121
|
migrationsExecutor,
|
|
102
|
-
migrationsStatusFacade
|
|
122
|
+
migrationsStatusFacade,
|
|
123
|
+
schemaStateManager,
|
|
124
|
+
migrationSnapshotFacade
|
|
103
125
|
}) => new MigrationExecutionFacade(
|
|
104
126
|
systemClientProvider,
|
|
105
127
|
tenantClientProvider,
|
|
@@ -107,11 +129,13 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
107
129
|
schemaVersionBuilder,
|
|
108
130
|
migrationPrinter,
|
|
109
131
|
migrationsExecutor,
|
|
110
|
-
migrationsStatusFacade
|
|
132
|
+
migrationsStatusFacade,
|
|
133
|
+
schemaStateManager,
|
|
134
|
+
migrationSnapshotFacade
|
|
111
135
|
)
|
|
112
136
|
).addService("migrationsValidator", ({ migrationDescriber, schemaMigrator }) => new MigrationsValidator(migrationDescriber, schemaMigrator)).addService(
|
|
113
137
|
"migrationRebaseFacade",
|
|
114
|
-
({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager }) => new MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager)
|
|
138
|
+
({ schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager }) => new MigrationRebaseFacade(schemaVersionBuilder, migrationsValidator, systemClientProvider, migrationFilesManager, schemaStateManager)
|
|
115
139
|
).addService(
|
|
116
140
|
"schemaLoader",
|
|
117
141
|
({ workspace: workspace2, jsCodeRunner, runtime: runtime2 }) => runtime2 === "bun" ? new ImportSchemaLoader(workspace2) : new TranspilingSchemaLoader(workspace2, jsCodeRunner)
|
|
@@ -129,7 +153,8 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
129
153
|
migrationCreator,
|
|
130
154
|
migrationsValidator,
|
|
131
155
|
migrationPrinter,
|
|
132
|
-
schemaMigrator
|
|
156
|
+
schemaMigrator,
|
|
157
|
+
schemaStateManager
|
|
133
158
|
}) => new MigrationAmendCommand(
|
|
134
159
|
migrationsResolver,
|
|
135
160
|
systemClientProvider,
|
|
@@ -139,17 +164,32 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
139
164
|
migrationCreator,
|
|
140
165
|
migrationsValidator,
|
|
141
166
|
migrationPrinter,
|
|
142
|
-
schemaMigrator
|
|
167
|
+
schemaMigrator,
|
|
168
|
+
schemaStateManager
|
|
143
169
|
)
|
|
144
170
|
).addService("migrationBlankCommand", ({ migrationCreator }) => new MigrationBlankCommand(migrationCreator)).addService(
|
|
145
171
|
"migrationDescribeCommand",
|
|
146
172
|
({ migrationPrinter, schemaVersionBuilder, migrationsResolver }) => new MigrationDescribeCommand(migrationPrinter, schemaVersionBuilder, migrationsResolver)
|
|
147
173
|
).addService(
|
|
148
174
|
"migrationDiffCommand",
|
|
149
|
-
({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade }) => new MigrationDiffCommand(
|
|
175
|
+
({ schemaLoader, schemaVersionBuilder, migrationCreator, migrationPrinter, migrationExecutionFacade, schemaStateManager, migrationsResolver }) => new MigrationDiffCommand(
|
|
176
|
+
schemaLoader,
|
|
177
|
+
schemaVersionBuilder,
|
|
178
|
+
migrationCreator,
|
|
179
|
+
migrationPrinter,
|
|
180
|
+
migrationExecutionFacade,
|
|
181
|
+
schemaStateManager,
|
|
182
|
+
migrationsResolver
|
|
183
|
+
)
|
|
150
184
|
).addService("migrationExecuteCommand", ({ migrationExecutionFacade }) => new MigrationExecuteCommand(migrationExecutionFacade)).addService(
|
|
185
|
+
"migrationInitStateCommand",
|
|
186
|
+
({ schemaLoader, schemaStateManager }) => new MigrationInitStateCommand(schemaLoader, schemaStateManager)
|
|
187
|
+
).addService(
|
|
151
188
|
"migrationRebaseCommand",
|
|
152
189
|
({ migrationsResolver, migrationRebaseFacade }) => new MigrationRebaseCommand(migrationsResolver, migrationRebaseFacade)
|
|
190
|
+
).addService("migrationSnapshotCommand", ({ migrationSnapshotFacade }) => new MigrationSnapshotCommand(migrationSnapshotFacade)).addService(
|
|
191
|
+
"migrationVerifySnapshotCommand",
|
|
192
|
+
({ migrationSnapshotFacade }) => new MigrationVerifySnapshotCommand(migrationSnapshotFacade)
|
|
153
193
|
).addService(
|
|
154
194
|
"migrationStatusCommand",
|
|
155
195
|
({ migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter }) => new MigrationStatusCommand(migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter)
|
|
@@ -165,7 +205,13 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
165
205
|
).addService("exportCommand", ({ dataTransferClient, remoteProjectResolver }) => new ExportCommand(remoteProjectResolver, dataTransferClient)).addService("importCommand", ({ dataTransferClient, remoteProjectResolver }) => new ImportCommand(remoteProjectResolver, dataTransferClient)).addService("transferCommand", ({ dataTransferClient, remoteProjectResolver }) => new TransferCommand(remoteProjectResolver, dataTransferClient)).addService(
|
|
166
206
|
"workspaceUpdateCommand",
|
|
167
207
|
({ packageWorkspaceResolver, dockerComposeManager }) => new WorkspaceUpdateApiCommand(packageWorkspaceResolver, dockerComposeManager)
|
|
168
|
-
).addService("actionsListVariables", ({ remoteProjectResolver }) => new ActionsListVariablesCommand(remoteProjectResolver)).addService("actionsSetVariables", ({ remoteProjectResolver }) => new ActionsSetVariablesCommand(remoteProjectResolver)).addService("actionsListFailedEvents", ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand(remoteProjectResolver)).addService("actionsRetryEvent", ({ remoteProjectResolver }) => new ActionsRetryEventCommand(remoteProjectResolver)).addService("actionsGetEvent", ({ remoteProjectResolver }) => new ActionsGetEventCommand(remoteProjectResolver)).addService("actionsStopEvent", ({ remoteProjectResolver }) => new ActionsStopEventCommand(remoteProjectResolver)).addService(
|
|
208
|
+
).addService("actionsListVariables", ({ remoteProjectResolver }) => new ActionsListVariablesCommand(remoteProjectResolver)).addService("actionsSetVariables", ({ remoteProjectResolver }) => new ActionsSetVariablesCommand(remoteProjectResolver)).addService("actionsListFailedEvents", ({ remoteProjectResolver }) => new ActionsListFailedEventsCommand(remoteProjectResolver)).addService("actionsRetryEvent", ({ remoteProjectResolver }) => new ActionsRetryEventCommand(remoteProjectResolver)).addService("actionsGetEvent", ({ remoteProjectResolver }) => new ActionsGetEventCommand(remoteProjectResolver)).addService("actionsStopEvent", ({ remoteProjectResolver }) => new ActionsStopEventCommand(remoteProjectResolver)).addService(
|
|
209
|
+
"tenantConfigLoader",
|
|
210
|
+
({ jsCodeRunner }) => runtime === "bun" ? new ImportTenantConfigLoader() : new TranspilingTenantConfigLoader(jsCodeRunner)
|
|
211
|
+
).addService("tenantConfigApplier", () => new TenantConfigApplier()).addService(
|
|
212
|
+
"tenantApplyCommand",
|
|
213
|
+
({ remoteProjectResolver, tenantConfigLoader, tenantConfigApplier }) => new TenantApplyCommand(remoteProjectResolver, tenantConfigLoader, tenantConfigApplier)
|
|
214
|
+
).addService("commandList", (dic) => {
|
|
169
215
|
const commands = {
|
|
170
216
|
["deploy"]: () => dic.deployCommand,
|
|
171
217
|
["version"]: () => dic.versionCommand,
|
|
@@ -175,9 +221,12 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
175
221
|
["migrations:diff"]: () => dic.migrationDiffCommand,
|
|
176
222
|
["migrations:amend"]: () => dic.migrationAmendCommand,
|
|
177
223
|
["migrations:blank"]: () => dic.migrationBlankCommand,
|
|
224
|
+
["migrations:init-state"]: () => dic.migrationInitStateCommand,
|
|
178
225
|
["migrations:describe"]: () => dic.migrationDescribeCommand,
|
|
179
226
|
["migrations:execute"]: () => dic.migrationExecuteCommand,
|
|
180
227
|
["migrations:rebase"]: () => dic.migrationRebaseCommand,
|
|
228
|
+
["migrations:snapshot"]: () => dic.migrationSnapshotCommand,
|
|
229
|
+
["migrations:verify-snapshot"]: () => dic.migrationVerifySnapshotCommand,
|
|
181
230
|
["migrations:status"]: () => dic.migrationStatusCommand,
|
|
182
231
|
["workspace:update:api"]: () => dic.workspaceUpdateCommand,
|
|
183
232
|
["project:validate"]: () => dic.projectValidateCommand,
|
|
@@ -188,7 +237,8 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
188
237
|
["actions:failed-events"]: () => dic.actionsListFailedEvents,
|
|
189
238
|
["actions:retry-event"]: () => dic.actionsRetryEvent,
|
|
190
239
|
["actions:get-event"]: () => dic.actionsGetEvent,
|
|
191
|
-
["actions:stop-event"]: () => dic.actionsStopEvent
|
|
240
|
+
["actions:stop-event"]: () => dic.actionsStopEvent,
|
|
241
|
+
["tenant:apply"]: () => dic.tenantApplyCommand
|
|
192
242
|
};
|
|
193
243
|
return commands;
|
|
194
244
|
}).addService("commandManager", ({ commandList }) => new CommandManager(commandList)).addService(
|
|
@@ -200,7 +250,7 @@ const createContainer = ({ env, version, runtime, workspace }) => {
|
|
|
200
250
|
`Contember CLI version ${version}`,
|
|
201
251
|
{
|
|
202
252
|
beforeRun: async ({ name }) => {
|
|
203
|
-
if (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !["deploy", "version", "data:export", "data:import", "data:transfer"].includes(name)) {
|
|
253
|
+
if (!process.env.CONTEMBER_SKIP_VERSION_CHECK && !["deploy", "version", "data:export", "data:import", "data:transfer", "tenant:apply"].includes(name)) {
|
|
204
254
|
await versionChecker.checkVersions();
|
|
205
255
|
}
|
|
206
256
|
}
|