Initial commit
This commit is contained in:
126
src/types.ts
Normal file
126
src/types.ts
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user