Files
speckle-server/packages/server/modules/fileuploads/domain/events.ts
T
Kristaps Fabians Geikins ed507c265b fix(server): not firing upload created/processed subs in next gen uploads (#4991)
* fix(server): not firing upload created subs in next gen uploads

* lint fixes

* upload finished fixes

* test fixes

* fixed file_import_started
2025-06-26 15:33:11 +03:00

31 lines
933 B
TypeScript

import {
FileUploadRecord,
FileUploadRecordV2
} from '@/modules/fileuploads/helpers/types'
export const fileuploadEventNamespace = 'fileupload' as const
const eventPrefix = `${fileuploadEventNamespace}.` as const
export const FileuploadEvents = {
Started: `${eventPrefix}started`,
Updated: `${eventPrefix}updated`
} as const
export type FileuploadEvents = (typeof FileuploadEvents)[keyof typeof FileuploadEvents]
type FileuploadStartedPayload = { upload: FileUploadRecordV2 & FileUploadRecord }
type FileuploadUpdatedPayload = {
upload: FileUploadRecordV2
/**
* Whether the upload represents a new model being created. This is only supported in
* legacy file uploads, where the model is created as part of the upload process.
*/
isNewModel: boolean
}
export type FileuploadEventsPayloads = {
[FileuploadEvents.Started]: FileuploadStartedPayload
[FileuploadEvents.Updated]: FileuploadUpdatedPayload
}