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;
143 matrix_user_id?: string;
147 number_of_posts: number;
149 number_of_comments: number;
150 comment_score: number;
152 show_avatars: boolean;
153 send_notifications_to_email: boolean;
156 export interface CommunityUser {
159 user_actor_id: string;
162 user_preferred_username?: string;
164 community_id: number;
165 community_actor_id: string;
166 community_local: boolean;
167 community_name: string;
168 community_icon?: string;
172 export interface Community {
180 description?: string;
188 creator_actor_id: string;
189 creator_local: boolean;
190 last_refreshed_at: string;
191 creator_name: string;
192 creator_preferred_username?: string;
193 creator_avatar?: string;
194 category_name: string;
195 number_of_subscribers: number;
196 number_of_posts: number;
197 number_of_comments: number;
199 subscribed?: boolean;
202 export interface Post {
208 community_id: number;
213 embed_title?: string;
214 embed_description?: string;
216 thumbnail_url?: string;
221 banned_from_community: boolean;
224 creator_actor_id: string;
225 creator_local: boolean;
226 creator_name: string;
227 creator_preferred_username?: string;
228 creator_published: string;
229 creator_avatar?: string;
230 community_actor_id: string;
231 community_local: boolean;
232 community_name: string;
233 community_icon?: string;
234 community_removed: boolean;
235 community_deleted: boolean;
236 community_nsfw: boolean;
237 number_of_comments: number;
242 hot_rank_active: number;
243 newest_activity_time: string;
246 subscribed?: boolean;
249 duplicates?: Array<Post>;
252 export interface Comment {
266 community_id: number;
267 community_actor_id: string;
268 community_local: boolean;
269 community_name: string;
270 community_icon?: string;
272 banned_from_community: boolean;
273 creator_actor_id: string;
274 creator_local: boolean;
275 creator_name: string;
276 creator_preferred_username?: string;
277 creator_avatar?: string;
278 creator_published: string;
283 hot_rank_active: number;
288 user_mention_id?: number; // For mention type
289 recipient_id?: number;
290 recipient_actor_id?: string;
291 recipient_local?: boolean;
295 export interface Category {
300 export interface Site {
303 description?: string;
307 creator_name: string;
308 creator_preferred_username?: string;
309 number_of_users: number;
310 number_of_posts: number;
311 number_of_comments: number;
312 number_of_communities: number;
313 enable_downvotes: boolean;
314 open_registration: boolean;
315 enable_nsfw: boolean;
320 export interface PrivateMessage {
323 recipient_id: number;
331 creator_name: string;
332 creator_preferred_username?: string;
333 creator_avatar?: string;
334 creator_actor_id: string;
335 creator_local: boolean;
336 recipient_name: string;
337 recipient_preferred_username?: string;
338 recipient_avatar?: string;
339 recipient_actor_id: string;
340 recipient_local: boolean;
343 export enum BanType {
348 export interface FollowCommunityForm {
349 community_id: number;
354 export interface GetFollowedCommunitiesForm {
358 export interface GetFollowedCommunitiesResponse {
359 communities: Array<CommunityUser>;
362 export interface GetUserDetailsForm {
368 community_id?: number;
372 export interface UserDetailsResponse {
374 follows: Array<CommunityUser>;
375 moderates: Array<CommunityUser>;
376 comments: Array<Comment>;
378 admins: Array<UserView>;
381 export interface GetRepliesForm {
385 unread_only: boolean;
389 export interface GetRepliesResponse {
390 replies: Array<Comment>;
393 export interface GetUserMentionsForm {
397 unread_only: boolean;
401 export interface GetUserMentionsResponse {
402 mentions: Array<Comment>;
405 export interface MarkUserMentionAsReadForm {
406 user_mention_id: number;
411 export interface UserMentionResponse {
415 export interface BanFromCommunityForm {
416 community_id: number;
424 export interface BanFromCommunityResponse {
429 export interface AddModToCommunityForm {
430 community_id: number;
436 export interface TransferCommunityForm {
437 community_id: number;
442 export interface TransferSiteForm {
447 export interface AddModToCommunityResponse {
448 moderators: Array<CommunityUser>;
451 export interface GetModlogForm {
452 mod_user_id?: number;
453 community_id?: number;
458 export interface GetModlogResponse {
459 removed_posts: Array<ModRemovePost>;
460 locked_posts: Array<ModLockPost>;
461 stickied_posts: Array<ModStickyPost>;
462 removed_comments: Array<ModRemoveComment>;
463 removed_communities: Array<ModRemoveCommunity>;
464 banned_from_community: Array<ModBanFromCommunity>;
465 banned: Array<ModBan>;
466 added_to_community: Array<ModAddCommunity>;
467 added: Array<ModAdd>;
470 export interface ModRemovePost {
477 mod_user_name: string;
479 community_id: number;
480 community_name: string;
483 export interface ModLockPost {
489 mod_user_name: string;
491 community_id: number;
492 community_name: string;
495 export interface ModStickyPost {
501 mod_user_name: string;
503 community_id: number;
504 community_name: string;
507 export interface ModRemoveComment {
514 mod_user_name: string;
515 comment_user_id: number;
516 comment_user_name: string;
517 comment_content: string;
520 community_id: number;
521 community_name: string;
524 export interface ModRemoveCommunity {
527 community_id: number;
532 mod_user_name: string;
533 community_name: string;
536 export interface ModBanFromCommunity {
539 other_user_id: number;
540 community_id: number;
545 mod_user_name: string;
546 other_user_name: string;
547 community_name: string;
550 export interface ModBan {
553 other_user_id: number;
558 mod_user_name: string;
559 other_user_name: string;
562 export interface ModAddCommunity {
565 other_user_id: number;
566 community_id: number;
569 mod_user_name: string;
570 other_user_name: string;
571 community_name: string;
574 export interface ModAdd {
577 other_user_id: number;
580 mod_user_name: string;
581 other_user_name: string;
584 export interface LoginForm {
585 username_or_email: string;
589 export interface RegisterForm {
593 password_verify: string;
596 captcha_uuid?: string;
597 captcha_answer?: string;
600 export interface GetCaptchaResponse {
608 export interface LoginResponse {
612 export interface UserSettingsForm {
615 default_sort_type: SortType;
616 default_listing_type: ListingType;
620 preferred_username?: string;
623 matrix_user_id?: string;
624 new_password?: string;
625 new_password_verify?: string;
626 old_password?: string;
627 show_avatars: boolean;
628 send_notifications_to_email: boolean;
632 export interface CommunityForm {
636 description?: string;
644 export interface DeleteCommunityForm {
650 export interface RemoveCommunityForm {
658 export interface GetCommunityForm {
664 export interface GetCommunityResponse {
665 community: Community;
666 moderators: Array<CommunityUser>;
670 export interface CommunityResponse {
671 community: Community;
674 export interface ListCommunitiesForm {
681 export interface ListCommunitiesResponse {
682 communities: Array<Community>;
685 export interface ListCategoriesResponse {
686 categories: Array<Category>;
689 export interface PostForm {
693 community_id?: number;
699 export interface DeletePostForm {
705 export interface RemovePostForm {
712 export interface LockPostForm {
718 export interface StickyPostForm {
724 export interface PostFormParams {
731 export interface GetPostForm {
736 export interface GetPostResponse {
738 comments: Array<Comment>;
739 community: Community;
740 moderators: Array<CommunityUser>;
744 export interface SavePostForm {
750 export interface PostResponse {
754 export interface CommentForm {
764 export interface DeleteCommentForm {
770 export interface RemoveCommentForm {
777 export interface MarkCommentAsReadForm {
783 export interface SaveCommentForm {
789 export interface CommentResponse {
791 recipient_ids: Array<number>;
795 export interface CommentLikeForm {
801 export interface CommentNode {
803 children?: Array<CommentNode>;
806 export interface GetPostsForm {
811 community_id?: number;
815 export interface GetPostsResponse {
819 export interface GetCommentsForm {
824 community_id?: number;
828 export interface GetCommentsResponse {
829 comments: Array<Comment>;
832 export interface CreatePostLikeForm {
838 export interface SiteForm {
840 description?: string;
843 enable_downvotes: boolean;
844 open_registration: boolean;
845 enable_nsfw: boolean;
849 export interface GetSiteConfig {
853 export interface GetSiteForm {
857 export interface GetSiteConfigResponse {
858 config_hjson: string;
861 export interface SiteConfigForm {
862 config_hjson: string;
866 export interface GetSiteResponse {
868 admins: Array<UserView>;
869 banned: Array<UserView>;
875 export interface SiteResponse {
879 export interface BanUserForm {
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 {