Chat screen now supports both: - Text messaging (keyboard input) - High-quality Ultravox voice calls (WebRTC) Features: - Voice call button in input bar (phone icon) - Green status bar when call is active - Transcripts from voice calls appear in chat history - Voice badge on messages from voice conversation - Mute button during calls - Auto-end call when leaving screen Background audio configured for iOS (audio, voip modes)
75 lines
1.3 KiB
TypeScript
75 lines
1.3 KiB
TypeScript
// User & Auth Types
|
|
export interface User {
|
|
user_id: number;
|
|
user_name: string;
|
|
max_role: number;
|
|
privileges: string;
|
|
}
|
|
|
|
export interface AuthResponse {
|
|
access_token: string;
|
|
privileges: string;
|
|
user_id: number;
|
|
max_role: number;
|
|
status: string;
|
|
}
|
|
|
|
export interface LoginCredentials {
|
|
username: string;
|
|
password: string;
|
|
}
|
|
|
|
// Beneficiary Types (elderly people being monitored)
|
|
export interface Beneficiary {
|
|
id: number;
|
|
name: string;
|
|
avatar?: string;
|
|
device_id?: string;
|
|
status: 'online' | 'offline';
|
|
relationship?: string;
|
|
last_activity?: string;
|
|
sensor_data?: SensorData;
|
|
}
|
|
|
|
export interface SensorData {
|
|
motion_detected?: boolean;
|
|
last_motion?: string;
|
|
door_status?: 'open' | 'closed';
|
|
temperature?: number;
|
|
humidity?: number;
|
|
last_updated?: string;
|
|
}
|
|
|
|
// Chat Types
|
|
export interface Message {
|
|
id: string;
|
|
role: 'user' | 'assistant';
|
|
content: string;
|
|
timestamp: Date;
|
|
isVoice?: boolean;
|
|
isSystem?: boolean;
|
|
}
|
|
|
|
export interface ChatResponse {
|
|
ok: boolean;
|
|
response: {
|
|
Command: string;
|
|
body: string;
|
|
language: string;
|
|
};
|
|
status: string;
|
|
}
|
|
|
|
// API Types
|
|
export interface ApiError {
|
|
message: string;
|
|
code?: string;
|
|
status?: number;
|
|
}
|
|
|
|
export interface ApiResponse<T> {
|
|
data?: T;
|
|
error?: ApiError;
|
|
ok: boolean;
|
|
}
|