@contember/cli 2.1.0-beta.2 → 2.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +14 -1
- package/dist/development/index.cjs +5 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +5 -0
- package/dist/development/index.js.map +1 -0
- package/dist/development/run.cjs +3 -3
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs +3 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.js +3 -1
- package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs +26 -4
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js +26 -4
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs +39 -3
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js +39 -3
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs +3 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js +3 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs +26 -0
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.js +26 -0
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs +28 -0
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js +28 -0
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +23 -0
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js +23 -0
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -0
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs +2 -2
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/development/src/commands/tenant/TenantApplyCommand.cjs +39 -0
- package/dist/development/src/commands/tenant/TenantApplyCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/TenantApplyCommand.js +39 -0
- package/dist/development/src/commands/tenant/TenantApplyCommand.js.map +1 -0
- package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/development/src/consts.cjs +2 -2
- package/dist/development/src/consts.cjs.map +1 -1
- package/dist/development/src/dic.cjs +60 -10
- package/dist/development/src/dic.cjs.map +1 -1
- package/dist/development/src/dic.js +61 -11
- package/dist/development/src/dic.js.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/development/src/lib/VersionChecker.cjs +2 -2
- package/dist/development/src/lib/VersionChecker.cjs.map +1 -1
- package/dist/development/src/lib/VersionChecker.js.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/development/src/lib/fs/DockerComposeManager.cjs +10 -10
- package/dist/development/src/lib/fs/DockerComposeManager.cjs.map +1 -1
- package/dist/development/src/lib/fs/DockerComposeManager.js.map +1 -1
- package/dist/development/src/lib/fs/YamlHandler.cjs.map +1 -1
- package/dist/development/src/lib/fs/YamlHandler.js.map +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.js.map +1 -1
- package/dist/development/src/lib/js/JsCodeRunner.cjs.map +1 -1
- package/dist/development/src/lib/js/JsCodeRunner.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs +78 -18
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js +79 -19
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs +5 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js +5 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs +171 -0
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -0
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js +171 -0
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -0
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectResolver.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityInfo.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityLink.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldLink.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldType.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldType.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/OnDelete.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.js.map +1 -1
- package/dist/development/src/lib/schema/SchemaLoader.cjs +5 -5
- package/dist/development/src/lib/schema/SchemaLoader.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaLoader.js.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationHelper.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.cjs +75 -12
- package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.js +75 -12
- package/dist/development/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs +55 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.js +55 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.js.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.cjs +32 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.js +32 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.js.map +1 -0
- package/dist/development/src/lib/tenant/tenantConfig.cjs +5 -0
- package/dist/development/src/lib/tenant/tenantConfig.cjs.map +1 -0
- package/dist/development/src/lib/tenant/tenantConfig.js +5 -0
- package/dist/development/src/lib/tenant/tenantConfig.js.map +1 -0
- package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs +6 -6
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
- package/dist/development/src/lib/workspace/WorkspaceResolver.js.map +1 -1
- package/dist/production/index.cjs +5 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +5 -0
- package/dist/production/index.js.map +1 -0
- package/dist/production/run.cjs +3 -3
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs +3 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.js +3 -1
- package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs +26 -4
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js +26 -4
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs +39 -3
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js +39 -3
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs +3 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js +3 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs +26 -0
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.js +26 -0
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs +28 -0
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js +28 -0
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +23 -0
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js +23 -0
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -0
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs +2 -2
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/production/src/commands/tenant/TenantApplyCommand.cjs +39 -0
- package/dist/production/src/commands/tenant/TenantApplyCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/TenantApplyCommand.js +39 -0
- package/dist/production/src/commands/tenant/TenantApplyCommand.js.map +1 -0
- package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/production/src/consts.cjs +2 -2
- package/dist/production/src/consts.cjs.map +1 -1
- package/dist/production/src/dic.cjs +60 -10
- package/dist/production/src/dic.cjs.map +1 -1
- package/dist/production/src/dic.js +61 -11
- package/dist/production/src/dic.js.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/production/src/lib/VersionChecker.cjs +2 -2
- package/dist/production/src/lib/VersionChecker.cjs.map +1 -1
- package/dist/production/src/lib/VersionChecker.js.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/production/src/lib/fs/DockerComposeManager.cjs +10 -10
- package/dist/production/src/lib/fs/DockerComposeManager.cjs.map +1 -1
- package/dist/production/src/lib/fs/DockerComposeManager.js.map +1 -1
- package/dist/production/src/lib/fs/YamlHandler.cjs.map +1 -1
- package/dist/production/src/lib/fs/YamlHandler.js.map +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.js.map +1 -1
- package/dist/production/src/lib/js/JsCodeRunner.cjs.map +1 -1
- package/dist/production/src/lib/js/JsCodeRunner.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs +78 -18
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js +79 -19
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs +5 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js +5 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs +171 -0
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -0
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js +171 -0
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -0
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectResolver.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityInfo.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityLink.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldLink.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldType.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldType.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/OnDelete.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -1
- package/dist/production/src/lib/schema/SchemaLoader.cjs +5 -5
- package/dist/production/src/lib/schema/SchemaLoader.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaLoader.js.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationHelper.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.cjs +75 -12
- package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.js +75 -12
- package/dist/production/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs +55 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.js +55 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.js.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.cjs +32 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.js +32 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.js.map +1 -0
- package/dist/production/src/lib/tenant/tenantConfig.cjs +5 -0
- package/dist/production/src/lib/tenant/tenantConfig.cjs.map +1 -0
- package/dist/production/src/lib/tenant/tenantConfig.js +5 -0
- package/dist/production/src/lib/tenant/tenantConfig.js.map +1 -0
- package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs +6 -6
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
- package/dist/production/src/lib/workspace/WorkspaceResolver.js.map +1 -1
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts.map +1 -1
- package/dist/types/commands/deploy/DeployCommand.d.ts +7 -6
- package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -1
- package/dist/types/commands/deploy/index.d.ts +1 -1
- package/dist/types/commands/deploy/index.d.ts.map +1 -1
- package/dist/types/commands/index.d.ts +6 -5
- package/dist/types/commands/index.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts +8 -7
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts +1 -1
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts +8 -5
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts +2 -1
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts +14 -0
- package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts +1 -1
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts +12 -0
- package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts +3 -3
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts +12 -0
- package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/index.d.ts +10 -7
- package/dist/types/commands/migrations/index.d.ts.map +1 -1
- package/dist/types/commands/misc/index.d.ts +1 -1
- package/dist/types/commands/misc/index.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts +1 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectValidateCommand.d.ts +2 -2
- package/dist/types/commands/project/ProjectValidateCommand.d.ts.map +1 -1
- package/dist/types/commands/project/index.d.ts +3 -3
- package/dist/types/commands/project/index.d.ts.map +1 -1
- package/dist/types/commands/tenant/TenantApplyCommand.d.ts +21 -0
- package/dist/types/commands/tenant/TenantApplyCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/index.d.ts +2 -0
- package/dist/types/commands/tenant/index.d.ts.map +1 -0
- package/dist/types/commands/transfer/ExportCommand.d.ts +2 -2
- package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/ImportCommand.d.ts +2 -2
- package/dist/types/commands/transfer/ImportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/TransferCommand.d.ts +2 -2
- package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/index.d.ts +3 -3
- package/dist/types/commands/transfer/index.d.ts.map +1 -1
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts +1 -1
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
- package/dist/types/commands/workspace/index.d.ts +1 -1
- package/dist/types/commands/workspace/index.d.ts.map +1 -1
- package/dist/types/dic.d.ts +54 -32
- package/dist/types/dic.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/SystemClientProvider.d.ts +1 -1
- package/dist/types/lib/SystemClientProvider.d.ts.map +1 -1
- package/dist/types/lib/TenantClientProvider.d.ts +2 -2
- package/dist/types/lib/TenantClientProvider.d.ts.map +1 -1
- package/dist/types/lib/VersionChecker.d.ts +1 -1
- package/dist/types/lib/VersionChecker.d.ts.map +1 -1
- package/dist/types/lib/admin/AdminClient.d.ts +1 -1
- package/dist/types/lib/admin/AdminClient.d.ts.map +1 -1
- package/dist/types/lib/admin/AdminDeployer.d.ts +3 -3
- package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -1
- package/dist/types/lib/fs/DockerComposeManager.d.ts +2 -2
- package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -1
- package/dist/types/lib/fs/YamlHandler.d.ts +2 -2
- package/dist/types/lib/fs/YamlHandler.d.ts.map +1 -1
- package/dist/types/lib/js/EsBuildBuilder.d.ts +1 -1
- package/dist/types/lib/js/EsBuildBuilder.d.ts.map +1 -1
- package/dist/types/lib/js/EvalExecutor.d.ts +1 -1
- package/dist/types/lib/js/EvalExecutor.d.ts.map +1 -1
- package/dist/types/lib/js/JsCodeRunner.d.ts +2 -2
- package/dist/types/lib/js/JsCodeRunner.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts +13 -8
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts +5 -4
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts +28 -0
- package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts.map +1 -0
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +2 -2
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProjectProvider.d.ts +1 -1
- package/dist/types/lib/project/RemoteProjectProvider.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProjectResolver.d.ts +2 -2
- package/dist/types/lib/project/RemoteProjectResolver.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts +1 -1
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/OnDelete.d.ts +1 -1
- package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -1
- package/dist/types/lib/schema/SchemaLoader.d.ts +2 -2
- package/dist/types/lib/schema/SchemaLoader.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantClient.d.ts +15 -0
- package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantConfigApplier.d.ts +18 -0
- package/dist/types/lib/tenant/TenantConfigApplier.d.ts.map +1 -0
- package/dist/types/lib/tenant/TenantConfigLoader.d.ts +16 -0
- package/dist/types/lib/tenant/TenantConfigLoader.d.ts.map +1 -0
- package/dist/types/lib/tenant/tenantConfig.d.ts +74 -0
- package/dist/types/lib/tenant/tenantConfig.d.ts.map +1 -0
- package/dist/types/lib/transfer/DataTransferClient.d.ts +1 -1
- package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts +2 -2
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -15
- package/src/commands/actions/ActionsGetEventCommand.ts +2 -2
- package/src/commands/actions/ActionsListFailedEventsCommand.ts +2 -2
- package/src/commands/actions/ActionsListVariablesCommand.ts +2 -2
- package/src/commands/actions/ActionsRetryEventCommand.ts +2 -2
- package/src/commands/actions/ActionsSetVariablesCommand.ts +2 -2
- package/src/commands/actions/ActionsStopEventCommand.ts +2 -2
- package/src/commands/deploy/DeployCommand.ts +13 -8
- package/src/commands/deploy/index.ts +1 -1
- package/src/commands/index.ts +6 -5
- package/src/commands/migrations/MigrationAmendCommand.ts +38 -10
- package/src/commands/migrations/MigrationDescribeCommand.ts +1 -1
- package/src/commands/migrations/MigrationDiffCommand.ts +50 -6
- package/src/commands/migrations/MigrationExecuteCommand.ts +6 -1
- package/src/commands/migrations/MigrationInitStateCommand.ts +34 -0
- package/src/commands/migrations/MigrationRebaseCommand.ts +1 -1
- package/src/commands/migrations/MigrationSnapshotCommand.ts +34 -0
- package/src/commands/migrations/MigrationStatusCommand.ts +3 -3
- package/src/commands/migrations/MigrationVerifySnapshotCommand.ts +28 -0
- package/src/commands/migrations/index.ts +10 -7
- package/src/commands/misc/index.ts +1 -1
- package/src/commands/project/ProjectGenerateDocumentationCommand.ts +3 -3
- package/src/commands/project/ProjectPrintSchemaCommand.ts +2 -2
- package/src/commands/project/ProjectValidateCommand.ts +3 -3
- package/src/commands/project/index.ts +3 -3
- package/src/commands/tenant/TenantApplyCommand.ts +57 -0
- package/src/commands/tenant/index.ts +1 -0
- package/src/commands/transfer/ExportCommand.ts +4 -4
- package/src/commands/transfer/ImportCommand.ts +6 -6
- package/src/commands/transfer/TransferCommand.ts +6 -6
- package/src/commands/transfer/index.ts +3 -3
- package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +2 -2
- package/src/commands/workspace/index.ts +1 -1
- package/src/dic.ts +103 -37
- package/src/index.ts +1 -0
- package/src/lib/SystemClientProvider.ts +1 -1
- package/src/lib/TenantClientProvider.ts +2 -2
- package/src/lib/VersionChecker.ts +2 -2
- package/src/lib/admin/AdminClient.ts +2 -2
- package/src/lib/admin/AdminDeployer.ts +3 -3
- package/src/lib/fs/DockerComposeManager.ts +2 -2
- package/src/lib/fs/YamlHandler.ts +2 -2
- package/src/lib/js/EsBuildBuilder.ts +1 -1
- package/src/lib/js/EvalExecutor.ts +1 -1
- package/src/lib/js/JsCodeRunner.ts +2 -2
- package/src/lib/migrations/MigrationExecutionFacade.ts +117 -23
- package/src/lib/migrations/MigrationPrinter.ts +1 -1
- package/src/lib/migrations/MigrationRebaseFacade.ts +10 -3
- package/src/lib/migrations/MigrationSnapshotFacade.ts +218 -0
- package/src/lib/migrations/MigrationsStatusFacade.ts +2 -2
- package/src/lib/migrations/MigrationsValidator.ts +1 -1
- package/src/lib/project/RemoteProjectProvider.ts +1 -1
- package/src/lib/project/RemoteProjectResolver.ts +3 -3
- package/src/lib/project/docs/components/EntityInfo.tsx +6 -6
- package/src/lib/project/docs/components/EntityLink.tsx +1 -1
- package/src/lib/project/docs/components/FieldLink.tsx +2 -2
- package/src/lib/project/docs/components/FieldPermissions.tsx +1 -1
- package/src/lib/project/docs/components/FieldType.tsx +2 -2
- package/src/lib/project/docs/components/OnDelete.tsx +3 -3
- package/src/lib/project/docs/components/ProjectInfo.tsx +3 -3
- package/src/lib/project/docs/projectDescribe.tsx +2 -2
- package/src/lib/schema/SchemaLoader.ts +2 -2
- package/src/lib/schema/SchemaValidationHelper.ts +1 -1
- package/src/lib/tenant/TenantClient.ts +123 -14
- package/src/lib/tenant/TenantConfigApplier.ts +72 -0
- package/src/lib/tenant/TenantConfigLoader.ts +41 -0
- package/src/lib/tenant/tenantConfig.ts +101 -0
- package/src/lib/transfer/DataTransferClient.ts +2 -2
- package/src/lib/workspace/WorkspaceResolver.ts +2 -2
- package/src/run.ts +6 -6
- package/src/tsconfig.json +1 -0
- package/tenant.config.example.ts +64 -0
- package/tests/cases/unit/MigrationAmendCommand.test.ts +156 -0
- package/tests/cases/unit/MigrationExecutionFacade.test.ts +81 -0
- package/tests/cases/unit/MigrationRebaseFacade.test.ts +87 -0
- package/tests/cases/unit/MigrationSnapshotFacade.test.ts +243 -0
- package/tests/tenantConfigApplier.test.ts +87 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
class TenantConfigApplier {
|
|
2
|
+
async apply(client, config, options = {}) {
|
|
3
|
+
const dryRun = options.dryRun === true;
|
|
4
|
+
const log = (message) => console.log(`${dryRun ? "[dry-run] " : ""}${message}`);
|
|
5
|
+
if (config.config) {
|
|
6
|
+
log("configure: applying global tenant config");
|
|
7
|
+
if (!dryRun) {
|
|
8
|
+
await client.configure(config.config);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
if (config.identityProviders && Object.keys(config.identityProviders).length > 0) {
|
|
12
|
+
const existing = await client.listIdentityProviders();
|
|
13
|
+
const existingBySlug = new Map(existing.map((it) => [it.slug, it]));
|
|
14
|
+
for (const [slug, idp] of Object.entries(config.identityProviders)) {
|
|
15
|
+
const current = existingBySlug.get(slug);
|
|
16
|
+
if (!current) {
|
|
17
|
+
log(`addIDP: ${slug} (${idp.type})`);
|
|
18
|
+
if (!dryRun) {
|
|
19
|
+
await client.addIdp(slug, idp.type, idp.configuration, idp.options);
|
|
20
|
+
}
|
|
21
|
+
} else {
|
|
22
|
+
log(`updateIDP: ${slug} (${idp.type})`);
|
|
23
|
+
if (!dryRun) {
|
|
24
|
+
await client.updateIdp(slug, idp.type, idp.configuration, idp.options);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const wantDisabled = idp.disabled === true;
|
|
28
|
+
const isDisabled = current ? current.disabledAt !== null : false;
|
|
29
|
+
if (wantDisabled && !isDisabled) {
|
|
30
|
+
log(`disableIDP: ${slug}`);
|
|
31
|
+
if (!dryRun) {
|
|
32
|
+
await client.disableIdp(slug);
|
|
33
|
+
}
|
|
34
|
+
} else if (!wantDisabled && isDisabled) {
|
|
35
|
+
log(`enableIDP: ${slug}`);
|
|
36
|
+
if (!dryRun) {
|
|
37
|
+
await client.enableIdp(slug);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (config.mailTemplates && config.mailTemplates.length > 0) {
|
|
43
|
+
for (const template of config.mailTemplates) {
|
|
44
|
+
log(`addMailTemplate: ${template.type}${template.variant ? `/${template.variant}` : ""}`);
|
|
45
|
+
if (!dryRun) {
|
|
46
|
+
await client.addMailTemplate(template);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
TenantConfigApplier
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=TenantConfigApplier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantConfigApplier.js","sources":["../../../../../../packages/cli/src/lib/tenant/TenantConfigApplier.ts"],"sourcesContent":["import { TenantClient } from './TenantClient.js'\nimport { TenantConfig } from './tenantConfig.js'\n\nexport interface TenantConfigApplyOptions {\n\tdryRun?: boolean\n}\n\n/**\n * Applies a {@link TenantConfig} to a tenant idempotently:\n * - `configure` is a partial merge, so it is always (re)sent.\n * - identity providers are added or updated based on the current state, then\n * enabled/disabled to match `disabled`.\n * - mail templates are upserted server-side by `addMailTemplate`.\n *\n * Nothing is ever removed — entries missing from the config are left untouched.\n */\nexport class TenantConfigApplier {\n\tpublic async apply(client: TenantClient, config: TenantConfig, options: TenantConfigApplyOptions = {}): Promise<void> {\n\t\tconst dryRun = options.dryRun === true\n\t\tconst log = (message: string) => console.log(`${dryRun ? '[dry-run] ' : ''}${message}`)\n\n\t\tif (config.config) {\n\t\t\tlog('configure: applying global tenant config')\n\t\t\tif (!dryRun) {\n\t\t\t\tawait client.configure(config.config)\n\t\t\t}\n\t\t}\n\n\t\tif (config.identityProviders && Object.keys(config.identityProviders).length > 0) {\n\t\t\tconst existing = await client.listIdentityProviders()\n\t\t\tconst existingBySlug = new Map(existing.map(it => [it.slug, it]))\n\n\t\t\tfor (const [slug, idp] of Object.entries(config.identityProviders)) {\n\t\t\t\tconst current = existingBySlug.get(slug)\n\t\t\t\tif (!current) {\n\t\t\t\t\tlog(`addIDP: ${slug} (${idp.type})`)\n\t\t\t\t\tif (!dryRun) {\n\t\t\t\t\t\tawait client.addIdp(slug, idp.type, idp.configuration, idp.options)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlog(`updateIDP: ${slug} (${idp.type})`)\n\t\t\t\t\tif (!dryRun) {\n\t\t\t\t\t\tawait client.updateIdp(slug, idp.type, idp.configuration, idp.options)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst wantDisabled = idp.disabled === true\n\t\t\t\tconst isDisabled = current ? current.disabledAt !== null : false\n\t\t\t\tif (wantDisabled && !isDisabled) {\n\t\t\t\t\tlog(`disableIDP: ${slug}`)\n\t\t\t\t\tif (!dryRun) {\n\t\t\t\t\t\tawait client.disableIdp(slug)\n\t\t\t\t\t}\n\t\t\t\t} else if (!wantDisabled && isDisabled) {\n\t\t\t\t\tlog(`enableIDP: ${slug}`)\n\t\t\t\t\tif (!dryRun) {\n\t\t\t\t\t\tawait client.enableIdp(slug)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (config.mailTemplates && config.mailTemplates.length > 0) {\n\t\t\tfor (const template of config.mailTemplates) {\n\t\t\t\tlog(`addMailTemplate: ${template.type}${template.variant ? `/${template.variant}` : ''}`)\n\t\t\t\tif (!dryRun) {\n\t\t\t\t\tawait client.addMailTemplate(template)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAgBO,MAAM,oBAAoB;AAAA,EAChC,MAAa,MAAM,QAAsB,QAAsB,UAAoC,CAAA,GAAmB;AACrH,UAAM,SAAS,QAAQ,WAAW;AAClC,UAAM,MAAM,CAAC,YAAoB,QAAQ,IAAI,GAAG,SAAS,eAAe,EAAE,GAAG,OAAO,EAAE;AAEtF,QAAI,OAAO,QAAQ;AAClB,UAAI,0CAA0C;AAC9C,UAAI,CAAC,QAAQ;AACZ,cAAM,OAAO,UAAU,OAAO,MAAM;AAAA,MACrC;AAAA,IACD;AAEA,QAAI,OAAO,qBAAqB,OAAO,KAAK,OAAO,iBAAiB,EAAE,SAAS,GAAG;AACjF,YAAM,WAAW,MAAM,OAAO,sBAAA;AAC9B,YAAM,iBAAiB,IAAI,IAAI,SAAS,IAAI,CAAA,OAAM,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC;AAEhE,iBAAW,CAAC,MAAM,GAAG,KAAK,OAAO,QAAQ,OAAO,iBAAiB,GAAG;AACnE,cAAM,UAAU,eAAe,IAAI,IAAI;AACvC,YAAI,CAAC,SAAS;AACb,cAAI,WAAW,IAAI,KAAK,IAAI,IAAI,GAAG;AACnC,cAAI,CAAC,QAAQ;AACZ,kBAAM,OAAO,OAAO,MAAM,IAAI,MAAM,IAAI,eAAe,IAAI,OAAO;AAAA,UACnE;AAAA,QACD,OAAO;AACN,cAAI,cAAc,IAAI,KAAK,IAAI,IAAI,GAAG;AACtC,cAAI,CAAC,QAAQ;AACZ,kBAAM,OAAO,UAAU,MAAM,IAAI,MAAM,IAAI,eAAe,IAAI,OAAO;AAAA,UACtE;AAAA,QACD;AAEA,cAAM,eAAe,IAAI,aAAa;AACtC,cAAM,aAAa,UAAU,QAAQ,eAAe,OAAO;AAC3D,YAAI,gBAAgB,CAAC,YAAY;AAChC,cAAI,eAAe,IAAI,EAAE;AACzB,cAAI,CAAC,QAAQ;AACZ,kBAAM,OAAO,WAAW,IAAI;AAAA,UAC7B;AAAA,QACD,WAAW,CAAC,gBAAgB,YAAY;AACvC,cAAI,cAAc,IAAI,EAAE;AACxB,cAAI,CAAC,QAAQ;AACZ,kBAAM,OAAO,UAAU,IAAI;AAAA,UAC5B;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAEA,QAAI,OAAO,iBAAiB,OAAO,cAAc,SAAS,GAAG;AAC5D,iBAAW,YAAY,OAAO,eAAe;AAC5C,YAAI,oBAAoB,SAAS,IAAI,GAAG,SAAS,UAAU,IAAI,SAAS,OAAO,KAAK,EAAE,EAAE;AACxF,YAAI,CAAC,QAAQ;AACZ,gBAAM,OAAO,gBAAgB,QAAQ;AAAA,QACtC;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const path = require("node:path");
|
|
4
|
+
const resolvePath = (path$1) => path.isAbsolute(path$1) ? path$1 : path.resolve(process.cwd(), path$1);
|
|
5
|
+
const extractDefault = (result) => {
|
|
6
|
+
if (typeof result !== "object" || result === null || !("default" in result)) {
|
|
7
|
+
throw `Tenant config file must have a default export (use \`export default defineTenantConfig({ ... })\`).`;
|
|
8
|
+
}
|
|
9
|
+
const config = result.default;
|
|
10
|
+
if (typeof config !== "object" || config === null) {
|
|
11
|
+
throw `Default export of the tenant config file must be an object.`;
|
|
12
|
+
}
|
|
13
|
+
return config;
|
|
14
|
+
};
|
|
15
|
+
class ImportTenantConfigLoader {
|
|
16
|
+
async loadConfig(path2) {
|
|
17
|
+
const result = await import(resolvePath(path2));
|
|
18
|
+
return extractDefault(result);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
class TranspilingTenantConfigLoader {
|
|
22
|
+
constructor(jsCodeRunner) {
|
|
23
|
+
this.jsCodeRunner = jsCodeRunner;
|
|
24
|
+
}
|
|
25
|
+
async loadConfig(path2) {
|
|
26
|
+
const result = await this.jsCodeRunner.run(resolvePath(path2));
|
|
27
|
+
return extractDefault(result);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ImportTenantConfigLoader = ImportTenantConfigLoader;
|
|
31
|
+
exports.TranspilingTenantConfigLoader = TranspilingTenantConfigLoader;
|
|
32
|
+
//# sourceMappingURL=TenantConfigLoader.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantConfigLoader.cjs","sources":["../../../../../../packages/cli/src/lib/tenant/TenantConfigLoader.ts"],"sourcesContent":["import { isAbsolute, resolve } from 'node:path'\nimport { JsCodeRunner } from '../js/JsCodeRunner.js'\nimport { TenantConfig } from './tenantConfig.js'\n\nconst resolvePath = (path: string): string => isAbsolute(path) ? path : resolve(process.cwd(), path)\n\nconst extractDefault = (result: unknown): TenantConfig => {\n\tif (typeof result !== 'object' || result === null || !('default' in result)) {\n\t\tthrow `Tenant config file must have a default export (use \\`export default defineTenantConfig({ ... })\\`).`\n\t}\n\tconst config = (result as { default: unknown }).default\n\tif (typeof config !== 'object' || config === null) {\n\t\tthrow `Default export of the tenant config file must be an object.`\n\t}\n\treturn config as TenantConfig\n}\n\nexport interface TenantConfigLoader {\n\tloadConfig(path: string): Promise<TenantConfig>\n}\n\n/** Loads a `tenant.config.ts` directly via dynamic import (Bun runtime). */\nexport class ImportTenantConfigLoader implements TenantConfigLoader {\n\tasync loadConfig(path: string): Promise<TenantConfig> {\n\t\tconst result = await import(resolvePath(path))\n\t\treturn extractDefault(result)\n\t}\n}\n\n/** Loads a `tenant.config.ts` by transpiling it first (Node runtime). */\nexport class TranspilingTenantConfigLoader implements TenantConfigLoader {\n\tconstructor(\n\t\tprivate readonly jsCodeRunner: JsCodeRunner,\n\t) {\n\t}\n\n\tasync loadConfig(path: string): Promise<TenantConfig> {\n\t\tconst result = await this.jsCodeRunner.run(resolvePath(path))\n\t\treturn extractDefault(result)\n\t}\n}\n"],"names":["path","isAbsolute","resolve"],"mappings":";;;AAIA,MAAM,cAAc,CAACA,WAAyBC,KAAAA,WAAWD,MAAI,IAAIA,SAAOE,KAAAA,QAAQ,QAAQ,IAAA,GAAOF,MAAI;AAEnG,MAAM,iBAAiB,CAAC,WAAkC;AACzD,MAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,EAAE,aAAa,SAAS;AAC5E,UAAM;AAAA,EACP;AACA,QAAM,SAAU,OAAgC;AAChD,MAAI,OAAO,WAAW,YAAY,WAAW,MAAM;AAClD,UAAM;AAAA,EACP;AACA,SAAO;AACR;AAOO,MAAM,yBAAuD;AAAA,EACnE,MAAM,WAAWA,OAAqC;AACrD,UAAM,SAAS,MAAM,OAAO,YAAYA,KAAI;AAC5C,WAAO,eAAe,MAAM;AAAA,EAC7B;AACD;AAGO,MAAM,8BAA4D;AAAA,EACxE,YACkB,cAChB;AADgB,SAAA,eAAA;AAAA,EAElB;AAAA,EAEA,MAAM,WAAWA,OAAqC;AACrD,UAAM,SAAS,MAAM,KAAK,aAAa,IAAI,YAAYA,KAAI,CAAC;AAC5D,WAAO,eAAe,MAAM;AAAA,EAC7B;AACD;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { isAbsolute, resolve } from "node:path";
|
|
2
|
+
const resolvePath = (path) => isAbsolute(path) ? path : resolve(process.cwd(), path);
|
|
3
|
+
const extractDefault = (result) => {
|
|
4
|
+
if (typeof result !== "object" || result === null || !("default" in result)) {
|
|
5
|
+
throw `Tenant config file must have a default export (use \`export default defineTenantConfig({ ... })\`).`;
|
|
6
|
+
}
|
|
7
|
+
const config = result.default;
|
|
8
|
+
if (typeof config !== "object" || config === null) {
|
|
9
|
+
throw `Default export of the tenant config file must be an object.`;
|
|
10
|
+
}
|
|
11
|
+
return config;
|
|
12
|
+
};
|
|
13
|
+
class ImportTenantConfigLoader {
|
|
14
|
+
async loadConfig(path) {
|
|
15
|
+
const result = await import(resolvePath(path));
|
|
16
|
+
return extractDefault(result);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
class TranspilingTenantConfigLoader {
|
|
20
|
+
constructor(jsCodeRunner) {
|
|
21
|
+
this.jsCodeRunner = jsCodeRunner;
|
|
22
|
+
}
|
|
23
|
+
async loadConfig(path) {
|
|
24
|
+
const result = await this.jsCodeRunner.run(resolvePath(path));
|
|
25
|
+
return extractDefault(result);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
ImportTenantConfigLoader,
|
|
30
|
+
TranspilingTenantConfigLoader
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=TenantConfigLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantConfigLoader.js","sources":["../../../../../../packages/cli/src/lib/tenant/TenantConfigLoader.ts"],"sourcesContent":["import { isAbsolute, resolve } from 'node:path'\nimport { JsCodeRunner } from '../js/JsCodeRunner.js'\nimport { TenantConfig } from './tenantConfig.js'\n\nconst resolvePath = (path: string): string => isAbsolute(path) ? path : resolve(process.cwd(), path)\n\nconst extractDefault = (result: unknown): TenantConfig => {\n\tif (typeof result !== 'object' || result === null || !('default' in result)) {\n\t\tthrow `Tenant config file must have a default export (use \\`export default defineTenantConfig({ ... })\\`).`\n\t}\n\tconst config = (result as { default: unknown }).default\n\tif (typeof config !== 'object' || config === null) {\n\t\tthrow `Default export of the tenant config file must be an object.`\n\t}\n\treturn config as TenantConfig\n}\n\nexport interface TenantConfigLoader {\n\tloadConfig(path: string): Promise<TenantConfig>\n}\n\n/** Loads a `tenant.config.ts` directly via dynamic import (Bun runtime). */\nexport class ImportTenantConfigLoader implements TenantConfigLoader {\n\tasync loadConfig(path: string): Promise<TenantConfig> {\n\t\tconst result = await import(resolvePath(path))\n\t\treturn extractDefault(result)\n\t}\n}\n\n/** Loads a `tenant.config.ts` by transpiling it first (Node runtime). */\nexport class TranspilingTenantConfigLoader implements TenantConfigLoader {\n\tconstructor(\n\t\tprivate readonly jsCodeRunner: JsCodeRunner,\n\t) {\n\t}\n\n\tasync loadConfig(path: string): Promise<TenantConfig> {\n\t\tconst result = await this.jsCodeRunner.run(resolvePath(path))\n\t\treturn extractDefault(result)\n\t}\n}\n"],"names":[],"mappings":";AAIA,MAAM,cAAc,CAAC,SAAyB,WAAW,IAAI,IAAI,OAAO,QAAQ,QAAQ,IAAA,GAAO,IAAI;AAEnG,MAAM,iBAAiB,CAAC,WAAkC;AACzD,MAAI,OAAO,WAAW,YAAY,WAAW,QAAQ,EAAE,aAAa,SAAS;AAC5E,UAAM;AAAA,EACP;AACA,QAAM,SAAU,OAAgC;AAChD,MAAI,OAAO,WAAW,YAAY,WAAW,MAAM;AAClD,UAAM;AAAA,EACP;AACA,SAAO;AACR;AAOO,MAAM,yBAAuD;AAAA,EACnE,MAAM,WAAW,MAAqC;AACrD,UAAM,SAAS,MAAM,OAAO,YAAY,IAAI;AAC5C,WAAO,eAAe,MAAM;AAAA,EAC7B;AACD;AAGO,MAAM,8BAA4D;AAAA,EACxE,YACkB,cAChB;AADgB,SAAA,eAAA;AAAA,EAElB;AAAA,EAEA,MAAM,WAAW,MAAqC;AACrD,UAAM,SAAS,MAAM,KAAK,aAAa,IAAI,YAAY,IAAI,CAAC;AAC5D,WAAO,eAAe,MAAM;AAAA,EAC7B;AACD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenantConfig.cjs","sources":["../../../../../../packages/cli/src/lib/tenant/tenantConfig.ts"],"sourcesContent":["import type {\n\tConfigCaptchaInput,\n\tConfigInput,\n\tConfigLoginInput,\n\tConfigPasswordInput,\n\tConfigPasswordlessInput,\n\tConfigRateLimitsInput,\n\tConfigRateLimitWindowInput,\n\tIDPOptions,\n\tMailTemplate,\n} from '@contember/graphql-client-tenant'\n\n// Enums and leaf input shapes are re-derived from the generated tenant client\n// (`@contember/graphql-client-tenant`, generated from `tenant.graphql`), so they\n// stay in sync with the schema. The only thing layered on top is `| null` on the\n// fields where the API treats an explicit `null`/`''` as \"clear/disable\" — the\n// codegen renders nullable inputs as optional only and drops the `| null`.\nexport type { CaptchaProvider, ConfigPolicy, MailType } from '@contember/graphql-client-tenant'\n\n/**\n * ISO 8601 duration string, e.g. `\"P1D\"` (1 day) or `\"PT5M\"` (5 minutes).\n */\nexport type Interval = string\n\n/** Adds `| null` to the given keys of an otherwise non-nullable generated input. */\ntype WithNullable<T, K extends keyof T> = Omit<T, K> & { readonly [P in K]?: T[P] | null }\n\nexport type TenantPasswordConfig = WithNullable<ConfigPasswordInput, 'pattern'>\n\nexport type TenantLoginConfig = WithNullable<ConfigLoginInput, 'maxTokenExpiration'>\n\nexport type TenantPasswordlessConfig = WithNullable<ConfigPasswordlessInput, 'url'>\n\n/**\n * `provider: null` disables captcha verification.\n * `secret` is write-only: `null`/omitted leaves the stored value unchanged, `''` clears it.\n */\nexport type TenantCaptchaConfig = WithNullable<ConfigCaptchaInput, 'provider' | 'secret' | 'threshold'>\n\nexport type TenantRateLimitWindow = ConfigRateLimitWindowInput\n\nexport type TenantRateLimitsConfig = ConfigRateLimitsInput\n\n/**\n * Maps to the tenant `configure(config: ConfigInput!)` mutation. New config\n * groups added to the schema flow through automatically; only the groups that\n * need `| null` overrides are pinned.\n */\nexport type TenantGlobalConfig = Omit<ConfigInput, 'password' | 'login' | 'passwordless' | 'captcha'> & {\n\treadonly password?: TenantPasswordConfig\n\treadonly login?: TenantLoginConfig\n\treadonly passwordless?: TenantPasswordlessConfig\n\treadonly captcha?: TenantCaptchaConfig\n}\n\nexport type TenantIdpOptions = IDPOptions\n\n/**\n * A single identity provider. The record key is used as the provider slug.\n * `type` is the handler key registered on the server (built-in: `oidc`,\n * `facebook`, `apple`).\n *\n * This is a CLI-specific composite — the `addIDP`/`updateIDP` mutations take\n * `type`/`configuration`/`options` as separate arguments, not a single input.\n */\nexport interface TenantIdpConfig {\n\ttype: string\n\tconfiguration: Record<string, unknown>\n\toptions?: TenantIdpOptions\n\t/** When `true`, the provider is disabled (kept, but not usable for sign-in). */\n\tdisabled?: boolean\n}\n\n/** Maps to the `addMailTemplate(template: MailTemplate!)` mutation. */\nexport type TenantMailTemplate = WithNullable<MailTemplate, 'projectSlug' | 'replyTo'>\n\n/**\n * Declarative tenant configuration. Applied idempotently by\n * `contember tenant:apply`.\n */\nexport interface TenantConfig {\n\tconfig?: TenantGlobalConfig\n\t/** Identity providers keyed by slug. */\n\tidentityProviders?: Record<string, TenantIdpConfig>\n\tmailTemplates?: TenantMailTemplate[]\n}\n\n/**\n * Type-safe helper for authoring a `tenant.config.ts`. Returns the config\n * unchanged — it exists only to provide editor autocompletion and type\n * checking.\n *\n * ```ts\n * import { defineTenantConfig } from '@contember/cli'\n *\n * export default defineTenantConfig({\n * config: { password: { minLength: 8 } },\n * })\n * ```\n */\nexport const defineTenantConfig = (config: TenantConfig): TenantConfig => config\n"],"names":[],"mappings":";;AAoGO,MAAM,qBAAqB,CAAC,WAAuC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenantConfig.js","sources":["../../../../../../packages/cli/src/lib/tenant/tenantConfig.ts"],"sourcesContent":["import type {\n\tConfigCaptchaInput,\n\tConfigInput,\n\tConfigLoginInput,\n\tConfigPasswordInput,\n\tConfigPasswordlessInput,\n\tConfigRateLimitsInput,\n\tConfigRateLimitWindowInput,\n\tIDPOptions,\n\tMailTemplate,\n} from '@contember/graphql-client-tenant'\n\n// Enums and leaf input shapes are re-derived from the generated tenant client\n// (`@contember/graphql-client-tenant`, generated from `tenant.graphql`), so they\n// stay in sync with the schema. The only thing layered on top is `| null` on the\n// fields where the API treats an explicit `null`/`''` as \"clear/disable\" — the\n// codegen renders nullable inputs as optional only and drops the `| null`.\nexport type { CaptchaProvider, ConfigPolicy, MailType } from '@contember/graphql-client-tenant'\n\n/**\n * ISO 8601 duration string, e.g. `\"P1D\"` (1 day) or `\"PT5M\"` (5 minutes).\n */\nexport type Interval = string\n\n/** Adds `| null` to the given keys of an otherwise non-nullable generated input. */\ntype WithNullable<T, K extends keyof T> = Omit<T, K> & { readonly [P in K]?: T[P] | null }\n\nexport type TenantPasswordConfig = WithNullable<ConfigPasswordInput, 'pattern'>\n\nexport type TenantLoginConfig = WithNullable<ConfigLoginInput, 'maxTokenExpiration'>\n\nexport type TenantPasswordlessConfig = WithNullable<ConfigPasswordlessInput, 'url'>\n\n/**\n * `provider: null` disables captcha verification.\n * `secret` is write-only: `null`/omitted leaves the stored value unchanged, `''` clears it.\n */\nexport type TenantCaptchaConfig = WithNullable<ConfigCaptchaInput, 'provider' | 'secret' | 'threshold'>\n\nexport type TenantRateLimitWindow = ConfigRateLimitWindowInput\n\nexport type TenantRateLimitsConfig = ConfigRateLimitsInput\n\n/**\n * Maps to the tenant `configure(config: ConfigInput!)` mutation. New config\n * groups added to the schema flow through automatically; only the groups that\n * need `| null` overrides are pinned.\n */\nexport type TenantGlobalConfig = Omit<ConfigInput, 'password' | 'login' | 'passwordless' | 'captcha'> & {\n\treadonly password?: TenantPasswordConfig\n\treadonly login?: TenantLoginConfig\n\treadonly passwordless?: TenantPasswordlessConfig\n\treadonly captcha?: TenantCaptchaConfig\n}\n\nexport type TenantIdpOptions = IDPOptions\n\n/**\n * A single identity provider. The record key is used as the provider slug.\n * `type` is the handler key registered on the server (built-in: `oidc`,\n * `facebook`, `apple`).\n *\n * This is a CLI-specific composite — the `addIDP`/`updateIDP` mutations take\n * `type`/`configuration`/`options` as separate arguments, not a single input.\n */\nexport interface TenantIdpConfig {\n\ttype: string\n\tconfiguration: Record<string, unknown>\n\toptions?: TenantIdpOptions\n\t/** When `true`, the provider is disabled (kept, but not usable for sign-in). */\n\tdisabled?: boolean\n}\n\n/** Maps to the `addMailTemplate(template: MailTemplate!)` mutation. */\nexport type TenantMailTemplate = WithNullable<MailTemplate, 'projectSlug' | 'replyTo'>\n\n/**\n * Declarative tenant configuration. Applied idempotently by\n * `contember tenant:apply`.\n */\nexport interface TenantConfig {\n\tconfig?: TenantGlobalConfig\n\t/** Identity providers keyed by slug. */\n\tidentityProviders?: Record<string, TenantIdpConfig>\n\tmailTemplates?: TenantMailTemplate[]\n}\n\n/**\n * Type-safe helper for authoring a `tenant.config.ts`. Returns the config\n * unchanged — it exists only to provide editor autocompletion and type\n * checking.\n *\n * ```ts\n * import { defineTenantConfig } from '@contember/cli'\n *\n * export default defineTenantConfig({\n * config: { password: { minLength: 8 } },\n * })\n * ```\n */\nexport const defineTenantConfig = (config: TenantConfig): TenantConfig => config\n"],"names":[],"mappings":"AAoGO,MAAM,qBAAqB,CAAC,WAAuC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTransferClient.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(\n\t\t\tnew LineTransform(line => {\n\t\t\t\ttransferred += line.length + 1\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst data = JSON.parse(line)\n\t\t\t\tswitch (data[0]) {\n\t\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'insertBegin':\n\t\t\t\t\t\ttable = data[1].table\n\t\t\t\t\t\trowCount = 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertRow':\n\t\t\t\t\t\trowCount++\n\t\t\t\t\t\trowTotal++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertEnd':\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}),\n\t\t)\n\t\tinputStream.on('error', err => {\n\t\t\tthrow new Error(`Input stream error: ${err}`)\n\t\t})\n\n\t\tconst bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit\n\n\t\tconst response = await fetch(`${project.endpoint}/import`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${project.token}`,\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: bodyStream,\n\t\t\t...{ duplex: 'half' },\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\tconst response = await fetch(`${baseUrl}/export`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${token}`,\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n}\n"],"names":["stream","LineTransform","Readable","createGzip"],"mappings":";;;;;;;;AAKO,MAAM,mBAAmB;AAAA,EAAzB,cAAA;AACN,kBAAA,MAAA,cAAa,OAAO,EAAE,eAAA,QAAeA,UAAQ,SAAS,WAKhD;AACL,UAAI,QAAQ;AACZ,UAAI,WAAW;AACf,UAAI,WAAW;AACf,UAAI,cAAc;AAClB,UAAI,QAAQ,KAAK,IAAA;AACjB,YAAM,cAAcA,SAAO;AAAA,QAC1B,IAAIC,OAAAA,cAAc,CAAA,SAAQ;AACzB,yBAAe,KAAK,SAAS;AAC7B,cAAI,SAAS,IAAI;AAChB,mBAAO;AAAA,UACR;AACA,gBAAM,OAAO,KAAK,MAAM,IAAI;AAC5B,kBAAQ,KAAK,CAAC,GAAA;AAAA,YACb,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,sBAAQ,KAAK,CAAC,EAAE;AAChB,yBAAW;AACX;AAAA,YACD,KAAK;AACJ;AACA;AACA;AAAA,UAEA;AAEF,cAAK,WAAW,QAAU,KAAK,KAAK,CAAC,MAAM,aAAa;AACvD,kBAAM,MAAM,KAAK,MAAM,cAAc,OAAO,IAAI,EAAE,SAAA;AAClD,kBAAM,YAAY,KAAK,OAAO,KAAK,IAAA,IAAQ,SAAS,GAAI;AACxD,0BAAc,eAAe,GAAG,kBAAkB,QAAQ,IAAI,KAAK,UAAU,QAAQ,WAAW,SAAS,UAAU;AAAA,UACpH;AACA,iBAAO;AAAA,QACR,CAAC;AAAA,MAAA;AAEF,kBAAY,GAAG,SAAS,CAAA,QAAO;AAC9B,cAAM,IAAI,MAAM,uBAAuB,GAAG,EAAE;AAAA,MAC7C,CAAC;AAED,YAAM,aAAaC,qBAAS,MAAM,OAAO,YAAY,KAAKC,UAAAA,YAAY,IAAI,WAAW;AAErF,YAAM,WAAW,MAAM,MAAM,GAAG,QAAQ,QAAQ,WAAW;AAAA,QAC1D,SAAS;AAAA,UACR,iBAAiB,UAAU,QAAQ,KAAK;AAAA,UACxC,gBAAgB;AAAA,UAChB,GAAI,OAAO,EAAE,oBAAoB,WAAW,CAAA;AAAA,QAAC;AAAA,QAE9C,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,GAAG,EAAE,QAAQ,OAAA;AAAA,MAAO,CACpB;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAEA,kBAAA,MAAA,cAAa,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,OAAO,UAAU,QAAA,GAAW,MAAM,eAAe,oBAK3F;AACL,YAAM,WAAW,MAAM,MAAM,GAAG,OAAO,WAAW;AAAA,QACjD,SAAS;AAAA,UACR,iBAAiB,UAAU,KAAK;AAAA,UAChC,mBAAmB,OAAO,SAAS;AAAA,UACnC,gBAAgB;AAAA,QAAA;AAAA,QAEjB,QAAQ;AAAA,QACR,MAAM,KAAK,UAAU;AAAA,UACpB,UAAU,CAAC,EAAE,MAAM,SAAS,QAAQ,eAAe,eAAe;AAAA,QAAA,CAClE;AAAA,MAAA,CACD;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EAAA;AACD;;"}
|
|
1
|
+
{"version":3,"file":"DataTransferClient.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream.js'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject.js'\n\nexport class DataTransferClient {\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(\n\t\t\tnew LineTransform(line => {\n\t\t\t\ttransferred += line.length + 1\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst data = JSON.parse(line)\n\t\t\t\tswitch (data[0]) {\n\t\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'insertBegin':\n\t\t\t\t\t\ttable = data[1].table\n\t\t\t\t\t\trowCount = 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertRow':\n\t\t\t\t\t\trowCount++\n\t\t\t\t\t\trowTotal++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertEnd':\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}),\n\t\t)\n\t\tinputStream.on('error', err => {\n\t\t\tthrow new Error(`Input stream error: ${err}`)\n\t\t})\n\n\t\tconst bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit\n\n\t\tconst response = await fetch(`${project.endpoint}/import`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${project.token}`,\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: bodyStream,\n\t\t\t...{ duplex: 'half' },\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\tconst response = await fetch(`${baseUrl}/export`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${token}`,\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n}\n"],"names":["stream","LineTransform","Readable","createGzip"],"mappings":";;;;;;;;AAKO,MAAM,mBAAmB;AAAA,EAAzB,cAAA;AACN,kBAAA,MAAA,cAAa,OAAO,EAAE,eAAA,QAAeA,UAAQ,SAAS,WAKhD;AACL,UAAI,QAAQ;AACZ,UAAI,WAAW;AACf,UAAI,WAAW;AACf,UAAI,cAAc;AAClB,UAAI,QAAQ,KAAK,IAAA;AACjB,YAAM,cAAcA,SAAO;AAAA,QAC1B,IAAIC,OAAAA,cAAc,CAAA,SAAQ;AACzB,yBAAe,KAAK,SAAS;AAC7B,cAAI,SAAS,IAAI;AAChB,mBAAO;AAAA,UACR;AACA,gBAAM,OAAO,KAAK,MAAM,IAAI;AAC5B,kBAAQ,KAAK,CAAC,GAAA;AAAA,YACb,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,sBAAQ,KAAK,CAAC,EAAE;AAChB,yBAAW;AACX;AAAA,YACD,KAAK;AACJ;AACA;AACA;AAAA,UAEA;AAEF,cAAK,WAAW,QAAU,KAAK,KAAK,CAAC,MAAM,aAAa;AACvD,kBAAM,MAAM,KAAK,MAAM,cAAc,OAAO,IAAI,EAAE,SAAA;AAClD,kBAAM,YAAY,KAAK,OAAO,KAAK,IAAA,IAAQ,SAAS,GAAI;AACxD,0BAAc,eAAe,GAAG,kBAAkB,QAAQ,IAAI,KAAK,UAAU,QAAQ,WAAW,SAAS,UAAU;AAAA,UACpH;AACA,iBAAO;AAAA,QACR,CAAC;AAAA,MAAA;AAEF,kBAAY,GAAG,SAAS,CAAA,QAAO;AAC9B,cAAM,IAAI,MAAM,uBAAuB,GAAG,EAAE;AAAA,MAC7C,CAAC;AAED,YAAM,aAAaC,qBAAS,MAAM,OAAO,YAAY,KAAKC,UAAAA,YAAY,IAAI,WAAW;AAErF,YAAM,WAAW,MAAM,MAAM,GAAG,QAAQ,QAAQ,WAAW;AAAA,QAC1D,SAAS;AAAA,UACR,iBAAiB,UAAU,QAAQ,KAAK;AAAA,UACxC,gBAAgB;AAAA,UAChB,GAAI,OAAO,EAAE,oBAAoB,WAAW,CAAA;AAAA,QAAC;AAAA,QAE9C,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,GAAG,EAAE,QAAQ,OAAA;AAAA,MAAO,CACpB;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAEA,kBAAA,MAAA,cAAa,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,OAAO,UAAU,QAAA,GAAW,MAAM,eAAe,oBAK3F;AACL,YAAM,WAAW,MAAM,MAAM,GAAG,OAAO,WAAW;AAAA,QACjD,SAAS;AAAA,UACR,iBAAiB,UAAU,KAAK;AAAA,UAChC,mBAAmB,OAAO,SAAS;AAAA,UACnC,gBAAgB;AAAA,QAAA;AAAA,QAEjB,QAAQ;AAAA,QACR,MAAM,KAAK,UAAU;AAAA,UACpB,UAAU,CAAC,EAAE,MAAM,SAAS,QAAQ,eAAe,eAAe;AAAA,QAAA,CAClE;AAAA,MAAA,CACD;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EAAA;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTransferClient.js","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(\n\t\t\tnew LineTransform(line => {\n\t\t\t\ttransferred += line.length + 1\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst data = JSON.parse(line)\n\t\t\t\tswitch (data[0]) {\n\t\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'insertBegin':\n\t\t\t\t\t\ttable = data[1].table\n\t\t\t\t\t\trowCount = 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertRow':\n\t\t\t\t\t\trowCount++\n\t\t\t\t\t\trowTotal++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertEnd':\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}),\n\t\t)\n\t\tinputStream.on('error', err => {\n\t\t\tthrow new Error(`Input stream error: ${err}`)\n\t\t})\n\n\t\tconst bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit\n\n\t\tconst response = await fetch(`${project.endpoint}/import`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${project.token}`,\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: bodyStream,\n\t\t\t...{ duplex: 'half' },\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\tconst response = await fetch(`${baseUrl}/export`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${token}`,\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAKO,MAAM,mBAAmB;AAAA,EAAzB,cAAA;AACN,kBAAA,MAAA,cAAa,OAAO,EAAE,eAAe,QAAQ,SAAS,WAKhD;AACL,UAAI,QAAQ;AACZ,UAAI,WAAW;AACf,UAAI,WAAW;AACf,UAAI,cAAc;AAClB,UAAI,QAAQ,KAAK,IAAA;AACjB,YAAM,cAAc,OAAO;AAAA,QAC1B,IAAI,cAAc,CAAA,SAAQ;AACzB,yBAAe,KAAK,SAAS;AAC7B,cAAI,SAAS,IAAI;AAChB,mBAAO;AAAA,UACR;AACA,gBAAM,OAAO,KAAK,MAAM,IAAI;AAC5B,kBAAQ,KAAK,CAAC,GAAA;AAAA,YACb,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,sBAAQ,KAAK,CAAC,EAAE;AAChB,yBAAW;AACX;AAAA,YACD,KAAK;AACJ;AACA;AACA;AAAA,UAEA;AAEF,cAAK,WAAW,QAAU,KAAK,KAAK,CAAC,MAAM,aAAa;AACvD,kBAAM,MAAM,KAAK,MAAM,cAAc,OAAO,IAAI,EAAE,SAAA;AAClD,kBAAM,YAAY,KAAK,OAAO,KAAK,IAAA,IAAQ,SAAS,GAAI;AACxD,0BAAc,eAAe,GAAG,kBAAkB,QAAQ,IAAI,KAAK,UAAU,QAAQ,WAAW,SAAS,UAAU;AAAA,UACpH;AACA,iBAAO;AAAA,QACR,CAAC;AAAA,MAAA;AAEF,kBAAY,GAAG,SAAS,CAAA,QAAO;AAC9B,cAAM,IAAI,MAAM,uBAAuB,GAAG,EAAE;AAAA,MAC7C,CAAC;AAED,YAAM,aAAa,SAAS,MAAM,OAAO,YAAY,KAAK,YAAY,IAAI,WAAW;AAErF,YAAM,WAAW,MAAM,MAAM,GAAG,QAAQ,QAAQ,WAAW;AAAA,QAC1D,SAAS;AAAA,UACR,iBAAiB,UAAU,QAAQ,KAAK;AAAA,UACxC,gBAAgB;AAAA,UAChB,GAAI,OAAO,EAAE,oBAAoB,WAAW,CAAA;AAAA,QAAC;AAAA,QAE9C,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,GAAG,EAAE,QAAQ,OAAA;AAAA,MAAO,CACpB;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAEA,kBAAA,MAAA,cAAa,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,OAAO,UAAU,QAAA,GAAW,MAAM,eAAe,oBAK3F;AACL,YAAM,WAAW,MAAM,MAAM,GAAG,OAAO,WAAW;AAAA,QACjD,SAAS;AAAA,UACR,iBAAiB,UAAU,KAAK;AAAA,UAChC,mBAAmB,OAAO,SAAS;AAAA,UACnC,gBAAgB;AAAA,QAAA;AAAA,QAEjB,QAAQ;AAAA,QACR,MAAM,KAAK,UAAU;AAAA,UACpB,UAAU,CAAC,EAAE,MAAM,SAAS,QAAQ,eAAe,eAAe;AAAA,QAAA,CAClE;AAAA,MAAA,CACD;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EAAA;AACD;"}
|
|
1
|
+
{"version":3,"file":"DataTransferClient.js","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream.js'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject.js'\n\nexport class DataTransferClient {\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(\n\t\t\tnew LineTransform(line => {\n\t\t\t\ttransferred += line.length + 1\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst data = JSON.parse(line)\n\t\t\t\tswitch (data[0]) {\n\t\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'insertBegin':\n\t\t\t\t\t\ttable = data[1].table\n\t\t\t\t\t\trowCount = 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertRow':\n\t\t\t\t\t\trowCount++\n\t\t\t\t\t\trowTotal++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertEnd':\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}),\n\t\t)\n\t\tinputStream.on('error', err => {\n\t\t\tthrow new Error(`Input stream error: ${err}`)\n\t\t})\n\n\t\tconst bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit\n\n\t\tconst response = await fetch(`${project.endpoint}/import`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${project.token}`,\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: bodyStream,\n\t\t\t...{ duplex: 'half' },\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\tconst response = await fetch(`${baseUrl}/export`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${token}`,\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAKO,MAAM,mBAAmB;AAAA,EAAzB,cAAA;AACN,kBAAA,MAAA,cAAa,OAAO,EAAE,eAAe,QAAQ,SAAS,WAKhD;AACL,UAAI,QAAQ;AACZ,UAAI,WAAW;AACf,UAAI,WAAW;AACf,UAAI,cAAc;AAClB,UAAI,QAAQ,KAAK,IAAA;AACjB,YAAM,cAAc,OAAO;AAAA,QAC1B,IAAI,cAAc,CAAA,SAAQ;AACzB,yBAAe,KAAK,SAAS;AAC7B,cAAI,SAAS,IAAI;AAChB,mBAAO;AAAA,UACR;AACA,gBAAM,OAAO,KAAK,MAAM,IAAI;AAC5B,kBAAQ,KAAK,CAAC,GAAA;AAAA,YACb,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,sBAAQ,KAAK,CAAC,EAAE;AAChB,yBAAW;AACX;AAAA,YACD,KAAK;AACJ;AACA;AACA;AAAA,UAEA;AAEF,cAAK,WAAW,QAAU,KAAK,KAAK,CAAC,MAAM,aAAa;AACvD,kBAAM,MAAM,KAAK,MAAM,cAAc,OAAO,IAAI,EAAE,SAAA;AAClD,kBAAM,YAAY,KAAK,OAAO,KAAK,IAAA,IAAQ,SAAS,GAAI;AACxD,0BAAc,eAAe,GAAG,kBAAkB,QAAQ,IAAI,KAAK,UAAU,QAAQ,WAAW,SAAS,UAAU;AAAA,UACpH;AACA,iBAAO;AAAA,QACR,CAAC;AAAA,MAAA;AAEF,kBAAY,GAAG,SAAS,CAAA,QAAO;AAC9B,cAAM,IAAI,MAAM,uBAAuB,GAAG,EAAE;AAAA,MAC7C,CAAC;AAED,YAAM,aAAa,SAAS,MAAM,OAAO,YAAY,KAAK,YAAY,IAAI,WAAW;AAErF,YAAM,WAAW,MAAM,MAAM,GAAG,QAAQ,QAAQ,WAAW;AAAA,QAC1D,SAAS;AAAA,UACR,iBAAiB,UAAU,QAAQ,KAAK;AAAA,UACxC,gBAAgB;AAAA,UAChB,GAAI,OAAO,EAAE,oBAAoB,WAAW,CAAA;AAAA,QAAC;AAAA,QAE9C,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,GAAG,EAAE,QAAQ,OAAA;AAAA,MAAO,CACpB;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAEA,kBAAA,MAAA,cAAa,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,OAAO,UAAU,QAAA,GAAW,MAAM,eAAe,oBAK3F;AACL,YAAM,WAAW,MAAM,MAAM,GAAG,OAAO,WAAW;AAAA,QACjD,SAAS;AAAA,UACR,iBAAiB,UAAU,KAAK;AAAA,UAChC,mBAAmB,OAAO,SAAS;AAAA,UACnC,gBAAgB;AAAA,QAAA;AAAA,QAEjB,QAAQ;AAAA,QACR,MAAM,KAAK,UAAU;AAAA,UACpB,UAAU,CAAC,EAAE,MAAM,SAAS,QAAQ,eAAe,eAAe;AAAA,QAAA,CAClE;AAAA,MAAA,CACD;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EAAA;AACD;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const path = require("node:path");
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
@@ -9,10 +9,10 @@ class WorkspaceResolver {
|
|
|
9
9
|
this.yamlHandler = yamlHandler;
|
|
10
10
|
__publicField(this, "resolve", async (baseDir) => {
|
|
11
11
|
const config = await this.readConfig(baseDir);
|
|
12
|
-
const apiDir = config.apiDir ?
|
|
13
|
-
const migrationsDir = config.migrationsDir ?
|
|
14
|
-
const adminDir = config.adminDir === false ? void 0 : config.adminDir ?
|
|
15
|
-
const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir ?
|
|
12
|
+
const apiDir = config.apiDir ? path.resolve(baseDir, config.apiDir) : path.join(baseDir, "api");
|
|
13
|
+
const migrationsDir = config.migrationsDir ? path.resolve(baseDir, config.migrationsDir) : path.join(apiDir, "migrations");
|
|
14
|
+
const adminDir = config.adminDir === false ? void 0 : config.adminDir ? path.resolve(baseDir, config.adminDir) : path.join(baseDir, "admin");
|
|
15
|
+
const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir ? path.resolve(baseDir, config.adminDistDir) : path.join(adminDir, "dist");
|
|
16
16
|
return {
|
|
17
17
|
baseDir,
|
|
18
18
|
apiDir,
|
|
@@ -23,7 +23,7 @@ class WorkspaceResolver {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
async readConfig(baseDir) {
|
|
26
|
-
const configPath =
|
|
26
|
+
const configPath = path.join(baseDir, "contember.yaml");
|
|
27
27
|
try {
|
|
28
28
|
return await this.yamlHandler.readYaml(configPath);
|
|
29
29
|
} catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceResolver.cjs","sources":["../../../../../../packages/cli/src/lib/workspace/WorkspaceResolver.ts"],"sourcesContent":["import { Workspace } from './Workspace'\nimport { join, resolve } from 'node:path'\nimport { YamlHandler } from '../fs/YamlHandler'\n\nexport interface LocalProjectConfig {\n\tapiDir?: string\n\tmigrationsDir?: string\n\tadminDir?: string | false\n\tadminDistDir?: string\n}\n\nexport class WorkspaceResolver {\n\tconstructor(\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\tresolve = async (baseDir: string): Promise<Workspace> => {\n\t\tconst config = await this.readConfig(baseDir)\n\t\tconst apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, 'api')\n\t\tconst migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, 'migrations')\n\t\tconst adminDir = config.adminDir === false ? undefined : (config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, 'admin'))\n\t\tconst adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, 'dist'))\n\n\t\treturn {\n\t\t\tbaseDir,\n\t\t\tapiDir,\n\t\t\tmigrationsDir,\n\t\t\tadminDir,\n\t\t\tadminDistDir,\n\t\t}\n\t}\n\n\tprivate async readConfig(baseDir: string): Promise<LocalProjectConfig> {\n\t\tconst configPath = join(baseDir, 'contember.yaml')\n\t\ttry {\n\t\t\treturn await this.yamlHandler.readYaml(configPath)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n}\n"],"names":["resolve","join"],"mappings":";;;;;;AAWO,MAAM,kBAAkB;AAAA,EAC9B,YACkB,aAChB;AADgB,SAAA,cAAA;AAIlB,kBAAA,MAAA,WAAU,OAAO,YAAwC;AACxD,YAAM,SAAS,MAAM,KAAK,WAAW,OAAO;AAC5C,YAAM,SAAS,OAAO,SAASA,
|
|
1
|
+
{"version":3,"file":"WorkspaceResolver.cjs","sources":["../../../../../../packages/cli/src/lib/workspace/WorkspaceResolver.ts"],"sourcesContent":["import { Workspace } from './Workspace.js'\nimport { join, resolve } from 'node:path'\nimport { YamlHandler } from '../fs/YamlHandler.js'\n\nexport interface LocalProjectConfig {\n\tapiDir?: string\n\tmigrationsDir?: string\n\tadminDir?: string | false\n\tadminDistDir?: string\n}\n\nexport class WorkspaceResolver {\n\tconstructor(\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\tresolve = async (baseDir: string): Promise<Workspace> => {\n\t\tconst config = await this.readConfig(baseDir)\n\t\tconst apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, 'api')\n\t\tconst migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, 'migrations')\n\t\tconst adminDir = config.adminDir === false ? undefined : (config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, 'admin'))\n\t\tconst adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, 'dist'))\n\n\t\treturn {\n\t\t\tbaseDir,\n\t\t\tapiDir,\n\t\t\tmigrationsDir,\n\t\t\tadminDir,\n\t\t\tadminDistDir,\n\t\t}\n\t}\n\n\tprivate async readConfig(baseDir: string): Promise<LocalProjectConfig> {\n\t\tconst configPath = join(baseDir, 'contember.yaml')\n\t\ttry {\n\t\t\treturn await this.yamlHandler.readYaml(configPath)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n}\n"],"names":["resolve","join"],"mappings":";;;;;;AAWO,MAAM,kBAAkB;AAAA,EAC9B,YACkB,aAChB;AADgB,SAAA,cAAA;AAIlB,kBAAA,MAAA,WAAU,OAAO,YAAwC;AACxD,YAAM,SAAS,MAAM,KAAK,WAAW,OAAO;AAC5C,YAAM,SAAS,OAAO,SAASA,aAAQ,SAAS,OAAO,MAAM,IAAIC,UAAK,SAAS,KAAK;AACpF,YAAM,gBAAgB,OAAO,gBAAgBD,aAAQ,SAAS,OAAO,aAAa,IAAIC,UAAK,QAAQ,YAAY;AAC/G,YAAM,WAAW,OAAO,aAAa,QAAQ,SAAa,OAAO,WAAWD,KAAAA,QAAQ,SAAS,OAAO,QAAQ,IAAIC,KAAAA,KAAK,SAAS,OAAO;AACrI,YAAM,eAAe,aAAa,SAAY,SAAa,OAAO,eAAeD,KAAAA,QAAQ,SAAS,OAAO,YAAY,IAAIC,KAAAA,KAAK,UAAU,MAAM;AAE9I,aAAO;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAEF,CAAA;AAAA,EAhBA;AAAA,EAkBA,MAAc,WAAW,SAA8C;AACtE,UAAM,aAAaA,KAAAA,KAAK,SAAS,gBAAgB;AACjD,QAAI;AACH,aAAO,MAAM,KAAK,YAAY,SAAS,UAAU;AAAA,IAClD,SAAS,GAAQ;AAChB,UAAI,EAAE,SAAS,UAAU;AACxB,eAAO,CAAA;AAAA,MACR;AACA,YAAM;AAAA,IACP;AAAA,EACD;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceResolver.js","sources":["../../../../../../packages/cli/src/lib/workspace/WorkspaceResolver.ts"],"sourcesContent":["import { Workspace } from './Workspace'\nimport { join, resolve } from 'node:path'\nimport { YamlHandler } from '../fs/YamlHandler'\n\nexport interface LocalProjectConfig {\n\tapiDir?: string\n\tmigrationsDir?: string\n\tadminDir?: string | false\n\tadminDistDir?: string\n}\n\nexport class WorkspaceResolver {\n\tconstructor(\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\tresolve = async (baseDir: string): Promise<Workspace> => {\n\t\tconst config = await this.readConfig(baseDir)\n\t\tconst apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, 'api')\n\t\tconst migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, 'migrations')\n\t\tconst adminDir = config.adminDir === false ? undefined : (config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, 'admin'))\n\t\tconst adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, 'dist'))\n\n\t\treturn {\n\t\t\tbaseDir,\n\t\t\tapiDir,\n\t\t\tmigrationsDir,\n\t\t\tadminDir,\n\t\t\tadminDistDir,\n\t\t}\n\t}\n\n\tprivate async readConfig(baseDir: string): Promise<LocalProjectConfig> {\n\t\tconst configPath = join(baseDir, 'contember.yaml')\n\t\ttry {\n\t\t\treturn await this.yamlHandler.readYaml(configPath)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAWO,MAAM,kBAAkB;AAAA,EAC9B,YACkB,aAChB;AADgB,SAAA,cAAA;AAIlB,kBAAA,MAAA,WAAU,OAAO,YAAwC;AACxD,YAAM,SAAS,MAAM,KAAK,WAAW,OAAO;AAC5C,YAAM,SAAS,OAAO,SAAS,QAAQ,SAAS,OAAO,MAAM,IAAI,KAAK,SAAS,KAAK;AACpF,YAAM,gBAAgB,OAAO,gBAAgB,QAAQ,SAAS,OAAO,aAAa,IAAI,KAAK,QAAQ,YAAY;AAC/G,YAAM,WAAW,OAAO,aAAa,QAAQ,SAAa,OAAO,WAAW,QAAQ,SAAS,OAAO,QAAQ,IAAI,KAAK,SAAS,OAAO;AACrI,YAAM,eAAe,aAAa,SAAY,SAAa,OAAO,eAAe,QAAQ,SAAS,OAAO,YAAY,IAAI,KAAK,UAAU,MAAM;AAE9I,aAAO;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAEF,CAAA;AAAA,EAhBA;AAAA,EAkBA,MAAc,WAAW,SAA8C;AACtE,UAAM,aAAa,KAAK,SAAS,gBAAgB;AACjD,QAAI;AACH,aAAO,MAAM,KAAK,YAAY,SAAS,UAAU;AAAA,IAClD,SAAS,GAAQ;AAChB,UAAI,EAAE,SAAS,UAAU;AACxB,eAAO,CAAA;AAAA,MACR;AACA,YAAM;AAAA,IACP;AAAA,EACD;AACD;"}
|
|
1
|
+
{"version":3,"file":"WorkspaceResolver.js","sources":["../../../../../../packages/cli/src/lib/workspace/WorkspaceResolver.ts"],"sourcesContent":["import { Workspace } from './Workspace.js'\nimport { join, resolve } from 'node:path'\nimport { YamlHandler } from '../fs/YamlHandler.js'\n\nexport interface LocalProjectConfig {\n\tapiDir?: string\n\tmigrationsDir?: string\n\tadminDir?: string | false\n\tadminDistDir?: string\n}\n\nexport class WorkspaceResolver {\n\tconstructor(\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\tresolve = async (baseDir: string): Promise<Workspace> => {\n\t\tconst config = await this.readConfig(baseDir)\n\t\tconst apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, 'api')\n\t\tconst migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, 'migrations')\n\t\tconst adminDir = config.adminDir === false ? undefined : (config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, 'admin'))\n\t\tconst adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, 'dist'))\n\n\t\treturn {\n\t\t\tbaseDir,\n\t\t\tapiDir,\n\t\t\tmigrationsDir,\n\t\t\tadminDir,\n\t\t\tadminDistDir,\n\t\t}\n\t}\n\n\tprivate async readConfig(baseDir: string): Promise<LocalProjectConfig> {\n\t\tconst configPath = join(baseDir, 'contember.yaml')\n\t\ttry {\n\t\t\treturn await this.yamlHandler.readYaml(configPath)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;;;AAWO,MAAM,kBAAkB;AAAA,EAC9B,YACkB,aAChB;AADgB,SAAA,cAAA;AAIlB,kBAAA,MAAA,WAAU,OAAO,YAAwC;AACxD,YAAM,SAAS,MAAM,KAAK,WAAW,OAAO;AAC5C,YAAM,SAAS,OAAO,SAAS,QAAQ,SAAS,OAAO,MAAM,IAAI,KAAK,SAAS,KAAK;AACpF,YAAM,gBAAgB,OAAO,gBAAgB,QAAQ,SAAS,OAAO,aAAa,IAAI,KAAK,QAAQ,YAAY;AAC/G,YAAM,WAAW,OAAO,aAAa,QAAQ,SAAa,OAAO,WAAW,QAAQ,SAAS,OAAO,QAAQ,IAAI,KAAK,SAAS,OAAO;AACrI,YAAM,eAAe,aAAa,SAAY,SAAa,OAAO,eAAe,QAAQ,SAAS,OAAO,YAAY,IAAI,KAAK,UAAU,MAAM;AAE9I,aAAO;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAEF,CAAA;AAAA,EAhBA;AAAA,EAkBA,MAAc,WAAW,SAA8C;AACtE,UAAM,aAAa,KAAK,SAAS,gBAAgB;AACjD,QAAI;AACH,aAAO,MAAM,KAAK,YAAY,SAAS,UAAU;AAAA,IAClD,SAAS,GAAQ;AAChB,UAAI,EAAE,SAAS,UAAU;AACxB,eAAO,CAAA;AAAA,MACR;AACA,YAAM;AAAA,IACP;AAAA,EACD;AACD;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver';
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js';
|
|
3
3
|
type Args = {
|
|
4
4
|
eventId: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsGetEventCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsGetEventCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ActionsGetEventCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsGetEventCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;AAGlF,KAAK,IAAI,GAAG;IACX,OAAO,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,OAAO,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAEhE,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAK9D,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAM7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;CAe5E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver';
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js';
|
|
3
3
|
type Args = {};
|
|
4
4
|
type Options = {
|
|
5
5
|
project?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsListFailedEventsCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsListFailedEventsCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ActionsListFailedEventsCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsListFailedEventsCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;AAGlF,KAAK,IAAI,GAAG,EAAE,CAAA;AAEd,KAAK,OAAO,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;CACd,CAAA;AAED,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAExE,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAK9D,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAM7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;CA2C5E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver';
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js';
|
|
3
3
|
type Args = {};
|
|
4
4
|
type Options = {
|
|
5
5
|
project?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsListVariablesCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsListVariablesCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ActionsListVariablesCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsListVariablesCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;AAIlF,KAAK,IAAI,GAAG,EAAE,CAAA;AAEd,KAAK,OAAO,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,2BAA4B,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAErE,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAK9D,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAK7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;CAY5E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver';
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js';
|
|
3
3
|
type Args = {
|
|
4
4
|
eventId: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsRetryEventCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsRetryEventCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ActionsRetryEventCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsRetryEventCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;AAGlF,KAAK,IAAI,GAAG;IACX,OAAO,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,OAAO,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,wBAAyB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAElE,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAK9D,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAM7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;CAgB5E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver';
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js';
|
|
3
3
|
type Args = {
|
|
4
4
|
variables: string[];
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsSetVariablesCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsSetVariablesCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ActionsSetVariablesCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsSetVariablesCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;AAGlF,KAAK,IAAI,GAAG;IACX,SAAS,EAAE,MAAM,EAAE,CAAA;CACnB,CAAA;AAED,KAAK,OAAO,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,CAAC,qBAAqB,CAAC,CAAC,EAAE,OAAO,CAAA;CACjC,CAAA;AAED,qBAAa,0BAA2B,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAEpE,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAK9D,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAS7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;CA8B5E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver';
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js';
|
|
3
3
|
type Args = {
|
|
4
4
|
eventId: string;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionsStopEventCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsStopEventCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ActionsStopEventCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/actions/ActionsStopEventCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;AAGlF,KAAK,IAAI,GAAG;IACX,OAAO,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,OAAO,GAAG;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,uBAAwB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAEjE,OAAO,CAAC,QAAQ,CAAC,qBAAqB;gBAArB,qBAAqB,EAAE,qBAAqB;IAK9D,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAM7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;CAgB5E"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade';
|
|
3
|
-
import { AdminDeployer } from '../../lib/admin/AdminDeployer';
|
|
4
|
-
import { FileSystem } from '../../lib/fs/FileSystem';
|
|
5
|
-
import { Workspace } from '../../lib/workspace/Workspace';
|
|
6
|
-
import { RemoteProjectProvider } from '../../lib/project/RemoteProjectProvider';
|
|
7
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver';
|
|
2
|
+
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade.js';
|
|
3
|
+
import { AdminDeployer } from '../../lib/admin/AdminDeployer.js';
|
|
4
|
+
import { FileSystem } from '../../lib/fs/FileSystem.js';
|
|
5
|
+
import { Workspace } from '../../lib/workspace/Workspace.js';
|
|
6
|
+
import { RemoteProjectProvider } from '../../lib/project/RemoteProjectProvider.js';
|
|
7
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js';
|
|
8
8
|
type Args = {
|
|
9
9
|
dsn?: string;
|
|
10
10
|
};
|
|
@@ -14,6 +14,7 @@ type Options = {
|
|
|
14
14
|
['no-migrations']?: boolean;
|
|
15
15
|
root?: boolean;
|
|
16
16
|
yes?: boolean;
|
|
17
|
+
snapshot?: boolean;
|
|
17
18
|
};
|
|
18
19
|
export declare class DeployCommand extends Command<Args, Options> {
|
|
19
20
|
private readonly adminDeployer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeployCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/deploy/DeployCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG5E,OAAO,EAAE,wBAAwB,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"DeployCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/deploy/DeployCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAA;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;AAElF,KAAK,IAAI,GAAG;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,KAAK,OAAO,GAAG;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,CAAA;IACtB,CAAC,eAAe,CAAC,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,qBAAa,aAAc,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IACzC,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,SAAS;gBALT,aAAa,EAAE,aAAa,EAC5B,wBAAwB,EAAE,wBAAwB,EAClD,EAAE,EAAE,UAAU,EACd,qBAAqB,EAAE,qBAAqB,EAC5C,qBAAqB,EAAE,qBAAqB,EAC5C,SAAS,EAAE,SAAS;IAKtC,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAiB7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;CAqE5E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './DeployCommand';
|
|
1
|
+
export * from './DeployCommand.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/deploy/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/deploy/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * from './deploy';
|
|
2
|
-
export * from './migrations';
|
|
3
|
-
export * from './misc';
|
|
4
|
-
export * from './project';
|
|
5
|
-
export * from './
|
|
1
|
+
export * from './deploy/index.js';
|
|
2
|
+
export * from './migrations/index.js';
|
|
3
|
+
export * from './misc/index.js';
|
|
4
|
+
export * from './project/index.js';
|
|
5
|
+
export * from './tenant/index.js';
|
|
6
|
+
export * from './workspace/index.js';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
2
|
import { SchemaMigrator } from '@contember/schema-migrations';
|
|
3
|
-
import { MigrationCreator, MigrationsResolver, SchemaVersionBuilder } from '@contember/migrations-client';
|
|
4
|
-
import { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade';
|
|
5
|
-
import { SchemaLoader } from '../../lib/schema/SchemaLoader';
|
|
6
|
-
import { MigrationsValidator } from '../../lib/migrations/MigrationsValidator';
|
|
7
|
-
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter';
|
|
8
|
-
import { SystemClientProvider } from '../../lib/SystemClientProvider';
|
|
3
|
+
import { MigrationCreator, MigrationsResolver, SchemaStateManager, SchemaVersionBuilder } from '@contember/migrations-client';
|
|
4
|
+
import { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade.js';
|
|
5
|
+
import { SchemaLoader } from '../../lib/schema/SchemaLoader.js';
|
|
6
|
+
import { MigrationsValidator } from '../../lib/migrations/MigrationsValidator.js';
|
|
7
|
+
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js';
|
|
8
|
+
import { SystemClientProvider } from '../../lib/SystemClientProvider.js';
|
|
9
9
|
type Args = {
|
|
10
10
|
migration?: string;
|
|
11
11
|
};
|
|
@@ -23,7 +23,8 @@ export declare class MigrationAmendCommand extends Command<Args, Options> {
|
|
|
23
23
|
private readonly migrationsValidator;
|
|
24
24
|
private readonly migrationPrinter;
|
|
25
25
|
private readonly schemaMigrator;
|
|
26
|
-
|
|
26
|
+
private readonly schemaStateManager;
|
|
27
|
+
constructor(migrationsResolver: MigrationsResolver, systemApiClientProvider: SystemClientProvider, migrationsStatusFacade: MigrationsStatusFacade, schemaLoader: SchemaLoader, schemaVersionBuilder: SchemaVersionBuilder, migrationCreator: MigrationCreator, migrationsValidator: MigrationsValidator, migrationPrinter: MigrationPrinter, schemaMigrator: SchemaMigrator, schemaStateManager: SchemaStateManager);
|
|
27
28
|
protected configure(configuration: CommandConfiguration<Args, Options>): void;
|
|
28
29
|
protected execute(input: Input<Args, Options>): Promise<number>;
|
|
29
30
|
private shouldContinue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationAmendCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/migrations/MigrationAmendCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAA0B,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAGrF,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"MigrationAmendCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/migrations/MigrationAmendCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAA0B,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAGrF,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAC7H,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAA;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAA;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAExE,KAAK,IAAI,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,KAAK,OAAO,GAAG;IACd,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,OAAO,CAAA;CACd,CAAA;AAED,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAE/D,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBATlB,kBAAkB,EAAE,kBAAkB,EACtC,uBAAuB,EAAE,oBAAoB,EAC7C,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB;IAKxD,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAU7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;YAiHvD,cAAc;YAiBd,YAAY;CAa1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter';
|
|
2
|
+
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js';
|
|
3
3
|
import { MigrationsResolver, SchemaVersionBuilder } from '@contember/migrations-client';
|
|
4
4
|
type Args = {
|
|
5
5
|
migration?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationDescribeCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/migrations/MigrationDescribeCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"MigrationDescribeCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/migrations/MigrationDescribeCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAEvF,KAAK,IAAI,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,KAAK,OAAO,GAAG;IACd,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IACrB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,qBAAa,wBAAyB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAElE,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAFlB,gBAAgB,EAAE,gBAAgB,EAClC,oBAAoB,EAAE,oBAAoB,EAC1C,kBAAkB,EAAE,kBAAkB;IAKxD,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAO7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAenE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { MigrationCreator, SchemaVersionBuilder } from '@contember/migrations-client';
|
|
3
|
-
import { SchemaLoader } from '../../lib/schema/SchemaLoader';
|
|
4
|
-
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter';
|
|
5
|
-
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade';
|
|
2
|
+
import { MigrationCreator, MigrationsResolver, SchemaStateManager, SchemaVersionBuilder } from '@contember/migrations-client';
|
|
3
|
+
import { SchemaLoader } from '../../lib/schema/SchemaLoader.js';
|
|
4
|
+
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js';
|
|
5
|
+
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade.js';
|
|
6
6
|
type Args = {
|
|
7
7
|
migrationName: string;
|
|
8
8
|
};
|
|
@@ -10,6 +10,7 @@ type Options = {
|
|
|
10
10
|
execute?: true;
|
|
11
11
|
yes?: true;
|
|
12
12
|
'skip-initial-schema-validation'?: true;
|
|
13
|
+
'recreate-views'?: true;
|
|
13
14
|
};
|
|
14
15
|
export declare class MigrationDiffCommand extends Command<Args, Options> {
|
|
15
16
|
private readonly schemaLoader;
|
|
@@ -17,7 +18,9 @@ export declare class MigrationDiffCommand extends Command<Args, Options> {
|
|
|
17
18
|
private readonly migrationCreator;
|
|
18
19
|
private readonly migrationPrinter;
|
|
19
20
|
private readonly migrationExecutorFacade;
|
|
20
|
-
|
|
21
|
+
private readonly schemaStateManager;
|
|
22
|
+
private readonly migrationsResolver;
|
|
23
|
+
constructor(schemaLoader: SchemaLoader, schemaVersionBuilder: SchemaVersionBuilder, migrationCreator: MigrationCreator, migrationPrinter: MigrationPrinter, migrationExecutorFacade: MigrationExecutionFacade, schemaStateManager: SchemaStateManager, migrationsResolver: MigrationsResolver);
|
|
21
24
|
protected configure(configuration: CommandConfiguration<Args, Options>): void;
|
|
22
25
|
protected execute(input: Input<Args, Options>): Promise<void>;
|
|
23
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationDiffCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/migrations/MigrationDiffCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG5E,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"MigrationDiffCommand.d.ts","sourceRoot":"","sources":["../../../../src/commands/migrations/MigrationDiffCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG5E,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAC7H,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAA;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAA;AAG3F,KAAK,IAAI,GAAG;IACX,aAAa,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,KAAK,OAAO,GAAG;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,gCAAgC,CAAC,EAAE,IAAI,CAAA;IACvC,gBAAgB,CAAC,EAAE,IAAI,CAAA;CACvB,CAAA;AAED,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAE9D,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBANlB,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,uBAAuB,EAAE,wBAAwB,EACjD,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,kBAAkB;IAKxD,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAkB7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CA4FnE"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common';
|
|
2
|
-
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade';
|
|
2
|
+
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade.js';
|
|
3
3
|
type Args = {};
|
|
4
4
|
type Options = {
|
|
5
5
|
until?: string;
|
|
6
6
|
force: boolean;
|
|
7
7
|
yes?: boolean;
|
|
8
|
+
['no-snapshot']?: boolean;
|
|
8
9
|
};
|
|
9
10
|
export declare class MigrationExecuteCommand extends Command<Args, Options> {
|
|
10
11
|
private readonly migrationExecutorFacade;
|