forked from retoor/devplacepy
Comment and post layouts stay full width on small screens. Secondary actions live in the More menu. Notifications can be grouped and throttled, and Enter can submit when that profile setting is on. Emulated-tool models accept large catalogs, with reserved names aliased on the wire and the catalog cached per owner. A dropped service-worker navigation is retried once. The test server waits 120s to finish importing before it is stopped.
308 lines
8.1 KiB
Python
308 lines
8.1 KiB
Python
# retoor <retoor@molodetz.nl>
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Optional
|
|
|
|
from devplacepy.schemas.base import _Out
|
|
from devplacepy.schemas.battles import WarOut
|
|
from devplacepy.schemas.content import (
|
|
AttachmentOut,
|
|
CommentItemOut,
|
|
GistOut,
|
|
MessageOut,
|
|
NewsOut,
|
|
NotificationOut,
|
|
PollOut,
|
|
PostOut,
|
|
ProjectLinkOut,
|
|
ProjectOut,
|
|
ReactionsOut,
|
|
UserOut,
|
|
)
|
|
|
|
|
|
class FeedItemOut(_Out):
|
|
post: PostOut
|
|
maturity: Optional[str] = None
|
|
author: Optional[UserOut] = None
|
|
time_ago: Optional[str] = None
|
|
my_vote: int = 0
|
|
comment_count: int = 0
|
|
attachments: list[AttachmentOut] = []
|
|
recent_comments: list[CommentItemOut] = []
|
|
reactions: ReactionsOut = ReactionsOut()
|
|
bookmarked: bool = False
|
|
poll: Optional[PollOut] = None
|
|
war: Optional[WarOut] = None
|
|
project_link: Optional[ProjectLinkOut] = None
|
|
|
|
|
|
class GistItemOut(_Out):
|
|
gist: GistOut
|
|
maturity: Optional[str] = None
|
|
author: Optional[UserOut] = None
|
|
time_ago: Optional[str] = None
|
|
my_vote: int = 0
|
|
comment_count: int = 0
|
|
recent_comments: list[CommentItemOut] = []
|
|
|
|
|
|
class ProjectListItemOut(ProjectOut):
|
|
author_name: Optional[str] = None
|
|
my_vote: int = 0
|
|
recent_comments: list[CommentItemOut] = []
|
|
|
|
|
|
class NewsListItemOut(_Out):
|
|
article: NewsOut
|
|
time_ago: Optional[str] = None
|
|
image_url: Optional[str] = None
|
|
grade: Optional[int] = None
|
|
featured: Optional[int] = None
|
|
recent_comments: list[CommentItemOut] = []
|
|
|
|
|
|
class ConversationOut(_Out):
|
|
other_user: Optional[UserOut] = None
|
|
last_message: Optional[str] = None
|
|
last_message_at: Optional[str] = None
|
|
unread: bool = False
|
|
|
|
|
|
class MessageItemOut(_Out):
|
|
message: MessageOut
|
|
sender: Optional[UserOut] = None
|
|
is_mine: bool = False
|
|
time_ago: Optional[str] = None
|
|
attachments: list[AttachmentOut] = []
|
|
grouped: bool = False
|
|
|
|
|
|
class NotificationItemOut(_Out):
|
|
notification: NotificationOut
|
|
actor: Optional[UserOut] = None
|
|
time_ago: Optional[str] = None
|
|
|
|
|
|
class NotificationEventGroupOut(_Out):
|
|
key: Optional[str] = None
|
|
count: int = 0
|
|
unread: bool = False
|
|
actors: list[UserOut] = []
|
|
latest: Optional[NotificationItemOut] = None
|
|
|
|
|
|
class NotificationGroupOut(_Out):
|
|
label: Optional[str] = None
|
|
entries: list[NotificationItemOut] = []
|
|
event_entries: list[NotificationEventGroupOut] = []
|
|
|
|
|
|
class LeaderboardEntryOut(_Out):
|
|
uid: Optional[str] = None
|
|
username: Optional[str] = None
|
|
avatar_seed: Optional[str] = None
|
|
stars: Optional[int] = None
|
|
level: Optional[int] = None
|
|
rank: Optional[int] = None
|
|
|
|
|
|
class SavedItemOut(_Out):
|
|
target_type: Optional[str] = None
|
|
target_uid: Optional[str] = None
|
|
type_label: Optional[str] = None
|
|
title: Optional[str] = None
|
|
url: Optional[str] = None
|
|
time_ago: Optional[str] = None
|
|
|
|
|
|
class TopicOut(_Out):
|
|
posts: list[FeedItemOut] = []
|
|
topic: str = ""
|
|
topic_label: str = ""
|
|
next_cursor: Optional[str] = None
|
|
|
|
|
|
class TopicSummaryOut(_Out):
|
|
key: str = ""
|
|
label: str = ""
|
|
post_count: int = 0
|
|
|
|
|
|
class TopicsHubOut(_Out):
|
|
topics: list[TopicSummaryOut] = []
|
|
|
|
|
|
class FeedOut(_Out):
|
|
posts: list[FeedItemOut] = []
|
|
current_tab: Optional[str] = None
|
|
current_topic: Optional[str] = None
|
|
search: Optional[str] = None
|
|
next_cursor: Optional[str] = None
|
|
total_members: Optional[int] = None
|
|
posts_today: Optional[int] = None
|
|
total_projects: Optional[int] = None
|
|
total_gists: Optional[int] = None
|
|
top_authors: list[UserOut] = []
|
|
daily_topic: Optional[Any] = None
|
|
online_users: list[UserOut] = []
|
|
|
|
|
|
class PostDetailOut(_Out):
|
|
maturity: Optional[str] = None
|
|
post: PostOut
|
|
author: Optional[UserOut] = None
|
|
is_owner: bool = False
|
|
star_count: int = 0
|
|
my_vote: int = 0
|
|
time_ago: Optional[str] = None
|
|
comments: list[CommentItemOut] = []
|
|
attachments: list[AttachmentOut] = []
|
|
reactions: ReactionsOut = ReactionsOut()
|
|
bookmarked: bool = False
|
|
note_content: Optional[str] = None
|
|
poll: Optional[PollOut] = None
|
|
war: Optional[WarOut] = None
|
|
comment_count: Optional[int] = None
|
|
related_posts: list[FeedItemOut] = []
|
|
topics: list[str] = []
|
|
project_link: Optional[ProjectLinkOut] = None
|
|
featured_topics: list[Any] = []
|
|
author_gists: list[Any] = []
|
|
author_projects: list[Any] = []
|
|
next_post_url: Optional[str] = None
|
|
|
|
|
|
class ProjectsOut(_Out):
|
|
projects: list[ProjectListItemOut] = []
|
|
current_tab: Optional[str] = None
|
|
search: Optional[str] = None
|
|
project_type: Optional[str] = None
|
|
total_count: Optional[int] = None
|
|
next_cursor: Optional[str] = None
|
|
total_members: Optional[int] = None
|
|
top_authors: list[UserOut] = []
|
|
|
|
|
|
class ProjectDetailOut(_Out):
|
|
maturity: Optional[str] = None
|
|
project: ProjectOut
|
|
author: Optional[UserOut] = None
|
|
is_owner: bool = False
|
|
star_count: int = 0
|
|
my_vote: int = 0
|
|
time_ago: Optional[str] = None
|
|
comments: list[CommentItemOut] = []
|
|
attachments: list[AttachmentOut] = []
|
|
reactions: ReactionsOut = ReactionsOut()
|
|
bookmarked: bool = False
|
|
note_content: Optional[str] = None
|
|
platforms: Optional[Any] = None
|
|
is_private: bool = False
|
|
read_only: bool = False
|
|
viewer_can_containers: bool = False
|
|
viewer_can_workspace: bool = False
|
|
workspace_editor_url: Optional[str] = None
|
|
workspace_editor_mode: Optional[str] = None
|
|
workspace_editor_width: Optional[int] = None
|
|
workspace_editor_height: Optional[int] = None
|
|
forked_from: Optional[dict] = None
|
|
fork_count: int = 0
|
|
file_count: int = 0
|
|
comment_count: int = 0
|
|
devlog_posts: list[FeedItemOut] = []
|
|
devlog_next_cursor: Optional[str] = None
|
|
devlog_count: int = 0
|
|
|
|
|
|
class GistsOut(_Out):
|
|
gists: list[GistItemOut] = []
|
|
total_count: Optional[int] = None
|
|
next_cursor: Optional[str] = None
|
|
current_language: Optional[str] = None
|
|
search: Optional[str] = None
|
|
languages: list[tuple[str, str]] = []
|
|
gist_language_codes: list[str] = []
|
|
|
|
|
|
class GistDetailOut(_Out):
|
|
maturity: Optional[str] = None
|
|
gist: GistOut
|
|
author: Optional[UserOut] = None
|
|
is_owner: bool = False
|
|
star_count: int = 0
|
|
my_vote: int = 0
|
|
time_ago: Optional[str] = None
|
|
comments: list[CommentItemOut] = []
|
|
attachments: list[AttachmentOut] = []
|
|
reactions: ReactionsOut = ReactionsOut()
|
|
bookmarked: bool = False
|
|
note_content: Optional[str] = None
|
|
|
|
|
|
class NewsListOut(_Out):
|
|
articles: list[NewsListItemOut] = []
|
|
next_cursor: Optional[str] = None
|
|
|
|
|
|
class NewsDetailOut(_Out):
|
|
maturity: Optional[str] = None
|
|
article: NewsOut
|
|
canonical_slug: Optional[str] = None
|
|
image_url: Optional[str] = None
|
|
grade: Optional[int] = None
|
|
time_ago: Optional[str] = None
|
|
comments: list[CommentItemOut] = []
|
|
bookmarked: bool = False
|
|
note_content: Optional[str] = None
|
|
|
|
|
|
class MessagesOut(_Out):
|
|
conversations: list[ConversationOut] = []
|
|
messages: list[MessageItemOut] = []
|
|
other_user: Optional[UserOut] = None
|
|
current_conversation: Optional[str] = None
|
|
search: Optional[str] = None
|
|
other_online: bool = False
|
|
other_last_seen: Optional[str] = None
|
|
|
|
|
|
class NotificationsOut(_Out):
|
|
notification_groups: list[NotificationGroupOut] = []
|
|
next_cursor: Optional[str] = None
|
|
grouping: bool = True
|
|
|
|
|
|
class LeaderboardOut(_Out):
|
|
entries: list[LeaderboardEntryOut] = []
|
|
user_rank: Optional[int] = None
|
|
total_members: Optional[int] = None
|
|
posts_today: Optional[int] = None
|
|
total_projects: Optional[int] = None
|
|
total_gists: Optional[int] = None
|
|
top_authors: list[UserOut] = []
|
|
featured_news: list[NewsOut] = []
|
|
|
|
|
|
class SavedOut(_Out):
|
|
items: list[SavedItemOut] = []
|
|
next_cursor: Optional[str] = None
|
|
|
|
|
|
class NoteItemOut(_Out):
|
|
target_type: Optional[str] = None
|
|
target_uid: Optional[str] = None
|
|
type_label: Optional[str] = None
|
|
title: Optional[str] = None
|
|
url: Optional[str] = None
|
|
content: Optional[str] = None
|
|
time_ago: Optional[str] = None
|
|
updated_at: Optional[str] = None
|
|
|
|
|
|
class NotesOut(_Out):
|
|
items: list[NoteItemOut] = []
|
|
next_cursor: Optional[str] = None
|
|
|