[+] Completed lab 3

This commit is contained in:
Антон Архипов
2026-11-16 16:15:08 +03:00
parent 0ab3a341aa
commit 98dd709eda
52 changed files with 4713 additions and 49 deletions
+71
View File
@@ -0,0 +1,71 @@
export interface User {
id: string;
username: string;
display_name: string;
created_at: string;
}
export interface CreateUserBody {
password: string;
username: string;
display_name: string;
}
export interface Session {
token: string;
token_type: 'Bearer';
expires_at: string;
user: User;
}
export interface Chat {
id: string;
title: string;
member_ids: string[];
created_at: string;
}
export interface CreateChatBody {
title: string;
member_ids: string[];
}
export interface Message {
id: string;
chat_id: string;
sender_id: string;
text: string;
created_at: string;
}
export interface CreateMessageBody {
text: string;
}
export interface Page<T> {
items: T[];
next_cursor: string | null;
}
export interface Health {
status: 'ok';
}
export type ErrorCode =
| 'invalid_request'
| 'unauthorized'
| 'not_found'
| 'conflict'
| 'payload_too_large'
| 'unsupported_media_type'
| 'rate_limited'
| 'unavailable'
| 'internal_error';
export interface ErrorResponse {
error: {
code: ErrorCode;
message: string;
request_id: string;
};
}