#11 Added SSE listening

This commit is contained in:
Vasily Domakov
2026-02-09 23:21:01 +03:00
parent de48c30c78
commit 1a4f9f6c5a
6 changed files with 135 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
from uuid import UUID
from itd.request import fetch
from itd.request import fetch, fetch_stream
def get_notifications(token: str, limit: int = 20, offset: int = 0):
return fetch(token, 'get', 'notifications', {'limit': limit, 'offset': offset})
@@ -12,4 +12,12 @@ def mark_all_as_read(token: str):
return fetch(token, 'post', f'notifications/read-all')
def get_unread_notifications_count(token: str):
return fetch(token, 'get', 'notifications/count')
return fetch(token, 'get', 'notifications/count')
def stream_notifications(token: str):
"""Получить SSE поток уведомлений
Returns:
Response: Streaming response для SSE
"""
return fetch_stream(token, 'notifications/stream')