@contember/cli 1.4.0-rc.8 → 2.0.0-alpha.12
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/Dockerfile +0 -1
- package/build.sh +1 -1
- package/dist/development/run.cjs +31 -0
- package/dist/development/run.cjs.map +1 -0
- package/dist/development/run.js +30 -0
- package/dist/development/run.js.map +1 -0
- package/dist/development/src/commands/deploy/DeployCommand.cjs +87 -0
- package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -0
- package/dist/development/src/commands/deploy/DeployCommand.js +87 -0
- package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs +123 -0
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js +123 -0
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationBlankCommand.cjs +23 -0
- package/dist/development/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationBlankCommand.js +23 -0
- package/dist/development/src/commands/migrations/MigrationBlankCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs +30 -0
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.js +30 -0
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs +76 -0
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js +76 -0
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs +26 -0
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js +26 -0
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs +31 -0
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.js +31 -0
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs +57 -0
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js +57 -0
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -0
- package/dist/development/src/commands/misc/VersionCommand.cjs +18 -0
- package/dist/development/src/commands/misc/VersionCommand.cjs.map +1 -0
- package/dist/development/src/commands/misc/VersionCommand.js +18 -0
- package/dist/development/src/commands/misc/VersionCommand.js.map +1 -0
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs +36 -0
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -0
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js +36 -0
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -0
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs +69 -0
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -0
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js +69 -0
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -0
- package/dist/development/src/commands/project/ProjectValidateCommand.cjs +40 -0
- package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -0
- package/dist/development/src/commands/project/ProjectValidateCommand.js +40 -0
- package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -0
- package/dist/development/src/commands/transfer/ExportCommand.cjs +66 -0
- package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -0
- package/dist/development/src/commands/transfer/ExportCommand.js +66 -0
- package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -0
- package/dist/development/src/commands/transfer/ImportCommand.cjs +60 -0
- package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -0
- package/dist/development/src/commands/transfer/ImportCommand.js +60 -0
- package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -0
- package/dist/development/src/commands/transfer/TransferCommand.cjs +73 -0
- package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -0
- package/dist/development/src/commands/transfer/TransferCommand.js +73 -0
- package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -0
- package/dist/development/src/commands/transfer/utils.cjs +22 -0
- package/dist/development/src/commands/transfer/utils.cjs.map +1 -0
- package/dist/development/src/commands/transfer/utils.js +22 -0
- package/dist/development/src/commands/transfer/utils.js.map +1 -0
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +54 -0
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -0
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js +54 -0
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -0
- package/dist/development/src/consts.cjs +10 -0
- package/dist/development/src/consts.cjs.map +1 -0
- package/dist/development/src/consts.js +9 -0
- package/dist/development/src/consts.js.map +1 -0
- package/dist/development/src/dic.cjs +116 -0
- package/dist/development/src/dic.cjs.map +1 -0
- package/dist/development/src/dic.js +116 -0
- package/dist/development/src/dic.js.map +1 -0
- package/dist/development/src/lib/SystemClientProvider.cjs +14 -0
- package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -0
- package/dist/development/src/lib/SystemClientProvider.js +14 -0
- package/dist/development/src/lib/SystemClientProvider.js.map +1 -0
- package/dist/development/src/lib/TenantClientProvider.cjs +14 -0
- package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -0
- package/dist/development/src/lib/TenantClientProvider.js +14 -0
- package/dist/development/src/lib/TenantClientProvider.js.map +1 -0
- package/dist/development/src/lib/VersionChecker.cjs +85 -0
- package/dist/development/src/lib/VersionChecker.cjs.map +1 -0
- package/dist/development/src/lib/VersionChecker.js +68 -0
- package/dist/development/src/lib/VersionChecker.js.map +1 -0
- package/dist/development/src/lib/admin/AdminClient.cjs +30 -0
- package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -0
- package/dist/development/src/lib/admin/AdminClient.js +30 -0
- package/dist/development/src/lib/admin/AdminClient.js.map +1 -0
- package/dist/development/src/lib/admin/AdminDeployer.cjs +36 -0
- package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -0
- package/dist/development/src/lib/admin/AdminDeployer.js +36 -0
- package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -0
- package/dist/development/src/lib/assertNever.cjs +7 -0
- package/dist/development/src/lib/assertNever.cjs.map +1 -0
- package/dist/development/src/lib/assertNever.js +7 -0
- package/dist/development/src/lib/assertNever.js.map +1 -0
- package/dist/development/src/lib/dsn.cjs +16 -0
- package/dist/development/src/lib/dsn.cjs.map +1 -0
- package/dist/development/src/lib/dsn.js +16 -0
- package/dist/development/src/lib/dsn.js.map +1 -0
- package/dist/development/src/lib/env.cjs +15 -0
- package/dist/development/src/lib/env.cjs.map +1 -0
- package/dist/development/src/lib/env.js +15 -0
- package/dist/development/src/lib/env.js.map +1 -0
- package/dist/development/src/lib/fs/DockerComposeManager.cjs +41 -0
- package/dist/development/src/lib/fs/DockerComposeManager.cjs.map +1 -0
- package/dist/development/src/lib/fs/DockerComposeManager.js +41 -0
- package/dist/development/src/lib/fs/DockerComposeManager.js.map +1 -0
- package/dist/development/src/lib/fs/FileSystem.cjs +43 -0
- package/dist/development/src/lib/fs/FileSystem.cjs.map +1 -0
- package/dist/development/src/lib/fs/FileSystem.js +27 -0
- package/dist/development/src/lib/fs/FileSystem.js.map +1 -0
- package/dist/development/src/lib/fs/YamlHandler.cjs +48 -0
- package/dist/development/src/lib/fs/YamlHandler.cjs.map +1 -0
- package/dist/development/src/lib/fs/YamlHandler.js +48 -0
- package/dist/development/src/lib/fs/YamlHandler.js.map +1 -0
- package/dist/development/src/lib/js/EsBuildBuilder.cjs +36 -0
- package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -0
- package/dist/development/src/lib/js/EsBuildBuilder.js +19 -0
- package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -0
- package/dist/development/src/lib/js/EvalExecutor.cjs +10 -0
- package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -0
- package/dist/development/src/lib/js/EvalExecutor.js +10 -0
- package/dist/development/src/lib/js/EvalExecutor.js.map +1 -0
- package/dist/development/src/lib/js/JsCodeRunner.cjs +17 -0
- package/dist/development/src/lib/js/JsCodeRunner.cjs.map +1 -0
- package/dist/development/src/lib/js/JsCodeRunner.js +17 -0
- package/dist/development/src/lib/js/JsCodeRunner.js.map +1 -0
- package/dist/development/src/lib/maskToken.cjs +5 -0
- package/dist/development/src/lib/maskToken.cjs.map +1 -0
- package/dist/development/src/lib/maskToken.js +5 -0
- package/dist/development/src/lib/maskToken.js.map +1 -0
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs +84 -0
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -0
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js +84 -0
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -0
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs +82 -0
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -0
- package/dist/development/src/lib/migrations/MigrationPrinter.js +82 -0
- package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -0
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs +41 -0
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -0
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js +41 -0
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -0
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs +27 -0
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -0
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js +27 -0
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -0
- package/dist/development/src/lib/migrations/MigrationsValidator.cjs +38 -0
- package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -0
- package/dist/development/src/lib/migrations/MigrationsValidator.js +38 -0
- package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -0
- package/dist/development/src/lib/migrations/migrations.cjs +43 -0
- package/dist/development/src/lib/migrations/migrations.cjs.map +1 -0
- package/dist/development/src/lib/migrations/migrations.js +43 -0
- package/dist/development/src/lib/migrations/migrations.js.map +1 -0
- package/dist/development/src/lib/project/RemoteProject.cjs +12 -0
- package/dist/development/src/lib/project/RemoteProject.cjs.map +1 -0
- package/dist/development/src/lib/project/RemoteProject.js +12 -0
- package/dist/development/src/lib/project/RemoteProject.js.map +1 -0
- package/dist/development/src/lib/project/RemoteProjectProvider.cjs +21 -0
- package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -0
- package/dist/development/src/lib/project/RemoteProjectProvider.js +21 -0
- package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -0
- package/dist/development/src/lib/project/RemoteProjectResolver.cjs +29 -0
- package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -0
- package/dist/development/src/lib/project/RemoteProjectResolver.js +29 -0
- package/dist/development/src/lib/project/RemoteProjectResolver.js.map +1 -0
- package/dist/development/src/lib/project/docs/components/EntityInfo.cjs +199 -0
- package/dist/development/src/lib/project/docs/components/EntityInfo.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/components/EntityInfo.js +199 -0
- package/dist/development/src/lib/project/docs/components/EntityInfo.js.map +1 -0
- package/dist/development/src/lib/project/docs/components/EntityLink.cjs +11 -0
- package/dist/development/src/lib/project/docs/components/EntityLink.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/components/EntityLink.js +11 -0
- package/dist/development/src/lib/project/docs/components/EntityLink.js.map +1 -0
- package/dist/development/src/lib/project/docs/components/FieldLink.cjs +31 -0
- package/dist/development/src/lib/project/docs/components/FieldLink.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/components/FieldLink.js +31 -0
- package/dist/development/src/lib/project/docs/components/FieldLink.js.map +1 -0
- package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs +33 -0
- package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/components/FieldPermissions.js +33 -0
- package/dist/development/src/lib/project/docs/components/FieldPermissions.js.map +1 -0
- package/dist/development/src/lib/project/docs/components/FieldType.cjs +135 -0
- package/dist/development/src/lib/project/docs/components/FieldType.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/components/FieldType.js +135 -0
- package/dist/development/src/lib/project/docs/components/FieldType.js.map +1 -0
- package/dist/development/src/lib/project/docs/components/OnDelete.cjs +134 -0
- package/dist/development/src/lib/project/docs/components/OnDelete.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/components/OnDelete.js +134 -0
- package/dist/development/src/lib/project/docs/components/OnDelete.js.map +1 -0
- package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs +96 -0
- package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/components/ProjectInfo.js +96 -0
- package/dist/development/src/lib/project/docs/components/ProjectInfo.js.map +1 -0
- package/dist/development/src/lib/project/docs/components/SinglePermission.cjs +26 -0
- package/dist/development/src/lib/project/docs/components/SinglePermission.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/components/SinglePermission.js +26 -0
- package/dist/development/src/lib/project/docs/components/SinglePermission.js.map +1 -0
- package/dist/development/src/lib/project/docs/components/utils.cjs +7 -0
- package/dist/development/src/lib/project/docs/components/utils.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/components/utils.js +7 -0
- package/dist/development/src/lib/project/docs/components/utils.js.map +1 -0
- package/dist/development/src/lib/project/docs/projectDescribe.cjs +32 -0
- package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -0
- package/dist/development/src/lib/project/docs/projectDescribe.js +31 -0
- package/dist/development/src/lib/project/docs/projectDescribe.js.map +1 -0
- package/dist/development/src/lib/schema/SchemaLoader.cjs +49 -0
- package/dist/development/src/lib/schema/SchemaLoader.cjs.map +1 -0
- package/dist/development/src/lib/schema/SchemaLoader.js +32 -0
- package/dist/development/src/lib/schema/SchemaLoader.js.map +1 -0
- package/dist/development/src/lib/schema/SchemaValidationHelper.cjs +11 -0
- package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -0
- package/dist/development/src/lib/schema/SchemaValidationHelper.js +11 -0
- package/dist/development/src/lib/schema/SchemaValidationHelper.js.map +1 -0
- package/dist/development/src/lib/schema/SchemaValidationPrinter.cjs +14 -0
- package/dist/development/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -0
- package/dist/development/src/lib/schema/SchemaValidationPrinter.js +14 -0
- package/dist/development/src/lib/schema/SchemaValidationPrinter.js.map +1 -0
- package/dist/development/src/lib/schema/collectReferences.cjs +34 -0
- package/dist/development/src/lib/schema/collectReferences.cjs.map +1 -0
- package/dist/development/src/lib/schema/collectReferences.js +34 -0
- package/dist/development/src/lib/schema/collectReferences.js.map +1 -0
- package/dist/development/src/lib/stream.cjs +43 -0
- package/dist/development/src/lib/stream.cjs.map +1 -0
- package/dist/development/src/lib/stream.js +43 -0
- package/dist/development/src/lib/stream.js.map +1 -0
- package/dist/development/src/lib/tenant/TenantClient.cjs +45 -0
- package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantClient.js +45 -0
- package/dist/development/src/lib/tenant/TenantClient.js.map +1 -0
- package/dist/development/src/lib/transfer/DataTransferClient.cjs +97 -0
- package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -0
- package/dist/development/src/lib/transfer/DataTransferClient.js +97 -0
- package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -0
- package/dist/development/src/lib/transfer/stdio.cjs +12 -0
- package/dist/development/src/lib/transfer/stdio.cjs.map +1 -0
- package/dist/development/src/lib/transfer/stdio.js +12 -0
- package/dist/development/src/lib/transfer/stdio.js.map +1 -0
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs +38 -0
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs.map +1 -0
- package/dist/development/src/lib/workspace/WorkspaceResolver.js +38 -0
- package/dist/development/src/lib/workspace/WorkspaceResolver.js.map +1 -0
- package/dist/production/run.cjs +31 -0
- package/dist/production/run.cjs.map +1 -0
- package/dist/production/run.js +30 -0
- package/dist/production/run.js.map +1 -0
- package/dist/production/src/commands/deploy/DeployCommand.cjs +87 -0
- package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -0
- package/dist/production/src/commands/deploy/DeployCommand.js +87 -0
- package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs +123 -0
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js +123 -0
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationBlankCommand.cjs +23 -0
- package/dist/production/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationBlankCommand.js +23 -0
- package/dist/production/src/commands/migrations/MigrationBlankCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs +30 -0
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.js +30 -0
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs +76 -0
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js +76 -0
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs +26 -0
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js +26 -0
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs +31 -0
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.js +31 -0
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs +57 -0
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js +57 -0
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -0
- package/dist/production/src/commands/misc/VersionCommand.cjs +18 -0
- package/dist/production/src/commands/misc/VersionCommand.cjs.map +1 -0
- package/dist/production/src/commands/misc/VersionCommand.js +18 -0
- package/dist/production/src/commands/misc/VersionCommand.js.map +1 -0
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs +36 -0
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -0
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js +36 -0
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -0
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs +69 -0
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -0
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js +69 -0
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -0
- package/dist/production/src/commands/project/ProjectValidateCommand.cjs +40 -0
- package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -0
- package/dist/production/src/commands/project/ProjectValidateCommand.js +40 -0
- package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -0
- package/dist/production/src/commands/transfer/ExportCommand.cjs +66 -0
- package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -0
- package/dist/production/src/commands/transfer/ExportCommand.js +66 -0
- package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -0
- package/dist/production/src/commands/transfer/ImportCommand.cjs +60 -0
- package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -0
- package/dist/production/src/commands/transfer/ImportCommand.js +60 -0
- package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -0
- package/dist/production/src/commands/transfer/TransferCommand.cjs +73 -0
- package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -0
- package/dist/production/src/commands/transfer/TransferCommand.js +73 -0
- package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -0
- package/dist/production/src/commands/transfer/utils.cjs +22 -0
- package/dist/production/src/commands/transfer/utils.cjs.map +1 -0
- package/dist/production/src/commands/transfer/utils.js +22 -0
- package/dist/production/src/commands/transfer/utils.js.map +1 -0
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +54 -0
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -0
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js +54 -0
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -0
- package/dist/production/src/consts.cjs +10 -0
- package/dist/production/src/consts.cjs.map +1 -0
- package/dist/production/src/consts.js +9 -0
- package/dist/production/src/consts.js.map +1 -0
- package/dist/production/src/dic.cjs +116 -0
- package/dist/production/src/dic.cjs.map +1 -0
- package/dist/production/src/dic.js +116 -0
- package/dist/production/src/dic.js.map +1 -0
- package/dist/production/src/lib/SystemClientProvider.cjs +14 -0
- package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -0
- package/dist/production/src/lib/SystemClientProvider.js +14 -0
- package/dist/production/src/lib/SystemClientProvider.js.map +1 -0
- package/dist/production/src/lib/TenantClientProvider.cjs +14 -0
- package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -0
- package/dist/production/src/lib/TenantClientProvider.js +14 -0
- package/dist/production/src/lib/TenantClientProvider.js.map +1 -0
- package/dist/production/src/lib/VersionChecker.cjs +85 -0
- package/dist/production/src/lib/VersionChecker.cjs.map +1 -0
- package/dist/production/src/lib/VersionChecker.js +68 -0
- package/dist/production/src/lib/VersionChecker.js.map +1 -0
- package/dist/production/src/lib/admin/AdminClient.cjs +30 -0
- package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -0
- package/dist/production/src/lib/admin/AdminClient.js +30 -0
- package/dist/production/src/lib/admin/AdminClient.js.map +1 -0
- package/dist/production/src/lib/admin/AdminDeployer.cjs +36 -0
- package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -0
- package/dist/production/src/lib/admin/AdminDeployer.js +36 -0
- package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -0
- package/dist/production/src/lib/assertNever.cjs +7 -0
- package/dist/production/src/lib/assertNever.cjs.map +1 -0
- package/dist/production/src/lib/assertNever.js +7 -0
- package/dist/production/src/lib/assertNever.js.map +1 -0
- package/dist/production/src/lib/dsn.cjs +16 -0
- package/dist/production/src/lib/dsn.cjs.map +1 -0
- package/dist/production/src/lib/dsn.js +16 -0
- package/dist/production/src/lib/dsn.js.map +1 -0
- package/dist/production/src/lib/env.cjs +15 -0
- package/dist/production/src/lib/env.cjs.map +1 -0
- package/dist/production/src/lib/env.js +15 -0
- package/dist/production/src/lib/env.js.map +1 -0
- package/dist/production/src/lib/fs/DockerComposeManager.cjs +41 -0
- package/dist/production/src/lib/fs/DockerComposeManager.cjs.map +1 -0
- package/dist/production/src/lib/fs/DockerComposeManager.js +41 -0
- package/dist/production/src/lib/fs/DockerComposeManager.js.map +1 -0
- package/dist/production/src/lib/fs/FileSystem.cjs +43 -0
- package/dist/production/src/lib/fs/FileSystem.cjs.map +1 -0
- package/dist/production/src/lib/fs/FileSystem.js +27 -0
- package/dist/production/src/lib/fs/FileSystem.js.map +1 -0
- package/dist/production/src/lib/fs/YamlHandler.cjs +48 -0
- package/dist/production/src/lib/fs/YamlHandler.cjs.map +1 -0
- package/dist/production/src/lib/fs/YamlHandler.js +48 -0
- package/dist/production/src/lib/fs/YamlHandler.js.map +1 -0
- package/dist/production/src/lib/js/EsBuildBuilder.cjs +36 -0
- package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -0
- package/dist/production/src/lib/js/EsBuildBuilder.js +19 -0
- package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -0
- package/dist/production/src/lib/js/EvalExecutor.cjs +10 -0
- package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -0
- package/dist/production/src/lib/js/EvalExecutor.js +10 -0
- package/dist/production/src/lib/js/EvalExecutor.js.map +1 -0
- package/dist/production/src/lib/js/JsCodeRunner.cjs +17 -0
- package/dist/production/src/lib/js/JsCodeRunner.cjs.map +1 -0
- package/dist/production/src/lib/js/JsCodeRunner.js +17 -0
- package/dist/production/src/lib/js/JsCodeRunner.js.map +1 -0
- package/dist/production/src/lib/maskToken.cjs +5 -0
- package/dist/production/src/lib/maskToken.cjs.map +1 -0
- package/dist/production/src/lib/maskToken.js +5 -0
- package/dist/production/src/lib/maskToken.js.map +1 -0
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs +84 -0
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -0
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js +84 -0
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -0
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs +82 -0
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -0
- package/dist/production/src/lib/migrations/MigrationPrinter.js +82 -0
- package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -0
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs +41 -0
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -0
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js +41 -0
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -0
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs +27 -0
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -0
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js +27 -0
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -0
- package/dist/production/src/lib/migrations/MigrationsValidator.cjs +38 -0
- package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -0
- package/dist/production/src/lib/migrations/MigrationsValidator.js +38 -0
- package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -0
- package/dist/production/src/lib/migrations/migrations.cjs +43 -0
- package/dist/production/src/lib/migrations/migrations.cjs.map +1 -0
- package/dist/production/src/lib/migrations/migrations.js +43 -0
- package/dist/production/src/lib/migrations/migrations.js.map +1 -0
- package/dist/production/src/lib/project/RemoteProject.cjs +12 -0
- package/dist/production/src/lib/project/RemoteProject.cjs.map +1 -0
- package/dist/production/src/lib/project/RemoteProject.js +12 -0
- package/dist/production/src/lib/project/RemoteProject.js.map +1 -0
- package/dist/production/src/lib/project/RemoteProjectProvider.cjs +21 -0
- package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -0
- package/dist/production/src/lib/project/RemoteProjectProvider.js +21 -0
- package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -0
- package/dist/production/src/lib/project/RemoteProjectResolver.cjs +29 -0
- package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -0
- package/dist/production/src/lib/project/RemoteProjectResolver.js +29 -0
- package/dist/production/src/lib/project/RemoteProjectResolver.js.map +1 -0
- package/dist/production/src/lib/project/docs/components/EntityInfo.cjs +77 -0
- package/dist/production/src/lib/project/docs/components/EntityInfo.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/components/EntityInfo.js +77 -0
- package/dist/production/src/lib/project/docs/components/EntityInfo.js.map +1 -0
- package/dist/production/src/lib/project/docs/components/EntityLink.cjs +7 -0
- package/dist/production/src/lib/project/docs/components/EntityLink.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/components/EntityLink.js +7 -0
- package/dist/production/src/lib/project/docs/components/EntityLink.js.map +1 -0
- package/dist/production/src/lib/project/docs/components/FieldLink.cjs +15 -0
- package/dist/production/src/lib/project/docs/components/FieldLink.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/components/FieldLink.js +15 -0
- package/dist/production/src/lib/project/docs/components/FieldLink.js.map +1 -0
- package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs +17 -0
- package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/components/FieldPermissions.js +17 -0
- package/dist/production/src/lib/project/docs/components/FieldPermissions.js.map +1 -0
- package/dist/production/src/lib/project/docs/components/FieldType.cjs +59 -0
- package/dist/production/src/lib/project/docs/components/FieldType.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/components/FieldType.js +59 -0
- package/dist/production/src/lib/project/docs/components/FieldType.js.map +1 -0
- package/dist/production/src/lib/project/docs/components/OnDelete.cjs +66 -0
- package/dist/production/src/lib/project/docs/components/OnDelete.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/components/OnDelete.js +66 -0
- package/dist/production/src/lib/project/docs/components/OnDelete.js.map +1 -0
- package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs +32 -0
- package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/components/ProjectInfo.js +32 -0
- package/dist/production/src/lib/project/docs/components/ProjectInfo.js.map +1 -0
- package/dist/production/src/lib/project/docs/components/SinglePermission.cjs +14 -0
- package/dist/production/src/lib/project/docs/components/SinglePermission.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/components/SinglePermission.js +14 -0
- package/dist/production/src/lib/project/docs/components/SinglePermission.js.map +1 -0
- package/dist/production/src/lib/project/docs/components/utils.cjs +7 -0
- package/dist/production/src/lib/project/docs/components/utils.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/components/utils.js +7 -0
- package/dist/production/src/lib/project/docs/components/utils.js.map +1 -0
- package/dist/production/src/lib/project/docs/projectDescribe.cjs +28 -0
- package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -0
- package/dist/production/src/lib/project/docs/projectDescribe.js +27 -0
- package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -0
- package/dist/production/src/lib/schema/SchemaLoader.cjs +49 -0
- package/dist/production/src/lib/schema/SchemaLoader.cjs.map +1 -0
- package/dist/production/src/lib/schema/SchemaLoader.js +32 -0
- package/dist/production/src/lib/schema/SchemaLoader.js.map +1 -0
- package/dist/production/src/lib/schema/SchemaValidationHelper.cjs +11 -0
- package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -0
- package/dist/production/src/lib/schema/SchemaValidationHelper.js +11 -0
- package/dist/production/src/lib/schema/SchemaValidationHelper.js.map +1 -0
- package/dist/production/src/lib/schema/SchemaValidationPrinter.cjs +14 -0
- package/dist/production/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -0
- package/dist/production/src/lib/schema/SchemaValidationPrinter.js +14 -0
- package/dist/production/src/lib/schema/SchemaValidationPrinter.js.map +1 -0
- package/dist/production/src/lib/schema/collectReferences.cjs +34 -0
- package/dist/production/src/lib/schema/collectReferences.cjs.map +1 -0
- package/dist/production/src/lib/schema/collectReferences.js +34 -0
- package/dist/production/src/lib/schema/collectReferences.js.map +1 -0
- package/dist/production/src/lib/stream.cjs +43 -0
- package/dist/production/src/lib/stream.cjs.map +1 -0
- package/dist/production/src/lib/stream.js +43 -0
- package/dist/production/src/lib/stream.js.map +1 -0
- package/dist/production/src/lib/tenant/TenantClient.cjs +45 -0
- package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantClient.js +45 -0
- package/dist/production/src/lib/tenant/TenantClient.js.map +1 -0
- package/dist/production/src/lib/transfer/DataTransferClient.cjs +97 -0
- package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -0
- package/dist/production/src/lib/transfer/DataTransferClient.js +97 -0
- package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -0
- package/dist/production/src/lib/transfer/stdio.cjs +12 -0
- package/dist/production/src/lib/transfer/stdio.cjs.map +1 -0
- package/dist/production/src/lib/transfer/stdio.js +12 -0
- package/dist/production/src/lib/transfer/stdio.js.map +1 -0
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs +38 -0
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs.map +1 -0
- package/dist/production/src/lib/workspace/WorkspaceResolver.js +38 -0
- package/dist/production/src/lib/workspace/WorkspaceResolver.js.map +1 -0
- package/dist/types/commands/deploy/DeployCommand.d.ts +30 -0
- package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -0
- package/dist/types/commands/index.d.ts +6 -0
- package/dist/types/commands/index.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts +32 -0
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationBlankCommand.d.ts +15 -0
- package/dist/types/commands/migrations/MigrationBlankCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts +20 -0
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts +25 -0
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts +16 -0
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts +18 -0
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts +22 -0
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts.map +1 -0
- package/dist/types/commands/misc/VersionCommand.d.ts +8 -0
- package/dist/types/commands/misc/VersionCommand.d.ts.map +1 -0
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts +15 -0
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -0
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts +19 -0
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -0
- package/dist/types/commands/project/ProjectValidateCommand.d.ts +19 -0
- package/dist/types/commands/project/ProjectValidateCommand.d.ts.map +1 -0
- package/dist/types/commands/project/index.d.ts +4 -0
- package/dist/types/commands/project/index.d.ts.map +1 -0
- package/dist/types/commands/transfer/ExportCommand.d.ts +23 -0
- package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -0
- package/dist/types/commands/transfer/ImportCommand.d.ts +20 -0
- package/dist/types/commands/transfer/ImportCommand.d.ts.map +1 -0
- package/dist/types/commands/transfer/TransferCommand.d.ts +21 -0
- package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -0
- package/dist/types/commands/transfer/utils.d.ts +5 -0
- package/dist/types/commands/transfer/utils.d.ts.map +1 -0
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts +15 -0
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -0
- package/dist/types/consts.d.ts +3 -0
- package/dist/types/consts.d.ts.map +1 -0
- package/dist/types/dic.d.ts +144 -0
- package/dist/types/dic.d.ts.map +1 -0
- package/dist/types/lib/SystemClientProvider.d.ts +8 -0
- package/dist/types/lib/SystemClientProvider.d.ts.map +1 -0
- package/dist/types/lib/TenantClientProvider.d.ts +8 -0
- package/dist/types/lib/TenantClientProvider.d.ts.map +1 -0
- package/dist/types/lib/VersionChecker.d.ts +11 -0
- package/dist/types/lib/VersionChecker.d.ts.map +1 -0
- package/dist/types/lib/admin/AdminClient.d.ts +12 -0
- package/dist/types/lib/admin/AdminClient.d.ts.map +1 -0
- package/dist/types/lib/admin/AdminDeployer.d.ts +15 -0
- package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -0
- package/dist/types/lib/assertNever.d.ts.map +1 -0
- package/dist/types/lib/dsn.d.ts.map +1 -0
- package/dist/types/lib/env.d.ts +11 -0
- package/dist/types/lib/env.d.ts.map +1 -0
- package/dist/types/lib/fs/DockerComposeManager.d.ts +25 -0
- package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -0
- package/dist/types/lib/fs/FileSystem.d.ts +8 -0
- package/dist/types/lib/fs/FileSystem.d.ts.map +1 -0
- package/dist/types/lib/fs/YamlHandler.d.ts +15 -0
- package/dist/types/lib/fs/YamlHandler.d.ts.map +1 -0
- package/dist/types/lib/js/EsBuildBuilder.d.ts +5 -0
- package/dist/types/lib/js/EsBuildBuilder.d.ts.map +1 -0
- package/dist/types/lib/js/EvalExecutor.d.ts +5 -0
- package/dist/types/lib/js/EvalExecutor.d.ts.map +1 -0
- package/dist/types/lib/js/JsBuilder.d.ts +4 -0
- package/dist/types/lib/js/JsBuilder.d.ts.map +1 -0
- package/dist/types/lib/js/JsCodeRunner.d.ts +9 -0
- package/dist/types/lib/js/JsCodeRunner.d.ts.map +1 -0
- package/dist/types/lib/js/JsExecutor.d.ts +4 -0
- package/dist/types/lib/js/JsExecutor.d.ts.map +1 -0
- package/dist/types/lib/json.d.ts +7 -0
- package/dist/types/lib/json.d.ts.map +1 -0
- package/dist/types/lib/maskToken.d.ts +2 -0
- package/dist/types/lib/maskToken.d.ts.map +1 -0
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts +23 -0
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -0
- package/dist/types/lib/migrations/MigrationPrinter.d.ts +12 -0
- package/dist/types/lib/migrations/MigrationPrinter.d.ts.map +1 -0
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts +12 -0
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts.map +1 -0
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +16 -0
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -0
- package/dist/types/lib/migrations/MigrationsValidator.d.ts +10 -0
- package/dist/types/lib/migrations/MigrationsValidator.d.ts.map +1 -0
- package/dist/types/lib/migrations/migrations.d.ts +3 -0
- package/dist/types/lib/migrations/migrations.d.ts.map +1 -0
- package/dist/types/lib/project/RemoteProject.d.ts +8 -0
- package/dist/types/lib/project/RemoteProject.d.ts.map +1 -0
- package/dist/types/lib/project/RemoteProjectProvider.d.ts +7 -0
- package/dist/types/lib/project/RemoteProjectProvider.d.ts.map +1 -0
- package/dist/types/lib/project/RemoteProjectResolver.d.ts +8 -0
- package/dist/types/lib/project/RemoteProjectResolver.d.ts.map +1 -0
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts +11 -0
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -0
- package/dist/types/lib/project/docs/components/EntityLink.d.ts.map +1 -0
- package/dist/types/lib/project/docs/components/FieldLink.d.ts +7 -0
- package/dist/types/lib/project/docs/components/FieldLink.d.ts.map +1 -0
- package/dist/types/lib/project/docs/components/FieldPermissions.d.ts +7 -0
- package/dist/types/lib/project/docs/components/FieldPermissions.d.ts.map +1 -0
- package/dist/types/lib/project/docs/components/FieldType.d.ts.map +1 -0
- package/dist/types/lib/project/docs/components/OnDelete.d.ts +9 -0
- package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -0
- package/dist/types/lib/project/docs/components/ProjectInfo.d.ts.map +1 -0
- package/dist/types/lib/project/docs/components/SinglePermission.d.ts +7 -0
- package/dist/types/lib/project/docs/components/SinglePermission.d.ts.map +1 -0
- package/dist/types/lib/project/docs/components/utils.d.ts.map +1 -0
- package/dist/types/lib/project/docs/projectDescribe.d.ts.map +1 -0
- package/dist/types/lib/schema/SchemaLoader.d.ts +18 -0
- package/dist/types/lib/schema/SchemaLoader.d.ts.map +1 -0
- package/dist/types/lib/schema/SchemaValidationHelper.d.ts +4 -0
- package/dist/types/lib/schema/SchemaValidationHelper.d.ts.map +1 -0
- package/dist/types/lib/schema/SchemaValidationPrinter.d.ts +3 -0
- package/dist/types/lib/schema/SchemaValidationPrinter.d.ts.map +1 -0
- package/dist/types/lib/schema/collectReferences.d.ts.map +1 -0
- package/dist/types/lib/stream.d.ts +8 -0
- package/dist/types/lib/stream.d.ts.map +1 -0
- package/dist/types/lib/tenant/TenantClient.d.ts +9 -0
- package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -0
- package/dist/types/lib/transfer/DataTransferClient.d.ts +18 -0
- package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -0
- package/dist/types/lib/transfer/stdio.d.ts.map +1 -0
- package/dist/types/lib/workspace/Workspace.d.ts +8 -0
- package/dist/types/lib/workspace/Workspace.d.ts.map +1 -0
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts +15 -0
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/esbuild.cjs +27 -0
- package/package.json +16 -13
- package/src/.eslintrc.cjs +5 -0
- package/src/commands/deploy/DeployCommand.ts +51 -107
- package/src/commands/index.ts +0 -1
- package/src/commands/migrations/MigrationAmendCommand.ts +97 -115
- package/src/commands/migrations/MigrationBlankCommand.ts +8 -20
- package/src/commands/migrations/MigrationDescribeCommand.ts +12 -22
- package/src/commands/migrations/MigrationDiffCommand.ts +66 -95
- package/src/commands/migrations/MigrationExecuteCommand.ts +23 -83
- package/src/commands/migrations/MigrationRebaseCommand.ts +20 -62
- package/src/commands/migrations/MigrationStatusCommand.ts +20 -40
- package/src/commands/misc/VersionCommand.ts +7 -2
- package/src/commands/project/ProjectGenerateDocumentationCommand.ts +47 -0
- package/src/commands/project/ProjectPrintSchemaCommand.ts +10 -16
- package/src/commands/project/ProjectValidateCommand.ts +33 -54
- package/src/commands/project/index.ts +1 -1
- package/src/commands/transfer/ExportCommand.ts +16 -14
- package/src/commands/transfer/ImportCommand.ts +18 -15
- package/src/commands/transfer/TransferCommand.ts +29 -18
- package/src/commands/transfer/utils.ts +1 -117
- package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +8 -16
- package/src/consts.ts +5 -0
- package/src/dic.ts +258 -0
- package/src/lib/SystemClientProvider.ts +14 -0
- package/src/lib/TenantClientProvider.ts +14 -0
- package/src/lib/VersionChecker.ts +71 -0
- package/src/lib/admin/AdminClient.ts +33 -0
- package/src/lib/admin/AdminDeployer.ts +45 -0
- package/src/lib/dsn.ts +13 -0
- package/src/lib/env.ts +21 -0
- package/src/lib/fs/DockerComposeManager.ts +63 -0
- package/src/lib/fs/FileSystem.ts +19 -0
- package/src/lib/fs/YamlHandler.ts +59 -0
- package/src/lib/js/EsBuildBuilder.ts +17 -0
- package/src/lib/js/EvalExecutor.ts +8 -0
- package/src/lib/js/JsBuilder.ts +3 -0
- package/src/lib/js/JsCodeRunner.ts +15 -0
- package/src/lib/js/JsExecutor.ts +3 -0
- package/src/lib/json.ts +4 -0
- package/src/lib/migrations/MigrationExecutionFacade.ts +97 -0
- package/src/lib/migrations/MigrationPrinter.ts +86 -0
- package/src/lib/migrations/MigrationRebaseFacade.ts +41 -0
- package/src/lib/migrations/MigrationsStatusFacade.ts +27 -0
- package/src/lib/migrations/MigrationsValidator.ts +40 -0
- package/src/lib/migrations/migrations.ts +45 -0
- package/src/lib/project/RemoteProject.ts +9 -0
- package/src/lib/project/RemoteProjectProvider.ts +16 -0
- package/src/lib/project/RemoteProjectResolver.ts +30 -0
- package/src/lib/project/docs/.eslintrc.cjs +5 -0
- package/src/lib/project/docs/components/EntityInfo.tsx +85 -0
- package/src/lib/project/docs/components/OnDelete.tsx +72 -0
- package/src/lib/project/docs/components/ProjectInfo.tsx +48 -0
- package/src/lib/project/docs/projectDescribe.tsx +28 -0
- package/src/lib/schema/SchemaLoader.ts +38 -0
- package/src/lib/schema/SchemaValidationHelper.ts +9 -0
- package/src/lib/schema/SchemaValidationPrinter.ts +13 -0
- package/src/lib/tenant/TenantClient.ts +45 -0
- package/src/lib/transfer/DataTransferClient.ts +112 -0
- package/src/lib/workspace/Workspace.ts +7 -0
- package/src/lib/workspace/WorkspaceResolver.ts +45 -0
- package/src/run.ts +23 -63
- package/src/tsconfig.json +4 -2
- package/tailwind.config.js +1 -1
- package/dist/src/commands/deploy/DeployCommand.d.ts +0 -21
- package/dist/src/commands/deploy/DeployCommand.d.ts.map +0 -1
- package/dist/src/commands/deploy/DeployCommand.js +0 -135
- package/dist/src/commands/deploy/DeployCommand.js.map +0 -1
- package/dist/src/commands/deploy/index.js +0 -18
- package/dist/src/commands/deploy/index.js.map +0 -1
- package/dist/src/commands/index.d.ts +0 -7
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/commands/index.js +0 -23
- package/dist/src/commands/index.js.map +0 -1
- package/dist/src/commands/migrations/MigrationAmendCommand.d.ts +0 -18
- package/dist/src/commands/migrations/MigrationAmendCommand.d.ts.map +0 -1
- package/dist/src/commands/migrations/MigrationAmendCommand.js +0 -126
- package/dist/src/commands/migrations/MigrationAmendCommand.js.map +0 -1
- package/dist/src/commands/migrations/MigrationBlankCommand.d.ts +0 -15
- package/dist/src/commands/migrations/MigrationBlankCommand.d.ts.map +0 -1
- package/dist/src/commands/migrations/MigrationBlankCommand.js +0 -29
- package/dist/src/commands/migrations/MigrationBlankCommand.js.map +0 -1
- package/dist/src/commands/migrations/MigrationDescribeCommand.d.ts +0 -17
- package/dist/src/commands/migrations/MigrationDescribeCommand.d.ts.map +0 -1
- package/dist/src/commands/migrations/MigrationDescribeCommand.js +0 -42
- package/dist/src/commands/migrations/MigrationDescribeCommand.js.map +0 -1
- package/dist/src/commands/migrations/MigrationDiffCommand.d.ts +0 -18
- package/dist/src/commands/migrations/MigrationDiffCommand.d.ts.map +0 -1
- package/dist/src/commands/migrations/MigrationDiffCommand.js +0 -110
- package/dist/src/commands/migrations/MigrationDiffCommand.js.map +0 -1
- package/dist/src/commands/migrations/MigrationExecuteCommand.d.ts +0 -17
- package/dist/src/commands/migrations/MigrationExecuteCommand.d.ts.map +0 -1
- package/dist/src/commands/migrations/MigrationExecuteCommand.js +0 -83
- package/dist/src/commands/migrations/MigrationExecuteCommand.js.map +0 -1
- package/dist/src/commands/migrations/MigrationRebaseCommand.d.ts +0 -16
- package/dist/src/commands/migrations/MigrationRebaseCommand.d.ts.map +0 -1
- package/dist/src/commands/migrations/MigrationRebaseCommand.js +0 -64
- package/dist/src/commands/migrations/MigrationRebaseCommand.js.map +0 -1
- package/dist/src/commands/migrations/MigrationStatusCommand.d.ts +0 -19
- package/dist/src/commands/migrations/MigrationStatusCommand.d.ts.map +0 -1
- package/dist/src/commands/migrations/MigrationStatusCommand.js +0 -88
- package/dist/src/commands/migrations/MigrationStatusCommand.js.map +0 -1
- package/dist/src/commands/migrations/MigrationValidationHelper.d.ts +0 -4
- package/dist/src/commands/migrations/MigrationValidationHelper.d.ts.map +0 -1
- package/dist/src/commands/migrations/MigrationValidationHelper.js +0 -34
- package/dist/src/commands/migrations/MigrationValidationHelper.js.map +0 -1
- package/dist/src/commands/migrations/SystemApiClientResolver.d.ts +0 -8
- package/dist/src/commands/migrations/SystemApiClientResolver.d.ts.map +0 -1
- package/dist/src/commands/migrations/SystemApiClientResolver.js +0 -14
- package/dist/src/commands/migrations/SystemApiClientResolver.js.map +0 -1
- package/dist/src/commands/migrations/index.js +0 -24
- package/dist/src/commands/migrations/index.js.map +0 -1
- package/dist/src/commands/misc/VersionCommand.d.ts +0 -6
- package/dist/src/commands/misc/VersionCommand.d.ts.map +0 -1
- package/dist/src/commands/misc/VersionCommand.js +0 -15
- package/dist/src/commands/misc/VersionCommand.js.map +0 -1
- package/dist/src/commands/misc/index.js +0 -18
- package/dist/src/commands/misc/index.js.map +0 -1
- package/dist/src/commands/project/ProjectGenerateDocumentation.d.ts +0 -15
- package/dist/src/commands/project/ProjectGenerateDocumentation.d.ts.map +0 -1
- package/dist/src/commands/project/ProjectGenerateDocumentation.js +0 -43
- package/dist/src/commands/project/ProjectGenerateDocumentation.js.map +0 -1
- package/dist/src/commands/project/ProjectPrintSchemaCommand.d.ts +0 -18
- package/dist/src/commands/project/ProjectPrintSchemaCommand.d.ts.map +0 -1
- package/dist/src/commands/project/ProjectPrintSchemaCommand.js +0 -81
- package/dist/src/commands/project/ProjectPrintSchemaCommand.js.map +0 -1
- package/dist/src/commands/project/ProjectValidateCommand.d.ts +0 -13
- package/dist/src/commands/project/ProjectValidateCommand.d.ts.map +0 -1
- package/dist/src/commands/project/ProjectValidateCommand.js +0 -65
- package/dist/src/commands/project/ProjectValidateCommand.js.map +0 -1
- package/dist/src/commands/project/index.d.ts +0 -4
- package/dist/src/commands/project/index.d.ts.map +0 -1
- package/dist/src/commands/project/index.js +0 -20
- package/dist/src/commands/project/index.js.map +0 -1
- package/dist/src/commands/tenant/CreateApiKeyCommand.d.ts +0 -14
- package/dist/src/commands/tenant/CreateApiKeyCommand.d.ts.map +0 -1
- package/dist/src/commands/tenant/CreateApiKeyCommand.js +0 -34
- package/dist/src/commands/tenant/CreateApiKeyCommand.js.map +0 -1
- package/dist/src/commands/tenant/InviteCommand.d.ts +0 -14
- package/dist/src/commands/tenant/InviteCommand.d.ts.map +0 -1
- package/dist/src/commands/tenant/InviteCommand.js +0 -32
- package/dist/src/commands/tenant/InviteCommand.js.map +0 -1
- package/dist/src/commands/tenant/ResetPasswordCommand.d.ts +0 -14
- package/dist/src/commands/tenant/ResetPasswordCommand.d.ts.map +0 -1
- package/dist/src/commands/tenant/ResetPasswordCommand.js +0 -30
- package/dist/src/commands/tenant/ResetPasswordCommand.js.map +0 -1
- package/dist/src/commands/tenant/SignInCommand.d.ts +0 -14
- package/dist/src/commands/tenant/SignInCommand.d.ts.map +0 -1
- package/dist/src/commands/tenant/SignInCommand.js +0 -32
- package/dist/src/commands/tenant/SignInCommand.js.map +0 -1
- package/dist/src/commands/tenant/index.d.ts +0 -5
- package/dist/src/commands/tenant/index.d.ts.map +0 -1
- package/dist/src/commands/tenant/index.js +0 -21
- package/dist/src/commands/tenant/index.js.map +0 -1
- package/dist/src/commands/transfer/ExportCommand.d.ts +0 -20
- package/dist/src/commands/transfer/ExportCommand.d.ts.map +0 -1
- package/dist/src/commands/transfer/ExportCommand.js +0 -70
- package/dist/src/commands/transfer/ExportCommand.js.map +0 -1
- package/dist/src/commands/transfer/ImportCommand.d.ts +0 -17
- package/dist/src/commands/transfer/ImportCommand.d.ts.map +0 -1
- package/dist/src/commands/transfer/ImportCommand.js +0 -61
- package/dist/src/commands/transfer/ImportCommand.js.map +0 -1
- package/dist/src/commands/transfer/TransferCommand.d.ts +0 -18
- package/dist/src/commands/transfer/TransferCommand.d.ts.map +0 -1
- package/dist/src/commands/transfer/TransferCommand.js +0 -67
- package/dist/src/commands/transfer/TransferCommand.js.map +0 -1
- package/dist/src/commands/transfer/index.js +0 -20
- package/dist/src/commands/transfer/index.js.map +0 -1
- package/dist/src/commands/transfer/utils.d.ts +0 -27
- package/dist/src/commands/transfer/utils.d.ts.map +0 -1
- package/dist/src/commands/transfer/utils.js +0 -136
- package/dist/src/commands/transfer/utils.js.map +0 -1
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.d.ts +0 -13
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +0 -1
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js +0 -66
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +0 -1
- package/dist/src/commands/workspace/index.js +0 -18
- package/dist/src/commands/workspace/index.js.map +0 -1
- package/dist/src/run.js +0 -50
- package/dist/src/run.js.map +0 -1
- package/dist/src/tsconfig.tsbuildinfo +0 -1
- package/dist/src/utils/admin.d.ts +0 -14
- package/dist/src/utils/admin.d.ts.map +0 -1
- package/dist/src/utils/admin.js +0 -47
- package/dist/src/utils/admin.js.map +0 -1
- package/dist/src/utils/assertNever.d.ts.map +0 -1
- package/dist/src/utils/assertNever.js +0 -8
- package/dist/src/utils/assertNever.js.map +0 -1
- package/dist/src/utils/checkVersions.d.ts +0 -3
- package/dist/src/utils/checkVersions.d.ts.map +0 -1
- package/dist/src/utils/checkVersions.js +0 -83
- package/dist/src/utils/checkVersions.js.map +0 -1
- package/dist/src/utils/dockerCompose.d.ts +0 -18
- package/dist/src/utils/dockerCompose.d.ts.map +0 -1
- package/dist/src/utils/dockerCompose.js +0 -66
- package/dist/src/utils/dockerCompose.js.map +0 -1
- package/dist/src/utils/dsn.d.ts.map +0 -1
- package/dist/src/utils/dsn.js +0 -17
- package/dist/src/utils/dsn.js.map +0 -1
- package/dist/src/utils/esbuild.d.ts +0 -2
- package/dist/src/utils/esbuild.d.ts.map +0 -1
- package/dist/src/utils/esbuild.js +0 -41
- package/dist/src/utils/esbuild.js.map +0 -1
- package/dist/src/utils/instance/environment.d.ts +0 -4
- package/dist/src/utils/instance/environment.d.ts.map +0 -1
- package/dist/src/utils/instance/environment.js +0 -3
- package/dist/src/utils/instance/environment.js.map +0 -1
- package/dist/src/utils/instance/index.d.ts +0 -3
- package/dist/src/utils/instance/index.d.ts.map +0 -1
- package/dist/src/utils/instance/index.js +0 -21
- package/dist/src/utils/instance/index.js.map +0 -1
- package/dist/src/utils/instance/interactiveUtils.d.ts +0 -4
- package/dist/src/utils/instance/interactiveUtils.d.ts.map +0 -1
- package/dist/src/utils/instance/interactiveUtils.js +0 -36
- package/dist/src/utils/instance/interactiveUtils.js.map +0 -1
- package/dist/src/utils/migrations/MigrationCreateHelper.d.ts +0 -21
- package/dist/src/utils/migrations/MigrationCreateHelper.d.ts.map +0 -1
- package/dist/src/utils/migrations/MigrationCreateHelper.js +0 -32
- package/dist/src/utils/migrations/MigrationCreateHelper.js.map +0 -1
- package/dist/src/utils/migrations/MigrationExecuteHelper.d.ts +0 -23
- package/dist/src/utils/migrations/MigrationExecuteHelper.d.ts.map +0 -1
- package/dist/src/utils/migrations/MigrationExecuteHelper.js +0 -84
- package/dist/src/utils/migrations/MigrationExecuteHelper.js.map +0 -1
- package/dist/src/utils/migrations/MigrationsContainer.d.ts +0 -20
- package/dist/src/utils/migrations/MigrationsContainer.d.ts.map +0 -1
- package/dist/src/utils/migrations/MigrationsContainer.js +0 -58
- package/dist/src/utils/migrations/MigrationsContainer.js.map +0 -1
- package/dist/src/utils/migrations/migrations.d.ts +0 -9
- package/dist/src/utils/migrations/migrations.d.ts.map +0 -1
- package/dist/src/utils/migrations/migrations.js +0 -77
- package/dist/src/utils/migrations/migrations.js.map +0 -1
- package/dist/src/utils/project/components/EntityInfo.d.ts +0 -11
- package/dist/src/utils/project/components/EntityInfo.d.ts.map +0 -1
- package/dist/src/utils/project/components/EntityInfo.js +0 -54
- package/dist/src/utils/project/components/EntityInfo.js.map +0 -1
- package/dist/src/utils/project/components/EntityLink.d.ts.map +0 -1
- package/dist/src/utils/project/components/EntityLink.js +0 -8
- package/dist/src/utils/project/components/EntityLink.js.map +0 -1
- package/dist/src/utils/project/components/FieldLink.d.ts +0 -7
- package/dist/src/utils/project/components/FieldLink.d.ts.map +0 -1
- package/dist/src/utils/project/components/FieldLink.js +0 -13
- package/dist/src/utils/project/components/FieldLink.js.map +0 -1
- package/dist/src/utils/project/components/FieldPermissions.d.ts +0 -7
- package/dist/src/utils/project/components/FieldPermissions.d.ts.map +0 -1
- package/dist/src/utils/project/components/FieldPermissions.js +0 -17
- package/dist/src/utils/project/components/FieldPermissions.js.map +0 -1
- package/dist/src/utils/project/components/FieldType.d.ts.map +0 -1
- package/dist/src/utils/project/components/FieldType.js +0 -59
- package/dist/src/utils/project/components/FieldType.js.map +0 -1
- package/dist/src/utils/project/components/OnDelete.d.ts +0 -9
- package/dist/src/utils/project/components/OnDelete.d.ts.map +0 -1
- package/dist/src/utils/project/components/OnDelete.js +0 -70
- package/dist/src/utils/project/components/OnDelete.js.map +0 -1
- package/dist/src/utils/project/components/ProjectInfo.d.ts.map +0 -1
- package/dist/src/utils/project/components/ProjectInfo.js +0 -28
- package/dist/src/utils/project/components/ProjectInfo.js.map +0 -1
- package/dist/src/utils/project/components/SinglePermission.d.ts +0 -7
- package/dist/src/utils/project/components/SinglePermission.d.ts.map +0 -1
- package/dist/src/utils/project/components/SinglePermission.js +0 -15
- package/dist/src/utils/project/components/SinglePermission.js.map +0 -1
- package/dist/src/utils/project/components/utils.d.ts.map +0 -1
- package/dist/src/utils/project/components/utils.js +0 -8
- package/dist/src/utils/project/components/utils.js.map +0 -1
- package/dist/src/utils/project/loadSchema.d.ts +0 -4
- package/dist/src/utils/project/loadSchema.d.ts.map +0 -1
- package/dist/src/utils/project/loadSchema.js +0 -14
- package/dist/src/utils/project/loadSchema.js.map +0 -1
- package/dist/src/utils/project/projectDescribe.d.ts.map +0 -1
- package/dist/src/utils/project/projectDescribe.js +0 -29
- package/dist/src/utils/project/projectDescribe.js.map +0 -1
- package/dist/src/utils/project/resources/out.css +0 -824
- package/dist/src/utils/schema/collectReferences.d.ts.map +0 -1
- package/dist/src/utils/schema/collectReferences.js +0 -35
- package/dist/src/utils/schema/collectReferences.js.map +0 -1
- package/dist/src/utils/schema.d.ts +0 -5
- package/dist/src/utils/schema.d.ts.map +0 -1
- package/dist/src/utils/schema.js +0 -22
- package/dist/src/utils/schema.js.map +0 -1
- package/dist/src/utils/stdio.d.ts.map +0 -1
- package/dist/src/utils/stdio.js +0 -13
- package/dist/src/utils/stdio.js.map +0 -1
- package/dist/src/utils/stream.d.ts +0 -9
- package/dist/src/utils/stream.d.ts.map +0 -1
- package/dist/src/utils/stream.js +0 -41
- package/dist/src/utils/stream.js.map +0 -1
- package/dist/src/utils/tenant.d.ts +0 -66
- package/dist/src/utils/tenant.d.ts.map +0 -1
- package/dist/src/utils/tenant.js +0 -355
- package/dist/src/utils/tenant.js.map +0 -1
- package/dist/src/utils/token.d.ts +0 -2
- package/dist/src/utils/token.d.ts.map +0 -1
- package/dist/src/utils/token.js +0 -6
- package/dist/src/utils/token.js.map +0 -1
- package/dist/src/utils/tuple.d.ts +0 -2
- package/dist/src/utils/tuple.d.ts.map +0 -1
- package/dist/src/utils/tuple.js +0 -6
- package/dist/src/utils/tuple.js.map +0 -1
- package/dist/src/utils/workspace.d.ts +0 -3
- package/dist/src/utils/workspace.d.ts.map +0 -1
- package/dist/src/utils/workspace.js +0 -25
- package/dist/src/utils/workspace.js.map +0 -1
- package/dist/src/utils/yaml.d.ts +0 -8
- package/dist/src/utils/yaml.d.ts.map +0 -1
- package/dist/src/utils/yaml.js +0 -33
- package/dist/src/utils/yaml.js.map +0 -1
- package/esbuild.js +0 -15
- package/src/.eslintrc.js +0 -5
- package/src/commands/migrations/MigrationValidationHelper.ts +0 -36
- package/src/commands/migrations/SystemApiClientResolver.ts +0 -22
- package/src/commands/project/ProjectGenerateDocumentation.ts +0 -49
- package/src/commands/tenant/CreateApiKeyCommand.ts +0 -40
- package/src/commands/tenant/InviteCommand.ts +0 -38
- package/src/commands/tenant/ResetPasswordCommand.ts +0 -36
- package/src/commands/tenant/SignInCommand.ts +0 -38
- package/src/commands/tenant/index.ts +0 -4
- package/src/utils/admin.ts +0 -45
- package/src/utils/checkVersions.ts +0 -58
- package/src/utils/dockerCompose.ts +0 -58
- package/src/utils/dsn.ts +0 -13
- package/src/utils/esbuild.ts +0 -14
- package/src/utils/instance/environment.ts +0 -4
- package/src/utils/instance/index.ts +0 -2
- package/src/utils/instance/interactiveUtils.ts +0 -39
- package/src/utils/migrations/MigrationCreateHelper.ts +0 -59
- package/src/utils/migrations/MigrationExecuteHelper.ts +0 -115
- package/src/utils/migrations/MigrationsContainer.ts +0 -80
- package/src/utils/migrations/migrations.ts +0 -80
- package/src/utils/project/components/EntityInfo.tsx +0 -82
- package/src/utils/project/components/OnDelete.tsx +0 -72
- package/src/utils/project/components/ProjectInfo.tsx +0 -48
- package/src/utils/project/loadSchema.ts +0 -14
- package/src/utils/project/projectDescribe.tsx +0 -26
- package/src/utils/schema.ts +0 -19
- package/src/utils/tenant.ts +0 -434
- package/src/utils/tuple.ts +0 -1
- package/src/utils/workspace.ts +0 -21
- package/src/utils/yaml.ts +0 -36
- /package/dist/{src → types}/commands/deploy/index.d.ts +0 -0
- /package/dist/{src → types}/commands/deploy/index.d.ts.map +0 -0
- /package/dist/{src → types}/commands/migrations/index.d.ts +0 -0
- /package/dist/{src → types}/commands/migrations/index.d.ts.map +0 -0
- /package/dist/{src → types}/commands/misc/index.d.ts +0 -0
- /package/dist/{src → types}/commands/misc/index.d.ts.map +0 -0
- /package/dist/{src → types}/commands/transfer/index.d.ts +0 -0
- /package/dist/{src → types}/commands/transfer/index.d.ts.map +0 -0
- /package/dist/{src → types}/commands/workspace/index.d.ts +0 -0
- /package/dist/{src → types}/commands/workspace/index.d.ts.map +0 -0
- /package/dist/{src/utils → types/lib}/assertNever.d.ts +0 -0
- /package/dist/{src/utils → types/lib}/dsn.d.ts +0 -0
- /package/dist/{src/utils/project → types/lib/project/docs}/components/EntityLink.d.ts +0 -0
- /package/dist/{src/utils/project → types/lib/project/docs}/components/FieldType.d.ts +0 -0
- /package/dist/{src/utils/project → types/lib/project/docs}/components/ProjectInfo.d.ts +0 -0
- /package/dist/{src/utils/project → types/lib/project/docs}/components/utils.d.ts +0 -0
- /package/dist/{src/utils/project → types/lib/project/docs}/projectDescribe.d.ts +0 -0
- /package/dist/{src/utils → types/lib}/schema/collectReferences.d.ts +0 -0
- /package/dist/{src/utils → types/lib/transfer}/stdio.d.ts +0 -0
- /package/dist/{src → types}/run.d.ts +0 -0
- /package/dist/{src → types}/run.d.ts.map +0 -0
- /package/src/{utils → lib}/assertNever.ts +0 -0
- /package/src/{utils/token.ts → lib/maskToken.ts} +0 -0
- /package/src/{utils/project → lib/project/docs}/components/EntityLink.tsx +0 -0
- /package/src/{utils/project → lib/project/docs}/components/FieldLink.tsx +0 -0
- /package/src/{utils/project → lib/project/docs}/components/FieldPermissions.tsx +0 -0
- /package/src/{utils/project → lib/project/docs}/components/FieldType.tsx +0 -0
- /package/src/{utils/project → lib/project/docs}/components/SinglePermission.tsx +0 -0
- /package/src/{utils/project → lib/project/docs}/components/utils.ts +0 -0
- /package/src/{utils/project → lib/project/docs}/resources/style.css +0 -0
- /package/src/{utils → lib}/schema/collectReferences.ts +0 -0
- /package/src/{utils → lib}/stream.ts +0 -0
- /package/src/{utils → lib/transfer}/stdio.ts +0 -0
package/Dockerfile
CHANGED
|
@@ -14,7 +14,6 @@ ENV NODE_ENV "production"
|
|
|
14
14
|
|
|
15
15
|
COPY --from=builder /src/dist/ /opt/contember/
|
|
16
16
|
COPY --from=builder /src/packages/cli/dist/src/utils/project/resources/out.css /opt/contember/resources/out.css
|
|
17
|
-
COPY --from=builder /src/packages/create/resources /opt/contember/resources
|
|
18
17
|
COPY --from=builder /src/packages/cli/package.json /opt/contember/package.json
|
|
19
18
|
RUN ln -s /opt/contember/run.js /usr/bin/contember
|
|
20
19
|
ENV CONTEMBER_CLI_PACKAGE_ROOT /opt/contember
|
package/build.sh
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
const node_path = require("node:path");
|
|
4
|
+
const consts = require("./src/consts.cjs");
|
|
5
|
+
const dic = require("./src/dic.cjs");
|
|
6
|
+
const env = require("./src/lib/env.cjs");
|
|
7
|
+
const WorkspaceResolver = require("./src/lib/workspace/WorkspaceResolver.cjs");
|
|
8
|
+
const YamlHandler = require("./src/lib/fs/YamlHandler.cjs");
|
|
9
|
+
const FileSystem = require("./src/lib/fs/FileSystem.cjs");
|
|
10
|
+
(async () => {
|
|
11
|
+
const version = require(node_path.join(consts.packageRoot, "package.json")).version;
|
|
12
|
+
const nodeVersion = process.version.match(/^v?(\d+)\..+$/);
|
|
13
|
+
if (nodeVersion && Number(nodeVersion[1]) < 18) {
|
|
14
|
+
throw `Node >= 18 is required`;
|
|
15
|
+
}
|
|
16
|
+
const env$1 = env.readCliEnv();
|
|
17
|
+
const dir = env$1.dir ? node_path.resolve(env$1.dir) : process.cwd();
|
|
18
|
+
const workspaceResolver = new WorkspaceResolver.WorkspaceResolver(new YamlHandler.YamlHandler(new FileSystem.FileSystem()));
|
|
19
|
+
const workspace = await workspaceResolver.resolve(dir);
|
|
20
|
+
const dic$1 = dic.createContainer({
|
|
21
|
+
version,
|
|
22
|
+
workspace,
|
|
23
|
+
env: env$1,
|
|
24
|
+
runtime: process.title === "bun" ? "bun" : "node"
|
|
25
|
+
});
|
|
26
|
+
await dic$1.application.run(process.argv.slice(2));
|
|
27
|
+
})().catch((e) => {
|
|
28
|
+
console.log(e);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=run.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.cjs","sources":["../../../packages/cli/src/run.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { join, resolve } from 'node:path'\nimport { packageRoot } from './consts'\nimport { createContainer } from './dic'\nimport { readCliEnv } from './lib/env'\nimport { WorkspaceResolver } from './lib/workspace/WorkspaceResolver'\nimport { YamlHandler } from './lib/fs/YamlHandler'\nimport { FileSystem } from './lib/fs/FileSystem';\n\n(async () => {\n\t// eslint-disable-next-line @typescript-eslint/no-var-requires\n\tconst version = require(join(packageRoot, 'package.json')).version\n\tconst nodeVersion = process.version.match(/^v?(\\d+)\\..+$/)\n\tif (nodeVersion && Number(nodeVersion[1]) < 18) {\n\t\tthrow `Node >= 18 is required`\n\t}\n\tconst env = readCliEnv()\n\tconst dir = env.dir ? resolve(env.dir) : process.cwd()\n\tconst workspaceResolver = new WorkspaceResolver(new YamlHandler(new FileSystem()))\n\tconst workspace = await workspaceResolver.resolve(dir)\n\tconst dic = createContainer({\n\t\tversion,\n\t\tworkspace,\n\t\tenv: env,\n\t\truntime: process.title === 'bun' ? 'bun' : 'node',\n\t})\n\n\n\tawait dic.application.run(process.argv.slice(2))\n})().catch(e => {\n\tconsole.log(e)\n\tprocess.exit(1)\n})\n"],"names":["join","packageRoot","env","readCliEnv","resolve","WorkspaceResolver","YamlHandler","FileSystem","dic","createContainer"],"mappings":";;;;;;;;;CASC,YAAY;AAEZ,QAAM,UAAU,QAAQA,UAAA,KAAKC,OAAa,aAAA,cAAc,CAAC,EAAE;AAC3D,QAAM,cAAc,QAAQ,QAAQ,MAAM,eAAe;AACzD,MAAI,eAAe,OAAO,YAAY,CAAC,CAAC,IAAI,IAAI;AACzC,UAAA;AAAA,EACP;AACA,QAAMC,QAAMC,IAAAA;AACN,QAAA,MAAMD,MAAI,MAAME,UAAA,QAAQF,MAAI,GAAG,IAAI,QAAQ;AAC3C,QAAA,oBAAoB,IAAIG,oCAAkB,IAAIC,wBAAY,IAAIC,WAAAA,WAAY,CAAA,CAAC;AACjF,QAAM,YAAY,MAAM,kBAAkB,QAAQ,GAAG;AACrD,QAAMC,QAAMC,IAAAA,gBAAgB;AAAA,IAC3B;AAAA,IACA;AAAA,IAAA,KACAP;AAAAA,IACA,SAAS,QAAQ,UAAU,QAAQ,QAAQ;AAAA,EAAA,CAC3C;AAGD,QAAMM,MAAI,YAAY,IAAI,QAAQ,KAAK,MAAM,CAAC,CAAC;AAChD,KAAK,MAAM,CAAK,MAAA;AACf,UAAQ,IAAI,CAAC;AACb,UAAQ,KAAK,CAAC;AACf,CAAC;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { packageRoot } from "./src/consts.js";
|
|
4
|
+
import { createContainer } from "./src/dic.js";
|
|
5
|
+
import { readCliEnv } from "./src/lib/env.js";
|
|
6
|
+
import { WorkspaceResolver } from "./src/lib/workspace/WorkspaceResolver.js";
|
|
7
|
+
import { YamlHandler } from "./src/lib/fs/YamlHandler.js";
|
|
8
|
+
import { FileSystem } from "./src/lib/fs/FileSystem.js";
|
|
9
|
+
(async () => {
|
|
10
|
+
const version = require(join(packageRoot, "package.json")).version;
|
|
11
|
+
const nodeVersion = process.version.match(/^v?(\d+)\..+$/);
|
|
12
|
+
if (nodeVersion && Number(nodeVersion[1]) < 18) {
|
|
13
|
+
throw `Node >= 18 is required`;
|
|
14
|
+
}
|
|
15
|
+
const env = readCliEnv();
|
|
16
|
+
const dir = env.dir ? resolve(env.dir) : process.cwd();
|
|
17
|
+
const workspaceResolver = new WorkspaceResolver(new YamlHandler(new FileSystem()));
|
|
18
|
+
const workspace = await workspaceResolver.resolve(dir);
|
|
19
|
+
const dic = createContainer({
|
|
20
|
+
version,
|
|
21
|
+
workspace,
|
|
22
|
+
env,
|
|
23
|
+
runtime: process.title === "bun" ? "bun" : "node"
|
|
24
|
+
});
|
|
25
|
+
await dic.application.run(process.argv.slice(2));
|
|
26
|
+
})().catch((e) => {
|
|
27
|
+
console.log(e);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sources":["../../../packages/cli/src/run.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { join, resolve } from 'node:path'\nimport { packageRoot } from './consts'\nimport { createContainer } from './dic'\nimport { readCliEnv } from './lib/env'\nimport { WorkspaceResolver } from './lib/workspace/WorkspaceResolver'\nimport { YamlHandler } from './lib/fs/YamlHandler'\nimport { FileSystem } from './lib/fs/FileSystem';\n\n(async () => {\n\t// eslint-disable-next-line @typescript-eslint/no-var-requires\n\tconst version = require(join(packageRoot, 'package.json')).version\n\tconst nodeVersion = process.version.match(/^v?(\\d+)\\..+$/)\n\tif (nodeVersion && Number(nodeVersion[1]) < 18) {\n\t\tthrow `Node >= 18 is required`\n\t}\n\tconst env = readCliEnv()\n\tconst dir = env.dir ? resolve(env.dir) : process.cwd()\n\tconst workspaceResolver = new WorkspaceResolver(new YamlHandler(new FileSystem()))\n\tconst workspace = await workspaceResolver.resolve(dir)\n\tconst dic = createContainer({\n\t\tversion,\n\t\tworkspace,\n\t\tenv: env,\n\t\truntime: process.title === 'bun' ? 'bun' : 'node',\n\t})\n\n\n\tawait dic.application.run(process.argv.slice(2))\n})().catch(e => {\n\tconsole.log(e)\n\tprocess.exit(1)\n})\n"],"names":[],"mappings":";;;;;;;;CASC,YAAY;AAEZ,QAAM,UAAU,QAAQ,KAAK,aAAa,cAAc,CAAC,EAAE;AAC3D,QAAM,cAAc,QAAQ,QAAQ,MAAM,eAAe;AACzD,MAAI,eAAe,OAAO,YAAY,CAAC,CAAC,IAAI,IAAI;AACzC,UAAA;AAAA,EACP;AACA,QAAM,MAAM;AACN,QAAA,MAAM,IAAI,MAAM,QAAQ,IAAI,GAAG,IAAI,QAAQ;AAC3C,QAAA,oBAAoB,IAAI,kBAAkB,IAAI,YAAY,IAAI,WAAY,CAAA,CAAC;AACjF,QAAM,YAAY,MAAM,kBAAkB,QAAQ,GAAG;AACrD,QAAM,MAAM,gBAAgB;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,QAAQ,UAAU,QAAQ,QAAQ;AAAA,EAAA,CAC3C;AAGD,QAAM,IAAI,YAAY,IAAI,QAAQ,KAAK,MAAM,CAAC,CAAC;AAChD,KAAK,MAAM,CAAK,MAAA;AACf,UAAQ,IAAI,CAAC;AACb,UAAQ,KAAK,CAAC;AACf,CAAC;"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const cliCommon = require("@contember/cli-common");
|
|
4
|
+
const prompts = require("prompts");
|
|
5
|
+
const maskToken = require("../../lib/maskToken.cjs");
|
|
6
|
+
class DeployCommand extends cliCommon.Command {
|
|
7
|
+
constructor(adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace) {
|
|
8
|
+
super();
|
|
9
|
+
this.adminDeployer = adminDeployer;
|
|
10
|
+
this.migrationExecutionFacade = migrationExecutionFacade;
|
|
11
|
+
this.fs = fs;
|
|
12
|
+
this.remoteProjectProvider = remoteProjectProvider;
|
|
13
|
+
this.remoteProjectResolver = remoteProjectResolver;
|
|
14
|
+
this.workspace = workspace;
|
|
15
|
+
}
|
|
16
|
+
configure(configuration) {
|
|
17
|
+
configuration.description("Deploy Contember project");
|
|
18
|
+
configuration.argument("dsn");
|
|
19
|
+
configuration.option("admin").valueRequired();
|
|
20
|
+
configuration.option("root").valueNone();
|
|
21
|
+
configuration.option("no-admin").valueNone();
|
|
22
|
+
configuration.option("no-migrations").valueNone();
|
|
23
|
+
configuration.option("yes").valueNone().description("Do not ask for confirmation.");
|
|
24
|
+
}
|
|
25
|
+
async execute(input) {
|
|
26
|
+
const dsn = input.getArgument("dsn");
|
|
27
|
+
const remoteProject = this.remoteProjectResolver.resolve(dsn);
|
|
28
|
+
if (!remoteProject) {
|
|
29
|
+
throw `Project not defined. Please provide DSN or environment variables CONTEMBER_*`;
|
|
30
|
+
}
|
|
31
|
+
this.remoteProjectProvider.setRemoteProject(remoteProject);
|
|
32
|
+
let adminEndpoint = input.getOption("admin");
|
|
33
|
+
const deployMigration = input.getOption("no-migrations") !== true;
|
|
34
|
+
const yes = input.getOption("yes") === true;
|
|
35
|
+
const projectAdminDistDir = this.workspace.adminDistDir;
|
|
36
|
+
const deployAdmin = input.getOption("no-admin") !== true && !!adminEndpoint && !!projectAdminDistDir;
|
|
37
|
+
console.log("");
|
|
38
|
+
console.log("Contember project deployment configuration:");
|
|
39
|
+
console.log(`Target project name: ${remoteProject.name}`);
|
|
40
|
+
console.log(`API URL: ${remoteProject.endpoint}`);
|
|
41
|
+
console.log(`Admin URL: ${adminEndpoint ?? "none"}`);
|
|
42
|
+
console.log(`Deploy token: ${maskToken.maskToken(remoteProject.token)}`);
|
|
43
|
+
console.log("");
|
|
44
|
+
if (deployAdmin && !await this.fs.pathExists(`${projectAdminDistDir}/index.html`)) {
|
|
45
|
+
throw `Missing ${projectAdminDistDir}/index.html. Please build admin before deploying.`;
|
|
46
|
+
}
|
|
47
|
+
if (deployMigration) {
|
|
48
|
+
const result = await this.migrationExecutionFacade.execute({
|
|
49
|
+
force: false,
|
|
50
|
+
requireConfirmation: !yes,
|
|
51
|
+
additionalMessage: deployAdmin ? "Admin will be deployed." : "Admin will NOT be deployed."
|
|
52
|
+
});
|
|
53
|
+
if (!result) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (deployAdmin) {
|
|
58
|
+
if (!deployMigration && !yes) {
|
|
59
|
+
if (!process.stdin.isTTY) {
|
|
60
|
+
throw "TTY not available. Pass --yes option to confirm execution.";
|
|
61
|
+
}
|
|
62
|
+
console.log("Admin will be deployed.");
|
|
63
|
+
console.log("(to skip this dialog, you can pass --yes option)");
|
|
64
|
+
console.log("");
|
|
65
|
+
const { ok } = await prompts({
|
|
66
|
+
type: "confirm",
|
|
67
|
+
name: "ok",
|
|
68
|
+
message: `Do you want to continue?`
|
|
69
|
+
});
|
|
70
|
+
if (!ok) {
|
|
71
|
+
return 1;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
await this.adminDeployer.deploy({
|
|
75
|
+
dir: projectAdminDistDir,
|
|
76
|
+
root: input.getOption("root") === true
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
console.log("");
|
|
80
|
+
console.log("Deployment successful");
|
|
81
|
+
console.log(`API URL: ${remoteProject.endpoint}`);
|
|
82
|
+
console.log(`Admin URL: ${adminEndpoint ?? "none"}`);
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.DeployCommand = DeployCommand;
|
|
87
|
+
//# sourceMappingURL=DeployCommand.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeployCommand.cjs","sources":["../../../../../../packages/cli/src/commands/deploy/DeployCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport prompts from 'prompts'\nimport { maskToken } from '../../lib/maskToken'\nimport { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade'\nimport { AdminDeployer } from '../../lib/admin/AdminDeployer'\nimport { FileSystem } from '../../lib/fs/FileSystem'\nimport { RemoteProject } from '../../lib/project/RemoteProject'\nimport { Workspace } from '../../lib/workspace/Workspace'\nimport { RemoteProjectProvider } from '../../lib/project/RemoteProjectProvider'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'\n\ntype Args = {\n\tdsn: string\n}\n\ntype Options = {\n\tadmin?: string\n\t['no-admin']?: boolean\n\t['no-migrations']?: boolean\n\troot?: boolean\n\tyes?: boolean\n}\n\nexport class DeployCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly adminDeployer: AdminDeployer,\n\t\tprivate readonly migrationExecutionFacade: MigrationExecutionFacade,\n\t\tprivate readonly fs: FileSystem,\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly workspace: Workspace,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Deploy Contember project')\n\t\tconfiguration.argument('dsn')\n\n\t\tconfiguration.option('admin').valueRequired()\n\t\tconfiguration.option('root').valueNone()\n\t\tconfiguration.option('no-admin').valueNone()\n\t\tconfiguration.option('no-migrations').valueNone()\n\t\tconfiguration //\n\t\t\t.option('yes')\n\t\t\t.valueNone()\n\t\t\t.description('Do not ask for confirmation.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\n\t\tconst dsn = input.getArgument('dsn')\n\t\tconst remoteProject = this.remoteProjectResolver.resolve(dsn)\n\t\tif (!remoteProject) {\n\t\t\tthrow `Project not defined. Please provide DSN or environment variables CONTEMBER_*`\n\t\t}\n\t\tthis.remoteProjectProvider.setRemoteProject(remoteProject)\n\n\t\tlet adminEndpoint = input.getOption('admin')\n\t\tconst deployMigration = input.getOption('no-migrations') !== true\n\t\tconst yes = input.getOption('yes') === true\n\t\tconst projectAdminDistDir = this.workspace.adminDistDir\n\t\tconst deployAdmin = input.getOption('no-admin') !== true && !!adminEndpoint && !!projectAdminDistDir\n\n\n\t\tconsole.log('')\n\t\tconsole.log('Contember project deployment configuration:')\n\t\tconsole.log(`Target project name: ${remoteProject.name}`)\n\t\tconsole.log(`API URL: ${remoteProject.endpoint}`)\n\t\tconsole.log(`Admin URL: ${adminEndpoint ?? 'none'}`)\n\t\tconsole.log(`Deploy token: ${maskToken(remoteProject.token)}`)\n\t\tconsole.log('')\n\n\n\t\tif (deployAdmin && !(await this.fs.pathExists(`${projectAdminDistDir}/index.html`))) {\n\t\t\tthrow `Missing ${projectAdminDistDir}/index.html. Please build admin before deploying.`\n\t\t}\n\n\t\tif (deployMigration) {\n\t\t\tconst result = await this.migrationExecutionFacade.execute({\n\t\t\t\tforce: false,\n\t\t\t\trequireConfirmation: !yes,\n\t\t\t\tadditionalMessage: deployAdmin ? 'Admin will be deployed.' : 'Admin will NOT be deployed.',\n\t\t\t})\n\t\t\tif (!result) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tif (deployAdmin) {\n\t\t\tif (!deployMigration && !yes) {\n\t\t\t\tif (!process.stdin.isTTY) {\n\t\t\t\t\tthrow 'TTY not available. Pass --yes option to confirm execution.'\n\t\t\t\t}\n\t\t\t\tconsole.log('Admin will be deployed.')\n\t\t\t\tconsole.log('(to skip this dialog, you can pass --yes option)')\n\t\t\t\tconsole.log('')\n\t\t\t\tconst { ok } = await prompts({\n\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\tname: 'ok',\n\t\t\t\t\tmessage: `Do you want to continue?`,\n\t\t\t\t})\n\t\t\t\tif (!ok) {\n\t\t\t\t\treturn 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait this.adminDeployer.deploy({\n\t\t\t\tdir: projectAdminDistDir,\n\t\t\t\troot: input.getOption('root') === true,\n\t\t\t})\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Deployment successful')\n\t\tconsole.log(`API URL: ${remoteProject.endpoint}`)\n\t\tconsole.log(`Admin URL: ${adminEndpoint ?? 'none'}`)\n\n\t\treturn 0\n\t}\n}\n"],"names":["Command","maskToken"],"mappings":";;;;;AAuBO,MAAM,sBAAsBA,UAAAA,QAAuB;AAAA,EACzD,YACkB,eACA,0BACA,IACA,uBACA,uBACA,WAChB;AACK;AAPW,SAAA,gBAAA;AACA,SAAA,2BAAA;AACA,SAAA,KAAA;AACA,SAAA,wBAAA;AACA,SAAA,wBAAA;AACA,SAAA,YAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,0BAA0B;AACpD,kBAAc,SAAS,KAAK;AAEd,kBAAA,OAAO,OAAO,EAAE,cAAc;AAC9B,kBAAA,OAAO,MAAM,EAAE,UAAU;AACzB,kBAAA,OAAO,UAAU,EAAE,UAAU;AAC7B,kBAAA,OAAO,eAAe,EAAE,UAAU;AAChD,kBACE,OAAO,KAAK,EACZ,UAAU,EACV,YAAY,8BAA8B;AAAA,EAC7C;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAEtE,UAAA,MAAM,MAAM,YAAY,KAAK;AACnC,UAAM,gBAAgB,KAAK,sBAAsB,QAAQ,GAAG;AAC5D,QAAI,CAAC,eAAe;AACb,YAAA;AAAA,IACP;AACK,SAAA,sBAAsB,iBAAiB,aAAa;AAErD,QAAA,gBAAgB,MAAM,UAAU,OAAO;AAC3C,UAAM,kBAAkB,MAAM,UAAU,eAAe,MAAM;AAC7D,UAAM,MAAM,MAAM,UAAU,KAAK,MAAM;AACjC,UAAA,sBAAsB,KAAK,UAAU;AACrC,UAAA,cAAc,MAAM,UAAU,UAAU,MAAM,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC;AAGjF,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,6CAA6C;AACzD,YAAQ,IAAI,wBAAwB,cAAc,IAAI,EAAE;AACxD,YAAQ,IAAI,YAAY,cAAc,QAAQ,EAAE;AAChD,YAAQ,IAAI,cAAc,iBAAiB,MAAM,EAAE;AACnD,YAAQ,IAAI,iBAAiBC,UAAAA,UAAU,cAAc,KAAK,CAAC,EAAE;AAC7D,YAAQ,IAAI,EAAE;AAGV,QAAA,eAAe,CAAE,MAAM,KAAK,GAAG,WAAW,GAAG,mBAAmB,aAAa,GAAI;AACpF,YAAM,WAAW,mBAAmB;AAAA,IACrC;AAEA,QAAI,iBAAiB;AACpB,YAAM,SAAS,MAAM,KAAK,yBAAyB,QAAQ;AAAA,QAC1D,OAAO;AAAA,QACP,qBAAqB,CAAC;AAAA,QACtB,mBAAmB,cAAc,4BAA4B;AAAA,MAAA,CAC7D;AACD,UAAI,CAAC,QAAQ;AACZ;AAAA,MACD;AAAA,IACD;AAEA,QAAI,aAAa;AACZ,UAAA,CAAC,mBAAmB,CAAC,KAAK;AACzB,YAAA,CAAC,QAAQ,MAAM,OAAO;AACnB,gBAAA;AAAA,QACP;AACA,gBAAQ,IAAI,yBAAyB;AACrC,gBAAQ,IAAI,kDAAkD;AAC9D,gBAAQ,IAAI,EAAE;AACd,cAAM,EAAE,OAAO,MAAM,QAAQ;AAAA,UAC5B,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QAAA,CACT;AACD,YAAI,CAAC,IAAI;AACD,iBAAA;AAAA,QACR;AAAA,MACD;AACM,YAAA,KAAK,cAAc,OAAO;AAAA,QAC/B,KAAK;AAAA,QACL,MAAM,MAAM,UAAU,MAAM,MAAM;AAAA,MAAA,CAClC;AAAA,IACF;AAEA,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,uBAAuB;AACnC,YAAQ,IAAI,YAAY,cAAc,QAAQ,EAAE;AAChD,YAAQ,IAAI,cAAc,iBAAiB,MAAM,EAAE;AAE5C,WAAA;AAAA,EACR;AACD;;"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Command } from "@contember/cli-common";
|
|
2
|
+
import prompts from "prompts";
|
|
3
|
+
import { maskToken } from "../../lib/maskToken.js";
|
|
4
|
+
class DeployCommand extends Command {
|
|
5
|
+
constructor(adminDeployer, migrationExecutionFacade, fs, remoteProjectProvider, remoteProjectResolver, workspace) {
|
|
6
|
+
super();
|
|
7
|
+
this.adminDeployer = adminDeployer;
|
|
8
|
+
this.migrationExecutionFacade = migrationExecutionFacade;
|
|
9
|
+
this.fs = fs;
|
|
10
|
+
this.remoteProjectProvider = remoteProjectProvider;
|
|
11
|
+
this.remoteProjectResolver = remoteProjectResolver;
|
|
12
|
+
this.workspace = workspace;
|
|
13
|
+
}
|
|
14
|
+
configure(configuration) {
|
|
15
|
+
configuration.description("Deploy Contember project");
|
|
16
|
+
configuration.argument("dsn");
|
|
17
|
+
configuration.option("admin").valueRequired();
|
|
18
|
+
configuration.option("root").valueNone();
|
|
19
|
+
configuration.option("no-admin").valueNone();
|
|
20
|
+
configuration.option("no-migrations").valueNone();
|
|
21
|
+
configuration.option("yes").valueNone().description("Do not ask for confirmation.");
|
|
22
|
+
}
|
|
23
|
+
async execute(input) {
|
|
24
|
+
const dsn = input.getArgument("dsn");
|
|
25
|
+
const remoteProject = this.remoteProjectResolver.resolve(dsn);
|
|
26
|
+
if (!remoteProject) {
|
|
27
|
+
throw `Project not defined. Please provide DSN or environment variables CONTEMBER_*`;
|
|
28
|
+
}
|
|
29
|
+
this.remoteProjectProvider.setRemoteProject(remoteProject);
|
|
30
|
+
let adminEndpoint = input.getOption("admin");
|
|
31
|
+
const deployMigration = input.getOption("no-migrations") !== true;
|
|
32
|
+
const yes = input.getOption("yes") === true;
|
|
33
|
+
const projectAdminDistDir = this.workspace.adminDistDir;
|
|
34
|
+
const deployAdmin = input.getOption("no-admin") !== true && !!adminEndpoint && !!projectAdminDistDir;
|
|
35
|
+
console.log("");
|
|
36
|
+
console.log("Contember project deployment configuration:");
|
|
37
|
+
console.log(`Target project name: ${remoteProject.name}`);
|
|
38
|
+
console.log(`API URL: ${remoteProject.endpoint}`);
|
|
39
|
+
console.log(`Admin URL: ${adminEndpoint ?? "none"}`);
|
|
40
|
+
console.log(`Deploy token: ${maskToken(remoteProject.token)}`);
|
|
41
|
+
console.log("");
|
|
42
|
+
if (deployAdmin && !await this.fs.pathExists(`${projectAdminDistDir}/index.html`)) {
|
|
43
|
+
throw `Missing ${projectAdminDistDir}/index.html. Please build admin before deploying.`;
|
|
44
|
+
}
|
|
45
|
+
if (deployMigration) {
|
|
46
|
+
const result = await this.migrationExecutionFacade.execute({
|
|
47
|
+
force: false,
|
|
48
|
+
requireConfirmation: !yes,
|
|
49
|
+
additionalMessage: deployAdmin ? "Admin will be deployed." : "Admin will NOT be deployed."
|
|
50
|
+
});
|
|
51
|
+
if (!result) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (deployAdmin) {
|
|
56
|
+
if (!deployMigration && !yes) {
|
|
57
|
+
if (!process.stdin.isTTY) {
|
|
58
|
+
throw "TTY not available. Pass --yes option to confirm execution.";
|
|
59
|
+
}
|
|
60
|
+
console.log("Admin will be deployed.");
|
|
61
|
+
console.log("(to skip this dialog, you can pass --yes option)");
|
|
62
|
+
console.log("");
|
|
63
|
+
const { ok } = await prompts({
|
|
64
|
+
type: "confirm",
|
|
65
|
+
name: "ok",
|
|
66
|
+
message: `Do you want to continue?`
|
|
67
|
+
});
|
|
68
|
+
if (!ok) {
|
|
69
|
+
return 1;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
await this.adminDeployer.deploy({
|
|
73
|
+
dir: projectAdminDistDir,
|
|
74
|
+
root: input.getOption("root") === true
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
console.log("");
|
|
78
|
+
console.log("Deployment successful");
|
|
79
|
+
console.log(`API URL: ${remoteProject.endpoint}`);
|
|
80
|
+
console.log(`Admin URL: ${adminEndpoint ?? "none"}`);
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
DeployCommand
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=DeployCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeployCommand.js","sources":["../../../../../../packages/cli/src/commands/deploy/DeployCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport prompts from 'prompts'\nimport { maskToken } from '../../lib/maskToken'\nimport { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade'\nimport { AdminDeployer } from '../../lib/admin/AdminDeployer'\nimport { FileSystem } from '../../lib/fs/FileSystem'\nimport { RemoteProject } from '../../lib/project/RemoteProject'\nimport { Workspace } from '../../lib/workspace/Workspace'\nimport { RemoteProjectProvider } from '../../lib/project/RemoteProjectProvider'\nimport { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'\n\ntype Args = {\n\tdsn: string\n}\n\ntype Options = {\n\tadmin?: string\n\t['no-admin']?: boolean\n\t['no-migrations']?: boolean\n\troot?: boolean\n\tyes?: boolean\n}\n\nexport class DeployCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly adminDeployer: AdminDeployer,\n\t\tprivate readonly migrationExecutionFacade: MigrationExecutionFacade,\n\t\tprivate readonly fs: FileSystem,\n\t\tprivate readonly remoteProjectProvider: RemoteProjectProvider,\n\t\tprivate readonly remoteProjectResolver: RemoteProjectResolver,\n\t\tprivate readonly workspace: Workspace,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Deploy Contember project')\n\t\tconfiguration.argument('dsn')\n\n\t\tconfiguration.option('admin').valueRequired()\n\t\tconfiguration.option('root').valueNone()\n\t\tconfiguration.option('no-admin').valueNone()\n\t\tconfiguration.option('no-migrations').valueNone()\n\t\tconfiguration //\n\t\t\t.option('yes')\n\t\t\t.valueNone()\n\t\t\t.description('Do not ask for confirmation.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<void | number> {\n\n\t\tconst dsn = input.getArgument('dsn')\n\t\tconst remoteProject = this.remoteProjectResolver.resolve(dsn)\n\t\tif (!remoteProject) {\n\t\t\tthrow `Project not defined. Please provide DSN or environment variables CONTEMBER_*`\n\t\t}\n\t\tthis.remoteProjectProvider.setRemoteProject(remoteProject)\n\n\t\tlet adminEndpoint = input.getOption('admin')\n\t\tconst deployMigration = input.getOption('no-migrations') !== true\n\t\tconst yes = input.getOption('yes') === true\n\t\tconst projectAdminDistDir = this.workspace.adminDistDir\n\t\tconst deployAdmin = input.getOption('no-admin') !== true && !!adminEndpoint && !!projectAdminDistDir\n\n\n\t\tconsole.log('')\n\t\tconsole.log('Contember project deployment configuration:')\n\t\tconsole.log(`Target project name: ${remoteProject.name}`)\n\t\tconsole.log(`API URL: ${remoteProject.endpoint}`)\n\t\tconsole.log(`Admin URL: ${adminEndpoint ?? 'none'}`)\n\t\tconsole.log(`Deploy token: ${maskToken(remoteProject.token)}`)\n\t\tconsole.log('')\n\n\n\t\tif (deployAdmin && !(await this.fs.pathExists(`${projectAdminDistDir}/index.html`))) {\n\t\t\tthrow `Missing ${projectAdminDistDir}/index.html. Please build admin before deploying.`\n\t\t}\n\n\t\tif (deployMigration) {\n\t\t\tconst result = await this.migrationExecutionFacade.execute({\n\t\t\t\tforce: false,\n\t\t\t\trequireConfirmation: !yes,\n\t\t\t\tadditionalMessage: deployAdmin ? 'Admin will be deployed.' : 'Admin will NOT be deployed.',\n\t\t\t})\n\t\t\tif (!result) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tif (deployAdmin) {\n\t\t\tif (!deployMigration && !yes) {\n\t\t\t\tif (!process.stdin.isTTY) {\n\t\t\t\t\tthrow 'TTY not available. Pass --yes option to confirm execution.'\n\t\t\t\t}\n\t\t\t\tconsole.log('Admin will be deployed.')\n\t\t\t\tconsole.log('(to skip this dialog, you can pass --yes option)')\n\t\t\t\tconsole.log('')\n\t\t\t\tconst { ok } = await prompts({\n\t\t\t\t\ttype: 'confirm',\n\t\t\t\t\tname: 'ok',\n\t\t\t\t\tmessage: `Do you want to continue?`,\n\t\t\t\t})\n\t\t\t\tif (!ok) {\n\t\t\t\t\treturn 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait this.adminDeployer.deploy({\n\t\t\t\tdir: projectAdminDistDir,\n\t\t\t\troot: input.getOption('root') === true,\n\t\t\t})\n\t\t}\n\n\t\tconsole.log('')\n\t\tconsole.log('Deployment successful')\n\t\tconsole.log(`API URL: ${remoteProject.endpoint}`)\n\t\tconsole.log(`Admin URL: ${adminEndpoint ?? 'none'}`)\n\n\t\treturn 0\n\t}\n}\n"],"names":[],"mappings":";;;AAuBO,MAAM,sBAAsB,QAAuB;AAAA,EACzD,YACkB,eACA,0BACA,IACA,uBACA,uBACA,WAChB;AACK;AAPW,SAAA,gBAAA;AACA,SAAA,2BAAA;AACA,SAAA,KAAA;AACA,SAAA,wBAAA;AACA,SAAA,wBAAA;AACA,SAAA,YAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,0BAA0B;AACpD,kBAAc,SAAS,KAAK;AAEd,kBAAA,OAAO,OAAO,EAAE,cAAc;AAC9B,kBAAA,OAAO,MAAM,EAAE,UAAU;AACzB,kBAAA,OAAO,UAAU,EAAE,UAAU;AAC7B,kBAAA,OAAO,eAAe,EAAE,UAAU;AAChD,kBACE,OAAO,KAAK,EACZ,UAAU,EACV,YAAY,8BAA8B;AAAA,EAC7C;AAAA,EAEA,MAAgB,QAAQ,OAAqD;AAEtE,UAAA,MAAM,MAAM,YAAY,KAAK;AACnC,UAAM,gBAAgB,KAAK,sBAAsB,QAAQ,GAAG;AAC5D,QAAI,CAAC,eAAe;AACb,YAAA;AAAA,IACP;AACK,SAAA,sBAAsB,iBAAiB,aAAa;AAErD,QAAA,gBAAgB,MAAM,UAAU,OAAO;AAC3C,UAAM,kBAAkB,MAAM,UAAU,eAAe,MAAM;AAC7D,UAAM,MAAM,MAAM,UAAU,KAAK,MAAM;AACjC,UAAA,sBAAsB,KAAK,UAAU;AACrC,UAAA,cAAc,MAAM,UAAU,UAAU,MAAM,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAC;AAGjF,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,6CAA6C;AACzD,YAAQ,IAAI,wBAAwB,cAAc,IAAI,EAAE;AACxD,YAAQ,IAAI,YAAY,cAAc,QAAQ,EAAE;AAChD,YAAQ,IAAI,cAAc,iBAAiB,MAAM,EAAE;AACnD,YAAQ,IAAI,iBAAiB,UAAU,cAAc,KAAK,CAAC,EAAE;AAC7D,YAAQ,IAAI,EAAE;AAGV,QAAA,eAAe,CAAE,MAAM,KAAK,GAAG,WAAW,GAAG,mBAAmB,aAAa,GAAI;AACpF,YAAM,WAAW,mBAAmB;AAAA,IACrC;AAEA,QAAI,iBAAiB;AACpB,YAAM,SAAS,MAAM,KAAK,yBAAyB,QAAQ;AAAA,QAC1D,OAAO;AAAA,QACP,qBAAqB,CAAC;AAAA,QACtB,mBAAmB,cAAc,4BAA4B;AAAA,MAAA,CAC7D;AACD,UAAI,CAAC,QAAQ;AACZ;AAAA,MACD;AAAA,IACD;AAEA,QAAI,aAAa;AACZ,UAAA,CAAC,mBAAmB,CAAC,KAAK;AACzB,YAAA,CAAC,QAAQ,MAAM,OAAO;AACnB,gBAAA;AAAA,QACP;AACA,gBAAQ,IAAI,yBAAyB;AACrC,gBAAQ,IAAI,kDAAkD;AAC9D,gBAAQ,IAAI,EAAE;AACd,cAAM,EAAE,OAAO,MAAM,QAAQ;AAAA,UAC5B,MAAM;AAAA,UACN,MAAM;AAAA,UACN,SAAS;AAAA,QAAA,CACT;AACD,YAAI,CAAC,IAAI;AACD,iBAAA;AAAA,QACR;AAAA,MACD;AACM,YAAA,KAAK,cAAc,OAAO;AAAA,QAC/B,KAAK;AAAA,QACL,MAAM,MAAM,UAAU,MAAM,MAAM;AAAA,MAAA,CAClC;AAAA,IACF;AAEA,YAAQ,IAAI,EAAE;AACd,YAAQ,IAAI,uBAAuB;AACnC,YAAQ,IAAI,YAAY,cAAc,QAAQ,EAAE;AAChD,YAAQ,IAAI,cAAc,iBAAiB,MAAM,EAAE;AAE5C,WAAA;AAAA,EACR;AACD;"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const cliCommon = require("@contember/cli-common");
|
|
4
|
+
const schemaMigrations = require("@contember/schema-migrations");
|
|
5
|
+
const prompts = require("prompts");
|
|
6
|
+
const schemaUtils = require("@contember/schema-utils");
|
|
7
|
+
const SchemaValidationPrinter = require("../../lib/schema/SchemaValidationPrinter.cjs");
|
|
8
|
+
class MigrationAmendCommand extends cliCommon.Command {
|
|
9
|
+
constructor(migrationsResolver, systemApiClientProvider, migrationsStatusFacade, schemaLoader, schemaVersionBuilder, migrationCreator, migrationsValidator, migrationPrinter, schemaMigrator) {
|
|
10
|
+
super();
|
|
11
|
+
this.migrationsResolver = migrationsResolver;
|
|
12
|
+
this.systemApiClientProvider = systemApiClientProvider;
|
|
13
|
+
this.migrationsStatusFacade = migrationsStatusFacade;
|
|
14
|
+
this.schemaLoader = schemaLoader;
|
|
15
|
+
this.schemaVersionBuilder = schemaVersionBuilder;
|
|
16
|
+
this.migrationCreator = migrationCreator;
|
|
17
|
+
this.migrationsValidator = migrationsValidator;
|
|
18
|
+
this.migrationPrinter = migrationPrinter;
|
|
19
|
+
this.schemaMigrator = schemaMigrator;
|
|
20
|
+
}
|
|
21
|
+
configure(configuration) {
|
|
22
|
+
configuration.description("Amends latest migration");
|
|
23
|
+
configuration.argument("migration").optional();
|
|
24
|
+
configuration.option("force").description("Ignore migrations order and missing migrations (dev only)");
|
|
25
|
+
configuration.option("yes").valueNone().description("Do not ask for confirmation.");
|
|
26
|
+
}
|
|
27
|
+
async execute(input) {
|
|
28
|
+
const migrationName = input.getArgument("migration");
|
|
29
|
+
const amendMigration = migrationName ? await this.migrationsResolver.findSchemaMigrationByVersion(migrationName) : await this.migrationsResolver.findLatestSchemaMigration();
|
|
30
|
+
if (!amendMigration) {
|
|
31
|
+
throw "No migration to amend";
|
|
32
|
+
}
|
|
33
|
+
const force = input.getOption("force");
|
|
34
|
+
const status = await this.migrationsStatusFacade.resolveMigrationsStatus({ force });
|
|
35
|
+
if (status.migrationsToExecute.length > 0) {
|
|
36
|
+
throw `Some migrations are not executed. Unable to amend.`;
|
|
37
|
+
}
|
|
38
|
+
const schema = await this.schemaLoader.loadSchema();
|
|
39
|
+
try {
|
|
40
|
+
const initialSchema = await this.schemaVersionBuilder.buildSchema();
|
|
41
|
+
const intermediateResult = await this.migrationCreator.prepareMigration(initialSchema, schema, "");
|
|
42
|
+
if (intermediateResult === null) {
|
|
43
|
+
console.log("Nothing to do");
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
if (amendMigration.formatVersion !== intermediateResult.migration.formatVersion) {
|
|
47
|
+
throw "Incompatible migration format version";
|
|
48
|
+
}
|
|
49
|
+
const prevSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(
|
|
50
|
+
schemaUtils.emptySchema,
|
|
51
|
+
(version) => version < amendMigration.version
|
|
52
|
+
);
|
|
53
|
+
const newSchema = await this.schemaMigrator.applyModifications(
|
|
54
|
+
prevSchema,
|
|
55
|
+
[...amendMigration.modifications, ...intermediateResult.migration.modifications],
|
|
56
|
+
amendMigration.formatVersion
|
|
57
|
+
);
|
|
58
|
+
const newMigrationResult = await this.migrationCreator.prepareMigration(prevSchema, newSchema, "");
|
|
59
|
+
const followingMigrations = (await this.migrationsResolver.getSchemaMigrations()).filter(
|
|
60
|
+
(it) => it.version > amendMigration.version
|
|
61
|
+
);
|
|
62
|
+
const valid = await this.migrationsValidator.validate(
|
|
63
|
+
prevSchema,
|
|
64
|
+
[...newMigrationResult ? [newMigrationResult.migration] : [], ...followingMigrations]
|
|
65
|
+
);
|
|
66
|
+
if (!valid) {
|
|
67
|
+
throw `Cannot amend migration`;
|
|
68
|
+
}
|
|
69
|
+
this.migrationPrinter.printMigrationDescription(
|
|
70
|
+
intermediateResult.initialSchema,
|
|
71
|
+
intermediateResult.migration,
|
|
72
|
+
{ noSql: true }
|
|
73
|
+
);
|
|
74
|
+
console.log(`Amending ${amendMigration.name}`);
|
|
75
|
+
if (!await this.shouldContinue(input)) {
|
|
76
|
+
console.log("Aborting");
|
|
77
|
+
return 1;
|
|
78
|
+
}
|
|
79
|
+
const systemClient = this.systemApiClientProvider.get();
|
|
80
|
+
await systemClient.migrate([intermediateResult.migration], force);
|
|
81
|
+
await systemClient.migrationDelete(intermediateResult.migration.version);
|
|
82
|
+
if (!newMigrationResult) {
|
|
83
|
+
await this.migrationCreator.removeMigration(amendMigration.name);
|
|
84
|
+
await systemClient.migrationDelete(amendMigration.version);
|
|
85
|
+
console.log("Latest migration was removed");
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
const newMigration = {
|
|
89
|
+
name: amendMigration.name,
|
|
90
|
+
version: amendMigration.version,
|
|
91
|
+
formatVersion: newMigrationResult.migration.formatVersion,
|
|
92
|
+
modifications: newMigrationResult.migration.modifications
|
|
93
|
+
};
|
|
94
|
+
await this.migrationCreator.saveMigration(newMigration);
|
|
95
|
+
await systemClient.migrationModify(amendMigration.version, newMigration);
|
|
96
|
+
return 0;
|
|
97
|
+
} catch (e) {
|
|
98
|
+
if (e instanceof schemaMigrations.InvalidSchemaException) {
|
|
99
|
+
SchemaValidationPrinter.printValidationErrors(e.validationErrors, e.message);
|
|
100
|
+
return 1;
|
|
101
|
+
}
|
|
102
|
+
throw e;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async shouldContinue(input) {
|
|
106
|
+
const yes = input.getOption("yes");
|
|
107
|
+
if (yes) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
const { action } = await prompts({
|
|
111
|
+
type: "select",
|
|
112
|
+
name: "action",
|
|
113
|
+
message: "Do you want to continue?",
|
|
114
|
+
choices: [
|
|
115
|
+
{ value: "yes", title: "Yes" },
|
|
116
|
+
{ value: "no", title: "Abort" }
|
|
117
|
+
]
|
|
118
|
+
});
|
|
119
|
+
return action === "yes";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
exports.MigrationAmendCommand = MigrationAmendCommand;
|
|
123
|
+
//# sourceMappingURL=MigrationAmendCommand.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MigrationAmendCommand.cjs","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationAmendCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { InvalidSchemaException, SchemaMigrator } from '@contember/schema-migrations'\nimport prompts from 'prompts'\nimport { emptySchema } from '@contember/schema-utils'\nimport { MigrationCreator, MigrationsResolver, SchemaVersionBuilder, SystemClient } from '@contember/migrations-client'\nimport { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade'\nimport { SchemaLoader } from '../../lib/schema/SchemaLoader'\nimport { MigrationsValidator } from '../../lib/migrations/MigrationsValidator'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter'\nimport { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter'\nimport { SystemClientProvider } from '../../lib/SystemClientProvider'\n\ntype Args = {\n\tmigration?: string\n}\n\ntype Options = {\n\tyes?: true\n\tforce: boolean\n}\n\nexport class MigrationAmendCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly systemApiClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsStatusFacade: MigrationsStatusFacade,\n\t\tprivate readonly schemaLoader: SchemaLoader,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t\tprivate readonly migrationsValidator: MigrationsValidator,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly schemaMigrator: SchemaMigrator,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Amends latest migration')\n\t\tconfiguration.argument('migration').optional()\n\t\tconfiguration.option('force').description('Ignore migrations order and missing migrations (dev only)')\n\t\tconfiguration //\n\t\t\t.option('yes')\n\t\t\t.valueNone()\n\t\t\t.description('Do not ask for confirmation.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<number> {\n\t\tconst migrationName = input.getArgument('migration')\n\t\tconst amendMigration = migrationName\n\t\t\t? await this.migrationsResolver.findSchemaMigrationByVersion(migrationName)\n\t\t\t: await this.migrationsResolver.findLatestSchemaMigration()\n\t\tif (!amendMigration) {\n\t\t\tthrow 'No migration to amend'\n\t\t}\n\t\tconst force = input.getOption('force')\n\t\tconst status = await this.migrationsStatusFacade.resolveMigrationsStatus({ force })\n\t\tif (status.migrationsToExecute.length > 0) {\n\t\t\tthrow `Some migrations are not executed. Unable to amend.`\n\t\t}\n\n\n\t\tconst schema = await this.schemaLoader.loadSchema()\n\t\ttry {\n\t\t\tconst initialSchema = await this.schemaVersionBuilder.buildSchema()\n\t\t\tconst intermediateResult = await this.migrationCreator.prepareMigration(initialSchema, schema, '')\n\t\t\tif (intermediateResult === null) {\n\t\t\t\tconsole.log('Nothing to do')\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (amendMigration.formatVersion !== intermediateResult.migration.formatVersion) {\n\t\t\t\tthrow 'Incompatible migration format version'\n\t\t\t}\n\t\t\tconst prevSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(\n\t\t\t\temptySchema,\n\t\t\t\tversion => version < amendMigration.version,\n\t\t\t)\n\t\t\tconst newSchema = await this.schemaMigrator.applyModifications(\n\t\t\t\tprevSchema,\n\t\t\t\t[...amendMigration.modifications, ...intermediateResult.migration.modifications],\n\t\t\t\tamendMigration.formatVersion,\n\t\t\t)\n\t\t\tconst newMigrationResult = await this.migrationCreator.prepareMigration(prevSchema, newSchema, '')\n\t\t\tconst followingMigrations = (await this.migrationsResolver.getSchemaMigrations()).filter(\n\t\t\t\tit => it.version > amendMigration.version,\n\t\t\t)\n\n\t\t\tconst valid = await this.migrationsValidator.validate(\n\t\t\t\tprevSchema,\n\t\t\t\t[...(newMigrationResult ? [newMigrationResult.migration] : []), ...followingMigrations],\n\t\t\t)\n\t\t\tif (!valid) {\n\t\t\t\tthrow `Cannot amend migration`\n\t\t\t}\n\n\t\t\tthis.migrationPrinter.printMigrationDescription(\n\t\t\t\tintermediateResult.initialSchema,\n\t\t\t\tintermediateResult.migration,\n\t\t\t\t{ noSql: true },\n\t\t\t)\n\t\t\tconsole.log(`Amending ${amendMigration.name}`)\n\t\t\tif (!(await this.shouldContinue(input))) {\n\t\t\t\tconsole.log('Aborting')\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\tconst systemClient = this.systemApiClientProvider.get()\n\t\t\tawait systemClient.migrate([intermediateResult.migration], force)\n\t\t\tawait systemClient.migrationDelete(intermediateResult.migration.version)\n\n\t\t\tif (!newMigrationResult) {\n\t\t\t\tawait this.migrationCreator.removeMigration(amendMigration.name)\n\t\t\t\tawait systemClient.migrationDelete(amendMigration.version)\n\t\t\t\tconsole.log('Latest migration was removed')\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tconst newMigration = {\n\t\t\t\tname: amendMigration.name,\n\t\t\t\tversion: amendMigration.version,\n\t\t\t\tformatVersion: newMigrationResult.migration.formatVersion,\n\t\t\t\tmodifications: newMigrationResult.migration.modifications,\n\t\t\t}\n\t\t\tawait this.migrationCreator.saveMigration(newMigration)\n\t\t\tawait systemClient.migrationModify(amendMigration.version, newMigration)\n\n\t\t\treturn 0\n\t\t} catch (e) {\n\t\t\tif (e instanceof InvalidSchemaException) {\n\t\t\t\tprintValidationErrors(e.validationErrors, e.message)\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n\n\tprivate async shouldContinue(input: Input<{}, { yes?: true }>): Promise<boolean> {\n\t\tconst yes = input.getOption('yes')\n\t\tif (yes) {\n\t\t\treturn true\n\t\t}\n\t\tconst { action } = await prompts({\n\t\t\ttype: 'select',\n\t\t\tname: 'action',\n\t\t\tmessage: 'Do you want to continue?',\n\t\t\tchoices: [\n\t\t\t\t{ value: 'yes', title: 'Yes' },\n\t\t\t\t{ value: 'no', title: 'Abort' },\n\t\t\t],\n\t\t})\n\t\treturn action === 'yes'\n\t}\n}\n"],"names":["Command","emptySchema","InvalidSchemaException","printValidationErrors"],"mappings":"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"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Command } from "@contember/cli-common";
|
|
2
|
+
import { InvalidSchemaException } from "@contember/schema-migrations";
|
|
3
|
+
import prompts from "prompts";
|
|
4
|
+
import { emptySchema } from "@contember/schema-utils";
|
|
5
|
+
import { printValidationErrors } from "../../lib/schema/SchemaValidationPrinter.js";
|
|
6
|
+
class MigrationAmendCommand extends Command {
|
|
7
|
+
constructor(migrationsResolver, systemApiClientProvider, migrationsStatusFacade, schemaLoader, schemaVersionBuilder, migrationCreator, migrationsValidator, migrationPrinter, schemaMigrator) {
|
|
8
|
+
super();
|
|
9
|
+
this.migrationsResolver = migrationsResolver;
|
|
10
|
+
this.systemApiClientProvider = systemApiClientProvider;
|
|
11
|
+
this.migrationsStatusFacade = migrationsStatusFacade;
|
|
12
|
+
this.schemaLoader = schemaLoader;
|
|
13
|
+
this.schemaVersionBuilder = schemaVersionBuilder;
|
|
14
|
+
this.migrationCreator = migrationCreator;
|
|
15
|
+
this.migrationsValidator = migrationsValidator;
|
|
16
|
+
this.migrationPrinter = migrationPrinter;
|
|
17
|
+
this.schemaMigrator = schemaMigrator;
|
|
18
|
+
}
|
|
19
|
+
configure(configuration) {
|
|
20
|
+
configuration.description("Amends latest migration");
|
|
21
|
+
configuration.argument("migration").optional();
|
|
22
|
+
configuration.option("force").description("Ignore migrations order and missing migrations (dev only)");
|
|
23
|
+
configuration.option("yes").valueNone().description("Do not ask for confirmation.");
|
|
24
|
+
}
|
|
25
|
+
async execute(input) {
|
|
26
|
+
const migrationName = input.getArgument("migration");
|
|
27
|
+
const amendMigration = migrationName ? await this.migrationsResolver.findSchemaMigrationByVersion(migrationName) : await this.migrationsResolver.findLatestSchemaMigration();
|
|
28
|
+
if (!amendMigration) {
|
|
29
|
+
throw "No migration to amend";
|
|
30
|
+
}
|
|
31
|
+
const force = input.getOption("force");
|
|
32
|
+
const status = await this.migrationsStatusFacade.resolveMigrationsStatus({ force });
|
|
33
|
+
if (status.migrationsToExecute.length > 0) {
|
|
34
|
+
throw `Some migrations are not executed. Unable to amend.`;
|
|
35
|
+
}
|
|
36
|
+
const schema = await this.schemaLoader.loadSchema();
|
|
37
|
+
try {
|
|
38
|
+
const initialSchema = await this.schemaVersionBuilder.buildSchema();
|
|
39
|
+
const intermediateResult = await this.migrationCreator.prepareMigration(initialSchema, schema, "");
|
|
40
|
+
if (intermediateResult === null) {
|
|
41
|
+
console.log("Nothing to do");
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
if (amendMigration.formatVersion !== intermediateResult.migration.formatVersion) {
|
|
45
|
+
throw "Incompatible migration format version";
|
|
46
|
+
}
|
|
47
|
+
const prevSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(
|
|
48
|
+
emptySchema,
|
|
49
|
+
(version) => version < amendMigration.version
|
|
50
|
+
);
|
|
51
|
+
const newSchema = await this.schemaMigrator.applyModifications(
|
|
52
|
+
prevSchema,
|
|
53
|
+
[...amendMigration.modifications, ...intermediateResult.migration.modifications],
|
|
54
|
+
amendMigration.formatVersion
|
|
55
|
+
);
|
|
56
|
+
const newMigrationResult = await this.migrationCreator.prepareMigration(prevSchema, newSchema, "");
|
|
57
|
+
const followingMigrations = (await this.migrationsResolver.getSchemaMigrations()).filter(
|
|
58
|
+
(it) => it.version > amendMigration.version
|
|
59
|
+
);
|
|
60
|
+
const valid = await this.migrationsValidator.validate(
|
|
61
|
+
prevSchema,
|
|
62
|
+
[...newMigrationResult ? [newMigrationResult.migration] : [], ...followingMigrations]
|
|
63
|
+
);
|
|
64
|
+
if (!valid) {
|
|
65
|
+
throw `Cannot amend migration`;
|
|
66
|
+
}
|
|
67
|
+
this.migrationPrinter.printMigrationDescription(
|
|
68
|
+
intermediateResult.initialSchema,
|
|
69
|
+
intermediateResult.migration,
|
|
70
|
+
{ noSql: true }
|
|
71
|
+
);
|
|
72
|
+
console.log(`Amending ${amendMigration.name}`);
|
|
73
|
+
if (!await this.shouldContinue(input)) {
|
|
74
|
+
console.log("Aborting");
|
|
75
|
+
return 1;
|
|
76
|
+
}
|
|
77
|
+
const systemClient = this.systemApiClientProvider.get();
|
|
78
|
+
await systemClient.migrate([intermediateResult.migration], force);
|
|
79
|
+
await systemClient.migrationDelete(intermediateResult.migration.version);
|
|
80
|
+
if (!newMigrationResult) {
|
|
81
|
+
await this.migrationCreator.removeMigration(amendMigration.name);
|
|
82
|
+
await systemClient.migrationDelete(amendMigration.version);
|
|
83
|
+
console.log("Latest migration was removed");
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
const newMigration = {
|
|
87
|
+
name: amendMigration.name,
|
|
88
|
+
version: amendMigration.version,
|
|
89
|
+
formatVersion: newMigrationResult.migration.formatVersion,
|
|
90
|
+
modifications: newMigrationResult.migration.modifications
|
|
91
|
+
};
|
|
92
|
+
await this.migrationCreator.saveMigration(newMigration);
|
|
93
|
+
await systemClient.migrationModify(amendMigration.version, newMigration);
|
|
94
|
+
return 0;
|
|
95
|
+
} catch (e) {
|
|
96
|
+
if (e instanceof InvalidSchemaException) {
|
|
97
|
+
printValidationErrors(e.validationErrors, e.message);
|
|
98
|
+
return 1;
|
|
99
|
+
}
|
|
100
|
+
throw e;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async shouldContinue(input) {
|
|
104
|
+
const yes = input.getOption("yes");
|
|
105
|
+
if (yes) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
const { action } = await prompts({
|
|
109
|
+
type: "select",
|
|
110
|
+
name: "action",
|
|
111
|
+
message: "Do you want to continue?",
|
|
112
|
+
choices: [
|
|
113
|
+
{ value: "yes", title: "Yes" },
|
|
114
|
+
{ value: "no", title: "Abort" }
|
|
115
|
+
]
|
|
116
|
+
});
|
|
117
|
+
return action === "yes";
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
MigrationAmendCommand
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=MigrationAmendCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MigrationAmendCommand.js","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationAmendCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { InvalidSchemaException, SchemaMigrator } from '@contember/schema-migrations'\nimport prompts from 'prompts'\nimport { emptySchema } from '@contember/schema-utils'\nimport { MigrationCreator, MigrationsResolver, SchemaVersionBuilder, SystemClient } from '@contember/migrations-client'\nimport { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade'\nimport { SchemaLoader } from '../../lib/schema/SchemaLoader'\nimport { MigrationsValidator } from '../../lib/migrations/MigrationsValidator'\nimport { MigrationPrinter } from '../../lib/migrations/MigrationPrinter'\nimport { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter'\nimport { SystemClientProvider } from '../../lib/SystemClientProvider'\n\ntype Args = {\n\tmigration?: string\n}\n\ntype Options = {\n\tyes?: true\n\tforce: boolean\n}\n\nexport class MigrationAmendCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationsResolver: MigrationsResolver,\n\t\tprivate readonly systemApiClientProvider: SystemClientProvider,\n\t\tprivate readonly migrationsStatusFacade: MigrationsStatusFacade,\n\t\tprivate readonly schemaLoader: SchemaLoader,\n\t\tprivate readonly schemaVersionBuilder: SchemaVersionBuilder,\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t\tprivate readonly migrationsValidator: MigrationsValidator,\n\t\tprivate readonly migrationPrinter: MigrationPrinter,\n\t\tprivate readonly schemaMigrator: SchemaMigrator,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Amends latest migration')\n\t\tconfiguration.argument('migration').optional()\n\t\tconfiguration.option('force').description('Ignore migrations order and missing migrations (dev only)')\n\t\tconfiguration //\n\t\t\t.option('yes')\n\t\t\t.valueNone()\n\t\t\t.description('Do not ask for confirmation.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<number> {\n\t\tconst migrationName = input.getArgument('migration')\n\t\tconst amendMigration = migrationName\n\t\t\t? await this.migrationsResolver.findSchemaMigrationByVersion(migrationName)\n\t\t\t: await this.migrationsResolver.findLatestSchemaMigration()\n\t\tif (!amendMigration) {\n\t\t\tthrow 'No migration to amend'\n\t\t}\n\t\tconst force = input.getOption('force')\n\t\tconst status = await this.migrationsStatusFacade.resolveMigrationsStatus({ force })\n\t\tif (status.migrationsToExecute.length > 0) {\n\t\t\tthrow `Some migrations are not executed. Unable to amend.`\n\t\t}\n\n\n\t\tconst schema = await this.schemaLoader.loadSchema()\n\t\ttry {\n\t\t\tconst initialSchema = await this.schemaVersionBuilder.buildSchema()\n\t\t\tconst intermediateResult = await this.migrationCreator.prepareMigration(initialSchema, schema, '')\n\t\t\tif (intermediateResult === null) {\n\t\t\t\tconsole.log('Nothing to do')\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (amendMigration.formatVersion !== intermediateResult.migration.formatVersion) {\n\t\t\t\tthrow 'Incompatible migration format version'\n\t\t\t}\n\t\t\tconst prevSchema = await this.schemaVersionBuilder.buildSchemaAdvanced(\n\t\t\t\temptySchema,\n\t\t\t\tversion => version < amendMigration.version,\n\t\t\t)\n\t\t\tconst newSchema = await this.schemaMigrator.applyModifications(\n\t\t\t\tprevSchema,\n\t\t\t\t[...amendMigration.modifications, ...intermediateResult.migration.modifications],\n\t\t\t\tamendMigration.formatVersion,\n\t\t\t)\n\t\t\tconst newMigrationResult = await this.migrationCreator.prepareMigration(prevSchema, newSchema, '')\n\t\t\tconst followingMigrations = (await this.migrationsResolver.getSchemaMigrations()).filter(\n\t\t\t\tit => it.version > amendMigration.version,\n\t\t\t)\n\n\t\t\tconst valid = await this.migrationsValidator.validate(\n\t\t\t\tprevSchema,\n\t\t\t\t[...(newMigrationResult ? [newMigrationResult.migration] : []), ...followingMigrations],\n\t\t\t)\n\t\t\tif (!valid) {\n\t\t\t\tthrow `Cannot amend migration`\n\t\t\t}\n\n\t\t\tthis.migrationPrinter.printMigrationDescription(\n\t\t\t\tintermediateResult.initialSchema,\n\t\t\t\tintermediateResult.migration,\n\t\t\t\t{ noSql: true },\n\t\t\t)\n\t\t\tconsole.log(`Amending ${amendMigration.name}`)\n\t\t\tif (!(await this.shouldContinue(input))) {\n\t\t\t\tconsole.log('Aborting')\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\tconst systemClient = this.systemApiClientProvider.get()\n\t\t\tawait systemClient.migrate([intermediateResult.migration], force)\n\t\t\tawait systemClient.migrationDelete(intermediateResult.migration.version)\n\n\t\t\tif (!newMigrationResult) {\n\t\t\t\tawait this.migrationCreator.removeMigration(amendMigration.name)\n\t\t\t\tawait systemClient.migrationDelete(amendMigration.version)\n\t\t\t\tconsole.log('Latest migration was removed')\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tconst newMigration = {\n\t\t\t\tname: amendMigration.name,\n\t\t\t\tversion: amendMigration.version,\n\t\t\t\tformatVersion: newMigrationResult.migration.formatVersion,\n\t\t\t\tmodifications: newMigrationResult.migration.modifications,\n\t\t\t}\n\t\t\tawait this.migrationCreator.saveMigration(newMigration)\n\t\t\tawait systemClient.migrationModify(amendMigration.version, newMigration)\n\n\t\t\treturn 0\n\t\t} catch (e) {\n\t\t\tif (e instanceof InvalidSchemaException) {\n\t\t\t\tprintValidationErrors(e.validationErrors, e.message)\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n\n\tprivate async shouldContinue(input: Input<{}, { yes?: true }>): Promise<boolean> {\n\t\tconst yes = input.getOption('yes')\n\t\tif (yes) {\n\t\t\treturn true\n\t\t}\n\t\tconst { action } = await prompts({\n\t\t\ttype: 'select',\n\t\t\tname: 'action',\n\t\t\tmessage: 'Do you want to continue?',\n\t\t\tchoices: [\n\t\t\t\t{ value: 'yes', title: 'Yes' },\n\t\t\t\t{ value: 'no', title: 'Abort' },\n\t\t\t],\n\t\t})\n\t\treturn action === 'yes'\n\t}\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const cliCommon = require("@contember/cli-common");
|
|
4
|
+
class MigrationBlankCommand extends cliCommon.Command {
|
|
5
|
+
constructor(migrationCreator) {
|
|
6
|
+
super();
|
|
7
|
+
this.migrationCreator = migrationCreator;
|
|
8
|
+
}
|
|
9
|
+
configure(configuration) {
|
|
10
|
+
configuration.description("Creates new blank migration file");
|
|
11
|
+
configuration.argument("migrationName");
|
|
12
|
+
configuration.argument("format").optional().validator((it) => !it || ["js", "ts", "json"].includes(it)).description("Migration file format (js, ts, json), default is ts.");
|
|
13
|
+
}
|
|
14
|
+
async execute(input) {
|
|
15
|
+
const migrationName = input.getArgument("migrationName");
|
|
16
|
+
const migrationFormat = input.getArgument("format") || "ts";
|
|
17
|
+
const filename = await this.migrationCreator.createEmptyMigrationFile(migrationName, migrationFormat);
|
|
18
|
+
console.log(`${filename} created`);
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.MigrationBlankCommand = MigrationBlankCommand;
|
|
23
|
+
//# sourceMappingURL=MigrationBlankCommand.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MigrationBlankCommand.cjs","sources":["../../../../../../packages/cli/src/commands/migrations/MigrationBlankCommand.ts"],"sourcesContent":["import { Command, CommandConfiguration, Input } from '@contember/cli-common'\nimport { MigrationCreator } from '@contember/migrations-client'\n\ntype Args = {\n\tmigrationName: string\n\tformat?: string\n}\n\ntype Options = {\n}\n\nexport class MigrationBlankCommand extends Command<Args, Options> {\n\tconstructor(\n\t\tprivate readonly migrationCreator: MigrationCreator,\n\t) {\n\t\tsuper()\n\t}\n\n\tprotected configure(configuration: CommandConfiguration<Args, Options>): void {\n\t\tconfiguration.description('Creates new blank migration file')\n\t\tconfiguration.argument('migrationName')\n\t\tconfiguration.argument('format').optional().validator(it => !it || ['js', 'ts', 'json'].includes(it))\n\t\t\t.description('Migration file format (js, ts, json), default is ts.')\n\t}\n\n\tprotected async execute(input: Input<Args, Options>): Promise<number> {\n\t\tconst migrationName = input.getArgument('migrationName')\n\t\tconst migrationFormat = input.getArgument('format') || 'ts'\n\t\tconst filename = await this.migrationCreator.createEmptyMigrationFile(migrationName, migrationFormat)\n\t\tconsole.log(`${filename} created`)\n\t\treturn 0\n\t}\n}\n\n"],"names":["Command"],"mappings":";;;AAWO,MAAM,8BAA8BA,UAAAA,QAAuB;AAAA,EACjE,YACkB,kBAChB;AACK;AAFW,SAAA,mBAAA;AAAA,EAGlB;AAAA,EAEU,UAAU,eAA0D;AAC7E,kBAAc,YAAY,kCAAkC;AAC5D,kBAAc,SAAS,eAAe;AACtC,kBAAc,SAAS,QAAQ,EAAE,SAAW,EAAA,UAAU,QAAM,CAAC,MAAM,CAAC,MAAM,MAAM,MAAM,EAAE,SAAS,EAAE,CAAC,EAClG,YAAY,sDAAsD;AAAA,EACrE;AAAA,EAEA,MAAgB,QAAQ,OAA8C;AAC/D,UAAA,gBAAgB,MAAM,YAAY,eAAe;AACvD,UAAM,kBAAkB,MAAM,YAAY,QAAQ,KAAK;AACvD,UAAM,WAAW,MAAM,KAAK,iBAAiB,yBAAyB,eAAe,eAAe;AAC5F,YAAA,IAAI,GAAG,QAAQ,UAAU;AAC1B,WAAA;AAAA,EACR;AACD;;"}
|