import type { FileUploadConvertedStatus, FileUploadRecord, FileUploadRecordV2 } from '@/modules/fileuploads/helpers/types' import type { Optional } from '@speckle/shared' import type { UploadResult } from '@/modules/blobstorage/domain/types' import type { FileImportResultPayload, JobPayload } from '@speckle/shared/workers/fileimport' export type GetFileInfo = (args: { fileId: string }) => Promise> export type GetFileInfoV2 = (args: { fileId: string projectId?: string }) => Promise> export type SaveUploadFileInput = Pick< FileUploadRecord, | 'streamId' | 'branchName' | 'userId' | 'fileName' | 'fileType' | 'fileSize' | 'modelId' > & { 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: SaveUploadFileInput ) => Promise export type InsertNewUploadAndNotifyV2 = ( uploadResults: SaveUploadFileInputV2 ) => Promise export type SaveUploadFileV2 = ( args: SaveUploadFileInputV2 ) => Promise export type UpdateFileUpload = (args: { id: string upload: Partial }) => 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 projectId: string status: FileUploadConvertedStatus convertedMessage: string convertedCommitId: string | null }) => Promise export type UpdateFileStatusForProjectFactory = (params: { projectId: string }) => 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: { scheduleJob: ScheduleFileimportJob } & FileImportMessage ) => Promise export type RegisterUploadCompleteAndStartFileImport = (args: { projectId: string modelId: string fileId: string userId: string expectedETag: string maximumFileSize: number }) => Promise export type GetModelUploadsBaseArgs = { projectId: string modelId: string } export type GetModelUploadsArgs = GetModelUploadsBaseArgs & { limit?: number cursor?: string | null } export type GetModelUploadsItems = (params: GetModelUploadsArgs) => Promise<{ items: FileUploadRecord[] cursor: string | null }> export type GetModelUploadsTotalCount = ( params: GetModelUploadsBaseArgs ) => Promise export type GetModelUploads = (params: GetModelUploadsArgs) => Promise<{ items: FileUploadRecord[] totalCount: number cursor: string | null }>