first commit

This commit is contained in:
lendry
2026-06-24 14:37:15 +03:00
commit 995adeedd4
188 changed files with 28810 additions and 0 deletions

View File

@@ -0,0 +1,116 @@
export interface ApiEndpoint {
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
path: string;
summary: string;
description?: string;
auth?: boolean;
}
export interface ApiTagGroup {
tag: string;
endpoints: ApiEndpoint[];
}
export const apiReference: ApiTagGroup[] = [
{
tag: 'Аутентификация',
endpoints: [
{ method: 'POST', path: '/auth/register', summary: 'Регистрация пользователя', description: 'Первый пользователь получает isSuperAdmin.' },
{ method: 'POST', path: '/auth/login', summary: 'Вход по почте, телефону или логину' },
{ method: 'POST', path: '/auth/identify', summary: 'Проверить способ входа (identifier-first)' },
{ method: 'POST', path: '/auth/otp/send', summary: 'Отправить OTP для passwordless-входа' },
{ method: 'POST', path: '/auth/otp/verify', summary: 'Проверить OTP' },
{ method: 'POST', path: '/auth/login/password', summary: 'Войти по паролю' },
{ method: 'POST', path: '/auth/ldap/login', summary: 'Войти через LDAP/LDAPS' },
{ method: 'POST', path: '/auth/pin/verify', summary: 'Подтвердить PIN-код' },
{ method: 'POST', path: '/auth/refresh', summary: 'Обновить access token' },
{ method: 'GET', path: '/auth/session', summary: 'Состояние текущей сессии', auth: true },
{ method: 'GET', path: '/auth/me', summary: 'Текущий пользователь', auth: true }
]
},
{
tag: 'OAuth 2.0',
endpoints: [
{ method: 'GET', path: '/oauth/authorize', summary: 'Создать authorization code' },
{ method: 'POST', path: '/oauth/token', summary: 'Выдать OAuth токены (code / refresh_token)' },
{ method: 'GET', path: '/oauth/userinfo', summary: 'Профиль по OAuth access token', auth: true }
]
},
{
tag: 'Профиль и биометрия',
endpoints: [
{ method: 'GET', path: '/profile/users/{userId}', summary: 'Получить профиль', auth: true },
{ method: 'PATCH', path: '/profile/users/{userId}', summary: 'Обновить профиль', auth: true },
{ method: 'PATCH', path: '/profile/users/{userId}/avatar', summary: 'Обновить аватар', auth: true },
{ method: 'PATCH', path: '/profile/users/{userId}/contacts', summary: 'Обновить контакты', auth: true },
{ method: 'POST', path: '/profile/users/{userId}/password', summary: 'Установить пароль', auth: true },
{ method: 'POST', path: '/profile/users/{userId}/self-delete', summary: 'Удалить свой профиль', auth: true }
]
},
{
tag: 'Безопасность',
endpoints: [
{ method: 'GET', path: '/security/users/{userId}/devices', summary: 'Активные устройства', auth: true },
{ method: 'GET', path: '/security/users/{userId}/sessions', summary: 'Активные сессии', auth: true },
{ method: 'POST', path: '/security/users/{userId}/pin/setup', summary: 'Настроить PIN', auth: true },
{ method: 'POST', path: '/security/users/{userId}/revoke-all-sessions', summary: 'Выйти везде', auth: true }
]
},
{
tag: 'Администрирование',
endpoints: [
{ method: 'GET', path: '/admin/users', summary: 'Список пользователей', auth: true },
{ method: 'PATCH', path: '/admin/users/{userId}', summary: 'Обновить пользователя', auth: true },
{ method: 'POST', path: '/admin/users/{userId}/reset-password', summary: 'Сбросить пароль', auth: true },
{ method: 'PATCH', path: '/admin/users/{userId}/super-admin', summary: 'Права супер-администратора', auth: true }
]
},
{
tag: 'RBAC и OAuth',
endpoints: [
{ method: 'GET', path: '/admin/rbac/roles', summary: 'Список ролей', auth: true },
{ method: 'POST', path: '/admin/rbac/oauth-clients', summary: 'Создать OAuth-приложение', auth: true },
{ method: 'GET', path: '/admin/rbac/oauth-scopes', summary: 'OAuth scopes', auth: true }
]
},
{
tag: 'Глобальные настройки',
endpoints: [
{ method: 'GET', path: '/admin/settings', summary: 'Список системных настроек', auth: true },
{ method: 'PUT', path: '/admin/settings', summary: 'Создать или обновить настройку', auth: true },
{ method: 'GET', path: '/settings/public', summary: 'Публичные настройки (без авторизации)' }
]
},
{
tag: 'Семья',
endpoints: [
{ method: 'POST', path: '/family/groups', summary: 'Создать семейную группу', auth: true },
{ method: 'GET', path: '/family/users/{userId}/groups', summary: 'Список семей пользователя', auth: true },
{ method: 'POST', path: '/family/groups/{groupId}/invites', summary: 'Пригласить участника', auth: true }
]
},
{
tag: 'Чат',
endpoints: [
{ method: 'GET', path: '/chat/groups/{groupId}/rooms', summary: 'Список чатов семьи', auth: true },
{ method: 'POST', path: '/chat/rooms/{roomId}/messages', summary: 'Отправить сообщение', auth: true },
{ method: 'GET', path: '/chat/rooms/{roomId}/messages', summary: 'Сообщения чата', auth: true }
]
},
{
tag: 'Медиа',
endpoints: [
{ method: 'POST', path: '/media/avatars/upload-url', summary: 'URL для загрузки аватара', auth: true },
{ method: 'GET', path: '/media/stream/{token}', summary: 'Потоковая выдача медиа' },
{ method: 'POST', path: '/media/chat/{roomId}/media/upload-url', summary: 'URL для медиа чата', auth: true }
]
},
{
tag: 'Уведомления',
endpoints: [
{ method: 'GET', path: '/notifications', summary: 'Список уведомлений', auth: true },
{ method: 'PATCH', path: '/notifications/{notificationId}/read', summary: 'Удалить просмотренное', auth: true },
{ method: 'DELETE', path: '/notifications', summary: 'Удалить все уведомления', auth: true }
]
}
];