1 export enum UserOperation {
30 GetFollowedCommunities,
34 MarkUserMentionAsRead,
54 MarkPrivateMessageAsRead,
62 export enum CommentSortType {
69 export enum CommentViewType {
74 export enum ListingType {
80 export enum DataType {
85 export enum SortType {
96 export enum SearchType {
105 export interface Claims {
110 export interface User {
113 preferred_username?: string;
123 default_sort_type: SortType;
124 default_listing_type: ListingType;
126 show_avatars: boolean;
127 send_notifications_to_email: boolean;
128 matrix_user_id?: string;
132 last_refreshed_at: string;
135 export interface UserView {
139 preferred_username?: string;
142 matrix_user_id?: string;
146 number_of_posts: number;
148 number_of_comments: number;
149 comment_score: number;
153 export interface CommunityUser {
156 user_actor_id: string;
159 user_preferred_username?: string;
161 community_id: number;
162 community_actor_id: string;
163 community_local: boolean;
164 community_name: string;
165 community_icon?: string;
169 export interface Community {
177 description?: string;
185 creator_actor_id: string;
186 creator_local: boolean;
187 last_refreshed_at: string;
188 creator_name: string;
189 creator_preferred_username?: string;
190 creator_avatar?: string;
191 category_name: string;
192 number_of_subscribers: number;
193 number_of_posts: number;
194 number_of_comments: number;
196 subscribed?: boolean;
199 export interface Post {
205 community_id: number;
210 embed_title?: string;
211 embed_description?: string;
213 thumbnail_url?: string;
218 banned_from_community: boolean;
221 creator_actor_id: string;
222 creator_local: boolean;
223 creator_name: string;
224 creator_preferred_username?: string;
225 creator_published: string;
226 creator_avatar?: string;
227 community_actor_id: string;
228 community_local: boolean;
229 community_name: string;
230 community_icon?: string;
231 community_removed: boolean;
232 community_deleted: boolean;
233 community_nsfw: boolean;
234 number_of_comments: number;
239 hot_rank_active: number;
240 newest_activity_time: string;
243 subscribed?: boolean;
246 duplicates?: Array<Post>;
249 export interface Comment {
263 community_id: number;
264 community_actor_id: string;
265 community_local: boolean;
266 community_name: string;
267 community_icon?: string;
269 banned_from_community: boolean;
270 creator_actor_id: string;
271 creator_local: boolean;
272 creator_name: string;
273 creator_preferred_username?: string;
274 creator_avatar?: string;
275 creator_published: string;
280 hot_rank_active: number;
285 user_mention_id?: number; // For mention type
286 recipient_id?: number;
287 recipient_actor_id?: string;
288 recipient_local?: boolean;
292 export interface Category {
297 export interface Site {
300 description?: string;
304 creator_name: string;
305 creator_preferred_username?: string;
306 number_of_users: number;
307 number_of_posts: number;
308 number_of_comments: number;
309 number_of_communities: number;
310 enable_downvotes: boolean;
311 open_registration: boolean;
312 enable_nsfw: boolean;
317 export interface PrivateMessage {
320 recipient_id: number;
328 creator_name: string;
329 creator_preferred_username?: string;
330 creator_avatar?: string;
331 creator_actor_id: string;
332 creator_local: boolean;
333 recipient_name: string;
334 recipient_preferred_username?: string;
335 recipient_avatar?: string;
336 recipient_actor_id: string;
337 recipient_local: boolean;
340 export enum BanType {
345 export interface FollowCommunityForm {
346 community_id: number;
351 export interface GetFollowedCommunitiesForm {
355 export interface GetFollowedCommunitiesResponse {
356 communities: Array<CommunityUser>;
359 export interface GetUserDetailsForm {
365 community_id?: number;
369 export interface UserDetailsResponse {
371 follows: Array<CommunityUser>;
372 moderates: Array<CommunityUser>;
373 comments: Array<Comment>;
375 admins: Array<UserView>;
378 export interface GetRepliesForm {
382 unread_only: boolean;
386 export interface GetRepliesResponse {
387 replies: Array<Comment>;
390 export interface GetUserMentionsForm {
394 unread_only: boolean;
398 export interface GetUserMentionsResponse {
399 mentions: Array<Comment>;
402 export interface MarkUserMentionAsReadForm {
403 user_mention_id: number;
408 export interface UserMentionResponse {
412 export interface BanFromCommunityForm {
413 community_id: number;
416 remove_data?: boolean;
422 export interface BanFromCommunityResponse {
427 export interface AddModToCommunityForm {
428 community_id: number;
434 export interface TransferCommunityForm {
435 community_id: number;
440 export interface TransferSiteForm {
445 export interface AddModToCommunityResponse {
446 moderators: Array<CommunityUser>;
449 export interface GetModlogForm {
450 mod_user_id?: number;
451 community_id?: number;
456 export interface GetModlogResponse {
457 removed_posts: Array<ModRemovePost>;
458 locked_posts: Array<ModLockPost>;
459 stickied_posts: Array<ModStickyPost>;
460 removed_comments: Array<ModRemoveComment>;
461 removed_communities: Array<ModRemoveCommunity>;
462 banned_from_community: Array<ModBanFromCommunity>;
463 banned: Array<ModBan>;
464 added_to_community: Array<ModAddCommunity>;
465 added: Array<ModAdd>;
468 export interface ModRemovePost {
475 mod_user_name: string;
477 community_id: number;
478 community_name: string;
481 export interface ModLockPost {
487 mod_user_name: string;
489 community_id: number;
490 community_name: string;
493 export interface ModStickyPost {
499 mod_user_name: string;
501 community_id: number;
502 community_name: string;
505 export interface ModRemoveComment {
512 mod_user_name: string;
513 comment_user_id: number;
514 comment_user_name: string;
515 comment_content: string;
518 community_id: number;
519 community_name: string;
522 export interface ModRemoveCommunity {
525 community_id: number;
530 mod_user_name: string;
531 community_name: string;
534 export interface ModBanFromCommunity {
537 other_user_id: number;
538 community_id: number;
543 mod_user_name: string;
544 other_user_name: string;
545 community_name: string;
548 export interface ModBan {
551 other_user_id: number;
556 mod_user_name: string;
557 other_user_name: string;
560 export interface ModAddCommunity {
563 other_user_id: number;
564 community_id: number;
567 mod_user_name: string;
568 other_user_name: string;
569 community_name: string;
572 export interface ModAdd {
575 other_user_id: number;
578 mod_user_name: string;
579 other_user_name: string;
582 export interface LoginForm {
583 username_or_email: string;
587 export interface RegisterForm {
591 password_verify: string;
594 captcha_uuid?: string;
595 captcha_answer?: string;
598 export interface GetCaptchaResponse {
606 export interface LoginResponse {
610 export interface UserSettingsForm {
613 default_sort_type: SortType;
614 default_listing_type: ListingType;
618 preferred_username?: string;
621 matrix_user_id?: string;
622 new_password?: string;
623 new_password_verify?: string;
624 old_password?: string;
625 show_avatars: boolean;
626 send_notifications_to_email: boolean;
630 export interface CommunityForm {
634 description?: string;
642 export interface DeleteCommunityForm {
648 export interface RemoveCommunityForm {
656 export interface GetCommunityForm {
662 export interface GetCommunityResponse {
663 community: Community;
664 moderators: Array<CommunityUser>;
668 export interface CommunityResponse {
669 community: Community;
672 export interface ListCommunitiesForm {
679 export interface ListCommunitiesResponse {
680 communities: Array<Community>;
683 export interface ListCategoriesResponse {
684 categories: Array<Category>;
687 export interface PostForm {
691 community_id?: number;
697 export interface DeletePostForm {
703 export interface RemovePostForm {
710 export interface LockPostForm {
716 export interface StickyPostForm {
722 export interface PostFormParams {
729 export interface GetPostForm {
734 export interface GetPostResponse {
736 comments: Array<Comment>;
737 community: Community;
738 moderators: Array<CommunityUser>;
742 export interface SavePostForm {
748 export interface PostResponse {
752 export interface CommentForm {
762 export interface DeleteCommentForm {
768 export interface RemoveCommentForm {
775 export interface MarkCommentAsReadForm {
781 export interface SaveCommentForm {
787 export interface CommentResponse {
789 recipient_ids: Array<number>;
793 export interface CommentLikeForm {
799 export interface CommentNode {
801 children?: Array<CommentNode>;
804 export interface GetPostsForm {
809 community_id?: number;
813 export interface GetPostsResponse {
817 export interface GetCommentsForm {
822 community_id?: number;
826 export interface GetCommentsResponse {
827 comments: Array<Comment>;
830 export interface CreatePostLikeForm {
836 export interface SiteForm {
838 description?: string;
841 enable_downvotes: boolean;
842 open_registration: boolean;
843 enable_nsfw: boolean;
847 export interface GetSiteConfig {
851 export interface GetSiteForm {
855 export interface GetSiteConfigResponse {
856 config_hjson: string;
859 export interface SiteConfigForm {
860 config_hjson: string;
864 export interface GetSiteResponse {
866 admins: Array<UserView>;
867 banned: Array<UserView>;
871 federated_instances: Array<string>;
874 export interface SiteResponse {
878 export interface BanUserForm {
881 remove_data?: boolean;
887 export interface BanUserResponse {
892 export interface AddAdminForm {
898 export interface AddAdminResponse {
899 admins: Array<UserView>;
902 export interface SearchForm {
905 community_id?: number;
912 export interface SearchResponse {
915 comments?: Array<Comment>;
916 communities: Array<Community>;
917 users: Array<UserView>;
920 export interface DeleteAccountForm {
924 export interface PasswordResetForm {
928 // export interface PasswordResetResponse {
931 export interface PasswordChangeForm {
934 password_verify: string;
937 export interface PrivateMessageForm {
939 recipient_id: number;
943 export interface PrivateMessageFormParams {
944 recipient_id: number;
947 export interface EditPrivateMessageForm {
953 export interface DeletePrivateMessageForm {
959 export interface MarkPrivateMessageAsReadForm {
965 export interface GetPrivateMessagesForm {
966 unread_only: boolean;
972 export interface PrivateMessagesResponse {
973 messages: Array<PrivateMessage>;
976 export interface PrivateMessageResponse {
977 message: PrivateMessage;
980 export interface UserJoinForm {
984 export interface UserJoinResponse {
988 export type MessageType =
992 | DeleteCommunityForm
993 | RemoveCommunityForm
994 | FollowCommunityForm
995 | ListCommunitiesForm
996 | GetFollowedCommunitiesForm
1008 | MarkCommentAsReadForm
1011 | CreatePostLikeForm
1012 | BanFromCommunityForm
1014 | AddModToCommunityForm
1015 | TransferCommunityForm
1020 | GetUserDetailsForm
1022 | GetUserMentionsForm
1023 | MarkUserMentionAsReadForm
1030 | PasswordChangeForm
1031 | PrivateMessageForm
1032 | EditPrivateMessageForm
1033 | DeletePrivateMessageForm
1034 | MarkPrivateMessageAsReadForm
1035 | GetPrivateMessagesForm
1040 | GetFollowedCommunitiesResponse
1041 | ListCommunitiesResponse
1044 | GetRepliesResponse
1045 | GetUserMentionsResponse
1046 | ListCategoriesResponse
1049 | UserMentionResponse
1051 | GetCaptchaResponse
1054 | BanFromCommunityResponse
1055 | AddModToCommunityResponse
1058 | PrivateMessageResponse
1059 | PrivateMessagesResponse
1060 | GetSiteConfigResponse
1063 export interface WebSocketResponse {
1068 export interface WebSocketJsonResponse {
1070 data?: ResponseType;
1072 reconnect?: boolean;
1075 export enum UserDetailsView {