import { injectable } from '@cloudbeaver/core-di' ; import { NotificationService } from '@cloudbeaver/core-events' ; import type { DataTransferParameters } from '@cloudbeaver/core-sdk' ; import { DataExportProcessService } from './DataExportProcessService' ; import { DataTransferProcessorsResource } from './DataTransferProcessorsResource' ; import { ExportNotification } from './ExportNotification/ExportNotification' ; import type { IExportContext } from './IExportContext' ; @ injectable ( ) export class DataExportService { constructor ( private notificationService , private dataExportProcessService , readonly processors ) { } async cancel ( exportId ) { await this . dataExportProcessService . cancel ( exportId ) ; } async delete ( exportId ) { await this . dataExportProcessService . delete ( exportId ) ; } download ( exportId ) { this . dataExportProcessService . download ( exportId ) ; } async exportData ( context , parameters ) { const taskId = await this . dataExportProcessService . exportData ( context , parameters ) ; this . notificationService . customNotification ( ( ) => ExportNotification , { source : taskId } ) ; return taskId ; } }