Initial commit

This commit is contained in:
2021-03-10 21:59:38 -07:00
parent 4e533f5e7b
commit fd54a8e4dd
16 changed files with 8096 additions and 0 deletions

126
src/types.ts Normal file
View File

@ -0,0 +1,126 @@
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: Blob;
}
export interface Transcription {
status: TranscriptionStatus;
text: string | null;
}
export interface StoredVoicemail {
messageId: number;
extensionId: number;
processed: boolean;
received: string;
toNumber: string;
extensionNumber: string;
extensionName: string;
fromNumber: string;
fromName?: string;
duration: number;
transcriptionStatus: TranscriptionStatus;
transcription: string | null;
ticketId?: number;
contactId?: number;
contactableType?: string;
contactableId?: number;
}