1 export enum UserOperation {
20 GetFollowedCommunities,
48 export enum CommentSortType {
55 export enum ListingType {
61 export enum DataType {
66 export enum SortType {
76 export enum SearchType {
85 export interface User {
91 default_sort_type: SortType;
92 default_listing_type: ListingType;
95 show_avatars: boolean;
98 export interface UserView {
103 matrix_user_id?: string;
106 number_of_posts: number;
108 number_of_comments: number;
109 comment_score: number;
111 show_avatars: boolean;
112 send_notifications_to_email: boolean;
115 export interface CommunityUser {
120 community_id: number;
121 community_name: string;
125 export interface Community {
129 description?: string;
137 creator_name: string;
138 creator_avatar?: string;
139 category_name: string;
140 number_of_subscribers: number;
141 number_of_posts: number;
142 number_of_comments: number;
144 subscribed?: boolean;
147 export interface Post {
153 community_id: number;
160 banned_from_community: boolean;
163 creator_name: string;
164 creator_avatar?: string;
165 community_name: string;
166 community_removed: boolean;
167 community_deleted: boolean;
168 community_nsfw: boolean;
169 number_of_comments: number;
174 newest_activity_time: string;
177 subscribed?: boolean;
180 upvoteLoading?: boolean;
181 downvoteLoading?: boolean;
182 duplicates?: Array<Post>;
185 export interface Comment {
196 community_id: number;
197 community_name: string;
199 banned_from_community: boolean;
200 creator_name: string;
201 creator_avatar?: string;
210 user_mention_id?: number; // For mention type
211 recipient_id?: number;
212 upvoteLoading?: boolean;
213 downvoteLoading?: boolean;
216 export interface Category {
221 export interface Site {
224 description?: string;
228 creator_name: string;
229 number_of_users: number;
230 number_of_posts: number;
231 number_of_comments: number;
232 number_of_communities: number;
233 enable_downvotes: boolean;
234 open_registration: boolean;
235 enable_nsfw: boolean;
238 export interface PrivateMessage {
241 recipient_id: number;
247 creator_name: string;
248 creator_avatar?: string;
249 recipient_name: string;
250 recipient_avatar?: string;
253 export enum BanType {
258 export interface FollowCommunityForm {
259 community_id: number;
264 export interface GetFollowedCommunitiesForm {
268 export interface GetFollowedCommunitiesResponse {
269 communities: Array<CommunityUser>;
272 export interface GetUserDetailsForm {
278 community_id?: number;
282 export interface UserDetailsResponse {
284 follows: Array<CommunityUser>;
285 moderates: Array<CommunityUser>;
286 comments: Array<Comment>;
288 admins: Array<UserView>;
291 export interface GetRepliesForm {
295 unread_only: boolean;
299 export interface GetRepliesResponse {
300 replies: Array<Comment>;
303 export interface GetUserMentionsForm {
307 unread_only: boolean;
311 export interface GetUserMentionsResponse {
312 mentions: Array<Comment>;
315 export interface EditUserMentionForm {
316 user_mention_id: number;
321 export interface UserMentionResponse {
325 export interface BanFromCommunityForm {
326 community_id: number;
334 export interface BanFromCommunityResponse {
339 export interface AddModToCommunityForm {
340 community_id: number;
346 export interface TransferCommunityForm {
347 community_id: number;
352 export interface TransferSiteForm {
357 export interface AddModToCommunityResponse {
358 moderators: Array<CommunityUser>;
361 export interface GetModlogForm {
362 mod_user_id?: number;
363 community_id?: number;
368 export interface GetModlogResponse {
369 removed_posts: Array<ModRemovePost>;
370 locked_posts: Array<ModLockPost>;
371 stickied_posts: Array<ModStickyPost>;
372 removed_comments: Array<ModRemoveComment>;
373 removed_communities: Array<ModRemoveCommunity>;
374 banned_from_community: Array<ModBanFromCommunity>;
375 banned: Array<ModBan>;
376 added_to_community: Array<ModAddCommunity>;
377 added: Array<ModAdd>;
380 export interface ModRemovePost {
387 mod_user_name: string;
389 community_id: number;
390 community_name: string;
393 export interface ModLockPost {
399 mod_user_name: string;
401 community_id: number;
402 community_name: string;
405 export interface ModStickyPost {
411 mod_user_name: string;
413 community_id: number;
414 community_name: string;
417 export interface ModRemoveComment {
424 mod_user_name: string;
425 comment_user_id: number;
426 comment_user_name: string;
427 comment_content: string;
430 community_id: number;
431 community_name: string;
434 export interface ModRemoveCommunity {
437 community_id: number;
442 mod_user_name: string;
443 community_name: string;
446 export interface ModBanFromCommunity {
449 other_user_id: number;
450 community_id: number;
455 mod_user_name: string;
456 other_user_name: string;
457 community_name: string;
460 export interface ModBan {
463 other_user_id: number;
468 mod_user_name: string;
469 other_user_name: string;
472 export interface ModAddCommunity {
475 other_user_id: number;
476 community_id: number;
479 mod_user_name: string;
480 other_user_name: string;
481 community_name: string;
484 export interface ModAdd {
487 other_user_id: number;
490 mod_user_name: string;
491 other_user_name: string;
494 export interface LoginForm {
495 username_or_email: string;
499 export interface RegisterForm {
503 password_verify: string;
508 export interface LoginResponse {
512 export interface UserSettingsForm {
515 default_sort_type: SortType;
516 default_listing_type: ListingType;
520 matrix_user_id?: string;
521 new_password?: string;
522 new_password_verify?: string;
523 old_password?: string;
524 show_avatars: boolean;
525 send_notifications_to_email: boolean;
529 export interface CommunityForm {
532 description?: string;
543 export interface GetCommunityForm {
549 export interface GetCommunityResponse {
550 community: Community;
551 moderators: Array<CommunityUser>;
552 admins: Array<UserView>;
556 export interface CommunityResponse {
557 community: Community;
560 export interface ListCommunitiesForm {
567 export interface ListCommunitiesResponse {
568 communities: Array<Community>;
571 export interface ListCategoriesResponse {
572 categories: Array<Category>;
575 export interface PostForm {
579 community_id: number;
592 export interface PostFormParams {
599 export interface GetPostForm {
604 export interface GetPostResponse {
606 comments: Array<Comment>;
607 community: Community;
608 moderators: Array<CommunityUser>;
609 admins: Array<UserView>;
613 export interface SavePostForm {
619 export interface PostResponse {
623 export interface CommentForm {
636 export interface SaveCommentForm {
642 export interface CommentResponse {
644 recipient_ids: Array<number>;
647 export interface CommentLikeForm {
654 export interface CommentNode {
656 children?: Array<CommentNode>;
659 export interface GetPostsForm {
664 community_id?: number;
668 export interface GetPostsResponse {
672 export interface GetCommentsForm {
677 community_id?: number;
681 export interface GetCommentsResponse {
682 comments: Array<Comment>;
685 export interface CreatePostLikeForm {
691 export interface SiteForm {
693 description?: string;
694 enable_downvotes: boolean;
695 open_registration: boolean;
696 enable_nsfw: boolean;
700 export interface GetSiteResponse {
702 admins: Array<UserView>;
703 banned: Array<UserView>;
707 export interface SiteResponse {
711 export interface BanUserForm {
719 export interface BanUserResponse {
724 export interface AddAdminForm {
730 export interface AddAdminResponse {
731 admins: Array<UserView>;
734 export interface SearchForm {
737 community_id?: number;
744 export interface SearchResponse {
747 comments?: Array<Comment>;
748 communities: Array<Community>;
749 users: Array<UserView>;
752 export interface DeleteAccountForm {
756 export interface PasswordResetForm {
760 // export interface PasswordResetResponse {
763 export interface PasswordChangeForm {
766 password_verify: string;
769 export interface PrivateMessageForm {
771 recipient_id: number;
775 export interface PrivateMessageFormParams {
776 recipient_id: number;
779 export interface EditPrivateMessageForm {
787 export interface GetPrivateMessagesForm {
788 unread_only: boolean;
794 export interface PrivateMessagesResponse {
795 messages: Array<PrivateMessage>;
798 export interface PrivateMessageResponse {
799 message: PrivateMessage;
802 export interface UserJoinForm {
806 export interface UserJoinResponse {
810 export type MessageType =
811 | EditPrivateMessageForm
815 | FollowCommunityForm
816 | ListCommunitiesForm
817 | GetFollowedCommunitiesForm
826 | BanFromCommunityForm
828 | AddModToCommunityForm
829 | TransferCommunityForm
836 | GetUserMentionsForm
837 | EditUserMentionForm
846 | EditPrivateMessageForm
847 | GetPrivateMessagesForm;
851 | GetFollowedCommunitiesResponse
852 | ListCommunitiesResponse
856 | GetUserMentionsResponse
857 | ListCategoriesResponse
860 | UserMentionResponse
864 | BanFromCommunityResponse
865 | AddModToCommunityResponse
868 | PrivateMessageResponse
869 | PrivateMessagesResponse;
871 export interface WebSocketResponse {
876 export interface WebSocketJsonResponse {