global update and global fix
This commit is contained in:
@@ -31,12 +31,39 @@ export const apiReference: ApiTagGroup[] = [
|
||||
]
|
||||
},
|
||||
{
|
||||
tag: 'OAuth 2.0',
|
||||
tag: 'OAuth 2.0 / OIDC',
|
||||
endpoints: [
|
||||
{ method: 'GET', path: '/.well-known/openid-configuration', summary: 'OpenID Connect Discovery' },
|
||||
{ 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 }
|
||||
{
|
||||
method: 'GET',
|
||||
path: '/.well-known/openid-configuration',
|
||||
summary: 'OpenID Connect Discovery',
|
||||
description: 'Метаданные провайдера: issuer, authorization_endpoint, token_endpoint, userinfo_endpoint, scopes_supported, code_challenge_methods_supported.'
|
||||
},
|
||||
{
|
||||
method: 'GET',
|
||||
path: '/oauth/authorize',
|
||||
summary: 'Authorization endpoint (OIDC)',
|
||||
description:
|
||||
'Стандартные query: client_id, redirect_uri, response_type=code, scope, state, code_challenge, code_challenge_method. ' +
|
||||
'HTTP 302 на redirect_uri?code=... или редирект на экран входа/подтверждения. Legacy: clientId, redirectUri, userId.'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/oauth/token',
|
||||
summary: 'Token endpoint',
|
||||
description:
|
||||
'Content-Type: application/x-www-form-urlencoded или JSON. ' +
|
||||
'Поля: grant_type, code, client_id, client_secret, redirect_uri, refresh_token. ' +
|
||||
'Ответ (snake_case): access_token, token_type, expires_in, refresh_token, id_token. ' +
|
||||
'Поддерживается Authorization: Basic (client_id:client_secret).'
|
||||
},
|
||||
{
|
||||
method: 'GET',
|
||||
path: '/oauth/userinfo',
|
||||
summary: 'UserInfo endpoint',
|
||||
description: 'Профиль по Bearer access_token. Поля: sub, email, phone, name, picture.',
|
||||
auth: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -47,6 +74,20 @@ export const apiReference: ApiTagGroup[] = [
|
||||
{ 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: 'GET',
|
||||
path: '/profile/users/{userId}/e2e-public-key',
|
||||
summary: 'Публичный E2E-ключ пользователя',
|
||||
description: 'SPKI base64 для ECDH P-256. Нужен перед созданием секретного чата.',
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
method: 'PATCH',
|
||||
path: '/profile/users/{userId}/e2e-public-key',
|
||||
summary: 'Сохранить свой E2E-ключ',
|
||||
description: 'Тело: { "publicKey": "..." }. Только для своего userId.',
|
||||
auth: true
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/profile/users/{userId}/self-delete',
|
||||
@@ -133,15 +174,63 @@ export const apiReference: ApiTagGroup[] = [
|
||||
{ method: 'GET', path: '/family/groups/{groupId}/invite-search', summary: 'Поиск пользователей для приглашения', auth: true },
|
||||
{ method: 'GET', path: '/family/invites', summary: 'Входящие приглашения', auth: true },
|
||||
{ method: 'POST', path: '/family/invites/{inviteId}/respond', summary: 'Принять или отклонить приглашение', auth: true },
|
||||
{ method: 'GET', path: '/family/groups/{groupId}/presence', summary: 'Онлайн-статус участников семьи', auth: true }
|
||||
{ method: 'GET', path: '/family/groups/{groupId}/presence', summary: 'Онлайн-статус участников семьи', auth: true },
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/family/groups/{groupId}/botfather',
|
||||
summary: 'Добавить BotFather в семью',
|
||||
description: 'Создаёт BOT-чат с системным ботом BotFather для управления Telegram-ботами.',
|
||||
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 }
|
||||
{
|
||||
method: 'GET',
|
||||
path: '/chat/groups/{groupId}/rooms',
|
||||
summary: 'Список чатов семьи',
|
||||
description: 'Автосинхронизация DIRECT/BOT через syncFamilyChats. Поля: type, peerUserId, botUsername, isE2E.',
|
||||
auth: true
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/chat/groups/{groupId}/rooms',
|
||||
summary: 'Создать групповой чат',
|
||||
description: 'Минимум 3 участника. Личные DIRECT создаются автоматически.',
|
||||
auth: true
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/chat/groups/{groupId}/e2e-rooms',
|
||||
summary: 'Создать секретный E2E-чат',
|
||||
description: 'Тело: { "peerUserId": "..." }. Только с участниками семьи (не ботами).',
|
||||
auth: true
|
||||
},
|
||||
{ method: 'PATCH', path: '/chat/rooms/{roomId}', summary: 'Настройки чата (название, mute)', auth: true },
|
||||
{ method: 'DELETE', path: '/chat/rooms/{roomId}', summary: 'Удалить чат', description: 'GENERAL удалить нельзя. E2E, DIRECT, BOT, GROUP — доступно участникам.', auth: true },
|
||||
{ method: 'POST', path: '/chat/rooms/{roomId}/members', summary: 'Добавить участника в групповой чат', auth: true },
|
||||
{ method: 'DELETE', path: '/chat/rooms/{roomId}/members/{memberUserId}', summary: 'Удалить участника из чата', auth: true },
|
||||
{
|
||||
method: 'GET',
|
||||
path: '/chat/rooms/{roomId}/messages',
|
||||
summary: 'Сообщения чата',
|
||||
description: 'Query: limit (по умолчанию 50), beforeMessageId. Поле isEncrypted на сообщениях E2E.',
|
||||
auth: true
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/chat/rooms/{roomId}/messages',
|
||||
summary: 'Отправить сообщение',
|
||||
description: 'type: TEXT|IMAGE|AUDIO|VOICE|FILE|EMOJI|POLL. isEncrypted обязателен для E2E. BOT — только через /bots/...',
|
||||
auth: true
|
||||
},
|
||||
{ method: 'PATCH', path: '/chat/messages/{messageId}', summary: 'Редактировать сообщение', auth: true },
|
||||
{ method: 'DELETE', path: '/chat/messages/{messageId}', summary: 'Удалить сообщение', auth: true },
|
||||
{ method: 'POST', path: '/chat/messages/{messageId}/vote', summary: 'Голос в опросе', auth: true },
|
||||
{ method: 'POST', path: '/chat/rooms/{roomId}/read', summary: 'Отметить чат прочитанным', auth: true },
|
||||
{ method: 'POST', path: '/chat/rooms/{roomId}/mute', summary: 'Включить/выключить уведомления', auth: true }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -152,6 +241,123 @@ export const apiReference: ApiTagGroup[] = [
|
||||
{ method: 'POST', path: '/media/chat/{roomId}/media/upload-url', summary: 'URL для медиа чата', auth: true }
|
||||
]
|
||||
},
|
||||
{
|
||||
tag: 'Telegram Bot API',
|
||||
endpoints: [
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/sendMessage',
|
||||
summary: 'Отправить текстовое сообщение',
|
||||
description: 'Параметры: chat_id, text, reply_markup? (inline/reply/remove).'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/editMessageText',
|
||||
summary: 'Редактировать текст сообщения',
|
||||
description: 'Параметры: chat_id, message_id, text, reply_markup?'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/editMessageReplyMarkup',
|
||||
summary: 'Редактировать клавиатуру сообщения',
|
||||
description: 'Параметры: chat_id, message_id, reply_markup'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/answerCallbackQuery',
|
||||
summary: 'Ответ на callback_query',
|
||||
description: 'Параметры: callback_query_id, text?, show_alert?, url?'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/sendPhoto',
|
||||
summary: 'Отправить фото',
|
||||
description: 'Параметры: chat_id, photo (URL или file_id), caption?, reply_markup?'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/sendDocument',
|
||||
summary: 'Отправить документ',
|
||||
description: 'Параметры: chat_id, document (URL или file_id), caption?, reply_markup?'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/getMe',
|
||||
summary: 'Информация о боте',
|
||||
description: 'Telegram-совместимый формат ответа { ok, result }. Авторизация — токен в URL.'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/getUpdates',
|
||||
summary: 'Long polling входящих Update',
|
||||
description: 'Параметры: offset, limit (до 100), timeout (до 50 сек). Недоступен при активном webhook.'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/setWebhook',
|
||||
summary: 'Установить webhook URL',
|
||||
description: 'Тело: url, secret_token?, drop_pending_updates?'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/deleteWebhook',
|
||||
summary: 'Удалить webhook'
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bot{token}/getWebhookInfo',
|
||||
summary: 'Информация о webhook'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
tag: 'BotFather',
|
||||
endpoints: [
|
||||
{ method: 'GET', path: '/bots', summary: 'Список моих ботов', auth: true },
|
||||
{ method: 'POST', path: '/bots', summary: 'Создать бота', description: 'Возвращает token один раз.', auth: true },
|
||||
{
|
||||
method: 'GET',
|
||||
path: '/bots/by-username/{botRef}/messages',
|
||||
summary: 'История чата с ботом',
|
||||
description: 'Сообщения пользователя с ботом в хронологическом порядке.',
|
||||
auth: true
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bots/by-username/{botRef}/messages',
|
||||
summary: 'Написать боту',
|
||||
description: 'Inbound-сообщение пользователя → RabbitMQ → webhook/getUpdates',
|
||||
auth: true
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bots/by-username/{botRef}/callback',
|
||||
summary: 'Нажатие inline-кнопки',
|
||||
description: 'Тело: { messageId, callbackData } → callback_query Update → webhook/getUpdates',
|
||||
auth: true
|
||||
},
|
||||
{ method: 'GET', path: '/bots/{botId}', summary: 'Получить бота', auth: true },
|
||||
{ method: 'PATCH', path: '/bots/{botId}', summary: 'Обновить name / username', auth: true },
|
||||
{ method: 'DELETE', path: '/bots/{botId}', summary: 'Удалить бота', auth: true },
|
||||
{ method: 'POST', path: '/bots/{botId}/revoke-token', summary: 'Перевыпустить токен', auth: true },
|
||||
{ method: 'PATCH', path: '/bots/{botId}/web-app', summary: 'Настроить Mini App URL', auth: true },
|
||||
{
|
||||
method: 'POST',
|
||||
path: '/bots/web-app/validate',
|
||||
summary: 'Проверить initData Mini App',
|
||||
description: 'HMAC-SHA256 валидация как в Telegram Web Apps.'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
tag: 'Администрирование ботов',
|
||||
endpoints: [
|
||||
{ method: 'GET', path: '/admin/bots', summary: 'Список всех ботов', description: 'Требует bots.manage.all', auth: true },
|
||||
{ method: 'GET', path: '/admin/bots/metrics', summary: 'Метрики ботов', auth: true },
|
||||
{ method: 'GET', path: '/admin/bots/{botId}', summary: 'Получить бота (админ)', auth: true },
|
||||
{ method: 'PATCH', path: '/admin/bots/{botId}/active', summary: 'Заблокировать / разблокировать бота', auth: true }
|
||||
]
|
||||
},
|
||||
{
|
||||
tag: 'Уведомления',
|
||||
endpoints: [
|
||||
|
||||
Reference in New Issue
Block a user