- Login: by phone number instead of username - Position field: shown as badge next to name in members list, search, admin panel - Logout: moved from sidebar to profile modal settings - Sidebar search: global — shows matching users with one-click private chat - Admin panel: new Чаты tab showing all chats with delete, position/phone in user form - Backend: /api/admin/chats endpoint, position column migration, phone login support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
80 lines
1.5 KiB
TypeScript
80 lines
1.5 KiB
TypeScript
export interface User {
|
|
id: string;
|
|
username: string;
|
|
displayName: string;
|
|
avatarColor: string;
|
|
avatar?: string | null;
|
|
bio?: string;
|
|
phone?: string;
|
|
position?: string | null;
|
|
isAdmin: boolean;
|
|
lastSeen?: string;
|
|
online?: boolean;
|
|
}
|
|
|
|
export interface ChatMember {
|
|
id: string;
|
|
username: string;
|
|
displayName: string;
|
|
avatarColor: string;
|
|
avatar?: string | null;
|
|
position?: string | null;
|
|
role: 'owner' | 'admin' | 'member';
|
|
online: boolean;
|
|
lastSeen: string;
|
|
canSendMessages: boolean;
|
|
}
|
|
|
|
export interface Chat {
|
|
id: string;
|
|
type: 'private' | 'group' | 'channel';
|
|
title: string;
|
|
description?: string;
|
|
avatarColor: string;
|
|
avatar?: string | null;
|
|
isPublic?: boolean;
|
|
role: 'owner' | 'admin' | 'member';
|
|
lastMessage?: string;
|
|
lastMessageAt?: string;
|
|
unreadCount: number;
|
|
memberCount: number;
|
|
privateUserId?: string;
|
|
createdAt: string;
|
|
members?: ChatMember[];
|
|
myRole?: string;
|
|
canSendMessages?: boolean;
|
|
canAddMembers?: boolean;
|
|
}
|
|
|
|
export interface Attachment {
|
|
id: string;
|
|
filename: string;
|
|
originalName: string;
|
|
mimeType: string;
|
|
size: number;
|
|
url: string;
|
|
}
|
|
|
|
export interface Message {
|
|
id: string;
|
|
chatId: string;
|
|
content: string;
|
|
type: 'text' | 'image' | 'file' | 'system';
|
|
isDeleted: boolean;
|
|
isEdited: boolean;
|
|
editedAt?: string;
|
|
createdAt: string;
|
|
replyTo?: {
|
|
id: string;
|
|
content: string;
|
|
senderName: string;
|
|
} | null;
|
|
attachments: Attachment[];
|
|
sender: {
|
|
id: string;
|
|
username: string;
|
|
displayName: string;
|
|
avatarColor: string;
|
|
} | null;
|
|
}
|