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;
99 export interface UserView {
104 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;
158 embed_title?: string;
159 embed_description?: string;
161 thumbnail_url?: string;
164 banned_from_community: boolean;
167 creator_name: string;
168 creator_avatar?: string;
169 community_name: string;
170 community_removed: boolean;
171 community_deleted: boolean;
172 community_nsfw: boolean;
173 number_of_comments: number;
178 newest_activity_time: string;
181 subscribed?: boolean;
184 duplicates?: Array<Post>;
187 export interface Comment {
198 community_id: number;
199 community_name: string;
201 banned_from_community: boolean;
202 creator_name: string;
203 creator_avatar?: string;
212 user_mention_id?: number; // For mention type
213 recipient_id?: number;
217 export interface Category {
222 export interface Site {
225 description?: string;
229 creator_name: string;
230 number_of_users: number;
231 number_of_posts: number;
232 number_of_comments: number;
233 number_of_communities: number;
234 enable_downvotes: boolean;
235 open_registration: boolean;
236 enable_nsfw: boolean;
239 export interface PrivateMessage {
242 recipient_id: number;
248 creator_name: string;
249 creator_avatar?: string;
250 recipient_name: string;
251 recipient_avatar?: string;
254 export enum BanType {
259 export interface FollowCommunityForm {
260 community_id: number;
265 export interface GetFollowedCommunitiesForm {
269 export interface GetFollowedCommunitiesResponse {
270 communities: Array<CommunityUser>;
273 export interface GetUserDetailsForm {
279 community_id?: number;
283 export interface UserDetailsResponse {
285 follows: Array<CommunityUser>;
286 moderates: Array<CommunityUser>;
287 comments: Array<Comment>;
289 admins: Array<UserView>;
292 export interface GetRepliesForm {
296 unread_only: boolean;
300 export interface GetRepliesResponse {
301 replies: Array<Comment>;
304 export interface GetUserMentionsForm {
308 unread_only: boolean;
312 export interface GetUserMentionsResponse {
313 mentions: Array<Comment>;
316 export interface EditUserMentionForm {
317 user_mention_id: number;
322 export interface UserMentionResponse {
326 export interface BanFromCommunityForm {
327 community_id: number;
335 export interface BanFromCommunityResponse {
340 export interface AddModToCommunityForm {
341 community_id: number;
347 export interface TransferCommunityForm {
348 community_id: number;
353 export interface TransferSiteForm {
358 export interface AddModToCommunityResponse {
359 moderators: Array<CommunityUser>;
362 export interface GetModlogForm {
363 mod_user_id?: number;
364 community_id?: number;
369 export interface GetModlogResponse {
370 removed_posts: Array<ModRemovePost>;
371 locked_posts: Array<ModLockPost>;
372 stickied_posts: Array<ModStickyPost>;
373 removed_comments: Array<ModRemoveComment>;
374 removed_communities: Array<ModRemoveCommunity>;
375 banned_from_community: Array<ModBanFromCommunity>;
376 banned: Array<ModBan>;
377 added_to_community: Array<ModAddCommunity>;
378 added: Array<ModAdd>;
381 export interface ModRemovePost {
388 mod_user_name: string;
390 community_id: number;
391 community_name: string;
394 export interface ModLockPost {
400 mod_user_name: string;
402 community_id: number;
403 community_name: string;
406 export interface ModStickyPost {
412 mod_user_name: string;
414 community_id: number;
415 community_name: string;
418 export interface ModRemoveComment {
425 mod_user_name: string;
426 comment_user_id: number;
427 comment_user_name: string;
428 comment_content: string;
431 community_id: number;
432 community_name: string;
435 export interface ModRemoveCommunity {
438 community_id: number;
443 mod_user_name: string;
444 community_name: string;
447 export interface ModBanFromCommunity {
450 other_user_id: number;
451 community_id: number;
456 mod_user_name: string;
457 other_user_name: string;
458 community_name: string;
461 export interface ModBan {
464 other_user_id: number;
469 mod_user_name: string;
470 other_user_name: string;
473 export interface ModAddCommunity {
476 other_user_id: number;
477 community_id: number;
480 mod_user_name: string;
481 other_user_name: string;
482 community_name: string;
485 export interface ModAdd {
488 other_user_id: number;
491 mod_user_name: string;
492 other_user_name: string;
495 export interface LoginForm {
496 username_or_email: string;
500 export interface RegisterForm {
504 password_verify: string;
509 export interface LoginResponse {
513 export interface UserSettingsForm {
516 default_sort_type: SortType;
517 default_listing_type: ListingType;
521 matrix_user_id?: string;
522 new_password?: string;
523 new_password_verify?: string;
524 old_password?: string;
525 show_avatars: boolean;
526 send_notifications_to_email: boolean;
530 export interface CommunityForm {
533 description?: string;
544 export interface GetCommunityForm {
550 export interface GetCommunityResponse {
551 community: Community;
552 moderators: Array<CommunityUser>;
553 admins: Array<UserView>;
557 export interface CommunityResponse {
558 community: Community;
561 export interface ListCommunitiesForm {
568 export interface ListCommunitiesResponse {
569 communities: Array<Community>;
572 export interface ListCategoriesResponse {
573 categories: Array<Category>;
576 export interface PostForm {
580 community_id: number;
593 export interface PostFormParams {
600 export interface GetPostForm {
605 export interface GetPostResponse {
607 comments: Array<Comment>;
608 community: Community;
609 moderators: Array<CommunityUser>;
610 admins: Array<UserView>;
614 export interface SavePostForm {
620 export interface PostResponse {
624 export interface CommentForm {
637 export interface SaveCommentForm {
643 export interface CommentResponse {
645 recipient_ids: Array<number>;
648 export interface CommentLikeForm {
655 export interface CommentNode {
657 children?: Array<CommentNode>;
660 export interface GetPostsForm {
665 community_id?: number;
669 export interface GetPostsResponse {
673 export interface GetCommentsForm {
678 community_id?: number;
682 export interface GetCommentsResponse {
683 comments: Array<Comment>;
686 export interface CreatePostLikeForm {
692 export interface SiteForm {
694 description?: string;
695 enable_downvotes: boolean;
696 open_registration: boolean;
697 enable_nsfw: boolean;
701 export interface GetSiteResponse {
703 admins: Array<UserView>;
704 banned: Array<UserView>;
708 export interface SiteResponse {
712 export interface BanUserForm {
720 export interface BanUserResponse {
725 export interface AddAdminForm {
731 export interface AddAdminResponse {
732 admins: Array<UserView>;
735 export interface SearchForm {
738 community_id?: number;
745 export interface SearchResponse {
748 comments?: Array<Comment>;
749 communities: Array<Community>;
750 users: Array<UserView>;
753 export interface DeleteAccountForm {
757 export interface PasswordResetForm {
761 // export interface PasswordResetResponse {
764 export interface PasswordChangeForm {
767 password_verify: string;
770 export interface PrivateMessageForm {
772 recipient_id: number;
776 export interface PrivateMessageFormParams {
777 recipient_id: number;
780 export interface EditPrivateMessageForm {
788 export interface GetPrivateMessagesForm {
789 unread_only: boolean;
795 export interface PrivateMessagesResponse {
796 messages: Array<PrivateMessage>;
799 export interface PrivateMessageResponse {
800 message: PrivateMessage;
803 export interface UserJoinForm {
807 export interface UserJoinResponse {
811 export type MessageType =
812 | EditPrivateMessageForm
816 | FollowCommunityForm
817 | ListCommunitiesForm
818 | GetFollowedCommunitiesForm
827 | BanFromCommunityForm
829 | AddModToCommunityForm
830 | TransferCommunityForm
837 | GetUserMentionsForm
838 | EditUserMentionForm
847 | EditPrivateMessageForm
848 | GetPrivateMessagesForm;
852 | GetFollowedCommunitiesResponse
853 | ListCommunitiesResponse
857 | GetUserMentionsResponse
858 | ListCategoriesResponse
861 | UserMentionResponse
865 | BanFromCommunityResponse
866 | AddModToCommunityResponse
869 | PrivateMessageResponse
870 | PrivateMessagesResponse;
872 export interface WebSocketResponse {
877 export interface WebSocketJsonResponse {