1 export enum UserOperation {
20 GetFollowedCommunities,
47 export enum CommentSortType {
54 export enum ListingType {
60 export enum SortType {
70 export enum SearchType {
79 export interface User {
85 default_sort_type: SortType;
86 default_listing_type: ListingType;
89 show_avatars: boolean;
92 export interface UserView {
97 matrix_user_id?: string;
100 number_of_posts: number;
102 number_of_comments: number;
103 comment_score: number;
105 show_avatars: boolean;
106 send_notifications_to_email: boolean;
109 export interface CommunityUser {
114 community_id: number;
115 community_name: string;
119 export interface Community {
123 description?: string;
131 creator_name: string;
132 creator_avatar?: string;
133 category_name: string;
134 number_of_subscribers: number;
135 number_of_posts: number;
136 number_of_comments: number;
138 subscribed?: boolean;
141 export interface Post {
147 community_id: number;
154 banned_from_community: boolean;
157 creator_name: string;
158 creator_avatar?: string;
159 community_name: string;
160 community_removed: boolean;
161 community_deleted: boolean;
162 community_nsfw: boolean;
163 number_of_comments: number;
170 subscribed?: boolean;
173 upvoteLoading?: boolean;
174 downvoteLoading?: boolean;
177 export interface Comment {
188 community_id: number;
190 banned_from_community: boolean;
191 creator_name: string;
192 creator_avatar?: string;
199 user_mention_id?: number; // For mention type
200 recipient_id?: number;
201 upvoteLoading?: boolean;
202 downvoteLoading?: boolean;
205 export interface Category {
210 export interface Site {
213 description?: string;
217 creator_name: string;
218 number_of_users: number;
219 number_of_posts: number;
220 number_of_comments: number;
221 number_of_communities: number;
222 enable_downvotes: boolean;
223 open_registration: boolean;
224 enable_nsfw: boolean;
227 export interface PrivateMessage {
230 recipient_id: number;
236 creator_name: string;
237 creator_avatar?: string;
238 recipient_name: string;
239 recipient_avatar?: string;
242 export enum BanType {
247 export interface FollowCommunityForm {
248 community_id: number;
253 export interface GetFollowedCommunitiesForm {
257 export interface GetFollowedCommunitiesResponse {
258 communities: Array<CommunityUser>;
261 export interface GetUserDetailsForm {
267 community_id?: number;
271 export interface UserDetailsResponse {
273 follows: Array<CommunityUser>;
274 moderates: Array<CommunityUser>;
275 comments: Array<Comment>;
277 admins: Array<UserView>;
280 export interface GetRepliesForm {
284 unread_only: boolean;
288 export interface GetRepliesResponse {
289 replies: Array<Comment>;
292 export interface GetUserMentionsForm {
296 unread_only: boolean;
300 export interface GetUserMentionsResponse {
301 mentions: Array<Comment>;
304 export interface EditUserMentionForm {
305 user_mention_id: number;
310 export interface UserMentionResponse {
314 export interface BanFromCommunityForm {
315 community_id: number;
323 export interface BanFromCommunityResponse {
328 export interface AddModToCommunityForm {
329 community_id: number;
335 export interface TransferCommunityForm {
336 community_id: number;
341 export interface TransferSiteForm {
346 export interface AddModToCommunityResponse {
347 moderators: Array<CommunityUser>;
350 export interface GetModlogForm {
351 mod_user_id?: number;
352 community_id?: number;
357 export interface GetModlogResponse {
358 removed_posts: Array<ModRemovePost>;
359 locked_posts: Array<ModLockPost>;
360 stickied_posts: Array<ModStickyPost>;
361 removed_comments: Array<ModRemoveComment>;
362 removed_communities: Array<ModRemoveCommunity>;
363 banned_from_community: Array<ModBanFromCommunity>;
364 banned: Array<ModBan>;
365 added_to_community: Array<ModAddCommunity>;
366 added: Array<ModAdd>;
369 export interface ModRemovePost {
376 mod_user_name: string;
378 community_id: number;
379 community_name: string;
382 export interface ModLockPost {
388 mod_user_name: string;
390 community_id: number;
391 community_name: string;
394 export interface ModStickyPost {
400 mod_user_name: string;
402 community_id: number;
403 community_name: string;
406 export interface ModRemoveComment {
413 mod_user_name: string;
414 comment_user_id: number;
415 comment_user_name: string;
416 comment_content: string;
419 community_id: number;
420 community_name: string;
423 export interface ModRemoveCommunity {
426 community_id: number;
431 mod_user_name: string;
432 community_name: string;
435 export interface ModBanFromCommunity {
438 other_user_id: number;
439 community_id: number;
444 mod_user_name: string;
445 other_user_name: string;
446 community_name: string;
449 export interface ModBan {
452 other_user_id: number;
457 mod_user_name: string;
458 other_user_name: string;
461 export interface ModAddCommunity {
464 other_user_id: number;
465 community_id: number;
468 mod_user_name: string;
469 other_user_name: string;
470 community_name: string;
473 export interface ModAdd {
476 other_user_id: number;
479 mod_user_name: string;
480 other_user_name: string;
483 export interface LoginForm {
484 username_or_email: string;
488 export interface RegisterForm {
492 password_verify: string;
497 export interface LoginResponse {
501 export interface UserSettingsForm {
504 default_sort_type: SortType;
505 default_listing_type: ListingType;
509 matrix_user_id?: string;
510 new_password?: string;
511 new_password_verify?: string;
512 old_password?: string;
513 show_avatars: boolean;
514 send_notifications_to_email: boolean;
518 export interface CommunityForm {
521 description?: string;
532 export interface GetCommunityForm {
538 export interface GetCommunityResponse {
539 community: Community;
540 moderators: Array<CommunityUser>;
541 admins: Array<UserView>;
545 export interface CommunityResponse {
546 community: Community;
549 export interface ListCommunitiesForm {
556 export interface ListCommunitiesResponse {
557 communities: Array<Community>;
560 export interface ListCategoriesResponse {
561 categories: Array<Category>;
564 export interface PostForm {
568 community_id: number;
581 export interface PostFormParams {
588 export interface GetPostForm {
593 export interface GetPostResponse {
595 comments: Array<Comment>;
596 community: Community;
597 moderators: Array<CommunityUser>;
598 admins: Array<UserView>;
602 export interface SavePostForm {
608 export interface PostResponse {
612 export interface CommentForm {
625 export interface SaveCommentForm {
631 export interface CommentResponse {
633 recipient_ids: Array<number>;
636 export interface CommentLikeForm {
643 export interface CommentNode {
645 children?: Array<CommentNode>;
648 export interface GetPostsForm {
653 community_id?: number;
657 export interface GetPostsResponse {
661 export interface CreatePostLikeForm {
667 export interface SiteForm {
669 description?: string;
670 enable_downvotes: boolean;
671 open_registration: boolean;
672 enable_nsfw: boolean;
676 export interface GetSiteResponse {
678 admins: Array<UserView>;
679 banned: Array<UserView>;
683 export interface SiteResponse {
687 export interface BanUserForm {
695 export interface BanUserResponse {
700 export interface AddAdminForm {
706 export interface AddAdminResponse {
707 admins: Array<UserView>;
710 export interface SearchForm {
713 community_id?: number;
720 export interface SearchResponse {
723 comments?: Array<Comment>;
724 communities: Array<Community>;
725 users: Array<UserView>;
728 export interface DeleteAccountForm {
732 export interface PasswordResetForm {
736 // export interface PasswordResetResponse {
739 export interface PasswordChangeForm {
742 password_verify: string;
745 export interface PrivateMessageForm {
747 recipient_id: number;
751 export interface PrivateMessageFormParams {
752 recipient_id: number;
755 export interface EditPrivateMessageForm {
763 export interface GetPrivateMessagesForm {
764 unread_only: boolean;
770 export interface PrivateMessagesResponse {
771 messages: Array<PrivateMessage>;
774 export interface PrivateMessageResponse {
775 message: PrivateMessage;
778 export interface UserJoinForm {
782 export interface UserJoinResponse {
786 export type MessageType =
787 | EditPrivateMessageForm
791 | FollowCommunityForm
792 | ListCommunitiesForm
793 | GetFollowedCommunitiesForm
802 | BanFromCommunityForm
804 | AddModToCommunityForm
805 | TransferCommunityForm
812 | GetUserMentionsForm
813 | EditUserMentionForm
822 | EditPrivateMessageForm
823 | GetPrivateMessagesForm;
827 | GetFollowedCommunitiesResponse
828 | ListCommunitiesResponse
832 | GetUserMentionsResponse
833 | ListCategoriesResponse
836 | UserMentionResponse
840 | BanFromCommunityResponse
841 | AddModToCommunityResponse
844 | PrivateMessageResponse
845 | PrivateMessagesResponse;
847 export interface WebSocketResponse {
852 export interface WebSocketJsonResponse {