@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaLoader.js","sources":["../../../../../../packages/cli/src/lib/schema/SchemaLoader.ts"],"sourcesContent":["import { join } from 'node:path'\nimport { Schema } from '@contember/schema'\nimport { schemaType } from '@contember/schema-utils'\nimport { JsCodeRunner } from '../js/JsCodeRunner'\nimport * as Typesafe from '@contember/typesafe'\nimport { Workspace } from '../workspace/Workspace'\n\nexport class ImportSchemaLoader {\n\tconstructor(\n\t\tprivate readonly workspace: Workspace,\n\t) {\n\t}\n\n\tloadSchema = async (): Promise<Schema> => {\n\t\tconst path = join(this.workspace.apiDir, 'index.ts')\n\t\tconst result = await import(path)\n\t\treturn Typesafe.object({ default: schemaType })(result).default\n\t}\n}\n\nexport class TranspilingSchemaLoader {\n\tconstructor(\n\t\tprivate readonly workspace: Workspace,\n\t\tprivate readonly jsCodeRunner: JsCodeRunner,\n\t) {\n\t}\n\n\tloadSchema = async (): Promise<Schema> => {\n\t\tconst path = join(this.workspace.apiDir, 'index.ts')\n\n\t\tconst result =
|
|
1
|
+
{"version":3,"file":"SchemaLoader.js","sources":["../../../../../../packages/cli/src/lib/schema/SchemaLoader.ts"],"sourcesContent":["import { join } from 'node:path'\nimport { Schema } from '@contember/schema'\nimport { schemaType } from '@contember/schema-utils'\nimport { JsCodeRunner } from '../js/JsCodeRunner'\nimport * as Typesafe from '@contember/typesafe'\nimport { Workspace } from '../workspace/Workspace'\n\nexport class ImportSchemaLoader {\n\tconstructor(\n\t\tprivate readonly workspace: Workspace,\n\t) {\n\t}\n\n\tloadSchema = async (): Promise<Schema> => {\n\t\tconst path = join(this.workspace.apiDir, 'index.ts')\n\t\tconst result = await import(path)\n\t\treturn Typesafe.object({ default: schemaType })(result).default\n\t}\n}\n\nexport class TranspilingSchemaLoader {\n\tconstructor(\n\t\tprivate readonly workspace: Workspace,\n\t\tprivate readonly jsCodeRunner: JsCodeRunner,\n\t) {\n\t}\n\n\tloadSchema = async (): Promise<Schema> => {\n\t\tconst path = join(this.workspace.apiDir, 'index.ts')\n\n\t\tconst result = await this.jsCodeRunner.run(path)\n\t\treturn Typesafe.object({ default: schemaType })(result).default\n\t}\n}\n\nexport interface SchemaLoader {\n\tloadSchema(): Promise<Schema>\n}\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,YACkB,WAChB;AADgB,SAAA,YAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAO,KAAK,KAAK,UAAU,QAAQ,UAAU;AACnD,YAAM,SAAS,MAAM,OAAO;AAC5B,aAAO,SAAS,OAAO,EAAE,SAAS,YAAY,EAAE,MAAM,EAAE;AAAA,IACzD,CAAA;AAAA,EANA;AAOD;AAEO,MAAM,wBAAwB;AAAA,EACpC,YACkB,WACA,cAChB;AAFgB,SAAA,YAAA;AACA,SAAA,eAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAO,KAAK,KAAK,UAAU,QAAQ,UAAU;AAEnD,YAAM,SAAS,MAAM,KAAK,aAAa,IAAI,IAAI;AAC/C,aAAO,SAAS,OAAO,EAAE,SAAS,YAAY,EAAE,MAAM,EAAE;AAAA,IACzD,CAAA;AAAA,EAPA;AAQD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaValidationHelper.cjs","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationHelper.ts"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { SchemaValidator, SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { printValidationErrors } from './SchemaValidationPrinter'\n\nexport const validateSchemaAndPrintErrors = (schema: Schema, message?: string, skippedErrors?: SchemaValidatorSkippedErrors[]): boolean => {\n\tconst errors = SchemaValidator.validate(schema, skippedErrors)\n\tprintValidationErrors(errors, message)\n\treturn errors.length === 0\n}\n"],"names":["SchemaValidator","printValidationErrors"],"mappings":";;;;AAIO,MAAM,+BAA+B,CAAC,QAAgB,SAAkB,kBAA4D;AAC1I,QAAM,SAASA,
|
|
1
|
+
{"version":3,"file":"SchemaValidationHelper.cjs","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationHelper.ts"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { SchemaValidator, SchemaValidatorSkippedErrors } from '@contember/schema-utils'\nimport { printValidationErrors } from './SchemaValidationPrinter'\n\nexport const validateSchemaAndPrintErrors = (schema: Schema, message?: string, skippedErrors?: SchemaValidatorSkippedErrors[]): boolean => {\n\tconst errors = SchemaValidator.validate(schema, skippedErrors)\n\tprintValidationErrors(errors, message)\n\treturn errors.length === 0\n}\n"],"names":["SchemaValidator","printValidationErrors"],"mappings":";;;;AAIO,MAAM,+BAA+B,CAAC,QAAgB,SAAkB,kBAA4D;AAC1I,QAAM,SAASA,YAAAA,gBAAgB,SAAS,QAAQ,aAAa;AAC7DC,0BAAAA,sBAAsB,QAAQ,OAAO;AACrC,SAAO,OAAO,WAAW;AAC1B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaValidationPrinter.cjs","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationPrinter.ts"],"sourcesContent":["import { ValidationError } from '@contember/schema-utils'\n\
|
|
1
|
+
{"version":3,"file":"SchemaValidationPrinter.cjs","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationPrinter.ts"],"sourcesContent":["import { ValidationError } from '@contember/schema-utils'\n\nexport const printValidationErrors = (errors: ValidationError[], message?: string) => {\n\tif (errors.length === 0) {\n\t\treturn\n\t}\n\tconsole.group(message || 'Schema is invalid:')\n\tfor (const err of errors) {\n\t\tconsole.log(`${err.path.join('.')}: [${err.code}] ${err.message}`)\n\t}\n\tconsole.groupEnd()\n}\n"],"names":[],"mappings":";;AAEO,MAAM,wBAAwB,CAAC,QAA2B,YAAqB;AACrF,MAAI,OAAO,WAAW,GAAG;AACxB;AAAA,EACD;AACA,UAAQ,MAAM,WAAW,oBAAoB;AAC7C,aAAW,OAAO,QAAQ;AACzB,YAAQ,IAAI,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,MAAM,IAAI,IAAI,KAAK,IAAI,OAAO,EAAE;AAAA,EAClE;AACA,UAAQ,SAAA;AACT;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaValidationPrinter.js","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationPrinter.ts"],"sourcesContent":["import { ValidationError } from '@contember/schema-utils'\n\
|
|
1
|
+
{"version":3,"file":"SchemaValidationPrinter.js","sources":["../../../../../../packages/cli/src/lib/schema/SchemaValidationPrinter.ts"],"sourcesContent":["import { ValidationError } from '@contember/schema-utils'\n\nexport const printValidationErrors = (errors: ValidationError[], message?: string) => {\n\tif (errors.length === 0) {\n\t\treturn\n\t}\n\tconsole.group(message || 'Schema is invalid:')\n\tfor (const err of errors) {\n\t\tconsole.log(`${err.path.join('.')}: [${err.code}] ${err.message}`)\n\t}\n\tconsole.groupEnd()\n}\n"],"names":[],"mappings":"AAEO,MAAM,wBAAwB,CAAC,QAA2B,YAAqB;AACrF,MAAI,OAAO,WAAW,GAAG;AACxB;AAAA,EACD;AACA,UAAQ,MAAM,WAAW,oBAAoB;AAC7C,aAAW,OAAO,QAAQ;AACzB,YAAQ,IAAI,GAAG,IAAI,KAAK,KAAK,GAAG,CAAC,MAAM,IAAI,IAAI,KAAK,IAAI,OAAO,EAAE;AAAA,EAClE;AACA,UAAQ,SAAA;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectReferences.cjs","sources":["../../../../../../packages/cli/src/lib/schema/collectReferences.ts"],"sourcesContent":["import { Model } from '@contember/schema'\n\nexport type ReferenceMapEntry = {\n\towningEntity: Model.Entity\n\towningRelation: Model.OneHasOneOwningRelation | Model.ManyHasOneRelation\n\ttargetEntity: Model.Entity\n\ttargetRelation: Model.OneHasOneInverseRelation | Model.OneHasManyRelation | null\n}\nexport type ReferencesMap = Record<string, ReferenceMapEntry[]>\n\nexport const collectReferences = (model: Model.Schema): ReferencesMap => {\n\tconst entityReferences: ReferencesMap = Object.fromEntries(Object.keys(model.entities).map(it => [it, []]))\n\tfor (const entity of Object.values(model.entities)) {\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tswitch (field.type) {\n\t\t\t\tcase 'OneHasOne':\n\t\t\t\t\tconst targetEntity = model.entities[field.target]\n\t\t\t\t\tif (!('ownedBy' in field)) {\n\t\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\t\ttargetEntity: targetEntity,\n\t\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity.fields[field.inversedBy] as Model.OneHasOneInverseRelation : null,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'ManyHasOne':\n\t\t\t\t\tconst targetEntity2 = model.entities[field.target]\n\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\ttargetEntity: targetEntity2,\n\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity2.fields[field.inversedBy] as Model.OneHasManyRelation : null,\n\t\t\t\t\t})\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn entityReferences\n}\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"collectReferences.cjs","sources":["../../../../../../packages/cli/src/lib/schema/collectReferences.ts"],"sourcesContent":["import { Model } from '@contember/schema'\n\nexport type ReferenceMapEntry = {\n\towningEntity: Model.Entity\n\towningRelation: Model.OneHasOneOwningRelation | Model.ManyHasOneRelation\n\ttargetEntity: Model.Entity\n\ttargetRelation: Model.OneHasOneInverseRelation | Model.OneHasManyRelation | null\n}\nexport type ReferencesMap = Record<string, ReferenceMapEntry[]>\n\nexport const collectReferences = (model: Model.Schema): ReferencesMap => {\n\tconst entityReferences: ReferencesMap = Object.fromEntries(Object.keys(model.entities).map(it => [it, []]))\n\tfor (const entity of Object.values(model.entities)) {\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tswitch (field.type) {\n\t\t\t\tcase 'OneHasOne':\n\t\t\t\t\tconst targetEntity = model.entities[field.target]\n\t\t\t\t\tif (!('ownedBy' in field)) {\n\t\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\t\ttargetEntity: targetEntity,\n\t\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity.fields[field.inversedBy] as Model.OneHasOneInverseRelation : null,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'ManyHasOne':\n\t\t\t\t\tconst targetEntity2 = model.entities[field.target]\n\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\ttargetEntity: targetEntity2,\n\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity2.fields[field.inversedBy] as Model.OneHasManyRelation : null,\n\t\t\t\t\t})\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn entityReferences\n}\n"],"names":[],"mappings":";;AAUO,MAAM,oBAAoB,CAAC,UAAuC;AACxE,QAAM,mBAAkC,OAAO,YAAY,OAAO,KAAK,MAAM,QAAQ,EAAE,IAAI,QAAM,CAAC,IAAI,CAAA,CAAE,CAAC,CAAC;AAC1G,aAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,eAAW,SAAS,OAAO,OAAO,OAAO,MAAM,GAAG;AACjD,cAAQ,MAAM,MAAA;AAAA,QACb,KAAK;AACJ,gBAAM,eAAe,MAAM,SAAS,MAAM,MAAM;AAChD,cAAI,EAAE,aAAa,QAAQ;AAC1B,6BAAiB,MAAM,MAAM,EAAE,KAAK;AAAA,cACnC,cAAc;AAAA,cACd,gBAAgB;AAAA,cAChB;AAAA,cACA,gBAAgB,MAAM,aAAa,aAAa,OAAO,MAAM,UAAU,IAAsC;AAAA,YAAA,CAC7G;AAAA,UACF;AACA;AAAA,QACD,KAAK;AACJ,gBAAM,gBAAgB,MAAM,SAAS,MAAM,MAAM;AACjD,2BAAiB,MAAM,MAAM,EAAE,KAAK;AAAA,YACnC,cAAc;AAAA,YACd,gBAAgB;AAAA,YAChB,cAAc;AAAA,YACd,gBAAgB,MAAM,aAAa,cAAc,OAAO,MAAM,UAAU,IAAgC;AAAA,UAAA,CACxG;AACD;AAAA,MAAA;AAAA,IAEH;AAAA,EACD;AACA,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectReferences.js","sources":["../../../../../../packages/cli/src/lib/schema/collectReferences.ts"],"sourcesContent":["import { Model } from '@contember/schema'\n\nexport type ReferenceMapEntry = {\n\towningEntity: Model.Entity\n\towningRelation: Model.OneHasOneOwningRelation | Model.ManyHasOneRelation\n\ttargetEntity: Model.Entity\n\ttargetRelation: Model.OneHasOneInverseRelation | Model.OneHasManyRelation | null\n}\nexport type ReferencesMap = Record<string, ReferenceMapEntry[]>\n\nexport const collectReferences = (model: Model.Schema): ReferencesMap => {\n\tconst entityReferences: ReferencesMap = Object.fromEntries(Object.keys(model.entities).map(it => [it, []]))\n\tfor (const entity of Object.values(model.entities)) {\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tswitch (field.type) {\n\t\t\t\tcase 'OneHasOne':\n\t\t\t\t\tconst targetEntity = model.entities[field.target]\n\t\t\t\t\tif (!('ownedBy' in field)) {\n\t\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\t\ttargetEntity: targetEntity,\n\t\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity.fields[field.inversedBy] as Model.OneHasOneInverseRelation : null,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'ManyHasOne':\n\t\t\t\t\tconst targetEntity2 = model.entities[field.target]\n\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\ttargetEntity: targetEntity2,\n\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity2.fields[field.inversedBy] as Model.OneHasManyRelation : null,\n\t\t\t\t\t})\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn entityReferences\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collectReferences.js","sources":["../../../../../../packages/cli/src/lib/schema/collectReferences.ts"],"sourcesContent":["import { Model } from '@contember/schema'\n\nexport type ReferenceMapEntry = {\n\towningEntity: Model.Entity\n\towningRelation: Model.OneHasOneOwningRelation | Model.ManyHasOneRelation\n\ttargetEntity: Model.Entity\n\ttargetRelation: Model.OneHasOneInverseRelation | Model.OneHasManyRelation | null\n}\nexport type ReferencesMap = Record<string, ReferenceMapEntry[]>\n\nexport const collectReferences = (model: Model.Schema): ReferencesMap => {\n\tconst entityReferences: ReferencesMap = Object.fromEntries(Object.keys(model.entities).map(it => [it, []]))\n\tfor (const entity of Object.values(model.entities)) {\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tswitch (field.type) {\n\t\t\t\tcase 'OneHasOne':\n\t\t\t\t\tconst targetEntity = model.entities[field.target]\n\t\t\t\t\tif (!('ownedBy' in field)) {\n\t\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\t\ttargetEntity: targetEntity,\n\t\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity.fields[field.inversedBy] as Model.OneHasOneInverseRelation : null,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase 'ManyHasOne':\n\t\t\t\t\tconst targetEntity2 = model.entities[field.target]\n\t\t\t\t\tentityReferences[field.target].push({\n\t\t\t\t\t\towningEntity: entity,\n\t\t\t\t\t\towningRelation: field,\n\t\t\t\t\t\ttargetEntity: targetEntity2,\n\t\t\t\t\t\ttargetRelation: field.inversedBy ? targetEntity2.fields[field.inversedBy] as Model.OneHasManyRelation : null,\n\t\t\t\t\t})\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn entityReferences\n}\n"],"names":[],"mappings":"AAUO,MAAM,oBAAoB,CAAC,UAAuC;AACxE,QAAM,mBAAkC,OAAO,YAAY,OAAO,KAAK,MAAM,QAAQ,EAAE,IAAI,QAAM,CAAC,IAAI,CAAA,CAAE,CAAC,CAAC;AAC1G,aAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,eAAW,SAAS,OAAO,OAAO,OAAO,MAAM,GAAG;AACjD,cAAQ,MAAM,MAAA;AAAA,QACb,KAAK;AACJ,gBAAM,eAAe,MAAM,SAAS,MAAM,MAAM;AAChD,cAAI,EAAE,aAAa,QAAQ;AAC1B,6BAAiB,MAAM,MAAM,EAAE,KAAK;AAAA,cACnC,cAAc;AAAA,cACd,gBAAgB;AAAA,cAChB;AAAA,cACA,gBAAgB,MAAM,aAAa,aAAa,OAAO,MAAM,UAAU,IAAsC;AAAA,YAAA,CAC7G;AAAA,UACF;AACA;AAAA,QACD,KAAK;AACJ,gBAAM,gBAAgB,MAAM,SAAS,MAAM,MAAM;AACjD,2BAAiB,MAAM,MAAM,EAAE,KAAK;AAAA,YACnC,cAAc;AAAA,YACd,gBAAgB;AAAA,YAChB,cAAc;AAAA,YACd,gBAAgB,MAAM,aAAa,cAAc,OAAO,MAAM,UAAU,IAAgC;AAAA,UAAA,CACxG;AACD;AAAA,MAAA;AAAA,IAEH;AAAA,EACD;AACA,SAAO;AACR;"}
|
|
@@ -32,12 +32,5 @@ class LineTransform extends node_stream.Transform {
|
|
|
32
32
|
__publicField(this, "chunks", []);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
const readStream = async (stream) => new Promise((resolve, reject) => {
|
|
36
|
-
const chunks = [];
|
|
37
|
-
stream.on("error", (err) => reject(err));
|
|
38
|
-
stream.on("data", (chunk) => chunks.push(chunk));
|
|
39
|
-
stream.on("end", () => resolve(node_buffer.Buffer.concat(chunks)));
|
|
40
|
-
});
|
|
41
35
|
exports.LineTransform = LineTransform;
|
|
42
|
-
exports.readStream = readStream;
|
|
43
36
|
//# sourceMappingURL=stream.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.cjs","sources":["../../../../../packages/cli/src/lib/stream.ts"],"sourcesContent":["import { Stream, Transform } from 'node:stream'\nimport { Buffer } from 'node:buffer'\n\
|
|
1
|
+
{"version":3,"file":"stream.cjs","sources":["../../../../../packages/cli/src/lib/stream.ts"],"sourcesContent":["import { Stream, Transform } from 'node:stream'\nimport { Buffer } from 'node:buffer'\n\nexport class LineTransform extends Transform {\n\tprivate chunks: Buffer[] = []\n\n\tconstructor(transform: (line: string) => string) {\n\t\tsuper({\n\t\t\ttransform: (chunk, encoding, done) => {\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst eolIndex = chunk.indexOf('\\n')\n\n\t\t\t\t\tif (eolIndex < 0) {\n\t\t\t\t\t\tthis.chunks.push(chunk)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.chunks.push(chunk.slice(0, eolIndex))\n\t\t\t\t\tchunk = chunk.slice(eolIndex + 1)\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')) + '\\n', 'utf8')\n\t\t\t\t\tthis.chunks = []\n\t\t\t\t}\n\n\t\t\t\treturn done()\n\t\t\t},\n\n\t\t\tflush: done => {\n\t\t\t\tif (this.chunks.length) {\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')), 'utf8')\n\t\t\t\t\treturn done()\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t}\n}\n\nexport const readStream = async (stream: Stream) =>\n\tnew Promise<Buffer>((resolve, reject) => {\n\t\tconst chunks: Buffer[] = []\n\t\tstream.on('error', err => reject(err))\n\t\tstream.on('data', chunk => chunks.push(chunk))\n\t\tstream.on('end', () => resolve(Buffer.concat(chunks)))\n\t})\n"],"names":["Transform","Buffer"],"mappings":";;;;;;;AAGO,MAAM,sBAAsBA,YAAAA,UAAU;AAAA,EAG5C,YAAY,WAAqC;AAChD,UAAM;AAAA,MACL,WAAW,CAAC,OAAO,UAAU,SAAS;AACrC,eAAO,MAAM;AACZ,gBAAM,WAAW,MAAM,QAAQ,IAAI;AAEnC,cAAI,WAAW,GAAG;AACjB,iBAAK,OAAO,KAAK,KAAK;AACtB;AAAA,UACD;AAEA,eAAK,OAAO,KAAK,MAAM,MAAM,GAAG,QAAQ,CAAC;AACzC,kBAAQ,MAAM,MAAM,WAAW,CAAC;AAChC,eAAK,KAAK,UAAUC,YAAAA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,IAAI,MAAM,MAAM;AAC/E,eAAK,SAAS,CAAA;AAAA,QACf;AAEA,eAAO,KAAA;AAAA,MACR;AAAA,MAEA,OAAO,CAAA,SAAQ;AACd,YAAI,KAAK,OAAO,QAAQ;AACvB,eAAK,KAAK,UAAUA,YAAAA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,GAAG,MAAM;AACxE,iBAAO,KAAA;AAAA,QACR;AAAA,MACD;AAAA,IAAA,CACA;AA5BF,kBAAA,MAAQ,UAAmB,EAAC;AAAA,EA6B5B;AACD;;"}
|
|
@@ -30,14 +30,7 @@ class LineTransform extends Transform {
|
|
|
30
30
|
__publicField(this, "chunks", []);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
const readStream = async (stream) => new Promise((resolve, reject) => {
|
|
34
|
-
const chunks = [];
|
|
35
|
-
stream.on("error", (err) => reject(err));
|
|
36
|
-
stream.on("data", (chunk) => chunks.push(chunk));
|
|
37
|
-
stream.on("end", () => resolve(Buffer.concat(chunks)));
|
|
38
|
-
});
|
|
39
33
|
export {
|
|
40
|
-
LineTransform
|
|
41
|
-
readStream
|
|
34
|
+
LineTransform
|
|
42
35
|
};
|
|
43
36
|
//# sourceMappingURL=stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sources":["../../../../../packages/cli/src/lib/stream.ts"],"sourcesContent":["import { Stream, Transform } from 'node:stream'\nimport { Buffer } from 'node:buffer'\n\
|
|
1
|
+
{"version":3,"file":"stream.js","sources":["../../../../../packages/cli/src/lib/stream.ts"],"sourcesContent":["import { Stream, Transform } from 'node:stream'\nimport { Buffer } from 'node:buffer'\n\nexport class LineTransform extends Transform {\n\tprivate chunks: Buffer[] = []\n\n\tconstructor(transform: (line: string) => string) {\n\t\tsuper({\n\t\t\ttransform: (chunk, encoding, done) => {\n\t\t\t\twhile (true) {\n\t\t\t\t\tconst eolIndex = chunk.indexOf('\\n')\n\n\t\t\t\t\tif (eolIndex < 0) {\n\t\t\t\t\t\tthis.chunks.push(chunk)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.chunks.push(chunk.slice(0, eolIndex))\n\t\t\t\t\tchunk = chunk.slice(eolIndex + 1)\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')) + '\\n', 'utf8')\n\t\t\t\t\tthis.chunks = []\n\t\t\t\t}\n\n\t\t\t\treturn done()\n\t\t\t},\n\n\t\t\tflush: done => {\n\t\t\t\tif (this.chunks.length) {\n\t\t\t\t\tthis.push(transform(Buffer.concat(this.chunks).toString('utf8')), 'utf8')\n\t\t\t\t\treturn done()\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t}\n}\n\nexport const readStream = async (stream: Stream) =>\n\tnew Promise<Buffer>((resolve, reject) => {\n\t\tconst chunks: Buffer[] = []\n\t\tstream.on('error', err => reject(err))\n\t\tstream.on('data', chunk => chunks.push(chunk))\n\t\tstream.on('end', () => resolve(Buffer.concat(chunks)))\n\t})\n"],"names":["Buffer"],"mappings":";;;;;AAGO,MAAM,sBAAsB,UAAU;AAAA,EAG5C,YAAY,WAAqC;AAChD,UAAM;AAAA,MACL,WAAW,CAAC,OAAO,UAAU,SAAS;AACrC,eAAO,MAAM;AACZ,gBAAM,WAAW,MAAM,QAAQ,IAAI;AAEnC,cAAI,WAAW,GAAG;AACjB,iBAAK,OAAO,KAAK,KAAK;AACtB;AAAA,UACD;AAEA,eAAK,OAAO,KAAK,MAAM,MAAM,GAAG,QAAQ,CAAC;AACzC,kBAAQ,MAAM,MAAM,WAAW,CAAC;AAChC,eAAK,KAAK,UAAUA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,IAAI,MAAM,MAAM;AAC/E,eAAK,SAAS,CAAA;AAAA,QACf;AAEA,eAAO,KAAA;AAAA,MACR;AAAA,MAEA,OAAO,CAAA,SAAQ;AACd,YAAI,KAAK,OAAO,QAAQ;AACvB,eAAK,KAAK,UAAUA,OAAO,OAAO,KAAK,MAAM,EAAE,SAAS,MAAM,CAAC,GAAG,MAAM;AACxE,iBAAO,KAAA;AAAA,QACR;AAAA,MACD;AAAA,IAAA,CACA;AA5BF,kBAAA,MAAQ,UAAmB,EAAC;AAAA,EA6B5B;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TenantClient.cjs","sources":["../../../../../../packages/cli/src/lib/tenant/TenantClient.ts"],"sourcesContent":["import { GraphQlClient } from '@contember/graphql-client'\n\nexport const createTenantApiUrl = (url: string) => {\n\tif (url.endsWith('/')) {\n\t\turl = url.substring(0, url.length - 1)\n\t}\n\tif (url.endsWith('/tenant')) {\n\t\treturn url\n\t}\n\treturn url + '/tenant'\n}\n\
|
|
1
|
+
{"version":3,"file":"TenantClient.cjs","sources":["../../../../../../packages/cli/src/lib/tenant/TenantClient.ts"],"sourcesContent":["import { GraphQlClient } from '@contember/graphql-client'\n\nexport const createTenantApiUrl = (url: string) => {\n\tif (url.endsWith('/')) {\n\t\turl = url.substring(0, url.length - 1)\n\t}\n\tif (url.endsWith('/tenant')) {\n\t\treturn url\n\t}\n\treturn url + '/tenant'\n}\n\nexport class TenantClient {\n\tconstructor(private readonly apiClient: GraphQlClient) {}\n\n\tpublic static create(url: string, apiToken: string): TenantClient {\n\t\tconst graphqlClient = new GraphQlClient({ url: createTenantApiUrl(url), apiToken })\n\t\treturn new TenantClient(graphqlClient)\n\t}\n\n\tpublic async createProject(slug: string, ignoreExisting = false): Promise<void> {\n\t\tconst query = `mutation($slug: String!) {\n createProject(projectSlug: $slug) {\n ok\n error {\n code\n }\n }\n}`\n\t\tconst result = await this.apiClient.execute<{\n\t\t\tcreateProject: { ok: boolean; error: { code: string } }\n\t\t}>(query, { variables: { slug } })\n\t\tif (!result.createProject.ok) {\n\t\t\tif (ignoreExisting && result.createProject.error.code === 'ALREADY_EXISTS') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow result.createProject.error.code\n\t\t}\n\t}\n}\n"],"names":["graphqlClient","GraphQlClient"],"mappings":";;;AAEO,MAAM,qBAAqB,CAAC,QAAgB;AAClD,MAAI,IAAI,SAAS,GAAG,GAAG;AACtB,UAAM,IAAI,UAAU,GAAG,IAAI,SAAS,CAAC;AAAA,EACtC;AACA,MAAI,IAAI,SAAS,SAAS,GAAG;AAC5B,WAAO;AAAA,EACR;AACA,SAAO,MAAM;AACd;AAEO,MAAM,aAAa;AAAA,EACzB,YAA6B,WAA0B;AAA1B,SAAA,YAAA;AAAA,EAA2B;AAAA,EAExD,OAAc,OAAO,KAAa,UAAgC;AACjE,UAAMA,kBAAgB,IAAIC,cAAAA,cAAc,EAAE,KAAK,mBAAmB,GAAG,GAAG,UAAU;AAClF,WAAO,IAAI,aAAaD,eAAa;AAAA,EACtC;AAAA,EAEA,MAAa,cAAc,MAAc,iBAAiB,OAAsB;AAC/E,UAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQd,UAAM,SAAS,MAAM,KAAK,UAAU,QAEjC,OAAO,EAAE,WAAW,EAAE,KAAA,GAAQ;AACjC,QAAI,CAAC,OAAO,cAAc,IAAI;AAC7B,UAAI,kBAAkB,OAAO,cAAc,MAAM,SAAS,kBAAkB;AAC3E;AAAA,MACD;AACA,YAAM,OAAO,cAAc,MAAM;AAAA,IAClC;AAAA,EACD;AACD;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TenantClient.js","sources":["../../../../../../packages/cli/src/lib/tenant/TenantClient.ts"],"sourcesContent":["import { GraphQlClient } from '@contember/graphql-client'\n\nexport const createTenantApiUrl = (url: string) => {\n\tif (url.endsWith('/')) {\n\t\turl = url.substring(0, url.length - 1)\n\t}\n\tif (url.endsWith('/tenant')) {\n\t\treturn url\n\t}\n\treturn url + '/tenant'\n}\n\
|
|
1
|
+
{"version":3,"file":"TenantClient.js","sources":["../../../../../../packages/cli/src/lib/tenant/TenantClient.ts"],"sourcesContent":["import { GraphQlClient } from '@contember/graphql-client'\n\nexport const createTenantApiUrl = (url: string) => {\n\tif (url.endsWith('/')) {\n\t\turl = url.substring(0, url.length - 1)\n\t}\n\tif (url.endsWith('/tenant')) {\n\t\treturn url\n\t}\n\treturn url + '/tenant'\n}\n\nexport class TenantClient {\n\tconstructor(private readonly apiClient: GraphQlClient) {}\n\n\tpublic static create(url: string, apiToken: string): TenantClient {\n\t\tconst graphqlClient = new GraphQlClient({ url: createTenantApiUrl(url), apiToken })\n\t\treturn new TenantClient(graphqlClient)\n\t}\n\n\tpublic async createProject(slug: string, ignoreExisting = false): Promise<void> {\n\t\tconst query = `mutation($slug: String!) {\n createProject(projectSlug: $slug) {\n ok\n error {\n code\n }\n }\n}`\n\t\tconst result = await this.apiClient.execute<{\n\t\t\tcreateProject: { ok: boolean; error: { code: string } }\n\t\t}>(query, { variables: { slug } })\n\t\tif (!result.createProject.ok) {\n\t\t\tif (ignoreExisting && result.createProject.error.code === 'ALREADY_EXISTS') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthrow result.createProject.error.code\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";AAEO,MAAM,qBAAqB,CAAC,QAAgB;AAClD,MAAI,IAAI,SAAS,GAAG,GAAG;AACtB,UAAM,IAAI,UAAU,GAAG,IAAI,SAAS,CAAC;AAAA,EACtC;AACA,MAAI,IAAI,SAAS,SAAS,GAAG;AAC5B,WAAO;AAAA,EACR;AACA,SAAO,MAAM;AACd;AAEO,MAAM,aAAa;AAAA,EACzB,YAA6B,WAA0B;AAA1B,SAAA,YAAA;AAAA,EAA2B;AAAA,EAExD,OAAc,OAAO,KAAa,UAAgC;AACjE,UAAM,gBAAgB,IAAI,cAAc,EAAE,KAAK,mBAAmB,GAAG,GAAG,UAAU;AAClF,WAAO,IAAI,aAAa,aAAa;AAAA,EACtC;AAAA,EAEA,MAAa,cAAc,MAAc,iBAAiB,OAAsB;AAC/E,UAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQd,UAAM,SAAS,MAAM,KAAK,UAAU,QAEjC,OAAO,EAAE,WAAW,EAAE,KAAA,GAAQ;AACjC,QAAI,CAAC,OAAO,cAAc,IAAI;AAC7B,UAAI,kBAAkB,OAAO,cAAc,MAAM,SAAS,kBAAkB;AAC3E;AAAA,MACD;AACA,YAAM,OAAO,cAAc,MAAM;AAAA,IAClC;AAAA,EACD;AACD;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const http = require("node:http");
|
|
4
|
-
const https = require("node:https");
|
|
5
3
|
const stream = require("../stream.cjs");
|
|
6
4
|
const node_stream = require("node:stream");
|
|
7
5
|
const node_zlib = require("node:zlib");
|
|
@@ -16,80 +14,74 @@ class DataTransferClient {
|
|
|
16
14
|
let rowTotal = 0;
|
|
17
15
|
let transferred = 0;
|
|
18
16
|
let start = Date.now();
|
|
19
|
-
const inputStream = stream$1.pipe(
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
17
|
+
const inputStream = stream$1.pipe(
|
|
18
|
+
new stream.LineTransform((line) => {
|
|
19
|
+
transferred += line.length + 1;
|
|
20
|
+
if (line === "") {
|
|
21
|
+
return "";
|
|
22
|
+
}
|
|
23
|
+
const data = JSON.parse(line);
|
|
24
|
+
switch (data[0]) {
|
|
25
|
+
case "importSystemSchemaBegin":
|
|
26
|
+
return JSON.stringify([data[0], { ...data[1], project: project.name }]);
|
|
27
|
+
case "importContentSchemaBegin":
|
|
28
|
+
return JSON.stringify([data[0], { ...data[1], project: project.name }]);
|
|
29
|
+
case "insertBegin":
|
|
30
|
+
table = data[1].table;
|
|
31
|
+
rowCount = 0;
|
|
32
|
+
break;
|
|
33
|
+
case "insertRow":
|
|
34
|
+
rowCount++;
|
|
35
|
+
rowTotal++;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
if (rowCount % 1e3 === 0 || data[0] !== "insertRow") {
|
|
39
|
+
const mbs = Math.floor(transferred / 1024 / 1024).toString();
|
|
40
|
+
const durationS = Math.floor((Date.now() - start) / 1e3);
|
|
41
|
+
printProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`);
|
|
42
|
+
}
|
|
43
|
+
return line;
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
inputStream.on("error", (err) => {
|
|
47
|
+
throw new Error(`Input stream error: ${err}`);
|
|
48
|
+
});
|
|
49
|
+
const bodyStream = node_stream.Readable.toWeb(gzip ? inputStream.pipe(node_zlib.createGzip()) : inputStream);
|
|
50
|
+
const response = await fetch(`${project.endpoint}/import`, {
|
|
49
51
|
headers: {
|
|
52
|
+
"Authorization": `Bearer ${project.token}`,
|
|
50
53
|
"Content-type": "application/x-ndjson",
|
|
51
54
|
...gzip ? { "Content-Encoding": "gzip" } : {}
|
|
52
55
|
},
|
|
53
|
-
|
|
56
|
+
method: "POST",
|
|
57
|
+
body: bodyStream,
|
|
58
|
+
...{ duplex: "half" }
|
|
54
59
|
});
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
const responseBody = await response.text();
|
|
62
|
+
throw new Error(`Invalid response: ${response.statusText}
|
|
63
|
+
${responseBody}`);
|
|
64
|
+
}
|
|
65
|
+
return response;
|
|
55
66
|
});
|
|
56
67
|
__publicField(this, "dataExport", async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }) => {
|
|
57
|
-
|
|
58
|
-
url: `${baseUrl}/export`,
|
|
59
|
-
token,
|
|
68
|
+
const response = await fetch(`${baseUrl}/export`, {
|
|
60
69
|
headers: {
|
|
70
|
+
"Authorization": `Bearer ${token}`,
|
|
61
71
|
"Accept-Encoding": gzip ? "gzip" : "identity",
|
|
62
72
|
"Content-type": "application/json"
|
|
63
73
|
},
|
|
74
|
+
method: "POST",
|
|
64
75
|
body: JSON.stringify({
|
|
65
76
|
projects: [{ slug: project, system: includeSystem, excludeTables }]
|
|
66
77
|
})
|
|
67
78
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Authorization: `Bearer ${token}`,
|
|
75
|
-
...headers
|
|
76
|
-
}
|
|
77
|
-
}, async (res) => {
|
|
78
|
-
if (res.statusCode !== 200) {
|
|
79
|
-
const responseBody = (await stream.readStream(res)).toString();
|
|
80
|
-
reject(new Error(`Invalid response: ${res.statusMessage}
|
|
81
|
-
${responseBody}`));
|
|
82
|
-
} else {
|
|
83
|
-
resolve(res);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
if (body instanceof node_stream.Stream) {
|
|
87
|
-
body.pipe(req);
|
|
88
|
-
} else {
|
|
89
|
-
req.write(body);
|
|
90
|
-
req.end();
|
|
91
|
-
}
|
|
92
|
-
});
|
|
79
|
+
if (!response.ok) {
|
|
80
|
+
const responseBody = await response.text();
|
|
81
|
+
throw new Error(`Invalid response: ${response.statusText}
|
|
82
|
+
${responseBody}`);
|
|
83
|
+
}
|
|
84
|
+
return response;
|
|
93
85
|
});
|
|
94
86
|
}
|
|
95
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTransferClient.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"DataTransferClient.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(\n\t\t\tnew LineTransform(line => {\n\t\t\t\ttransferred += line.length + 1\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst data = JSON.parse(line)\n\t\t\t\tswitch (data[0]) {\n\t\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'insertBegin':\n\t\t\t\t\t\ttable = data[1].table\n\t\t\t\t\t\trowCount = 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertRow':\n\t\t\t\t\t\trowCount++\n\t\t\t\t\t\trowTotal++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertEnd':\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}),\n\t\t)\n\t\tinputStream.on('error', err => {\n\t\t\tthrow new Error(`Input stream error: ${err}`)\n\t\t})\n\n\t\tconst bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit\n\n\t\tconst response = await fetch(`${project.endpoint}/import`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${project.token}`,\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: bodyStream,\n\t\t\t...{ duplex: 'half' },\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\tconst response = await fetch(`${baseUrl}/export`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${token}`,\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n}\n"],"names":["stream","LineTransform","Readable","createGzip"],"mappings":";;;;;;;;AAKO,MAAM,mBAAmB;AAAA,EAAzB,cAAA;AACN,kBAAA,MAAA,cAAa,OAAO,EAAE,eAAA,QAAeA,UAAQ,SAAS,WAKhD;AACL,UAAI,QAAQ;AACZ,UAAI,WAAW;AACf,UAAI,WAAW;AACf,UAAI,cAAc;AAClB,UAAI,QAAQ,KAAK,IAAA;AACjB,YAAM,cAAcA,SAAO;AAAA,QAC1B,IAAIC,OAAAA,cAAc,CAAA,SAAQ;AACzB,yBAAe,KAAK,SAAS;AAC7B,cAAI,SAAS,IAAI;AAChB,mBAAO;AAAA,UACR;AACA,gBAAM,OAAO,KAAK,MAAM,IAAI;AAC5B,kBAAQ,KAAK,CAAC,GAAA;AAAA,YACb,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,sBAAQ,KAAK,CAAC,EAAE;AAChB,yBAAW;AACX;AAAA,YACD,KAAK;AACJ;AACA;AACA;AAAA,UAEA;AAEF,cAAK,WAAW,QAAU,KAAK,KAAK,CAAC,MAAM,aAAa;AACvD,kBAAM,MAAM,KAAK,MAAM,cAAc,OAAO,IAAI,EAAE,SAAA;AAClD,kBAAM,YAAY,KAAK,OAAO,KAAK,IAAA,IAAQ,SAAS,GAAI;AACxD,0BAAc,eAAe,GAAG,kBAAkB,QAAQ,IAAI,KAAK,UAAU,QAAQ,WAAW,SAAS,UAAU;AAAA,UACpH;AACA,iBAAO;AAAA,QACR,CAAC;AAAA,MAAA;AAEF,kBAAY,GAAG,SAAS,CAAA,QAAO;AAC9B,cAAM,IAAI,MAAM,uBAAuB,GAAG,EAAE;AAAA,MAC7C,CAAC;AAED,YAAM,aAAaC,qBAAS,MAAM,OAAO,YAAY,KAAKC,UAAAA,YAAY,IAAI,WAAW;AAErF,YAAM,WAAW,MAAM,MAAM,GAAG,QAAQ,QAAQ,WAAW;AAAA,QAC1D,SAAS;AAAA,UACR,iBAAiB,UAAU,QAAQ,KAAK;AAAA,UACxC,gBAAgB;AAAA,UAChB,GAAI,OAAO,EAAE,oBAAoB,WAAW,CAAA;AAAA,QAAC;AAAA,QAE9C,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,GAAG,EAAE,QAAQ,OAAA;AAAA,MAAO,CACpB;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAEA,kBAAA,MAAA,cAAa,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,OAAO,UAAU,QAAA,GAAW,MAAM,eAAe,oBAK3F;AACL,YAAM,WAAW,MAAM,MAAM,GAAG,OAAO,WAAW;AAAA,QACjD,SAAS;AAAA,UACR,iBAAiB,UAAU,KAAK;AAAA,UAChC,mBAAmB,OAAO,SAAS;AAAA,UACnC,gBAAgB;AAAA,QAAA;AAAA,QAEjB,QAAQ;AAAA,QACR,MAAM,KAAK,UAAU;AAAA,UACpB,UAAU,CAAC,EAAE,MAAM,SAAS,QAAQ,eAAe,eAAe;AAAA,QAAA,CAClE;AAAA,MAAA,CACD;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EAAA;AACD;;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { LineTransform, readStream } from "../stream.js";
|
|
4
|
-
import { Stream } from "node:stream";
|
|
1
|
+
import { LineTransform } from "../stream.js";
|
|
2
|
+
import { Readable } from "node:stream";
|
|
5
3
|
import { createGzip } from "node:zlib";
|
|
6
4
|
var __defProp = Object.defineProperty;
|
|
7
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -14,80 +12,74 @@ class DataTransferClient {
|
|
|
14
12
|
let rowTotal = 0;
|
|
15
13
|
let transferred = 0;
|
|
16
14
|
let start = Date.now();
|
|
17
|
-
const inputStream = stream.pipe(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
15
|
+
const inputStream = stream.pipe(
|
|
16
|
+
new LineTransform((line) => {
|
|
17
|
+
transferred += line.length + 1;
|
|
18
|
+
if (line === "") {
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
const data = JSON.parse(line);
|
|
22
|
+
switch (data[0]) {
|
|
23
|
+
case "importSystemSchemaBegin":
|
|
24
|
+
return JSON.stringify([data[0], { ...data[1], project: project.name }]);
|
|
25
|
+
case "importContentSchemaBegin":
|
|
26
|
+
return JSON.stringify([data[0], { ...data[1], project: project.name }]);
|
|
27
|
+
case "insertBegin":
|
|
28
|
+
table = data[1].table;
|
|
29
|
+
rowCount = 0;
|
|
30
|
+
break;
|
|
31
|
+
case "insertRow":
|
|
32
|
+
rowCount++;
|
|
33
|
+
rowTotal++;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
if (rowCount % 1e3 === 0 || data[0] !== "insertRow") {
|
|
37
|
+
const mbs = Math.floor(transferred / 1024 / 1024).toString();
|
|
38
|
+
const durationS = Math.floor((Date.now() - start) / 1e3);
|
|
39
|
+
printProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`);
|
|
40
|
+
}
|
|
41
|
+
return line;
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
inputStream.on("error", (err) => {
|
|
45
|
+
throw new Error(`Input stream error: ${err}`);
|
|
46
|
+
});
|
|
47
|
+
const bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream);
|
|
48
|
+
const response = await fetch(`${project.endpoint}/import`, {
|
|
47
49
|
headers: {
|
|
50
|
+
"Authorization": `Bearer ${project.token}`,
|
|
48
51
|
"Content-type": "application/x-ndjson",
|
|
49
52
|
...gzip ? { "Content-Encoding": "gzip" } : {}
|
|
50
53
|
},
|
|
51
|
-
|
|
54
|
+
method: "POST",
|
|
55
|
+
body: bodyStream,
|
|
56
|
+
...{ duplex: "half" }
|
|
52
57
|
});
|
|
58
|
+
if (!response.ok) {
|
|
59
|
+
const responseBody = await response.text();
|
|
60
|
+
throw new Error(`Invalid response: ${response.statusText}
|
|
61
|
+
${responseBody}`);
|
|
62
|
+
}
|
|
63
|
+
return response;
|
|
53
64
|
});
|
|
54
65
|
__publicField(this, "dataExport", async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }) => {
|
|
55
|
-
|
|
56
|
-
url: `${baseUrl}/export`,
|
|
57
|
-
token,
|
|
66
|
+
const response = await fetch(`${baseUrl}/export`, {
|
|
58
67
|
headers: {
|
|
68
|
+
"Authorization": `Bearer ${token}`,
|
|
59
69
|
"Accept-Encoding": gzip ? "gzip" : "identity",
|
|
60
70
|
"Content-type": "application/json"
|
|
61
71
|
},
|
|
72
|
+
method: "POST",
|
|
62
73
|
body: JSON.stringify({
|
|
63
74
|
projects: [{ slug: project, system: includeSystem, excludeTables }]
|
|
64
75
|
})
|
|
65
76
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Authorization: `Bearer ${token}`,
|
|
73
|
-
...headers
|
|
74
|
-
}
|
|
75
|
-
}, async (res) => {
|
|
76
|
-
if (res.statusCode !== 200) {
|
|
77
|
-
const responseBody = (await readStream(res)).toString();
|
|
78
|
-
reject(new Error(`Invalid response: ${res.statusMessage}
|
|
79
|
-
${responseBody}`));
|
|
80
|
-
} else {
|
|
81
|
-
resolve(res);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
if (body instanceof Stream) {
|
|
85
|
-
body.pipe(req);
|
|
86
|
-
} else {
|
|
87
|
-
req.write(body);
|
|
88
|
-
req.end();
|
|
89
|
-
}
|
|
90
|
-
});
|
|
77
|
+
if (!response.ok) {
|
|
78
|
+
const responseBody = await response.text();
|
|
79
|
+
throw new Error(`Invalid response: ${response.statusText}
|
|
80
|
+
${responseBody}`);
|
|
81
|
+
}
|
|
82
|
+
return response;
|
|
91
83
|
});
|
|
92
84
|
}
|
|
93
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTransferClient.js","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"DataTransferClient.js","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\tdataImport = async ({ printProgress, stream, project, gzip }: {\n\t\tstream: Readable\n\t\tproject: RemoteProject\n\t\tprintProgress: (message: string) => void\n\t\tgzip: boolean\n\t}) => {\n\t\tlet table = ''\n\t\tlet rowCount = 0\n\t\tlet rowTotal = 0\n\t\tlet transferred = 0\n\t\tlet start = Date.now()\n\t\tconst inputStream = stream.pipe(\n\t\t\tnew LineTransform(line => {\n\t\t\t\ttransferred += line.length + 1\n\t\t\t\tif (line === '') {\n\t\t\t\t\treturn ''\n\t\t\t\t}\n\t\t\t\tconst data = JSON.parse(line)\n\t\t\t\tswitch (data[0]) {\n\t\t\t\t\tcase 'importSystemSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'importContentSchemaBegin':\n\t\t\t\t\t\treturn JSON.stringify([data[0], { ...data[1], project: project.name }])\n\t\t\t\t\tcase 'insertBegin':\n\t\t\t\t\t\ttable = data[1].table\n\t\t\t\t\t\trowCount = 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertRow':\n\t\t\t\t\t\trowCount++\n\t\t\t\t\t\trowTotal++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'insertEnd':\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((rowCount % 1000) === 0 || data[0] !== 'insertRow') {\n\t\t\t\t\tconst mbs = Math.floor(transferred / 1024 / 1024).toString()\n\t\t\t\t\tconst durationS = Math.floor((Date.now() - start) / 1000)\n\t\t\t\t\tprintProgress(`transferred ${mbs} MiB; inserted ${rowCount} ${table} rows, ${rowTotal} total; ${durationS} seconds`)\n\t\t\t\t}\n\t\t\t\treturn line\n\t\t\t}),\n\t\t)\n\t\tinputStream.on('error', err => {\n\t\t\tthrow new Error(`Input stream error: ${err}`)\n\t\t})\n\n\t\tconst bodyStream = Readable.toWeb(gzip ? inputStream.pipe(createGzip()) : inputStream) as unknown as BodyInit\n\n\t\tconst response = await fetch(`${project.endpoint}/import`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${project.token}`,\n\t\t\t\t'Content-type': 'application/x-ndjson',\n\t\t\t\t...(gzip ? { 'Content-Encoding': 'gzip' } : {}),\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: bodyStream,\n\t\t\t...{ duplex: 'half' },\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n\n\tdataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {\n\t\tproject: RemoteProject\n\t\texcludeTables?: string[]\n\t\tincludeSystem: boolean\n\t\tgzip: boolean\n\t}) => {\n\t\tconst response = await fetch(`${baseUrl}/export`, {\n\t\t\theaders: {\n\t\t\t\t'Authorization': `Bearer ${token}`,\n\t\t\t\t'Accept-Encoding': gzip ? 'gzip' : 'identity',\n\t\t\t\t'Content-type': 'application/json',\n\t\t\t},\n\t\t\tmethod: 'POST',\n\t\t\tbody: JSON.stringify({\n\t\t\t\tprojects: [{ slug: project, system: includeSystem, excludeTables }],\n\t\t\t}),\n\t\t})\n\t\tif (!response.ok) {\n\t\t\tconst responseBody = await response.text()\n\t\t\tthrow new Error(`Invalid response: ${response.statusText}\\n${responseBody}`)\n\t\t}\n\t\treturn response\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAKO,MAAM,mBAAmB;AAAA,EAAzB,cAAA;AACN,kBAAA,MAAA,cAAa,OAAO,EAAE,eAAe,QAAQ,SAAS,WAKhD;AACL,UAAI,QAAQ;AACZ,UAAI,WAAW;AACf,UAAI,WAAW;AACf,UAAI,cAAc;AAClB,UAAI,QAAQ,KAAK,IAAA;AACjB,YAAM,cAAc,OAAO;AAAA,QAC1B,IAAI,cAAc,CAAA,SAAQ;AACzB,yBAAe,KAAK,SAAS;AAC7B,cAAI,SAAS,IAAI;AAChB,mBAAO;AAAA,UACR;AACA,gBAAM,OAAO,KAAK,MAAM,IAAI;AAC5B,kBAAQ,KAAK,CAAC,GAAA;AAAA,YACb,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,qBAAO,KAAK,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,SAAS,QAAQ,KAAA,CAAM,CAAC;AAAA,YACvE,KAAK;AACJ,sBAAQ,KAAK,CAAC,EAAE;AAChB,yBAAW;AACX;AAAA,YACD,KAAK;AACJ;AACA;AACA;AAAA,UAEA;AAEF,cAAK,WAAW,QAAU,KAAK,KAAK,CAAC,MAAM,aAAa;AACvD,kBAAM,MAAM,KAAK,MAAM,cAAc,OAAO,IAAI,EAAE,SAAA;AAClD,kBAAM,YAAY,KAAK,OAAO,KAAK,IAAA,IAAQ,SAAS,GAAI;AACxD,0BAAc,eAAe,GAAG,kBAAkB,QAAQ,IAAI,KAAK,UAAU,QAAQ,WAAW,SAAS,UAAU;AAAA,UACpH;AACA,iBAAO;AAAA,QACR,CAAC;AAAA,MAAA;AAEF,kBAAY,GAAG,SAAS,CAAA,QAAO;AAC9B,cAAM,IAAI,MAAM,uBAAuB,GAAG,EAAE;AAAA,MAC7C,CAAC;AAED,YAAM,aAAa,SAAS,MAAM,OAAO,YAAY,KAAK,YAAY,IAAI,WAAW;AAErF,YAAM,WAAW,MAAM,MAAM,GAAG,QAAQ,QAAQ,WAAW;AAAA,QAC1D,SAAS;AAAA,UACR,iBAAiB,UAAU,QAAQ,KAAK;AAAA,UACxC,gBAAgB;AAAA,UAChB,GAAI,OAAO,EAAE,oBAAoB,WAAW,CAAA;AAAA,QAAC;AAAA,QAE9C,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,GAAG,EAAE,QAAQ,OAAA;AAAA,MAAO,CACpB;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAEA,kBAAA,MAAA,cAAa,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,OAAO,UAAU,QAAA,GAAW,MAAM,eAAe,oBAK3F;AACL,YAAM,WAAW,MAAM,MAAM,GAAG,OAAO,WAAW;AAAA,QACjD,SAAS;AAAA,UACR,iBAAiB,UAAU,KAAK;AAAA,UAChC,mBAAmB,OAAO,SAAS;AAAA,UACnC,gBAAgB;AAAA,QAAA;AAAA,QAEjB,QAAQ;AAAA,QACR,MAAM,KAAK,UAAU;AAAA,UACpB,UAAU,CAAC,EAAE,MAAM,SAAS,QAAQ,eAAe,eAAe;AAAA,QAAA,CAClE;AAAA,MAAA,CACD;AACD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,eAAe,MAAM,SAAS,KAAA;AACpC,cAAM,IAAI,MAAM,qBAAqB,SAAS,UAAU;AAAA,EAAK,YAAY,EAAE;AAAA,MAC5E;AACA,aAAO;AAAA,IACR,CAAA;AAAA,EAAA;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/stdio.ts"],"sourcesContent":["export const printProgressLine = (message: string) => {\n\tif (!process.stdout.clearLine) {\n\t\treturn\n\t}\n\tprocess.stdout.clearLine(0)\n\tprocess.stdout.cursorTo(0)\n\tprocess.stdout.write(message)\n}\n
|
|
1
|
+
{"version":3,"file":"stdio.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/stdio.ts"],"sourcesContent":["export const printProgressLine = (message: string) => {\n\tif (!process.stdout.clearLine) {\n\t\treturn\n\t}\n\tprocess.stdout.clearLine(0)\n\tprocess.stdout.cursorTo(0)\n\tprocess.stdout.write(message)\n}\n"],"names":[],"mappings":";;AAAO,MAAM,oBAAoB,CAAC,YAAoB;AACrD,MAAI,CAAC,QAAQ,OAAO,WAAW;AAC9B;AAAA,EACD;AACA,UAAQ,OAAO,UAAU,CAAC;AAC1B,UAAQ,OAAO,SAAS,CAAC;AACzB,UAAQ,OAAO,MAAM,OAAO;AAC7B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.js","sources":["../../../../../../packages/cli/src/lib/transfer/stdio.ts"],"sourcesContent":["export const printProgressLine = (message: string) => {\n\tif (!process.stdout.clearLine) {\n\t\treturn\n\t}\n\tprocess.stdout.clearLine(0)\n\tprocess.stdout.cursorTo(0)\n\tprocess.stdout.write(message)\n}\n
|
|
1
|
+
{"version":3,"file":"stdio.js","sources":["../../../../../../packages/cli/src/lib/transfer/stdio.ts"],"sourcesContent":["export const printProgressLine = (message: string) => {\n\tif (!process.stdout.clearLine) {\n\t\treturn\n\t}\n\tprocess.stdout.clearLine(0)\n\tprocess.stdout.cursorTo(0)\n\tprocess.stdout.write(message)\n}\n"],"names":[],"mappings":"AAAO,MAAM,oBAAoB,CAAC,YAAoB;AACrD,MAAI,CAAC,QAAQ,OAAO,WAAW;AAC9B;AAAA,EACD;AACA,UAAQ,OAAO,UAAU,CAAC;AAC1B,UAAQ,OAAO,SAAS,CAAC;AACzB,UAAQ,OAAO,MAAM,OAAO;AAC7B;"}
|
|
@@ -9,10 +9,10 @@ class WorkspaceResolver {
|
|
|
9
9
|
this.yamlHandler = yamlHandler;
|
|
10
10
|
__publicField(this, "resolve", async (baseDir) => {
|
|
11
11
|
const config = await this.readConfig(baseDir);
|
|
12
|
-
const apiDir = config.apiDir
|
|
13
|
-
const migrationsDir = config.migrationsDir
|
|
14
|
-
const adminDir = config.adminDir === false ? void 0 : config.adminDir
|
|
15
|
-
const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir
|
|
12
|
+
const apiDir = config.apiDir ? node_path.resolve(baseDir, config.apiDir) : node_path.join(baseDir, "api");
|
|
13
|
+
const migrationsDir = config.migrationsDir ? node_path.resolve(baseDir, config.migrationsDir) : node_path.join(apiDir, "migrations");
|
|
14
|
+
const adminDir = config.adminDir === false ? void 0 : config.adminDir ? node_path.resolve(baseDir, config.adminDir) : node_path.join(baseDir, "admin");
|
|
15
|
+
const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir ? node_path.resolve(baseDir, config.adminDistDir) : node_path.join(adminDir, "dist");
|
|
16
16
|
return {
|
|
17
17
|
baseDir,
|
|
18
18
|
apiDir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceResolver.cjs","sources":["../../../../../../packages/cli/src/lib/workspace/WorkspaceResolver.ts"],"sourcesContent":["import { Workspace } from './Workspace'\nimport { join } from 'node:path'\nimport { YamlHandler } from '../fs/YamlHandler'\n\nexport interface LocalProjectConfig {\n\tapiDir?: string\n\tmigrationsDir?: string\n\tadminDir?: string | false\n\tadminDistDir?: string\n}\n\nexport class WorkspaceResolver {\n\tconstructor(\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\tresolve = async (baseDir: string): Promise<Workspace> => {\n\t\tconst config = await this.readConfig(baseDir)\n\t\tconst apiDir = config.apiDir
|
|
1
|
+
{"version":3,"file":"WorkspaceResolver.cjs","sources":["../../../../../../packages/cli/src/lib/workspace/WorkspaceResolver.ts"],"sourcesContent":["import { Workspace } from './Workspace'\nimport { join, resolve } from 'node:path'\nimport { YamlHandler } from '../fs/YamlHandler'\n\nexport interface LocalProjectConfig {\n\tapiDir?: string\n\tmigrationsDir?: string\n\tadminDir?: string | false\n\tadminDistDir?: string\n}\n\nexport class WorkspaceResolver {\n\tconstructor(\n\t\tprivate readonly yamlHandler: YamlHandler,\n\t) {\n\t}\n\n\tresolve = async (baseDir: string): Promise<Workspace> => {\n\t\tconst config = await this.readConfig(baseDir)\n\t\tconst apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, 'api')\n\t\tconst migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, 'migrations')\n\t\tconst adminDir = config.adminDir === false ? undefined : (config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, 'admin'))\n\t\tconst adminDistDir = adminDir === undefined ? undefined : (config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, 'dist'))\n\n\t\treturn {\n\t\t\tbaseDir,\n\t\t\tapiDir,\n\t\t\tmigrationsDir,\n\t\t\tadminDir,\n\t\t\tadminDistDir,\n\t\t}\n\t}\n\n\tprivate async readConfig(baseDir: string): Promise<LocalProjectConfig> {\n\t\tconst configPath = join(baseDir, 'contember.yaml')\n\t\ttry {\n\t\t\treturn await this.yamlHandler.readYaml(configPath)\n\t\t} catch (e: any) {\n\t\t\tif (e.code === 'ENOENT') {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t\tthrow e\n\t\t}\n\t}\n}\n"],"names":["resolve","join"],"mappings":";;;;;;AAWO,MAAM,kBAAkB;AAAA,EAC9B,YACkB,aAChB;AADgB,SAAA,cAAA;AAIlB,kBAAA,MAAA,WAAU,OAAO,YAAwC;AACxD,YAAM,SAAS,MAAM,KAAK,WAAW,OAAO;AAC5C,YAAM,SAAS,OAAO,SAASA,kBAAQ,SAAS,OAAO,MAAM,IAAIC,eAAK,SAAS,KAAK;AACpF,YAAM,gBAAgB,OAAO,gBAAgBD,kBAAQ,SAAS,OAAO,aAAa,IAAIC,eAAK,QAAQ,YAAY;AAC/G,YAAM,WAAW,OAAO,aAAa,QAAQ,SAAa,OAAO,WAAWD,UAAAA,QAAQ,SAAS,OAAO,QAAQ,IAAIC,UAAAA,KAAK,SAAS,OAAO;AACrI,YAAM,eAAe,aAAa,SAAY,SAAa,OAAO,eAAeD,UAAAA,QAAQ,SAAS,OAAO,YAAY,IAAIC,UAAAA,KAAK,UAAU,MAAM;AAE9I,aAAO;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IAEF,CAAA;AAAA,EAhBA;AAAA,EAkBA,MAAc,WAAW,SAA8C;AACtE,UAAM,aAAaA,UAAAA,KAAK,SAAS,gBAAgB;AACjD,QAAI;AACH,aAAO,MAAM,KAAK,YAAY,SAAS,UAAU;AAAA,IAClD,SAAS,GAAQ;AAChB,UAAI,EAAE,SAAS,UAAU;AACxB,eAAO,CAAA;AAAA,MACR;AACA,YAAM;AAAA,IACP;AAAA,EACD;AACD;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { join } from "node:path";
|
|
1
|
+
import { join, resolve } from "node:path";
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
@@ -7,10 +7,10 @@ class WorkspaceResolver {
|
|
|
7
7
|
this.yamlHandler = yamlHandler;
|
|
8
8
|
__publicField(this, "resolve", async (baseDir) => {
|
|
9
9
|
const config = await this.readConfig(baseDir);
|
|
10
|
-
const apiDir = config.apiDir
|
|
11
|
-
const migrationsDir = config.migrationsDir
|
|
12
|
-
const adminDir = config.adminDir === false ? void 0 : config.adminDir
|
|
13
|
-
const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir
|
|
10
|
+
const apiDir = config.apiDir ? resolve(baseDir, config.apiDir) : join(baseDir, "api");
|
|
11
|
+
const migrationsDir = config.migrationsDir ? resolve(baseDir, config.migrationsDir) : join(apiDir, "migrations");
|
|
12
|
+
const adminDir = config.adminDir === false ? void 0 : config.adminDir ? resolve(baseDir, config.adminDir) : join(baseDir, "admin");
|
|
13
|
+
const adminDistDir = adminDir === void 0 ? void 0 : config.adminDistDir ? resolve(baseDir, config.adminDistDir) : join(adminDir, "dist");
|
|
14
14
|
return {
|
|
15
15
|
baseDir,
|
|
16
16
|
apiDir,
|