1 export enum UserOperation {
20 GetFollowedCommunities,
50 export enum CommentSortType {
57 export enum CommentViewType {
62 export enum ListingType {
68 export enum DataType {
73 export enum SortType {
83 export enum SearchType {
92 export interface User {
98 default_sort_type: SortType;
99 default_listing_type: ListingType;
102 show_avatars: boolean;
103 unreadCount?: number;
106 export interface UserView {
112 matrix_user_id?: string;
116 number_of_posts: number;
118 number_of_comments: number;
119 comment_score: number;
121 show_avatars: boolean;
122 send_notifications_to_email: boolean;
125 export interface CommunityUser {
128 user_actor_id: string;
132 community_id: number;
133 community_actor_id: string;
134 community_local: boolean;
135 community_name: string;
139 export interface Community {
145 description?: string;
153 creator_actor_id: string;
154 creator_local: boolean;
155 last_refreshed_at: string;
156 creator_name: string;
157 creator_avatar?: string;
158 category_name: string;
159 number_of_subscribers: number;
160 number_of_posts: number;
161 number_of_comments: number;
163 subscribed?: boolean;
166 export interface Post {
172 community_id: number;
177 embed_title?: string;
178 embed_description?: string;
180 thumbnail_url?: string;
185 banned_from_community: boolean;
188 creator_actor_id: string;
189 creator_local: boolean;
190 creator_name: string;
191 creator_published: string;
192 creator_avatar?: string;
193 community_actor_id: string;
194 community_local: boolean;
195 community_name: string;
196 community_removed: boolean;
197 community_deleted: boolean;
198 community_nsfw: boolean;
199 number_of_comments: number;
204 newest_activity_time: string;
207 subscribed?: boolean;
210 duplicates?: Array<Post>;
213 export interface Comment {
227 community_id: number;
228 community_actor_id: string;
229 community_local: boolean;
230 community_name: string;
232 banned_from_community: boolean;
233 creator_actor_id: string;
234 creator_local: boolean;
235 creator_name: string;
236 creator_avatar?: string;
237 creator_published: string;
246 user_mention_id?: number; // For mention type
247 recipient_id?: number;
248 recipient_actor_id?: string;
249 recipient_local?: boolean;
253 export interface Category {
258 export interface Site {
261 description?: string;
265 creator_name: string;
266 number_of_users: number;
267 number_of_posts: number;
268 number_of_comments: number;
269 number_of_communities: number;
270 enable_downvotes: boolean;
271 open_registration: boolean;
272 enable_nsfw: boolean;
275 export interface PrivateMessage {
278 recipient_id: number;
286 creator_name: string;
287 creator_avatar?: string;
288 creator_actor_id: string;
289 creator_local: boolean;
290 recipient_name: string;
291 recipient_avatar?: string;
292 recipient_actor_id: string;
293 recipient_local: boolean;
296 export enum BanType {
301 export interface FollowCommunityForm {
302 community_id: number;
307 export interface GetFollowedCommunitiesForm {
311 export interface GetFollowedCommunitiesResponse {
312 communities: Array<CommunityUser>;
315 export interface GetUserDetailsForm {
321 community_id?: number;
325 export interface UserDetailsResponse {
327 follows: Array<CommunityUser>;
328 moderates: Array<CommunityUser>;
329 comments: Array<Comment>;
331 admins: Array<UserView>;
334 export interface GetRepliesForm {
338 unread_only: boolean;
342 export interface GetRepliesResponse {
343 replies: Array<Comment>;
346 export interface GetUserMentionsForm {
350 unread_only: boolean;
354 export interface GetUserMentionsResponse {
355 mentions: Array<Comment>;
358 export interface EditUserMentionForm {
359 user_mention_id: number;
364 export interface UserMentionResponse {
368 export interface BanFromCommunityForm {
369 community_id: number;
377 export interface BanFromCommunityResponse {
382 export interface AddModToCommunityForm {
383 community_id: number;
389 export interface TransferCommunityForm {
390 community_id: number;
395 export interface TransferSiteForm {
400 export interface AddModToCommunityResponse {
401 moderators: Array<CommunityUser>;
404 export interface GetModlogForm {
405 mod_user_id?: number;
406 community_id?: number;
411 export interface GetModlogResponse {
412 removed_posts: Array<ModRemovePost>;
413 locked_posts: Array<ModLockPost>;
414 stickied_posts: Array<ModStickyPost>;
415 removed_comments: Array<ModRemoveComment>;
416 removed_communities: Array<ModRemoveCommunity>;
417 banned_from_community: Array<ModBanFromCommunity>;
418 banned: Array<ModBan>;
419 added_to_community: Array<ModAddCommunity>;
420 added: Array<ModAdd>;
423 export interface ModRemovePost {
430 mod_user_name: string;
432 community_id: number;
433 community_name: string;
436 export interface ModLockPost {
442 mod_user_name: string;
444 community_id: number;
445 community_name: string;
448 export interface ModStickyPost {
454 mod_user_name: string;
456 community_id: number;
457 community_name: string;
460 export interface ModRemoveComment {
467 mod_user_name: string;
468 comment_user_id: number;
469 comment_user_name: string;
470 comment_content: string;
473 community_id: number;
474 community_name: string;
477 export interface ModRemoveCommunity {
480 community_id: number;
485 mod_user_name: string;
486 community_name: string;
489 export interface ModBanFromCommunity {
492 other_user_id: number;
493 community_id: number;
498 mod_user_name: string;
499 other_user_name: string;
500 community_name: string;
503 export interface ModBan {
506 other_user_id: number;
511 mod_user_name: string;
512 other_user_name: string;
515 export interface ModAddCommunity {
518 other_user_id: number;
519 community_id: number;
522 mod_user_name: string;
523 other_user_name: string;
524 community_name: string;
527 export interface ModAdd {
530 other_user_id: number;
533 mod_user_name: string;
534 other_user_name: string;
537 export interface LoginForm {
538 username_or_email: string;
542 export interface RegisterForm {
546 password_verify: string;
551 export interface LoginResponse {
555 export interface UserSettingsForm {
558 default_sort_type: SortType;
559 default_listing_type: ListingType;
563 matrix_user_id?: string;
564 new_password?: string;
565 new_password_verify?: string;
566 old_password?: string;
567 show_avatars: boolean;
568 send_notifications_to_email: boolean;
572 export interface CommunityForm {
575 description?: string;
586 export interface GetCommunityForm {
592 export interface GetCommunityResponse {
593 community: Community;
594 moderators: Array<CommunityUser>;
595 admins: Array<UserView>;
599 export interface CommunityResponse {
600 community: Community;
603 export interface ListCommunitiesForm {
610 export interface ListCommunitiesResponse {
611 communities: Array<Community>;
614 export interface ListCategoriesResponse {
615 categories: Array<Category>;
618 export interface PostForm {
622 community_id: number;
635 export interface PostFormParams {
642 export interface GetPostForm {
647 export interface GetPostResponse {
649 comments: Array<Comment>;
650 community: Community;
651 moderators: Array<CommunityUser>;
652 admins: Array<UserView>;
656 export interface SavePostForm {
662 export interface PostResponse {
666 export interface CommentForm {
679 export interface SaveCommentForm {
685 export interface CommentResponse {
687 recipient_ids: Array<number>;
690 export interface CommentLikeForm {
697 export interface CommentNode {
699 children?: Array<CommentNode>;
702 export interface GetPostsForm {
707 community_id?: number;
711 export interface GetPostsResponse {
715 export interface GetCommentsForm {
720 community_id?: number;
724 export interface GetCommentsResponse {
725 comments: Array<Comment>;
728 export interface CreatePostLikeForm {
734 export interface SiteForm {
736 description?: string;
737 enable_downvotes: boolean;
738 open_registration: boolean;
739 enable_nsfw: boolean;
743 export interface GetSiteConfig {
747 export interface GetSiteConfigResponse {
748 config_hjson: string;
751 export interface SiteConfigForm {
752 config_hjson: string;
756 export interface GetSiteResponse {
758 admins: Array<UserView>;
759 banned: Array<UserView>;
763 export interface SiteResponse {
767 export interface BanUserForm {
775 export interface BanUserResponse {
780 export interface AddAdminForm {
786 export interface AddAdminResponse {
787 admins: Array<UserView>;
790 export interface SearchForm {
793 community_id?: number;
800 export interface SearchResponse {
803 comments?: Array<Comment>;
804 communities: Array<Community>;
805 users: Array<UserView>;
808 export interface DeleteAccountForm {
812 export interface PasswordResetForm {
816 // export interface PasswordResetResponse {
819 export interface PasswordChangeForm {
822 password_verify: string;
825 export interface PrivateMessageForm {
827 recipient_id: number;
831 export interface PrivateMessageFormParams {
832 recipient_id: number;
835 export interface EditPrivateMessageForm {
843 export interface GetPrivateMessagesForm {
844 unread_only: boolean;
850 export interface PrivateMessagesResponse {
851 messages: Array<PrivateMessage>;
854 export interface PrivateMessageResponse {
855 message: PrivateMessage;
858 export interface UserJoinForm {
862 export interface UserJoinResponse {
866 export type MessageType =
867 | EditPrivateMessageForm
871 | FollowCommunityForm
872 | ListCommunitiesForm
873 | GetFollowedCommunitiesForm
882 | BanFromCommunityForm
884 | AddModToCommunityForm
885 | TransferCommunityForm
892 | GetUserMentionsForm
893 | EditUserMentionForm
902 | EditPrivateMessageForm
903 | GetPrivateMessagesForm
908 | GetFollowedCommunitiesResponse
909 | ListCommunitiesResponse
913 | GetUserMentionsResponse
914 | ListCategoriesResponse
917 | UserMentionResponse
921 | BanFromCommunityResponse
922 | AddModToCommunityResponse
925 | PrivateMessageResponse
926 | PrivateMessagesResponse
927 | GetSiteConfigResponse;
929 export interface WebSocketResponse {
934 export interface WebSocketJsonResponse {
941 export enum UserDetailsView {