@contember/cli 2.1.0-alpha.3 → 2.1.0-alpha.35
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/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs +31 -0
- package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -0
- package/dist/development/src/commands/actions/ActionsGetEventCommand.js +31 -0
- package/dist/development/src/commands/actions/ActionsGetEventCommand.js.map +1 -0
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs +60 -0
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -0
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js +60 -0
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -0
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs +29 -0
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -0
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.js +29 -0
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.js.map +1 -0
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs +32 -0
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -0
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.js +32 -0
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.js.map +1 -0
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs +43 -0
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -0
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js +43 -0
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -0
- package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs +32 -0
- package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -0
- package/dist/development/src/commands/actions/ActionsStopEventCommand.js +32 -0
- package/dist/development/src/commands/actions/ActionsStopEventCommand.js.map +1 -0
- package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/development/src/commands/misc/VersionCommand.cjs.map +1 -1
- package/dist/development/src/commands/misc/VersionCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/ExportCommand.cjs +7 -2
- package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ExportCommand.js +8 -3
- package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.cjs +7 -4
- package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.js +5 -2
- package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.cjs +4 -5
- package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.js +4 -5
- package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/utils.cjs.map +1 -1
- package/dist/development/src/commands/transfer/utils.js.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +16 -14
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js +16 -14
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/development/src/consts.cjs.map +1 -1
- package/dist/development/src/dic.cjs +100 -4
- package/dist/development/src/dic.cjs.map +1 -1
- package/dist/development/src/dic.js +101 -5
- package/dist/development/src/dic.js.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/development/src/lib/VersionChecker.cjs +7 -9
- package/dist/development/src/lib/VersionChecker.cjs.map +1 -1
- package/dist/development/src/lib/VersionChecker.js +7 -9
- package/dist/development/src/lib/VersionChecker.js.map +1 -1
- package/dist/development/src/lib/actions/ActionsClient.cjs +91 -0
- package/dist/development/src/lib/actions/ActionsClient.cjs.map +1 -0
- package/dist/development/src/lib/actions/ActionsClient.js +91 -0
- package/dist/development/src/lib/actions/ActionsClient.js.map +1 -0
- package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/development/src/lib/assertNever.cjs.map +1 -1
- package/dist/development/src/lib/assertNever.js.map +1 -1
- package/dist/development/src/lib/dsn.cjs.map +1 -1
- package/dist/development/src/lib/dsn.js.map +1 -1
- package/dist/development/src/lib/env.cjs.map +1 -1
- package/dist/development/src/lib/env.js.map +1 -1
- package/dist/development/src/lib/fs/DockerComposeManager.cjs.map +1 -1
- package/dist/development/src/lib/fs/DockerComposeManager.js.map +1 -1
- package/dist/development/src/lib/fs/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/fs/FileSystem.js.map +1 -1
- package/dist/development/src/lib/fs/YamlHandler.cjs.map +1 -1
- package/dist/development/src/lib/fs/YamlHandler.js.map +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.js.map +1 -1
- package/dist/development/src/lib/js/JsCodeRunner.cjs.map +1 -1
- package/dist/development/src/lib/js/JsCodeRunner.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs +2 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js +2 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs +7 -2
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.js +7 -2
- package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs +3 -3
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js +3 -3
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProject.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProject.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectResolver.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityInfo.cjs +135 -177
- package/dist/development/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityInfo.js +136 -178
- package/dist/development/src/lib/project/docs/components/EntityInfo.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityLink.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldLink.cjs +5 -5
- package/dist/development/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldLink.js +5 -5
- package/dist/development/src/lib/project/docs/components/FieldLink.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs +8 -8
- package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldPermissions.js +8 -8
- package/dist/development/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldType.cjs +34 -36
- package/dist/development/src/lib/project/docs/components/FieldType.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldType.js +34 -36
- package/dist/development/src/lib/project/docs/components/FieldType.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/OnDelete.cjs +22 -26
- package/dist/development/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/OnDelete.js +22 -26
- package/dist/development/src/lib/project/docs/components/OnDelete.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs +16 -16
- package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/ProjectInfo.js +16 -16
- package/dist/development/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/SinglePermission.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/SinglePermission.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/utils.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/utils.js.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.js.map +1 -1
- package/dist/development/src/lib/schema/SchemaLoader.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaLoader.js.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
- package/dist/development/src/lib/schema/collectReferences.cjs.map +1 -1
- package/dist/development/src/lib/schema/collectReferences.js.map +1 -1
- package/dist/development/src/lib/stream.cjs +0 -7
- package/dist/development/src/lib/stream.cjs.map +1 -1
- package/dist/development/src/lib/stream.js +1 -8
- package/dist/development/src/lib/stream.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.cjs +53 -61
- package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.js +55 -63
- package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/development/src/lib/transfer/stdio.cjs.map +1 -1
- package/dist/development/src/lib/transfer/stdio.js.map +1 -1
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs +4 -4
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
- package/dist/development/src/lib/workspace/WorkspaceResolver.js +5 -5
- package/dist/development/src/lib/workspace/WorkspaceResolver.js.map +1 -1
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +0 -0
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs +31 -0
- package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -0
- package/dist/production/src/commands/actions/ActionsGetEventCommand.js +31 -0
- package/dist/production/src/commands/actions/ActionsGetEventCommand.js.map +1 -0
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs +60 -0
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -0
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js +60 -0
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -0
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs +29 -0
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -0
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.js +29 -0
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.js.map +1 -0
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs +32 -0
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -0
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.js +32 -0
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.js.map +1 -0
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs +43 -0
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -0
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js +43 -0
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -0
- package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs +32 -0
- package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -0
- package/dist/production/src/commands/actions/ActionsStopEventCommand.js +32 -0
- package/dist/production/src/commands/actions/ActionsStopEventCommand.js.map +1 -0
- package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationBlankCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/production/src/commands/misc/VersionCommand.cjs.map +1 -1
- package/dist/production/src/commands/misc/VersionCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/ExportCommand.cjs +7 -2
- package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ExportCommand.js +8 -3
- package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.cjs +7 -4
- package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.js +5 -2
- package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.cjs +4 -5
- package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.js +4 -5
- package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/utils.cjs.map +1 -1
- package/dist/production/src/commands/transfer/utils.js.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs +16 -14
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js +16 -14
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/production/src/consts.cjs.map +1 -1
- package/dist/production/src/dic.cjs +100 -4
- package/dist/production/src/dic.cjs.map +1 -1
- package/dist/production/src/dic.js +101 -5
- package/dist/production/src/dic.js.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/production/src/lib/VersionChecker.cjs +7 -9
- package/dist/production/src/lib/VersionChecker.cjs.map +1 -1
- package/dist/production/src/lib/VersionChecker.js +7 -9
- package/dist/production/src/lib/VersionChecker.js.map +1 -1
- package/dist/production/src/lib/actions/ActionsClient.cjs +91 -0
- package/dist/production/src/lib/actions/ActionsClient.cjs.map +1 -0
- package/dist/production/src/lib/actions/ActionsClient.js +91 -0
- package/dist/production/src/lib/actions/ActionsClient.js.map +1 -0
- package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/production/src/lib/assertNever.cjs.map +1 -1
- package/dist/production/src/lib/assertNever.js.map +1 -1
- package/dist/production/src/lib/dsn.cjs.map +1 -1
- package/dist/production/src/lib/dsn.js.map +1 -1
- package/dist/production/src/lib/env.cjs.map +1 -1
- package/dist/production/src/lib/env.js.map +1 -1
- package/dist/production/src/lib/fs/DockerComposeManager.cjs.map +1 -1
- package/dist/production/src/lib/fs/DockerComposeManager.js.map +1 -1
- package/dist/production/src/lib/fs/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/fs/FileSystem.js.map +1 -1
- package/dist/production/src/lib/fs/YamlHandler.cjs.map +1 -1
- package/dist/production/src/lib/fs/YamlHandler.js.map +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.js.map +1 -1
- package/dist/production/src/lib/js/JsCodeRunner.cjs.map +1 -1
- package/dist/production/src/lib/js/JsCodeRunner.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs +2 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js +2 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs +7 -2
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.js +7 -2
- package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs +3 -3
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js +3 -3
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProject.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProject.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectResolver.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityInfo.cjs +39 -66
- package/dist/production/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityInfo.js +40 -67
- package/dist/production/src/lib/project/docs/components/EntityInfo.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityLink.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldLink.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldType.cjs +3 -5
- package/dist/production/src/lib/project/docs/components/FieldType.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldType.js +3 -5
- package/dist/production/src/lib/project/docs/components/FieldType.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/OnDelete.cjs +4 -8
- package/dist/production/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/OnDelete.js +4 -8
- package/dist/production/src/lib/project/docs/components/OnDelete.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/SinglePermission.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/SinglePermission.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/utils.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/utils.js.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -1
- package/dist/production/src/lib/schema/SchemaLoader.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaLoader.js.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationPrinter.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
- package/dist/production/src/lib/schema/collectReferences.cjs.map +1 -1
- package/dist/production/src/lib/schema/collectReferences.js.map +1 -1
- package/dist/production/src/lib/stream.cjs +0 -7
- package/dist/production/src/lib/stream.cjs.map +1 -1
- package/dist/production/src/lib/stream.js +1 -8
- package/dist/production/src/lib/stream.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.cjs +53 -61
- package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.js +55 -63
- package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/production/src/lib/transfer/stdio.cjs.map +1 -1
- package/dist/production/src/lib/transfer/stdio.js.map +1 -1
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs +4 -4
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
- package/dist/production/src/lib/workspace/WorkspaceResolver.js +5 -5
- package/dist/production/src/lib/workspace/WorkspaceResolver.js.map +1 -1
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts +16 -0
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts.map +1 -0
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts +15 -0
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts.map +1 -0
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts +14 -0
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts.map +1 -0
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts +16 -0
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts.map +1 -0
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts +19 -0
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts.map +1 -0
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts +16 -0
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts.map +1 -0
- package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationBlankCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/ImportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/utils.d.ts.map +1 -1
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
- package/dist/types/dic.d.ts +18 -0
- package/dist/types/dic.d.ts.map +1 -1
- package/dist/types/lib/VersionChecker.d.ts.map +1 -1
- package/dist/types/lib/actions/ActionsClient.d.ts +33 -0
- package/dist/types/lib/actions/ActionsClient.d.ts.map +1 -0
- package/dist/types/lib/admin/AdminClient.d.ts.map +1 -1
- package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -1
- package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationPrinter.d.ts +1 -1
- package/dist/types/lib/migrations/MigrationPrinter.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +3 -1
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/FieldLink.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/FieldPermissions.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/FieldType.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/ProjectInfo.d.ts.map +1 -1
- package/dist/types/lib/project/docs/projectDescribe.d.ts.map +1 -1
- package/dist/types/lib/schema/SchemaValidationPrinter.d.ts.map +1 -1
- package/dist/types/lib/stream.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -1
- package/dist/types/lib/transfer/DataTransferClient.d.ts +2 -4
- package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
- package/package.json +39 -35
- package/src/commands/actions/ActionsGetEventCommand.ts +41 -0
- package/src/commands/actions/ActionsListFailedEventsCommand.ts +68 -0
- package/src/commands/actions/ActionsListVariablesCommand.ts +36 -0
- package/src/commands/actions/ActionsRetryEventCommand.ts +42 -0
- package/src/commands/actions/ActionsSetVariablesCommand.ts +62 -0
- package/src/commands/actions/ActionsStopEventCommand.ts +42 -0
- package/src/commands/deploy/DeployCommand.ts +0 -3
- package/src/commands/migrations/MigrationAmendCommand.ts +2 -2
- package/src/commands/migrations/MigrationBlankCommand.ts +1 -3
- package/src/commands/migrations/MigrationDescribeCommand.ts +0 -1
- package/src/commands/migrations/MigrationDiffCommand.ts +0 -2
- package/src/commands/migrations/MigrationExecuteCommand.ts +1 -2
- package/src/commands/migrations/MigrationRebaseCommand.ts +0 -2
- package/src/commands/migrations/MigrationStatusCommand.ts +8 -13
- package/src/commands/project/ProjectGenerateDocumentationCommand.ts +1 -2
- package/src/commands/project/ProjectPrintSchemaCommand.ts +1 -3
- package/src/commands/transfer/ExportCommand.ts +9 -4
- package/src/commands/transfer/ImportCommand.ts +7 -3
- package/src/commands/transfer/TransferCommand.ts +6 -6
- package/src/commands/transfer/utils.ts +0 -1
- package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +16 -14
- package/src/dic.ts +162 -103
- package/src/lib/VersionChecker.ts +11 -9
- package/src/lib/actions/ActionsClient.ts +111 -0
- package/src/lib/admin/AdminClient.ts +2 -2
- package/src/lib/admin/AdminDeployer.ts +0 -1
- package/src/lib/fs/DockerComposeManager.ts +0 -3
- package/src/lib/migrations/MigrationExecutionFacade.ts +1 -0
- package/src/lib/migrations/MigrationPrinter.ts +7 -4
- package/src/lib/migrations/MigrationsStatusFacade.ts +4 -4
- package/src/lib/project/RemoteProjectResolver.ts +2 -2
- package/src/lib/project/docs/components/EntityInfo.tsx +36 -31
- package/src/lib/project/docs/components/FieldLink.tsx +5 -1
- package/src/lib/project/docs/components/FieldPermissions.tsx +8 -6
- package/src/lib/project/docs/components/FieldType.tsx +31 -30
- package/src/lib/project/docs/components/OnDelete.tsx +15 -13
- package/src/lib/project/docs/components/ProjectInfo.tsx +1 -4
- package/src/lib/project/docs/components/SinglePermission.tsx +0 -1
- package/src/lib/project/docs/components/utils.ts +0 -1
- package/src/lib/project/docs/projectDescribe.tsx +0 -2
- package/src/lib/project/docs/resources/style.css +2 -3
- package/src/lib/schema/SchemaLoader.ts +1 -1
- package/src/lib/schema/SchemaValidationPrinter.ts +0 -1
- package/src/lib/stream.ts +7 -8
- package/src/lib/tenant/TenantClient.ts +0 -1
- package/src/lib/transfer/DataTransferClient.ts +56 -74
- package/src/lib/transfer/stdio.ts +0 -1
- package/src/lib/workspace/WorkspaceResolver.ts +5 -5
- package/src/run.ts +2 -5
- package/dist/development/src/lib/migrations/migrations.cjs +0 -43
- package/dist/development/src/lib/migrations/migrations.cjs.map +0 -1
- package/dist/development/src/lib/migrations/migrations.js +0 -43
- package/dist/development/src/lib/migrations/migrations.js.map +0 -1
- package/dist/production/src/lib/migrations/migrations.cjs +0 -43
- package/dist/production/src/lib/migrations/migrations.cjs.map +0 -1
- package/dist/production/src/lib/migrations/migrations.js +0 -43
- package/dist/production/src/lib/migrations/migrations.js.map +0 -1
- package/dist/types/lib/migrations/migrations.d.ts +0 -3
- package/dist/types/lib/migrations/migrations.d.ts.map +0 -1
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/postcss.config.js +0 -6
- package/src/.eslintrc.cjs +0 -5
- package/src/lib/migrations/migrations.ts +0 -45
- package/src/lib/project/docs/.eslintrc.cjs +0 -5
- package/tailwind.config.js +0 -7
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { MigrationsResolver, MigrationsStatusResolver
|
|
2
|
-
import { createMigrationStatusTable } from './migrations'
|
|
1
|
+
import { MigrationsResolver, MigrationsStatusResolver } from '@contember/migrations-client'
|
|
3
2
|
import { SystemClientProvider } from '../SystemClientProvider'
|
|
3
|
+
import { MigrationPrinter } from './MigrationPrinter'
|
|
4
4
|
|
|
5
5
|
export class MigrationsStatusFacade {
|
|
6
6
|
constructor(
|
|
7
7
|
private readonly systemClientProvider: SystemClientProvider,
|
|
8
8
|
private readonly migrationsResolver: MigrationsResolver,
|
|
9
9
|
private readonly migrationsStatusResolver: MigrationsStatusResolver,
|
|
10
|
+
private readonly migrationPrinter: MigrationPrinter,
|
|
10
11
|
) {
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
|
|
14
14
|
public resolveMigrationsStatus = async ({ force, allowError }: { force?: boolean; allowError?: boolean }) => {
|
|
15
15
|
const executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()
|
|
16
16
|
const localMigrations = await this.migrationsResolver.getMigrationFiles()
|
|
17
17
|
const status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)
|
|
18
18
|
if (status.errorMigrations.length > 0 && !allowError) {
|
|
19
|
-
console.error(
|
|
19
|
+
console.error(this.migrationPrinter.printStatusTable(status.errorMigrations))
|
|
20
20
|
if (!force) {
|
|
21
21
|
throw `Cannot execute migrations`
|
|
22
22
|
}
|
|
@@ -13,9 +13,9 @@ export class RemoteProjectResolver {
|
|
|
13
13
|
let token: string | undefined
|
|
14
14
|
let project: string | undefined
|
|
15
15
|
if (identifier?.includes('://')) {
|
|
16
|
-
({ endpoint, project, token } = parseDsn(identifier))
|
|
16
|
+
;({ endpoint, project, token } = parseDsn(identifier))
|
|
17
17
|
} else if (this.cliEnv.dsn) {
|
|
18
|
-
({ endpoint, project, token } = parseDsn(this.cliEnv.dsn))
|
|
18
|
+
;({ endpoint, project, token } = parseDsn(this.cliEnv.dsn))
|
|
19
19
|
} else {
|
|
20
20
|
endpoint = this.cliEnv.apiUrl
|
|
21
21
|
token = this.cliEnv.apiToken
|
|
@@ -14,8 +14,7 @@ interface EntityInfoProps {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export const EntityInfo = ({ entity, schema, references }: EntityInfoProps) => (
|
|
17
|
-
<div class={'m-4 border border-gray-400 rounded-lg group'}
|
|
18
|
-
id={formatEntityAnchor(entity.name)}>
|
|
17
|
+
<div class={'m-4 border border-gray-400 rounded-lg group'} id={formatEntityAnchor(entity.name)}>
|
|
19
18
|
<div class={'font-bold text-gray-900 py-2 px-4 border-b border-gray-400 group-target:bg-yellow-100 rounded-t-lg'}>
|
|
20
19
|
{entity.name}
|
|
21
20
|
</div>
|
|
@@ -26,60 +25,66 @@ export const EntityInfo = ({ entity, schema, references }: EntityInfoProps) => (
|
|
|
26
25
|
<tr>
|
|
27
26
|
<th class={'text-left px-2 text-gray-500 font-normal w-[180px] max-w-[180px]'}>Name</th>
|
|
28
27
|
<th class={'text-left px-2 text-gray-500 font-normal w-[340px] max-w-[340px]'}>Type</th>
|
|
29
|
-
{Object.keys(schema.acl.roles).map(role =>
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
{Object.keys(schema.acl.roles).map(role => (
|
|
29
|
+
<th
|
|
30
|
+
key={role}
|
|
31
|
+
class={'text-left px-2 text-gray-500 font-normal w-[120px] max-w-[120px] text-xs truncate text-sm'}
|
|
32
|
+
>
|
|
33
|
+
{role}
|
|
34
|
+
</th>
|
|
35
|
+
))}
|
|
32
36
|
</tr>
|
|
33
37
|
</thead>
|
|
34
38
|
<tr>
|
|
35
39
|
<td></td>
|
|
36
40
|
<td></td>
|
|
37
|
-
{Object.entries(schema.acl.roles).map(([name, role]) =>
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
{Object.entries(schema.acl.roles).map(([name, role]) => (
|
|
42
|
+
<td class={'px-2'} key={name}>
|
|
43
|
+
<SinglePermission value={'D'} predicate={role.entities[entity.name]?.operations.delete} />
|
|
44
|
+
</td>
|
|
45
|
+
))}
|
|
41
46
|
</tr>
|
|
42
47
|
{Object.values(entity.fields).map(field => (
|
|
43
|
-
<tr class={'even:bg-gray-100 target:bg-yellow-100'}
|
|
44
|
-
id={formatFieldAnchor(entity.name, field.name)}
|
|
45
|
-
key={field.name}
|
|
46
|
-
>
|
|
48
|
+
<tr class={'even:bg-gray-100 target:bg-yellow-100'} id={formatFieldAnchor(entity.name, field.name)} key={field.name}>
|
|
47
49
|
<td class={'px-2 font-mono truncate w-[180px] max-w-[180px]'} title={field.name}>
|
|
48
50
|
{field.name}
|
|
49
51
|
</td>
|
|
50
52
|
<td class={'text-gray-800 px-2 font-mono w-[420px] max-w-[420px]'}>
|
|
51
53
|
<FieldType field={field} />
|
|
52
54
|
</td>
|
|
53
|
-
{Object.entries(schema.acl.roles).map(([name, role]) =>
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
{Object.entries(schema.acl.roles).map(([name, role]) => (
|
|
56
|
+
<td class={'px-2'} key={name}>
|
|
57
|
+
<FieldPermissions field={field.name} entityPermissions={role.entities[entity.name]} />
|
|
58
|
+
</td>
|
|
59
|
+
))}
|
|
57
60
|
</tr>
|
|
58
61
|
))}
|
|
59
|
-
|
|
60
62
|
</table>
|
|
61
63
|
</div>
|
|
62
64
|
<div class={'px-2 py-2 w-1/2'}>
|
|
63
65
|
<h3 class={'text-lg text-gray-600'}>On delete behaviour:</h3>
|
|
64
66
|
<p class={'text-gray-500 text-sm'}>
|
|
65
|
-
(What happens when you attempt to delete entity {entity.name})
|
|
67
|
+
(What happens when you attempt to delete entity {entity.name})
|
|
68
|
+
</p>
|
|
66
69
|
<div class={'mt-2 text-sm '}>
|
|
67
70
|
<OnDelete references={references} entity={entity} />
|
|
68
71
|
</div>
|
|
69
72
|
</div>
|
|
70
|
-
{false &&
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
{
|
|
74
|
-
Object.entries(
|
|
75
|
-
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
{false && (
|
|
74
|
+
<div class={'px-2 py-2 w-1/2'}>
|
|
75
|
+
<h3 class={'text-lg text-gray-600'}>ACL predicates:</h3>
|
|
76
|
+
<div class={'mt-2 text-sm '}>
|
|
77
|
+
{Object.entries(schema.acl.roles).map(([roleName, role]) =>
|
|
78
|
+
Object.entries(role.entities[entity.name]?.predicates ?? {}).map(([predicateName, predicate]) => (
|
|
79
|
+
<Fragment key={roleName + '__' + predicateName}>
|
|
80
|
+
<h4>{roleName}: {predicateName}</h4>
|
|
81
|
+
<code>{JSON.stringify(predicate)}</code>
|
|
82
|
+
</Fragment>
|
|
83
|
+
))
|
|
84
|
+
)}
|
|
85
|
+
</div>
|
|
81
86
|
</div>
|
|
82
|
-
|
|
87
|
+
)}
|
|
83
88
|
</div>
|
|
84
89
|
</div>
|
|
85
90
|
)
|
|
@@ -4,7 +4,11 @@ import { formatFieldAnchor } from './utils'
|
|
|
4
4
|
|
|
5
5
|
export const FieldLink = ({ entity, field, noEntityLabel }: { entity: string; field: string; noEntityLabel?: boolean }) => (
|
|
6
6
|
<Fragment>
|
|
7
|
-
{noEntityLabel ? '' :
|
|
7
|
+
{noEntityLabel ? '' : (
|
|
8
|
+
<Fragment>
|
|
9
|
+
<EntityLink entity={entity} />.
|
|
10
|
+
</Fragment>
|
|
11
|
+
)}
|
|
8
12
|
<a href={`#${formatFieldAnchor(entity, field)}`} class={'text-blue-500 hover:underline'}>{field}</a>
|
|
9
13
|
</Fragment>
|
|
10
14
|
)
|
|
@@ -2,13 +2,15 @@ import { Fragment, h } from 'preact'
|
|
|
2
2
|
import { Acl } from '@contember/schema'
|
|
3
3
|
import { SinglePermission } from './SinglePermission'
|
|
4
4
|
|
|
5
|
-
export const FieldPermissions
|
|
5
|
+
export const FieldPermissions = ({ entityPermissions, field }: { entityPermissions?: Acl.EntityPermissions; field: string }) => {
|
|
6
6
|
const readPermissions = entityPermissions?.operations.read?.[field]
|
|
7
7
|
const updatePermissions = entityPermissions?.operations.update?.[field]
|
|
8
8
|
const createPermissions = entityPermissions?.operations.create?.[field]
|
|
9
|
-
return
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
return (
|
|
10
|
+
<Fragment>
|
|
11
|
+
<SinglePermission value={'C'} predicate={createPermissions} />
|
|
12
|
+
<SinglePermission value={'R'} predicate={readPermissions} />
|
|
13
|
+
<SinglePermission value={'U'} predicate={updatePermissions} />
|
|
14
|
+
</Fragment>
|
|
15
|
+
)
|
|
14
16
|
}
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { Model } from '@contember/schema'
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment, h } from 'preact'
|
|
3
3
|
import { EntityLink } from './EntityLink'
|
|
4
4
|
import { FieldLink } from './FieldLink'
|
|
5
5
|
|
|
6
6
|
export const FieldType = ({ field }: { field: Model.AnyField }) => {
|
|
7
7
|
if (field.type === 'ManyHasMany') {
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<EntityLink entity={field.target} />[] <TargetField field={field} /> (m:n)
|
|
11
|
+
</>
|
|
12
|
+
)
|
|
13
13
|
} else if (field.type === 'OneHasMany') {
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<EntityLink entity={field.target} />[] <TargetField field={field} /> (1:n)
|
|
17
|
+
</>
|
|
18
|
+
)
|
|
19
19
|
} else if (field.type === 'OneHasOne') {
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<NullableMark field={field} />
|
|
23
|
+
<EntityLink entity={field.target} /> <TargetField field={field} /> (1:1)
|
|
24
|
+
</>
|
|
25
|
+
)
|
|
26
26
|
} else if (field.type === 'ManyHasOne') {
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
<NullableMark field={field} />
|
|
30
|
+
<EntityLink entity={field.target} /> <TargetField field={field} /> (m:1)
|
|
31
|
+
</>
|
|
32
|
+
)
|
|
33
33
|
} else {
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<NullableMark field={field} />
|
|
37
|
+
{field.type}
|
|
38
|
+
</>
|
|
39
|
+
)
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
const TargetField = ({ field }: {field: Model.AnyRelation}) => {
|
|
43
|
+
const TargetField = ({ field }: { field: Model.AnyRelation }) => {
|
|
43
44
|
if ('ownedBy' in field) {
|
|
44
45
|
return <FieldLink entity={field.target} field={field.ownedBy} noEntityLabel />
|
|
45
46
|
}
|
|
@@ -50,5 +51,5 @@ const TargetField = ({ field }: {field: Model.AnyRelation}) => {
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
const NullableMark = (props: { field: Model.NullableRelation | Model.AnyColumn }) => {
|
|
53
|
-
return props.field.nullable ? <span class={'font-bold color-black'}
|
|
54
|
+
return props.field.nullable ? <span class={'font-bold color-black'}>?</span> : null
|
|
54
55
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment, h } from 'preact'
|
|
2
2
|
import { Model } from '@contember/schema'
|
|
3
3
|
import { ReferenceMapEntry, ReferencesMap } from '../../../schema/collectReferences'
|
|
4
4
|
import { FieldLink } from './FieldLink'
|
|
@@ -36,37 +36,39 @@ export const OnDelete = ({ references, entity, visited = [] }: { references: Ref
|
|
|
36
36
|
.sort(sortReferences)
|
|
37
37
|
.map(it => {
|
|
38
38
|
const inverseDescr = it.targetRelation
|
|
39
|
-
?
|
|
39
|
+
? (
|
|
40
|
+
<>
|
|
41
|
+
see <FieldLink entity={entity.name} field={it.targetRelation.name} />
|
|
42
|
+
</>
|
|
43
|
+
)
|
|
40
44
|
: 'no inverse side'
|
|
41
45
|
if (it.owningRelation.joiningColumn.onDelete === 'restrict') {
|
|
42
46
|
return (
|
|
43
47
|
<li key={it.owningEntity.name + '_' + it.owningRelation.name}>
|
|
44
|
-
<span class={'bg-black text-white px-1'}>Fails</span> when referenced from
|
|
45
|
-
|
|
46
|
-
{' '}({inverseDescr})
|
|
48
|
+
<span class={'bg-black text-white px-1'}>Fails</span> when referenced from{' '}
|
|
49
|
+
<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} /> ({inverseDescr})
|
|
47
50
|
</li>
|
|
48
51
|
)
|
|
49
52
|
}
|
|
50
53
|
if (it.owningRelation.joiningColumn.onDelete === 'set null') {
|
|
51
54
|
return (
|
|
52
55
|
<li key={it.owningEntity.name + '_' + it.owningRelation.name}>
|
|
53
|
-
<span class={'bg-blue-400 text-white px-1'}>Sets null</span> at
|
|
54
|
-
{' '}
|
|
55
|
-
|
|
56
|
+
<span class={'bg-blue-400 text-white px-1'}>Sets null</span> at <FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />
|
|
57
|
+
{' '}
|
|
58
|
+
({inverseDescr})
|
|
56
59
|
</li>
|
|
57
60
|
)
|
|
58
61
|
}
|
|
59
62
|
if (it.owningRelation.joiningColumn.onDelete === 'cascade') {
|
|
60
63
|
return (
|
|
61
64
|
<li key={it.owningEntity.name + '_' + it.owningRelation.name}>
|
|
62
|
-
<span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} />
|
|
63
|
-
{
|
|
64
|
-
{' '}<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel />
|
|
65
|
-
{' '}({inverseDescr})
|
|
65
|
+
<span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} /> connected using{' '}
|
|
66
|
+
<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel /> ({inverseDescr})
|
|
66
67
|
<OnDelete entity={it.owningEntity} visited={[...visited, entity]} references={references} />
|
|
67
68
|
</li>
|
|
68
69
|
)
|
|
69
70
|
}
|
|
70
71
|
})}
|
|
71
|
-
</ul>
|
|
72
|
+
</ul>
|
|
73
|
+
)
|
|
72
74
|
}
|
|
@@ -4,7 +4,6 @@ import { collectReferences } from '../../../schema/collectReferences'
|
|
|
4
4
|
import { EntityLink } from './EntityLink'
|
|
5
5
|
import { EntityInfo } from './EntityInfo'
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
export const ProjectInfo = (props: { schema: Schema; projectName: string }) => {
|
|
9
8
|
const references = collectReferences(props.schema.model)
|
|
10
9
|
|
|
@@ -37,11 +36,9 @@ export const ProjectInfo = (props: { schema: Schema; projectName: string }) => {
|
|
|
37
36
|
</ul>
|
|
38
37
|
</div>
|
|
39
38
|
</div>
|
|
40
|
-
|
|
41
|
-
|
|
42
39
|
</div>
|
|
43
40
|
{Object.values(props.schema.model.entities).map(entity => (
|
|
44
|
-
<EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references}/>
|
|
41
|
+
<EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references} />
|
|
45
42
|
))}
|
|
46
43
|
</div>
|
|
47
44
|
)
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@tailwind utilities;
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@source "../../components/**/*.tsx";
|
|
@@ -28,7 +28,7 @@ export class TranspilingSchemaLoader {
|
|
|
28
28
|
loadSchema = async (): Promise<Schema> => {
|
|
29
29
|
const path = join(this.workspace.apiDir, 'index.ts')
|
|
30
30
|
|
|
31
|
-
const result =
|
|
31
|
+
const result = await this.jsCodeRunner.run(path)
|
|
32
32
|
return Typesafe.object({ default: schemaType })(result).default
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/lib/stream.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Stream, Transform } from 'node:stream'
|
|
2
2
|
import { Buffer } from 'node:buffer'
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
export class LineTransform extends Transform {
|
|
6
5
|
private chunks: Buffer[] = []
|
|
7
6
|
|
|
@@ -35,10 +34,10 @@ export class LineTransform extends Transform {
|
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})
|
|
37
|
+
export const readStream = async (stream: Stream) =>
|
|
38
|
+
new Promise<Buffer>((resolve, reject) => {
|
|
39
|
+
const chunks: Buffer[] = []
|
|
40
|
+
stream.on('error', err => reject(err))
|
|
41
|
+
stream.on('data', chunk => chunks.push(chunk))
|
|
42
|
+
stream.on('end', () => resolve(Buffer.concat(chunks)))
|
|
43
|
+
})
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { LineTransform, readStream } from '../stream'
|
|
4
|
-
import { Readable, Stream } from 'node:stream'
|
|
1
|
+
import { LineTransform } from '../stream'
|
|
2
|
+
import { Readable } from 'node:stream'
|
|
5
3
|
import { createGzip } from 'node:zlib'
|
|
6
4
|
import { RemoteProject } from '../project/RemoteProject'
|
|
7
5
|
|
|
8
6
|
export class DataTransferClient {
|
|
9
|
-
|
|
10
7
|
dataImport = async ({ printProgress, stream, project, gzip }: {
|
|
11
8
|
stream: Readable
|
|
12
9
|
project: RemoteProject
|
|
@@ -18,96 +15,81 @@ export class DataTransferClient {
|
|
|
18
15
|
let rowTotal = 0
|
|
19
16
|
let transferred = 0
|
|
20
17
|
let start = Date.now()
|
|
21
|
-
const inputStream = stream.pipe(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
18
|
+
const inputStream = stream.pipe(
|
|
19
|
+
new LineTransform(line => {
|
|
20
|
+
transferred += line.length + 1
|
|
21
|
+
if (line === '') {
|
|
22
|
+
return ''
|
|
23
|
+
}
|
|
24
|
+
const data = JSON.parse(line)
|
|
25
|
+
switch (data[0]) {
|
|
26
|
+
case 'importSystemSchemaBegin':
|
|
27
|
+
return JSON.stringify([data[0], { ...data[1], project: project.name }])
|
|
28
|
+
case 'importContentSchemaBegin':
|
|
29
|
+
return JSON.stringify([data[0], { ...data[1], project: project.name }])
|
|
30
|
+
case 'insertBegin':
|
|
31
|
+
table = data[1].table
|
|
32
|
+
rowCount = 0
|
|
33
|
+
break
|
|
34
|
+
case 'insertRow':
|
|
35
|
+
rowCount++
|
|
36
|
+
rowTotal++
|
|
37
|
+
break
|
|
38
|
+
case 'insertEnd':
|
|
39
|
+
break
|
|
40
|
+
}
|
|
41
|
+
if ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {
|
|
42
|
+
const mbs = Math.floor(transferred / 1024 / 1024).toString()
|
|
43
|
+
const durationS = Math.floor((Date.now() - start) / 1000)
|
|
44
|
+
printProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)
|
|
45
|
+
}
|
|
46
|
+
return line
|
|
47
|
+
}),
|
|
48
|
+
)
|
|
49
|
+
inputStream.on('error', err => {
|
|
50
|
+
throw new Error(`Input stream error: ${err}`)
|
|
51
|
+
})
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
const bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit
|
|
54
|
+
|
|
55
|
+
const response = await fetch(`${project.endpoint}/import`, {
|
|
54
56
|
headers: {
|
|
57
|
+
'Authorization': `Bearer ${project.token}`,
|
|
55
58
|
'Content-type': 'application/x-ndjson',
|
|
56
59
|
...(gzip ? { 'Content-Encoding': 'gzip' } : {}),
|
|
57
60
|
},
|
|
58
|
-
|
|
61
|
+
method: 'POST',
|
|
62
|
+
body: bodyStream,
|
|
63
|
+
...{ duplex: 'half' },
|
|
59
64
|
})
|
|
65
|
+
if (!response.ok) {
|
|
66
|
+
const responseBody = await response.text()
|
|
67
|
+
throw new Error(`Invalid response: ${response.statusText}\n${responseBody}`)
|
|
68
|
+
}
|
|
69
|
+
return response
|
|
60
70
|
}
|
|
61
71
|
|
|
62
|
-
|
|
63
72
|
dataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {
|
|
64
73
|
project: RemoteProject
|
|
65
74
|
excludeTables?: string[]
|
|
66
75
|
includeSystem: boolean
|
|
67
76
|
gzip: boolean
|
|
68
77
|
}) => {
|
|
69
|
-
|
|
70
|
-
url: `${baseUrl}/export`,
|
|
71
|
-
token,
|
|
78
|
+
const response = await fetch(`${baseUrl}/export`, {
|
|
72
79
|
headers: {
|
|
80
|
+
'Authorization': `Bearer ${token}`,
|
|
73
81
|
'Accept-Encoding': gzip ? 'gzip' : 'identity',
|
|
74
82
|
'Content-type': 'application/json',
|
|
75
83
|
},
|
|
84
|
+
method: 'POST',
|
|
76
85
|
body: JSON.stringify({
|
|
77
86
|
projects: [{ slug: project, system: includeSystem, excludeTables }],
|
|
78
87
|
}),
|
|
79
88
|
})
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
token: string
|
|
86
|
-
headers: Record<string, string>
|
|
87
|
-
body: any
|
|
88
|
-
}) => {
|
|
89
|
-
return await new Promise<http.IncomingMessage>((resolve, reject) => {
|
|
90
|
-
const req = (url.startsWith('https://') ? https : http).request(url, {
|
|
91
|
-
method: 'POST',
|
|
92
|
-
headers: {
|
|
93
|
-
Authorization: `Bearer ${token}`,
|
|
94
|
-
...headers,
|
|
95
|
-
},
|
|
96
|
-
}, async res => {
|
|
97
|
-
if (res.statusCode !== 200) {
|
|
98
|
-
const responseBody = (await readStream(res)).toString()
|
|
99
|
-
reject(new Error(`Invalid response: ${res.statusMessage}\n${responseBody}`))
|
|
100
|
-
} else {
|
|
101
|
-
resolve(res)
|
|
102
|
-
}
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
if (body instanceof Stream) {
|
|
106
|
-
body.pipe(req)
|
|
107
|
-
} else {
|
|
108
|
-
req.write(body)
|
|
109
|
-
req.end()
|
|
110
|
-
}
|
|
111
|
-
})
|
|
89
|
+
if (!response.ok) {
|
|
90
|
+
const responseBody = await response.text()
|
|
91
|
+
throw new Error(`Invalid response: ${response.statusText}\n${responseBody}`)
|
|
92
|
+
}
|
|
93
|
+
return response
|
|
112
94
|
}
|
|
113
95
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Workspace } from './Workspace'
|
|
2
|
-
import { join } from 'node:path'
|
|
2
|
+
import { join, resolve } from 'node:path'
|
|
3
3
|
import { YamlHandler } from '../fs/YamlHandler'
|
|
4
4
|
|
|
5
5
|
export interface LocalProjectConfig {
|
|
@@ -17,10 +17,10 @@ export class WorkspaceResolver {
|
|
|
17
17
|
|
|
18
18
|
resolve = async (baseDir: string): Promise<Workspace> => {
|
|
19
19
|
const config = await this.readConfig(baseDir)
|
|
20
|
-
const apiDir = config.apiDir
|
|
21
|
-
const migrationsDir = config.migrationsDir
|
|
22
|
-
const adminDir = config.adminDir === false ? undefined : (config.adminDir
|
|
23
|
-
const adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir
|
|
20
|
+
const apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, 'api')
|
|
21
|
+
const migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, 'migrations')
|
|
22
|
+
const adminDir = config.adminDir === false ? undefined : (config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, 'admin'))
|
|
23
|
+
const adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, 'dist'))
|
|
24
24
|
|
|
25
25
|
return {
|
|
26
26
|
baseDir,
|
package/src/run.ts
CHANGED
|
@@ -5,10 +5,8 @@ import { createContainer } from './dic'
|
|
|
5
5
|
import { readCliEnv } from './lib/env'
|
|
6
6
|
import { WorkspaceResolver } from './lib/workspace/WorkspaceResolver'
|
|
7
7
|
import { YamlHandler } from './lib/fs/YamlHandler'
|
|
8
|
-
import { FileSystem } from './lib/fs/FileSystem'
|
|
9
|
-
|
|
10
|
-
(async () => {
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
8
|
+
import { FileSystem } from './lib/fs/FileSystem'
|
|
9
|
+
;(async () => {
|
|
12
10
|
const version = require(join(packageRoot, 'package.json')).version
|
|
13
11
|
const nodeVersion = process.version.match(/^v?(\d+)\..+$/)
|
|
14
12
|
if (nodeVersion && Number(nodeVersion[1]) < 18) {
|
|
@@ -25,7 +23,6 @@ import { FileSystem } from './lib/fs/FileSystem';
|
|
|
25
23
|
runtime: process.title === 'bun' ? 'bun' : 'node',
|
|
26
24
|
})
|
|
27
25
|
|
|
28
|
-
|
|
29
26
|
await dic.application.run(process.argv.slice(2))
|
|
30
27
|
})().catch(e => {
|
|
31
28
|
console.log(e)
|