export type Contact = { id: number; name: string; contactable: { id: number; __typename: string; }; }; export type RCExtension = { id: number; uri: string; extensionNumber: string; name: string; type: | "User" | "FaxUser" | "VirtualUser" | "DigitalUser" | "Department" | "Announcement" | "Voicemail" | "SharedLinesGroup" | "PagingOnly" | "IvrMenu" | "ApplicationExtension" | "ParkLocation" | "Bot" | "Room" | "Limited" | "Site" | "ProxyAdmin" | "DelegatedLinesGroup" | "GroupCallPickup"; hidden: boolean; status: "Enabled" | "Disabled" | "Frozen" | "NotActivated" | "Unassigned"; }; export type Recipient = { extensionId?: number; extensionNumber?: string; location: string; name: string; phoneNumber: string; }; export type Sender = Recipient & { extensionId: number; extensionNumber: string; }; type BaseAttachment = { id: string; uri: string; contentType: string; fileName: string; size: number; }; export type RCAudioAttachment = BaseAttachment & { type: "AudioRecording"; vmDuration: number; }; export type RCAttachment = | (BaseAttachment & { type: | "AudioTranscription" | "Text" | "SourceDocument" | "RenderedDocument" | "MmsAttachment"; }) | RCAudioAttachment; type TranscriptionStatus = | "NotAvailable" | "InProgress" | "TimedOut" | "Completed" | "CompletedPartially" | "Failed" | "Unknown"; export interface RCMessage { id: number; uri: string; extensionId: number; availability: "Alive" | "Deleted" | "Purged"; creationTime: string; from: Sender; to: Recipient[]; type: "Fax" | "SMS" | "VoiceMail" | "Pager" | "Text"; vmTranscriptionStatus: TranscriptionStatus; attachments: RCAttachment[]; } export interface Recording { duration: number; mimeType: string; audio: ArrayBuffer; } export interface Transcription { status: TranscriptionStatus; text: string | null; } declare module "knex/types/tables" { interface StoredVoicemail { messageId: number; extensionId: number; received: string; toNumber: string; extensionNumber: string; extensionName: string; fromNumber: string; fromName: string; transcriptionStatus: TranscriptionStatus; transcription: string | null; ticketId?: number; contactId?: number; contactableType?: string; contactableId?: number; } interface StoredRecording { messageId: number; mimeType: string; audio: ArrayBuffer; duration: number; } interface Tables { voicemails: StoredVoicemail; recordings: StoredRecording; } }