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 duplicates?: Array<Post>;
183 export interface Comment {
194 community_id: number;
195 community_name: string;
197 banned_from_community: boolean;
198 creator_name: string;
199 creator_avatar?: string;
208 user_mention_id?: number; // For mention type
209 recipient_id?: number;
212 export interface Category {
217 export interface Site {
220 description?: string;
224 creator_name: string;
225 number_of_users: number;
226 number_of_posts: number;
227 number_of_comments: number;
228 number_of_communities: number;
229 enable_downvotes: boolean;
230 open_registration: boolean;
231 enable_nsfw: boolean;
234 export interface PrivateMessage {
237 recipient_id: number;
243 creator_name: string;
244 creator_avatar?: string;
245 recipient_name: string;
246 recipient_avatar?: string;
249 export enum BanType {
254 export interface FollowCommunityForm {
255 community_id: number;
260 export interface GetFollowedCommunitiesForm {
264 export interface GetFollowedCommunitiesResponse {
265 communities: Array<CommunityUser>;
268 export interface GetUserDetailsForm {
274 community_id?: number;
278 export interface UserDetailsResponse {
280 follows: Array<CommunityUser>;
281 moderates: Array<CommunityUser>;
282 comments: Array<Comment>;
284 admins: Array<UserView>;
287 export interface GetRepliesForm {
291 unread_only: boolean;
295 export interface GetRepliesResponse {
296 replies: Array<Comment>;
299 export interface GetUserMentionsForm {
303 unread_only: boolean;
307 export interface GetUserMentionsResponse {
308 mentions: Array<Comment>;
311 export interface EditUserMentionForm {
312 user_mention_id: number;
317 export interface UserMentionResponse {
321 export interface BanFromCommunityForm {
322 community_id: number;
330 export interface BanFromCommunityResponse {
335 export interface AddModToCommunityForm {
336 community_id: number;
342 export interface TransferCommunityForm {
343 community_id: number;
348 export interface TransferSiteForm {
353 export interface AddModToCommunityResponse {
354 moderators: Array<CommunityUser>;
357 export interface GetModlogForm {
358 mod_user_id?: number;
359 community_id?: number;
364 export interface GetModlogResponse {
365 removed_posts: Array<ModRemovePost>;
366 locked_posts: Array<ModLockPost>;
367 stickied_posts: Array<ModStickyPost>;
368 removed_comments: Array<ModRemoveComment>;
369 removed_communities: Array<ModRemoveCommunity>;
370 banned_from_community: Array<ModBanFromCommunity>;
371 banned: Array<ModBan>;
372 added_to_community: Array<ModAddCommunity>;
373 added: Array<ModAdd>;
376 export interface ModRemovePost {
383 mod_user_name: string;
385 community_id: number;
386 community_name: string;
389 export interface ModLockPost {
395 mod_user_name: string;
397 community_id: number;
398 community_name: string;
401 export interface ModStickyPost {
407 mod_user_name: string;
409 community_id: number;
410 community_name: string;
413 export interface ModRemoveComment {
420 mod_user_name: string;
421 comment_user_id: number;
422 comment_user_name: string;
423 comment_content: string;
426 community_id: number;
427 community_name: string;
430 export interface ModRemoveCommunity {
433 community_id: number;
438 mod_user_name: string;
439 community_name: string;
442 export interface ModBanFromCommunity {
445 other_user_id: number;
446 community_id: number;
451 mod_user_name: string;
452 other_user_name: string;
453 community_name: string;
456 export interface ModBan {
459 other_user_id: number;
464 mod_user_name: string;
465 other_user_name: string;
468 export interface ModAddCommunity {
471 other_user_id: number;
472 community_id: number;
475 mod_user_name: string;
476 other_user_name: string;
477 community_name: string;
480 export interface ModAdd {
483 other_user_id: number;
486 mod_user_name: string;
487 other_user_name: string;
490 export interface LoginForm {
491 username_or_email: string;
495 export interface RegisterForm {
499 password_verify: string;
504 export interface LoginResponse {
508 export interface UserSettingsForm {
511 default_sort_type: SortType;
512 default_listing_type: ListingType;
516 matrix_user_id?: string;
517 new_password?: string;
518 new_password_verify?: string;
519 old_password?: string;
520 show_avatars: boolean;
521 send_notifications_to_email: boolean;
525 export interface CommunityForm {
528 description?: string;
539 export interface GetCommunityForm {
545 export interface GetCommunityResponse {
546 community: Community;
547 moderators: Array<CommunityUser>;
548 admins: Array<UserView>;
552 export interface CommunityResponse {
553 community: Community;
556 export interface ListCommunitiesForm {
563 export interface ListCommunitiesResponse {
564 communities: Array<Community>;
567 export interface ListCategoriesResponse {
568 categories: Array<Category>;
571 export interface PostForm {
575 community_id: number;
588 export interface PostFormParams {
595 export interface GetPostForm {
600 export interface GetPostResponse {
602 comments: Array<Comment>;
603 community: Community;
604 moderators: Array<CommunityUser>;
605 admins: Array<UserView>;
609 export interface SavePostForm {
615 export interface PostResponse {
619 export interface CommentForm {
632 export interface SaveCommentForm {
638 export interface CommentResponse {
640 recipient_ids: Array<number>;
643 export interface CommentLikeForm {
650 export interface CommentNode {
652 children?: Array<CommentNode>;
655 export interface GetPostsForm {
660 community_id?: number;
664 export interface GetPostsResponse {
668 export interface GetCommentsForm {
673 community_id?: number;
677 export interface GetCommentsResponse {
678 comments: Array<Comment>;
681 export interface CreatePostLikeForm {
687 export interface SiteForm {
689 description?: string;
690 enable_downvotes: boolean;
691 open_registration: boolean;
692 enable_nsfw: boolean;
696 export interface GetSiteResponse {
698 admins: Array<UserView>;
699 banned: Array<UserView>;
703 export interface SiteResponse {
707 export interface BanUserForm {
715 export interface BanUserResponse {
720 export interface AddAdminForm {
726 export interface AddAdminResponse {
727 admins: Array<UserView>;
730 export interface SearchForm {
733 community_id?: number;
740 export interface SearchResponse {
743 comments?: Array<Comment>;
744 communities: Array<Community>;
745 users: Array<UserView>;
748 export interface DeleteAccountForm {
752 export interface PasswordResetForm {
756 // export interface PasswordResetResponse {
759 export interface PasswordChangeForm {
762 password_verify: string;
765 export interface PrivateMessageForm {
767 recipient_id: number;
771 export interface PrivateMessageFormParams {
772 recipient_id: number;
775 export interface EditPrivateMessageForm {
783 export interface GetPrivateMessagesForm {
784 unread_only: boolean;
790 export interface PrivateMessagesResponse {
791 messages: Array<PrivateMessage>;
794 export interface PrivateMessageResponse {
795 message: PrivateMessage;
798 export interface UserJoinForm {
802 export interface UserJoinResponse {
806 export type MessageType =
807 | EditPrivateMessageForm
811 | FollowCommunityForm
812 | ListCommunitiesForm
813 | GetFollowedCommunitiesForm
822 | BanFromCommunityForm
824 | AddModToCommunityForm
825 | TransferCommunityForm
832 | GetUserMentionsForm
833 | EditUserMentionForm
842 | EditPrivateMessageForm
843 | GetPrivateMessagesForm;
847 | GetFollowedCommunitiesResponse
848 | ListCommunitiesResponse
852 | GetUserMentionsResponse
853 | ListCategoriesResponse
856 | UserMentionResponse
860 | BanFromCommunityResponse
861 | AddModToCommunityResponse
864 | PrivateMessageResponse
865 | PrivateMessagesResponse;
867 export interface WebSocketResponse {
872 export interface WebSocketJsonResponse {