51 lines
1011 B
TypeScript
51 lines
1011 B
TypeScript
import { UserPreview } from "./user.model";
|
|
|
|
export type ClientType = 'ANDROID' | 'IOS' | 'LINUX' | 'MACOS' | 'WINDOWS';
|
|
|
|
export interface Client {
|
|
client_id: string;
|
|
user_id: string;
|
|
type: ClientType;
|
|
fcm_token: string;
|
|
timestamp_created: string;
|
|
agent_model: string;
|
|
agent_version: string;
|
|
name: string | null;
|
|
}
|
|
|
|
export interface ClientListResponse {
|
|
clients: Client[];
|
|
}
|
|
|
|
export interface ClientPreview {
|
|
client_id: string;
|
|
user_id: string;
|
|
name: string | null;
|
|
type: ClientType;
|
|
timestamp_created: string;
|
|
agent_model: string;
|
|
agent_version: string;
|
|
}
|
|
|
|
export interface ClientPreviewResponse {
|
|
user: UserPreview;
|
|
client: ClientPreview;
|
|
}
|
|
|
|
export function getClientTypeIcon(type: ClientType): string {
|
|
switch (type) {
|
|
case 'ANDROID':
|
|
return 'android';
|
|
case 'IOS':
|
|
return 'apple';
|
|
case 'MACOS':
|
|
return 'apple';
|
|
case 'WINDOWS':
|
|
return 'windows';
|
|
case 'LINUX':
|
|
return 'desktop';
|
|
default:
|
|
return 'desktop';
|
|
}
|
|
}
|