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;
107 number_of_posts: number;
109 number_of_comments: number;
110 comment_score: number;
112 show_avatars: boolean;
113 send_notifications_to_email: boolean;
116 export interface CommunityUser {
121 community_id: number;
122 community_name: string;
126 export interface Community {
130 description?: string;
138 creator_name: string;
139 creator_avatar?: string;
140 category_name: string;
141 number_of_subscribers: number;
142 number_of_posts: number;
143 number_of_comments: number;
145 subscribed?: boolean;
148 export interface Post {
154 community_id: number;
159 embed_title?: string;
160 embed_description?: string;
162 thumbnail_url?: string;
165 banned_from_community: boolean;
168 creator_name: string;
169 creator_avatar?: string;
170 community_name: string;
171 community_removed: boolean;
172 community_deleted: boolean;
173 community_nsfw: boolean;
174 number_of_comments: number;
179 newest_activity_time: string;
182 subscribed?: boolean;
185 duplicates?: Array<Post>;
188 export interface Comment {
199 community_id: number;
200 community_name: string;
202 banned_from_community: boolean;
203 creator_name: string;
204 creator_avatar?: string;
213 user_mention_id?: number; // For mention type
214 recipient_id?: number;
218 export interface Category {
223 export interface Site {
226 description?: string;
230 creator_name: string;
231 number_of_users: number;
232 number_of_posts: number;
233 number_of_comments: number;
234 number_of_communities: number;
235 enable_downvotes: boolean;
236 open_registration: boolean;
237 enable_nsfw: boolean;
240 export interface PrivateMessage {
243 recipient_id: number;
249 creator_name: string;
250 creator_avatar?: string;
251 recipient_name: string;
252 recipient_avatar?: string;
255 export enum BanType {
260 export interface FollowCommunityForm {
261 community_id: number;
266 export interface GetFollowedCommunitiesForm {
270 export interface GetFollowedCommunitiesResponse {
271 communities: Array<CommunityUser>;
274 export interface GetUserDetailsForm {
280 community_id?: number;
284 export interface UserDetailsResponse {
286 follows: Array<CommunityUser>;
287 moderates: Array<CommunityUser>;
288 comments: Array<Comment>;
290 admins: Array<UserView>;
293 export interface GetRepliesForm {
297 unread_only: boolean;
301 export interface GetRepliesResponse {
302 replies: Array<Comment>;
305 export interface GetUserMentionsForm {
309 unread_only: boolean;
313 export interface GetUserMentionsResponse {
314 mentions: Array<Comment>;
317 export interface EditUserMentionForm {
318 user_mention_id: number;
323 export interface UserMentionResponse {
327 export interface BanFromCommunityForm {
328 community_id: number;
336 export interface BanFromCommunityResponse {
341 export interface AddModToCommunityForm {
342 community_id: number;
348 export interface TransferCommunityForm {
349 community_id: number;
354 export interface TransferSiteForm {
359 export interface AddModToCommunityResponse {
360 moderators: Array<CommunityUser>;
363 export interface GetModlogForm {
364 mod_user_id?: number;
365 community_id?: number;
370 export interface GetModlogResponse {
371 removed_posts: Array<ModRemovePost>;
372 locked_posts: Array<ModLockPost>;
373 stickied_posts: Array<ModStickyPost>;
374 removed_comments: Array<ModRemoveComment>;
375 removed_communities: Array<ModRemoveCommunity>;
376 banned_from_community: Array<ModBanFromCommunity>;
377 banned: Array<ModBan>;
378 added_to_community: Array<ModAddCommunity>;
379 added: Array<ModAdd>;
382 export interface ModRemovePost {
389 mod_user_name: string;
391 community_id: number;
392 community_name: string;
395 export interface ModLockPost {
401 mod_user_name: string;
403 community_id: number;
404 community_name: string;
407 export interface ModStickyPost {
413 mod_user_name: string;
415 community_id: number;
416 community_name: string;
419 export interface ModRemoveComment {
426 mod_user_name: string;
427 comment_user_id: number;
428 comment_user_name: string;
429 comment_content: string;
432 community_id: number;
433 community_name: string;
436 export interface ModRemoveCommunity {
439 community_id: number;
444 mod_user_name: string;
445 community_name: string;
448 export interface ModBanFromCommunity {
451 other_user_id: number;
452 community_id: number;
457 mod_user_name: string;
458 other_user_name: string;
459 community_name: string;
462 export interface ModBan {
465 other_user_id: number;
470 mod_user_name: string;
471 other_user_name: string;
474 export interface ModAddCommunity {
477 other_user_id: number;
478 community_id: number;
481 mod_user_name: string;
482 other_user_name: string;
483 community_name: string;
486 export interface ModAdd {
489 other_user_id: number;
492 mod_user_name: string;
493 other_user_name: string;
496 export interface LoginForm {
497 username_or_email: string;
501 export interface RegisterForm {
505 password_verify: string;
510 export interface LoginResponse {
514 export interface UserSettingsForm {
517 default_sort_type: SortType;
518 default_listing_type: ListingType;
522 matrix_user_id?: string;
523 new_password?: string;
524 new_password_verify?: string;
525 old_password?: string;
526 show_avatars: boolean;
527 send_notifications_to_email: boolean;
531 export interface CommunityForm {
534 description?: string;
545 export interface GetCommunityForm {
551 export interface GetCommunityResponse {
552 community: Community;
553 moderators: Array<CommunityUser>;
554 admins: Array<UserView>;
558 export interface CommunityResponse {
559 community: Community;
562 export interface ListCommunitiesForm {
569 export interface ListCommunitiesResponse {
570 communities: Array<Community>;
573 export interface ListCategoriesResponse {
574 categories: Array<Category>;
577 export interface PostForm {
581 community_id: number;
594 export interface PostFormParams {
601 export interface GetPostForm {
606 export interface GetPostResponse {
608 comments: Array<Comment>;
609 community: Community;
610 moderators: Array<CommunityUser>;
611 admins: Array<UserView>;
615 export interface SavePostForm {
621 export interface PostResponse {
625 export interface CommentForm {
638 export interface SaveCommentForm {
644 export interface CommentResponse {
646 recipient_ids: Array<number>;
649 export interface CommentLikeForm {
656 export interface CommentNode {
658 children?: Array<CommentNode>;
661 export interface GetPostsForm {
666 community_id?: number;
670 export interface GetPostsResponse {
674 export interface GetCommentsForm {
679 community_id?: number;
683 export interface GetCommentsResponse {
684 comments: Array<Comment>;
687 export interface CreatePostLikeForm {
693 export interface SiteForm {
695 description?: string;
696 enable_downvotes: boolean;
697 open_registration: boolean;
698 enable_nsfw: boolean;
702 export interface GetSiteResponse {
704 admins: Array<UserView>;
705 banned: Array<UserView>;
709 export interface SiteResponse {
713 export interface BanUserForm {
721 export interface BanUserResponse {
726 export interface AddAdminForm {
732 export interface AddAdminResponse {
733 admins: Array<UserView>;
736 export interface SearchForm {
739 community_id?: number;
746 export interface SearchResponse {
749 comments?: Array<Comment>;
750 communities: Array<Community>;
751 users: Array<UserView>;
754 export interface DeleteAccountForm {
758 export interface PasswordResetForm {
762 // export interface PasswordResetResponse {
765 export interface PasswordChangeForm {
768 password_verify: string;
771 export interface PrivateMessageForm {
773 recipient_id: number;
777 export interface PrivateMessageFormParams {
778 recipient_id: number;
781 export interface EditPrivateMessageForm {
789 export interface GetPrivateMessagesForm {
790 unread_only: boolean;
796 export interface PrivateMessagesResponse {
797 messages: Array<PrivateMessage>;
800 export interface PrivateMessageResponse {
801 message: PrivateMessage;
804 export interface UserJoinForm {
808 export interface UserJoinResponse {
812 export type MessageType =
813 | EditPrivateMessageForm
817 | FollowCommunityForm
818 | ListCommunitiesForm
819 | GetFollowedCommunitiesForm
828 | BanFromCommunityForm
830 | AddModToCommunityForm
831 | TransferCommunityForm
838 | GetUserMentionsForm
839 | EditUserMentionForm
848 | EditPrivateMessageForm
849 | GetPrivateMessagesForm;
853 | GetFollowedCommunitiesResponse
854 | ListCommunitiesResponse
858 | GetUserMentionsResponse
859 | ListCategoriesResponse
862 | UserMentionResponse
866 | BanFromCommunityResponse
867 | AddModToCommunityResponse
870 | PrivateMessageResponse
871 | PrivateMessagesResponse;
873 export interface WebSocketResponse {
878 export interface WebSocketJsonResponse {