import { FileUploadConvertedStatus, FileUploadRecord, FileUploadRecordV2 } from '@/modules/fileuploads/helpers/types' import { Optional } from '@speckle/shared' import { UploadResult } from '@/modules/blobstorage/domain/types' import { FileImportResultPayload, JobPayload } from '@speckle/shared/workers/fileimport' export type GetFileInfo = (args: { fileId: string }) => Promise> export type SaveUploadFileInput = Pick< FileUploadRecord, 'streamId' | 'branchName' | 'userId' | 'fileName' | 'fileType' | 'fileSize' > & { fileId: string } export type SaveUploadFileInputV2 = Pick< FileUploadRecordV2, 'projectId' | 'userId' | 'fileName' | 'fileType' | 'fileSize' > & { fileId: string; modelId: string; modelName: string } export type SaveUploadFile = (args: SaveUploadFileInput) => Promise export type InsertNewUploadAndNotify = ( uploadResults: SaveUploadFileInputV2 ) => Promise export type SaveUploadFileV2 = ( args: SaveUploadFileInputV2 ) => Promise export type GarbageCollectPendingUploadedFiles = (args: { timeoutThresholdSeconds: number }) => Promise export type NotifyChangeInFileStatus = (params: { file: FileUploadRecord }) => Promise export type ProcessFileImportResult = (params: { jobId: string jobResult: FileImportResultPayload }) => Promise export type UpdateFileStatus = (params: { fileId: string status: FileUploadConvertedStatus convertedMessage: string convertedCommitId: string | null }) => Promise export type UploadedFile = UploadResult & { userId: string } export type FileImportMessage = Pick< JobPayload, 'modelId' | 'projectId' | 'fileType' | 'fileName' | 'blobId' > & { jobId: string; userId: string } export type ScheduleFileimportJob = (args: JobPayload) => Promise export type PushJobToFileImporter = (args: FileImportMessage) => Promise