@@ -28,42 +28,23 @@ const EVENT_TYPE_TRANSLATION_TABLE = {
2828 "EXTRACTION_ATTACHMENTS_CONTINUE" : EventType . ExtractionAttachmentsContinue ,
2929 "EXTRACTION_DATA_DELETE" : EventType . ExtractionDataDelete ,
3030 "EXTRACTION_ATTACHMENTS_DELETE" : EventType . ExtractionAttachmentsDelete ,
31-
32- "EXTRACTION_EXTERNAL_SYNC_UNITS_DONE" : ExtractorEventType . ExtractionExternalSyncUnitsDone ,
33- "EXTRACTION_EXTERNAL_SYNC_UNITS_ERROR" : ExtractorEventType . ExtractionExternalSyncUnitsError ,
34- "EXTRACTION_METADATA_DONE" : ExtractorEventType . ExtractionMetadataDone ,
35- "EXTRACTION_METADATA_ERROR" : ExtractorEventType . ExtractionMetadataError ,
36- "EXTRACTION_DATA_PROGRESS" : ExtractorEventType . ExtractionDataProgress ,
37- "EXTRACTION_DATA_DELAY" : ExtractorEventType . ExtractionDataDelay ,
38- "EXTRACTION_DATA_DONE" : ExtractorEventType . ExtractionDataDone ,
39- "EXTRACTION_DATA_ERROR" : ExtractorEventType . ExtractionDataError ,
40- "EXTRACTION_ATTACHMENTS_PROGRESS" : ExtractorEventType . ExtractionAttachmentsProgress ,
41- "EXTRACTION_ATTACHMENTS_DELAY" : ExtractorEventType . ExtractionAttachmentsDelay ,
42- "EXTRACTION_ATTACHMENTS_DONE" : ExtractorEventType . ExtractionAttachmentsDone ,
43- "EXTRACTION_ATTACHMENTS_ERROR" : ExtractorEventType . ExtractionAttachmentsError ,
44- "EXTRACTION_DATA_DELETE_DONE" : ExtractorEventType . ExtractionDataDeleteDone ,
45- "EXTRACTION_DATA_DELETE_ERROR" : ExtractorEventType . ExtractionDataDeleteError ,
46- "EXTRACTION_ATTACHMENTS_DELETE_DONE" : ExtractorEventType . ExtractionAttachmentsDeleteDone ,
47- "EXTRACTION_ATTACHMENTS_DELETE_ERROR" : ExtractorEventType . ExtractionAttachmentsDeleteError
4831} ;
4932
5033/**
5134 * Translates Event type from the old naming scheme to the new one
5235 */
53- export function getEventType ( eventType : string ) : EventType | ExtractorEventType {
36+ export function getEventType ( eventType : string ) : EventType {
5437 // If we notice that the event has a newer translation, translate to that
5538 if ( eventType in EVENT_TYPE_TRANSLATION_TABLE ) {
5639 return EVENT_TYPE_TRANSLATION_TABLE [ eventType as keyof typeof EVENT_TYPE_TRANSLATION_TABLE ] ;
5740 }
5841
59- // Return the correct event type
60- if ( eventType in ExtractorEventType ) {
61- return eventType as ExtractorEventType ;
62- } else if ( eventType in EventType ) {
42+ // Event type doesn't need translation, return
43+ if ( eventType in EventType ) {
6344 return eventType as EventType ;
6445 }
6546
66- return ExtractorEventType . UnknownEventType ;
47+ return EventType . UnknownEventType ;
6748}
6849
6950export function getTimeoutErrorEventType ( eventType : EventType ) : {
0 commit comments