@contember/cli 2.1.0-alpha.30 → 2.1.0-alpha.36
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.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs +7 -4
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js +7 -4
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs.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.map +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.map +1 -1
- package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/development/src/commands/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 +87 -3
- package/dist/development/src/dic.cjs.map +1 -1
- package/dist/development/src/dic.js +88 -4
- 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.map +1 -1
- package/dist/development/src/lib/VersionChecker.js.map +1 -1
- package/dist/development/src/lib/actions/ActionsClient.cjs.map +1 -1
- package/dist/development/src/lib/actions/ActionsClient.js.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/development/src/lib/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.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/development/src/lib/project/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.map +1 -1
- 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 +29 -27
- package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.js +29 -27
- 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.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs +7 -4
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js +7 -4
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs.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.map +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.map +1 -1
- package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/production/src/commands/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 +87 -3
- package/dist/production/src/dic.cjs.map +1 -1
- package/dist/production/src/dic.js +88 -4
- 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.map +1 -1
- package/dist/production/src/lib/VersionChecker.js.map +1 -1
- package/dist/production/src/lib/actions/ActionsClient.cjs.map +1 -1
- package/dist/production/src/lib/actions/ActionsClient.js.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/production/src/lib/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.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/production/src/lib/project/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.map +1 -1
- 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 +29 -27
- package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.js +29 -27
- 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.map +1 -1
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts.map +1 -1
- 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/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.map +1 -1
- package/dist/types/lib/VersionChecker.d.ts.map +1 -1
- package/dist/types/lib/actions/ActionsClient.d.ts.map +1 -1
- 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/MigrationPrinter.d.ts.map +1 -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.map +1 -1
- package/package.json +39 -35
- package/src/commands/actions/ActionsGetEventCommand.ts +0 -1
- package/src/commands/actions/ActionsListFailedEventsCommand.ts +1 -3
- package/src/commands/actions/ActionsListVariablesCommand.ts +1 -2
- package/src/commands/actions/ActionsSetVariablesCommand.ts +13 -7
- 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 +7 -12
- package/src/commands/project/ProjectGenerateDocumentationCommand.ts +1 -2
- package/src/commands/project/ProjectPrintSchemaCommand.ts +1 -3
- package/src/commands/transfer/ImportCommand.ts +1 -2
- package/src/commands/transfer/TransferCommand.ts +2 -3
- package/src/commands/transfer/utils.ts +0 -1
- package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +16 -14
- package/src/dic.ts +150 -116
- package/src/lib/VersionChecker.ts +0 -2
- package/src/lib/actions/ActionsClient.ts +0 -1
- 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/MigrationPrinter.ts +0 -2
- package/src/lib/migrations/MigrationsStatusFacade.ts +0 -1
- 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 +32 -32
- package/src/lib/transfer/stdio.ts +0 -1
- package/src/lib/workspace/WorkspaceResolver.ts +5 -5
- package/src/run.ts +2 -5
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/postcss.config.js +0 -6
- package/src/.eslintrc.cjs +0 -5
- package/src/lib/project/docs/.eslintrc.cjs +0 -5
- package/tailwind.config.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnDelete.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/OnDelete.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"OnDelete.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/OnDelete.tsx"],"sourcesContent":["import { Fragment, h } from 'preact'\nimport { Model } from '@contember/schema'\nimport { ReferenceMapEntry, ReferencesMap } from '../../../schema/collectReferences'\nimport { FieldLink } from './FieldLink'\nimport { EntityLink } from './EntityLink'\n\nconst sortReferences = (a: ReferenceMapEntry, b: ReferenceMapEntry) =>\n\ta.owningRelation.joiningColumn.onDelete.localeCompare(b.owningRelation.joiningColumn.onDelete)\n\t|| a.owningEntity.name.localeCompare(b.owningEntity.name)\n\t|| a.owningRelation.name.localeCompare(b.owningRelation.name)\n\nexport const OnDelete = ({ references, entity, visited = [] }: { references: ReferencesMap; entity: Model.Entity; visited?: Model.Entity[] }) => {\n\tconst referencedFrom = references[entity.name]\n\tif (referencedFrom.length === 0) {\n\t\tif (visited.length !== 0) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<span class={'bg-green-200 text-gray-600 p-1 rounded'}>\n\t\t\t\tThis entity is not referenced from any other entity.\n\t\t\t</span>\n\t\t)\n\t}\n\n\tif (visited.includes(entity)) {\n\t\treturn (\n\t\t\t<ul class={'ml-4'}>\n\t\t\t\t<li class={'italic'}>(recursion)</li>\n\t\t\t</ul>\n\t\t)\n\t}\n\n\treturn (\n\t\t<ul class={visited.length > 0 ? 'ml-4' : ''}>\n\t\t\t{referencedFrom\n\t\t\t\t.sort(sortReferences)\n\t\t\t\t.map(it => {\n\t\t\t\t\tconst inverseDescr = it.targetRelation\n\t\t\t\t\t\t? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\tsee <FieldLink entity={entity.name} field={it.targetRelation.name} />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: 'no inverse side'\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'restrict') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-black text-white px-1'}>Fails</span> when referenced from{' '}\n\t\t\t\t\t\t\t\t<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} /> ({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'set null') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-blue-400 text-white px-1'}>Sets null</span> at <FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'cascade') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} /> connected using{' '}\n\t\t\t\t\t\t\t\t<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel /> ({inverseDescr})\n\t\t\t\t\t\t\t\t<OnDelete entity={it.owningEntity} visited={[...visited, entity]} references={references} />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t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|
|
|
24
24
|
" when referenced from",
|
|
25
25
|
" ",
|
|
26
26
|
/* @__PURE__ */ jsx(FieldLink, { entity: it.owningEntity.name, field: it.owningRelation.name }),
|
|
27
|
-
" ",
|
|
28
|
-
"(",
|
|
27
|
+
" (",
|
|
29
28
|
inverseDescr,
|
|
30
29
|
")"
|
|
31
30
|
] }, it.owningEntity.name + "_" + it.owningRelation.name);
|
|
@@ -33,8 +32,7 @@ const OnDelete = ({ references, entity, visited = [] }) => {
|
|
|
33
32
|
if (it.owningRelation.joiningColumn.onDelete === "set null") {
|
|
34
33
|
return /* @__PURE__ */ jsxs("li", { children: [
|
|
35
34
|
/* @__PURE__ */ jsx("span", { class: "bg-blue-400 text-white px-1", children: "Sets null" }),
|
|
36
|
-
" at",
|
|
37
|
-
" ",
|
|
35
|
+
" at ",
|
|
38
36
|
/* @__PURE__ */ jsx(FieldLink, { entity: it.owningEntity.name, field: it.owningRelation.name }),
|
|
39
37
|
" ",
|
|
40
38
|
"(",
|
|
@@ -47,12 +45,10 @@ const OnDelete = ({ references, entity, visited = [] }) => {
|
|
|
47
45
|
/* @__PURE__ */ jsx("span", { class: "bg-red-400 text-white px-1", children: "Deletes" }),
|
|
48
46
|
" ",
|
|
49
47
|
/* @__PURE__ */ jsx(EntityLink, { entity: it.owningEntity.name }),
|
|
50
|
-
" ",
|
|
51
|
-
"connected using",
|
|
48
|
+
" connected using",
|
|
52
49
|
" ",
|
|
53
50
|
/* @__PURE__ */ jsx(FieldLink, { entity: it.owningEntity.name, field: it.owningRelation.name, noEntityLabel: true }),
|
|
54
|
-
" ",
|
|
55
|
-
"(",
|
|
51
|
+
" (",
|
|
56
52
|
inverseDescr,
|
|
57
53
|
")",
|
|
58
54
|
/* @__PURE__ */ jsx(OnDelete, { entity: it.owningEntity, visited: [...visited, entity], references })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnDelete.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/OnDelete.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"OnDelete.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/OnDelete.tsx"],"sourcesContent":["import { Fragment, h } from 'preact'\nimport { Model } from '@contember/schema'\nimport { ReferenceMapEntry, ReferencesMap } from '../../../schema/collectReferences'\nimport { FieldLink } from './FieldLink'\nimport { EntityLink } from './EntityLink'\n\nconst sortReferences = (a: ReferenceMapEntry, b: ReferenceMapEntry) =>\n\ta.owningRelation.joiningColumn.onDelete.localeCompare(b.owningRelation.joiningColumn.onDelete)\n\t|| a.owningEntity.name.localeCompare(b.owningEntity.name)\n\t|| a.owningRelation.name.localeCompare(b.owningRelation.name)\n\nexport const OnDelete = ({ references, entity, visited = [] }: { references: ReferencesMap; entity: Model.Entity; visited?: Model.Entity[] }) => {\n\tconst referencedFrom = references[entity.name]\n\tif (referencedFrom.length === 0) {\n\t\tif (visited.length !== 0) {\n\t\t\treturn null\n\t\t}\n\t\treturn (\n\t\t\t<span class={'bg-green-200 text-gray-600 p-1 rounded'}>\n\t\t\t\tThis entity is not referenced from any other entity.\n\t\t\t</span>\n\t\t)\n\t}\n\n\tif (visited.includes(entity)) {\n\t\treturn (\n\t\t\t<ul class={'ml-4'}>\n\t\t\t\t<li class={'italic'}>(recursion)</li>\n\t\t\t</ul>\n\t\t)\n\t}\n\n\treturn (\n\t\t<ul class={visited.length > 0 ? 'ml-4' : ''}>\n\t\t\t{referencedFrom\n\t\t\t\t.sort(sortReferences)\n\t\t\t\t.map(it => {\n\t\t\t\t\tconst inverseDescr = it.targetRelation\n\t\t\t\t\t\t? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\tsee <FieldLink entity={entity.name} field={it.targetRelation.name} />\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: 'no inverse side'\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'restrict') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-black text-white px-1'}>Fails</span> when referenced from{' '}\n\t\t\t\t\t\t\t\t<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} /> ({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'set null') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-blue-400 text-white px-1'}>Sets null</span> at <FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} />\n\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t({inverseDescr})\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tif (it.owningRelation.joiningColumn.onDelete === 'cascade') {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={it.owningEntity.name + '_' + it.owningRelation.name}>\n\t\t\t\t\t\t\t\t<span class={'bg-red-400 text-white px-1'}>Deletes</span> <EntityLink entity={it.owningEntity.name} /> connected using{' '}\n\t\t\t\t\t\t\t\t<FieldLink entity={it.owningEntity.name} field={it.owningRelation.name} noEntityLabel /> ({inverseDescr})\n\t\t\t\t\t\t\t\t<OnDelete entity={it.owningEntity} visited={[...visited, entity]} references={references} />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t})}\n\t\t</ul>\n\t)\n}\n"],"names":[],"mappings":";;;AAMA,MAAM,iBAAiB,CAAC,GAAsB,MAC7C,EAAE,eAAe,cAAc,SAAS,cAAc,EAAE,eAAe,cAAc,QAAQ,KAC1F,EAAE,aAAa,KAAK,cAAc,EAAE,aAAa,IAAI,KACrD,EAAE,eAAe,KAAK,cAAc,EAAE,eAAe,IAAI;AAEtD,MAAM,WAAW,C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,KAAA,CAAM;AAAA,QACvI;AAAA,QAAI;AAAA,QACH;AAAA,QAAa;AAAA,MAAA,EAAA,GAHP,GAAG,aAAa,OAAO,MAAM,GAAG,eAAe,IAIxD;AAAA,IAEF;AACA,QAAI,GAAG,eAAe,cAAc,aAAa,WAAW;AAC3D,kCACE,MAAA,EACA,UAAA;AAAA,QAAA,oBAAC,QAAA,EAAK,OAAO,8BAA8B,UAAA,WAAO;AAAA,QAAO;AAAA,QAAC,oBAAC,YAAA,EAAW,QAAQ,GAAG,aAAa,MAAM;AAAA,QAAE;AAAA,QAAiB;AAAA,QACvH,oBAAC,WAAA,EAAU,QAAQ,GAAG,aAAa,MAAM,OAAO,GAAG,eAAe,MAAM,eAAa,KAAA,CAAC;AAAA,QAAE;AAAA,QAAG;AAAA,QAAa;AAAA,QACxG,oBAAC,UAAA,EAAS,QAAQ,GAAG,cAAc,SAAS,CAAC,GAAG,SAAS,MAAM,GAAG,WAAA,CAAwB;AAAA,MAAA,EAAA,GAHlF,GAAG,aAAa,OAAO,MAAM,GAAG,eAAe,IAIxD;AAAA,IAEF;AAAA,EACD,CAAC,EAAA,CACH;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectInfo.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/ProjectInfo.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport { collectReferences } from '../../../schema/collectReferences'\nimport { EntityLink } from './EntityLink'\nimport { EntityInfo } from './EntityInfo'\n\
|
|
1
|
+
{"version":3,"file":"ProjectInfo.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/ProjectInfo.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport { collectReferences } from '../../../schema/collectReferences'\nimport { EntityLink } from './EntityLink'\nimport { EntityInfo } from './EntityInfo'\n\nexport const ProjectInfo = (props: { schema: Schema; projectName: string }) => {\n\tconst references = collectReferences(props.schema.model)\n\n\treturn (\n\t\t<div class={'w-full'}>\n\t\t\t<div class={'bg-gray-100 p-6 border-b border-gray-400'}>\n\t\t\t\t<h1 class={'font-bold text-xl mb-1'}>{props.projectName}</h1>\n\t\t\t\t<div class={'flex flex-column gap-4'}>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Entities</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t\t\t\t\t<li key={entity.name}>\n\t\t\t\t\t\t\t\t\t<EntityLink entity={entity.name} />\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Enums</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.entries(props.schema.model.enums).map(([name, values]) => (\n\t\t\t\t\t\t\t\t<li class={'mb-2'} key={name}>\n\t\t\t\t\t\t\t\t\t{name} <br />\n\t\t\t\t\t\t\t\t\t<span class={'text-gray-700 ml-4'}>\n\t\t\t\t\t\t\t\t\t\t{values.join(', ')}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t<EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references} />\n\t\t\t))}\n\t\t</div>\n\t)\n}\n"],"names":["collectReferences","jsxs","jsx","EntityLink","EntityInfo"],"mappings":";;;;;;AAMO,MAAM,cAAc,CAAC,UAAmD;AAC9E,QAAM,aAAaA,kBAAAA,kBAAkB,MAAM,OAAO,KAAK;AAEvD,SACCC,2BAAAA,KAAC,OA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AAA,GACF;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectInfo.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/ProjectInfo.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport { collectReferences } from '../../../schema/collectReferences'\nimport { EntityLink } from './EntityLink'\nimport { EntityInfo } from './EntityInfo'\n\
|
|
1
|
+
{"version":3,"file":"ProjectInfo.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/ProjectInfo.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport { collectReferences } from '../../../schema/collectReferences'\nimport { EntityLink } from './EntityLink'\nimport { EntityInfo } from './EntityInfo'\n\nexport const ProjectInfo = (props: { schema: Schema; projectName: string }) => {\n\tconst references = collectReferences(props.schema.model)\n\n\treturn (\n\t\t<div class={'w-full'}>\n\t\t\t<div class={'bg-gray-100 p-6 border-b border-gray-400'}>\n\t\t\t\t<h1 class={'font-bold text-xl mb-1'}>{props.projectName}</h1>\n\t\t\t\t<div class={'flex flex-column gap-4'}>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Entities</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t\t\t\t\t<li key={entity.name}>\n\t\t\t\t\t\t\t\t\t<EntityLink entity={entity.name} />\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2 class={'font-semibold text-gray-500 mb-1'}>Enums</h2>\n\t\t\t\t\t\t<ul class={'text-sm'}>\n\t\t\t\t\t\t\t{Object.entries(props.schema.model.enums).map(([name, values]) => (\n\t\t\t\t\t\t\t\t<li class={'mb-2'} key={name}>\n\t\t\t\t\t\t\t\t\t{name} <br />\n\t\t\t\t\t\t\t\t\t<span class={'text-gray-700 ml-4'}>\n\t\t\t\t\t\t\t\t\t\t{values.join(', ')}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{Object.values(props.schema.model.entities).map(entity => (\n\t\t\t\t<EntityInfo key={entity.name} entity={entity} schema={props.schema} references={references} />\n\t\t\t))}\n\t\t</div>\n\t)\n}\n"],"names":[],"mappings":";;;;AAMO,MAAM,cAAc,CAAC,UAAmD;AAC9E,QAAM,aAAa,kBAAkB,MAAM,OAAO,KAAK;AAEvD,SACC,qBAAC,OAAA,EAAI,OAAO,UACX,UAAA;AAAA,IAAA,qBAAC,OAAA,EAAI,OAAO,4CACX,UAAA;AAAA,MAAA,oBAAC,MAAA,EAAG,OAAO,0BAA2B,UAAA,MAAM,aAAY;AAAA,MACxD,qBAAC,OAAA,EAAI,OAAO,0BACX,UAAA;AAAA,QAAA,qBAAC,OAAA,EACA,UAAA;AAAA,UAAA,oBAAC,MAAA,EAAG,OAAO,oCAAoC,UAAA,YAAQ;AAAA,UACvD,oBAAC,MAAA,EAAG,OAAO,WACT,UAAA,OAAO,OAAO,MAAM,OAAO,MAAM,QAAQ,EAAE,IAAI,YAC/C,oBAAC,MAAA,EACA,UAAA,oBAAC,YAAA,EAAW,QAAQ,OAAO,MAAM,EAAA,GADzB,OAAO,IAEhB,CACA,EAAA,CACF;AAAA,QAAA,GACD;AAAA,6BACC,OAAA,EACA,UAAA;AAAA,UAAA,oBAAC,MAAA,EAAG,OAAO,oCAAoC,UAAA,SAAK;AAAA,UACpD,oBAAC,QAAG,OAAO,WACT,iBAAO,QAAQ,MAAM,OAAO,MAAM,KAAK,EAAE,IAAI,CAAC,CAAC,MAAM,MAAM,MAC3D,qBAAC,MAAA,EAAG,OAAO,QACT,UAAA;AAAA,YAAA;AAAA,YAAK;AAAA,gCAAE,MAAA,EAAG;AAAA,gCACV,QAAA,EAAK,OAAO,sBACX,UAAA,OAAO,KAAK,IAAI,EAAA,CAClB;AAAA,UAAA,EAAA,GAJuB,IAKxB,CACA,EAAA,CACF;AAAA,QAAA,EAAA,CACD;AAAA,MAAA,EAAA,CACD;AAAA,IAAA,GACD;AAAA,IACC,OAAO,OAAO,MAAM,OAAO,MAAM,QAAQ,EAAE,IAAI,CAAA,WAC/C,oBAAC,YAAA,EAA6B,QAAgB,QAAQ,MAAM,QAAQ,WAAA,GAAnD,OAAO,IAAoE,CAC5F;AAAA,EAAA,GACF;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SinglePermission.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/SinglePermission.tsx"],"sourcesContent":["import { h } from 'preact'\nimport { Acl } from '@contember/schema'\n\nexport const SinglePermission = ({ predicate, value }: { predicate?: Acl.Predicate; value: string }) => {\n\tif (!predicate) {\n\t\treturn <span class={'bg-red-500 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\tif (predicate === true) {\n\t\treturn <span class={'bg-green-600 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\treturn <span class={'bg-yellow-400 text-black font-semibold px-0.5'} title={predicate}>{value}</span>\n}\n
|
|
1
|
+
{"version":3,"file":"SinglePermission.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/SinglePermission.tsx"],"sourcesContent":["import { h } from 'preact'\nimport { Acl } from '@contember/schema'\n\nexport const SinglePermission = ({ predicate, value }: { predicate?: Acl.Predicate; value: string }) => {\n\tif (!predicate) {\n\t\treturn <span class={'bg-red-500 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\tif (predicate === true) {\n\t\treturn <span class={'bg-green-600 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\treturn <span class={'bg-yellow-400 text-black font-semibold px-0.5'} title={predicate}>{value}</span>\n}\n"],"names":["jsx"],"mappings":";;;AAGO,MAAM,mBAAmB,CAAC,EAAE,WAAW,YAA0D;AACvG,MAAI,CAAC,WAAW;AACf,WAAOA,2BAAAA,IAAC,QAAA,EAAK,OAAO,8CAA+C,UAAA,OAAM;AAAA,EAC1E;AACA,MAAI,cAAc,MAAM;AACvB,WAAOA,2BAAAA,IAAC,QAAA,EAAK,OAAO,gDAAiD,UAAA,OAAM;AAAA,EAC5E;AACA,wCAAQ,QAAA,EAAK,OAAO,iDAAiD,OAAO,WAAY,UAAA,OAAM;AAC/F;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SinglePermission.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/SinglePermission.tsx"],"sourcesContent":["import { h } from 'preact'\nimport { Acl } from '@contember/schema'\n\nexport const SinglePermission = ({ predicate, value }: { predicate?: Acl.Predicate; value: string }) => {\n\tif (!predicate) {\n\t\treturn <span class={'bg-red-500 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\tif (predicate === true) {\n\t\treturn <span class={'bg-green-600 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\treturn <span class={'bg-yellow-400 text-black font-semibold px-0.5'} title={predicate}>{value}</span>\n}\n
|
|
1
|
+
{"version":3,"file":"SinglePermission.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/SinglePermission.tsx"],"sourcesContent":["import { h } from 'preact'\nimport { Acl } from '@contember/schema'\n\nexport const SinglePermission = ({ predicate, value }: { predicate?: Acl.Predicate; value: string }) => {\n\tif (!predicate) {\n\t\treturn <span class={'bg-red-500 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\tif (predicate === true) {\n\t\treturn <span class={'bg-green-600 text-white font-semibold px-0.5'}>{value}</span>\n\t}\n\treturn <span class={'bg-yellow-400 text-black font-semibold px-0.5'} title={predicate}>{value}</span>\n}\n"],"names":[],"mappings":";AAGO,MAAM,mBAAmB,CAAC,EAAE,WAAW,YAA0D;AACvG,MAAI,CAAC,WAAW;AACf,WAAO,oBAAC,QAAA,EAAK,OAAO,8CAA+C,UAAA,OAAM;AAAA,EAC1E;AACA,MAAI,cAAc,MAAM;AACvB,WAAO,oBAAC,QAAA,EAAK,OAAO,gDAAiD,UAAA,OAAM;AAAA,EAC5E;AACA,6BAAQ,QAAA,EAAK,OAAO,iDAAiD,OAAO,WAAY,UAAA,OAAM;AAC/F;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/utils.ts"],"sourcesContent":["export const formatEntityAnchor = (name: string) => `entity-${name}`\nexport const formatFieldAnchor = (entity: string, field: string) => `field-${entity}--${field}`\n
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/utils.ts"],"sourcesContent":["export const formatEntityAnchor = (name: string) => `entity-${name}`\nexport const formatFieldAnchor = (entity: string, field: string) => `field-${entity}--${field}`\n"],"names":[],"mappings":";;AAAO,MAAM,qBAAqB,CAAC,SAAiB,UAAU,IAAI;AAC3D,MAAM,oBAAoB,CAAC,QAAgB,UAAkB,SAAS,MAAM,KAAK,KAAK;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/utils.ts"],"sourcesContent":["export const formatEntityAnchor = (name: string) => `entity-${name}`\nexport const formatFieldAnchor = (entity: string, field: string) => `field-${entity}--${field}`\n
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../../../packages/cli/src/lib/project/docs/components/utils.ts"],"sourcesContent":["export const formatEntityAnchor = (name: string) => `entity-${name}`\nexport const formatFieldAnchor = (entity: string, field: string) => `field-${entity}--${field}`\n"],"names":[],"mappings":"AAAO,MAAM,qBAAqB,CAAC,SAAiB,UAAU,IAAI;AAC3D,MAAM,oBAAoB,CAAC,QAAgB,UAAkB,SAAS,MAAM,KAAK,KAAK;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectDescribe.cjs","sources":["../../../../../../../packages/cli/src/lib/project/docs/projectDescribe.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport render from 'preact-render-to-string'\nimport { ProjectInfo } from './components/ProjectInfo'\nimport { readFile } from 'node:fs/promises'\nimport { packageRoot } from '../../../consts'\n\nexport const renderProjectInfoHtml = async (schema: Schema, projectName: string) => {\n\tconst html = render(<ProjectInfo schema={schema} projectName={projectName} />)\n\n\tconst css = await readFile(packageRoot + '/dist/resources/out.css')\n\treturn `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t<style>${css}</style>\n\t<title>${projectName}</title>\n</head>\n<body>\n${html}\n</body>\n</html>\n`\n
|
|
1
|
+
{"version":3,"file":"projectDescribe.cjs","sources":["../../../../../../../packages/cli/src/lib/project/docs/projectDescribe.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport render from 'preact-render-to-string'\nimport { ProjectInfo } from './components/ProjectInfo'\nimport { readFile } from 'node:fs/promises'\nimport { packageRoot } from '../../../consts'\n\nexport const renderProjectInfoHtml = async (schema: Schema, projectName: string) => {\n\tconst html = render(<ProjectInfo schema={schema} projectName={projectName} />)\n\n\tconst css = await readFile(packageRoot + '/dist/resources/out.css')\n\treturn `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t<style>${css}</style>\n\t<title>${projectName}</title>\n</head>\n<body>\n${html}\n</body>\n</html>\n`\n}\n"],"names":["jsx","ProjectInfo","readFile","packageRoot"],"mappings":";;;;;;;AAOO,MAAM,wBAAwB,OAAO,QAAgB,gBAAwB;AACnF,QAAM,OAAO,OAAOA,2BAAAA,IAACC,YAAAA,aAAA,EAAY,QAAgB,aAA0B,CAAE;AAE7E,QAAM,MAAM,MAAMC,YAASC,OAAAA,cAAc,yBAAyB;AAClE,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,UAKE,GAAG;AAAA,UACH,WAAW;AAAA;AAAA;AAAA,EAGnB,IAAI;AAAA;AAAA;AAAA;AAIN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectDescribe.js","sources":["../../../../../../../packages/cli/src/lib/project/docs/projectDescribe.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport render from 'preact-render-to-string'\nimport { ProjectInfo } from './components/ProjectInfo'\nimport { readFile } from 'node:fs/promises'\nimport { packageRoot } from '../../../consts'\n\nexport const renderProjectInfoHtml = async (schema: Schema, projectName: string) => {\n\tconst html = render(<ProjectInfo schema={schema} projectName={projectName} />)\n\n\tconst css = await readFile(packageRoot + '/dist/resources/out.css')\n\treturn `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t<style>${css}</style>\n\t<title>${projectName}</title>\n</head>\n<body>\n${html}\n</body>\n</html>\n`\n
|
|
1
|
+
{"version":3,"file":"projectDescribe.js","sources":["../../../../../../../packages/cli/src/lib/project/docs/projectDescribe.tsx"],"sourcesContent":["import { Schema } from '@contember/schema'\nimport { h } from 'preact'\nimport render from 'preact-render-to-string'\nimport { ProjectInfo } from './components/ProjectInfo'\nimport { readFile } from 'node:fs/promises'\nimport { packageRoot } from '../../../consts'\n\nexport const renderProjectInfoHtml = async (schema: Schema, projectName: string) => {\n\tconst html = render(<ProjectInfo schema={schema} projectName={projectName} />)\n\n\tconst css = await readFile(packageRoot + '/dist/resources/out.css')\n\treturn `<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"UTF-8\">\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t<style>${css}</style>\n\t<title>${projectName}</title>\n</head>\n<body>\n${html}\n</body>\n</html>\n`\n}\n"],"names":[],"mappings":";;;;;AAOO,MAAM,wBAAwB,OAAO,QAAgB,gBAAwB;AACnF,QAAM,OAAO,OAAO,oBAAC,aAAA,EAAY,QAAgB,aAA0B,CAAE;AAE7E,QAAM,MAAM,MAAM,SAAS,cAAc,yBAAyB;AAClE,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA,UAKE,GAAG;AAAA,UACH,WAAW;AAAA;AAAA;AAAA,EAGnB,IAAI;AAAA;AAAA;AAAA;AAIN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaLoader.cjs","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.cjs","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":["join","Typesafe","schemaType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,YACkB,WAChB;AADgB,SAAA,YAAA;AAIlB,kBAAA,MAAA,cAAa,YAA6B;AACzC,YAAM,OAAOA,UAAAA,KAAK,KAAK,UAAU,QAAQ,UAAU;AACnD,YAAM,SAAS,MAAM,OAAO;AAC5B,aAAOC,oBAAS,OAAO,EAAE,SAASC,YAAAA,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,OAAOF,UAAAA,KAAK,KAAK,UAAU,QAAQ,UAAU;AAEnD,YAAM,SAAS,MAAM,KAAK,aAAa,IAAI,IAAI;AAC/C,aAAOC,oBAAS,OAAO,EAAE,SAASC,YAAAA,YAAY,EAAE,MAAM,EAAE;AAAA,IACzD,CAAA;AAAA,EAPA;AAQD;;;"}
|
|
@@ -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;"}
|
|
@@ -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;;"}
|
|
@@ -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;"}
|
|
@@ -14,33 +14,35 @@ class DataTransferClient {
|
|
|
14
14
|
let rowTotal = 0;
|
|
15
15
|
let transferred = 0;
|
|
16
16
|
let start = Date.now();
|
|
17
|
-
const inputStream = stream$1.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
|
-
|
|
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
|
+
);
|
|
44
46
|
inputStream.on("error", (err) => {
|
|
45
47
|
throw new Error(`Input stream error: ${err}`);
|
|
46
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTransferClient.cjs","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\
|
|
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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AAA,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;;"}
|
|
@@ -12,33 +12,35 @@ class DataTransferClient {
|
|
|
12
12
|
let rowTotal = 0;
|
|
13
13
|
let transferred = 0;
|
|
14
14
|
let start = Date.now();
|
|
15
|
-
const inputStream = stream.pipe(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
+
);
|
|
42
44
|
inputStream.on("error", (err) => {
|
|
43
45
|
throw new Error(`Input stream error: ${err}`);
|
|
44
46
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTransferClient.js","sources":["../../../../../../packages/cli/src/lib/transfer/DataTransferClient.ts"],"sourcesContent":["import { LineTransform } from '../stream'\nimport { Readable } from 'node:stream'\nimport { createGzip } from 'node:zlib'\nimport { RemoteProject } from '../project/RemoteProject'\n\nexport class DataTransferClient {\n\
|
|
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;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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;"}
|