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;
421 export interface BanFromCommunityResponse {
426 export interface AddModToCommunityForm {
427 community_id: number;
433 export interface TransferCommunityForm {
434 community_id: number;
439 export interface TransferSiteForm {
444 export interface AddModToCommunityResponse {
445 moderators: Array<CommunityUser>;
448 export interface GetModlogForm {
449 mod_user_id?: number;
450 community_id?: number;
455 export interface GetModlogResponse {
456 removed_posts: Array<ModRemovePost>;
457 locked_posts: Array<ModLockPost>;
458 stickied_posts: Array<ModStickyPost>;
459 removed_comments: Array<ModRemoveComment>;
460 removed_communities: Array<ModRemoveCommunity>;
461 banned_from_community: Array<ModBanFromCommunity>;
462 banned: Array<ModBan>;
463 added_to_community: Array<ModAddCommunity>;
464 added: Array<ModAdd>;
467 export interface ModRemovePost {
474 mod_user_name: string;
476 community_id: number;
477 community_name: string;
480 export interface ModLockPost {
486 mod_user_name: string;
488 community_id: number;
489 community_name: string;
492 export interface ModStickyPost {
498 mod_user_name: string;
500 community_id: number;
501 community_name: string;
504 export interface ModRemoveComment {
511 mod_user_name: string;
512 comment_user_id: number;
513 comment_user_name: string;
514 comment_content: string;
517 community_id: number;
518 community_name: string;
521 export interface ModRemoveCommunity {
524 community_id: number;
529 mod_user_name: string;
530 community_name: string;
533 export interface ModBanFromCommunity {
536 other_user_id: number;
537 community_id: number;
542 mod_user_name: string;
543 other_user_name: string;
544 community_name: string;
547 export interface ModBan {
550 other_user_id: number;
555 mod_user_name: string;
556 other_user_name: string;
559 export interface ModAddCommunity {
562 other_user_id: number;
563 community_id: number;
566 mod_user_name: string;
567 other_user_name: string;
568 community_name: string;
571 export interface ModAdd {
574 other_user_id: number;
577 mod_user_name: string;
578 other_user_name: string;
581 export interface LoginForm {
582 username_or_email: string;
586 export interface RegisterForm {
590 password_verify: string;
593 captcha_uuid?: string;
594 captcha_answer?: string;
597 export interface GetCaptchaResponse {
605 export interface LoginResponse {
609 export interface UserSettingsForm {
612 default_sort_type: SortType;
613 default_listing_type: ListingType;
617 preferred_username?: string;
620 matrix_user_id?: string;
621 new_password?: string;
622 new_password_verify?: string;
623 old_password?: string;
624 show_avatars: boolean;
625 send_notifications_to_email: boolean;
629 export interface CommunityForm {
633 description?: string;
641 export interface DeleteCommunityForm {
647 export interface RemoveCommunityForm {
655 export interface GetCommunityForm {
661 export interface GetCommunityResponse {
662 community: Community;
663 moderators: Array<CommunityUser>;
667 export interface CommunityResponse {
668 community: Community;
671 export interface ListCommunitiesForm {
678 export interface ListCommunitiesResponse {
679 communities: Array<Community>;
682 export interface ListCategoriesResponse {
683 categories: Array<Category>;
686 export interface PostForm {
690 community_id?: number;
696 export interface DeletePostForm {
702 export interface RemovePostForm {
709 export interface LockPostForm {
715 export interface StickyPostForm {
721 export interface PostFormParams {
728 export interface GetPostForm {
733 export interface GetPostResponse {
735 comments: Array<Comment>;
736 community: Community;
737 moderators: Array<CommunityUser>;
741 export interface SavePostForm {
747 export interface PostResponse {
751 export interface CommentForm {
761 export interface DeleteCommentForm {
767 export interface RemoveCommentForm {
774 export interface MarkCommentAsReadForm {
780 export interface SaveCommentForm {
786 export interface CommentResponse {
788 recipient_ids: Array<number>;
792 export interface CommentLikeForm {
798 export interface CommentNode {
800 children?: Array<CommentNode>;
803 export interface GetPostsForm {
808 community_id?: number;
812 export interface GetPostsResponse {
816 export interface GetCommentsForm {
821 community_id?: number;
825 export interface GetCommentsResponse {
826 comments: Array<Comment>;
829 export interface CreatePostLikeForm {
835 export interface SiteForm {
837 description?: string;
840 enable_downvotes: boolean;
841 open_registration: boolean;
842 enable_nsfw: boolean;
846 export interface GetSiteConfig {
850 export interface GetSiteForm {
854 export interface GetSiteConfigResponse {
855 config_hjson: string;
858 export interface SiteConfigForm {
859 config_hjson: string;
863 export interface GetSiteResponse {
865 admins: Array<UserView>;
866 banned: Array<UserView>;
872 export interface SiteResponse {
876 export interface BanUserForm {
884 export interface BanUserResponse {
889 export interface AddAdminForm {
895 export interface AddAdminResponse {
896 admins: Array<UserView>;
899 export interface SearchForm {
902 community_id?: number;
909 export interface SearchResponse {
912 comments?: Array<Comment>;
913 communities: Array<Community>;
914 users: Array<UserView>;
917 export interface DeleteAccountForm {
921 export interface PasswordResetForm {
925 // export interface PasswordResetResponse {
928 export interface PasswordChangeForm {
931 password_verify: string;
934 export interface PrivateMessageForm {
936 recipient_id: number;
940 export interface PrivateMessageFormParams {
941 recipient_id: number;
944 export interface EditPrivateMessageForm {
950 export interface DeletePrivateMessageForm {
956 export interface MarkPrivateMessageAsReadForm {
962 export interface GetPrivateMessagesForm {
963 unread_only: boolean;
969 export interface PrivateMessagesResponse {
970 messages: Array<PrivateMessage>;
973 export interface PrivateMessageResponse {
974 message: PrivateMessage;
977 export interface UserJoinForm {
981 export interface UserJoinResponse {
985 export type MessageType =
989 | DeleteCommunityForm
990 | RemoveCommunityForm
991 | FollowCommunityForm
992 | ListCommunitiesForm
993 | GetFollowedCommunitiesForm
1005 | MarkCommentAsReadForm
1008 | CreatePostLikeForm
1009 | BanFromCommunityForm
1011 | AddModToCommunityForm
1012 | TransferCommunityForm
1017 | GetUserDetailsForm
1019 | GetUserMentionsForm
1020 | MarkUserMentionAsReadForm
1027 | PasswordChangeForm
1028 | PrivateMessageForm
1029 | EditPrivateMessageForm
1030 | DeletePrivateMessageForm
1031 | MarkPrivateMessageAsReadForm
1032 | GetPrivateMessagesForm
1037 | GetFollowedCommunitiesResponse
1038 | ListCommunitiesResponse
1041 | GetRepliesResponse
1042 | GetUserMentionsResponse
1043 | ListCategoriesResponse
1046 | UserMentionResponse
1048 | GetCaptchaResponse
1051 | BanFromCommunityResponse
1052 | AddModToCommunityResponse
1055 | PrivateMessageResponse
1056 | PrivateMessagesResponse
1057 | GetSiteConfigResponse
1060 export interface WebSocketResponse {
1065 export interface WebSocketJsonResponse {
1067 data?: ResponseType;
1069 reconnect?: boolean;
1072 export enum UserDetailsView {