feat(backend): alerts come enriched and paged with an unseen count and a live alert frame
This commit is contained in:
1 parent
4469938f47
commit
2bb8ca45fb
7 files changed
+682
-65
No files matched your search
@@ -523,12 +523,31 @@ class WatchView(BaseModel):
|
||||
id: int
|
||||
account_id: int
|
||||
kind: str
|
||||
name: str | None
|
||||
params: dict[str, Any]
|
||||
enabled: bool
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class ChatRef(BaseModel):
|
||||
id: int
|
||||
title: str | None
|
||||
kind: str
|
||||
has_avatar: bool
|
||||
|
||||
|
||||
class PersonRef(BaseModel):
|
||||
id: int
|
||||
name: str | None
|
||||
has_avatar: bool
|
||||
|
||||
|
||||
class WatchItem(WatchView):
|
||||
chat: ChatRef | None
|
||||
person: PersonRef | None
|
||||
|
||||
|
||||
class AlertView(BaseModel):
|
||||
id: int
|
||||
account_id: int
|
||||
@@ -539,6 +558,65 @@ class AlertView(BaseModel):
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class AlertWatch(BaseModel):
|
||||
id: int
|
||||
kind: str
|
||||
name: str | None
|
||||
|
||||
|
||||
class AlertMessage(BaseModel):
|
||||
id: int
|
||||
text: str | None
|
||||
sender: PersonRef | None
|
||||
date: datetime | None
|
||||
deleted: bool
|
||||
edited: bool
|
||||
|
||||
|
||||
class AlertItem(BaseModel):
|
||||
id: int
|
||||
account_id: int
|
||||
ts: datetime
|
||||
seen: bool
|
||||
event: str
|
||||
watch: AlertWatch
|
||||
chat: ChatRef | None
|
||||
message: AlertMessage | None
|
||||
peer: PersonRef | None
|
||||
path: str
|
||||
|
||||
|
||||
class AlertPage(BaseModel):
|
||||
items: list[AlertItem]
|
||||
next_before: int | None
|
||||
unseen: int
|
||||
|
||||
|
||||
class WebhookView(BaseModel):
|
||||
id: int
|
||||
account_id: int
|
||||
url: str
|
||||
secret: str
|
||||
enabled: bool
|
||||
watch_ids: list[int] | None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
class DeliveryView(BaseModel):
|
||||
id: int
|
||||
webhook_id: int
|
||||
alert_id: int | None
|
||||
event: str
|
||||
status: str
|
||||
attempts: int
|
||||
next_attempt_at: datetime
|
||||
response_code: int | None
|
||||
last_error: str | None
|
||||
created_at: datetime
|
||||
finished_at: datetime | None
|
||||
|
||||
|
||||
class FileShareView(BaseModel):
|
||||
id: int
|
||||
account_id: int
|
||||
|
||||
Reference in new issue
Block a user