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 {
95 export enum SearchType {
104 export interface Claims {
109 export interface User {
112 preferred_username?: string;
121 default_sort_type: SortType;
122 default_listing_type: ListingType;
124 show_avatars: boolean;
125 send_notifications_to_email: boolean;
126 matrix_user_id?: string;
130 last_refreshed_at: string;
133 export interface UserView {
139 matrix_user_id?: string;
143 number_of_posts: number;
145 number_of_comments: number;
146 comment_score: number;
148 show_avatars: boolean;
149 send_notifications_to_email: boolean;
152 export interface CommunityUser {
155 user_actor_id: string;
159 community_id: number;
160 community_actor_id: string;
161 community_local: boolean;
162 community_name: string;
166 export interface Community {
172 description?: string;
180 creator_actor_id: string;
181 creator_local: boolean;
182 last_refreshed_at: string;
183 creator_name: string;
184 creator_avatar?: string;
185 category_name: string;
186 number_of_subscribers: number;
187 number_of_posts: number;
188 number_of_comments: number;
190 subscribed?: boolean;
193 export interface Post {
199 community_id: number;
204 embed_title?: string;
205 embed_description?: string;
207 thumbnail_url?: string;
212 banned_from_community: boolean;
215 creator_actor_id: string;
216 creator_local: boolean;
217 creator_name: string;
218 creator_published: string;
219 creator_avatar?: string;
220 community_actor_id: string;
221 community_local: boolean;
222 community_name: string;
223 community_removed: boolean;
224 community_deleted: boolean;
225 community_nsfw: boolean;
226 number_of_comments: number;
231 newest_activity_time: string;
234 subscribed?: boolean;
237 duplicates?: Array<Post>;
240 export interface Comment {
254 community_id: number;
255 community_actor_id: string;
256 community_local: boolean;
257 community_name: string;
259 banned_from_community: boolean;
260 creator_actor_id: string;
261 creator_local: boolean;
262 creator_name: string;
263 creator_avatar?: string;
264 creator_published: string;
273 user_mention_id?: number; // For mention type
274 recipient_id?: number;
275 recipient_actor_id?: string;
276 recipient_local?: boolean;
280 export interface Category {
285 export interface Site {
288 description?: string;
292 creator_name: string;
293 number_of_users: number;
294 number_of_posts: number;
295 number_of_comments: number;
296 number_of_communities: number;
297 enable_downvotes: boolean;
298 open_registration: boolean;
299 enable_nsfw: boolean;
302 export interface PrivateMessage {
305 recipient_id: number;
313 creator_name: string;
314 creator_avatar?: string;
315 creator_actor_id: string;
316 creator_local: boolean;
317 recipient_name: string;
318 recipient_avatar?: string;
319 recipient_actor_id: string;
320 recipient_local: boolean;
323 export enum BanType {
328 export interface FollowCommunityForm {
329 community_id: number;
334 export interface GetFollowedCommunitiesForm {
338 export interface GetFollowedCommunitiesResponse {
339 communities: Array<CommunityUser>;
342 export interface GetUserDetailsForm {
348 community_id?: number;
352 export interface UserDetailsResponse {
354 follows: Array<CommunityUser>;
355 moderates: Array<CommunityUser>;
356 comments: Array<Comment>;
358 admins: Array<UserView>;
361 export interface GetRepliesForm {
365 unread_only: boolean;
369 export interface GetRepliesResponse {
370 replies: Array<Comment>;
373 export interface GetUserMentionsForm {
377 unread_only: boolean;
381 export interface GetUserMentionsResponse {
382 mentions: Array<Comment>;
385 export interface MarkUserMentionAsReadForm {
386 user_mention_id: number;
391 export interface UserMentionResponse {
395 export interface BanFromCommunityForm {
396 community_id: number;
404 export interface BanFromCommunityResponse {
409 export interface AddModToCommunityForm {
410 community_id: number;
416 export interface TransferCommunityForm {
417 community_id: number;
422 export interface TransferSiteForm {
427 export interface AddModToCommunityResponse {
428 moderators: Array<CommunityUser>;
431 export interface GetModlogForm {
432 mod_user_id?: number;
433 community_id?: number;
438 export interface GetModlogResponse {
439 removed_posts: Array<ModRemovePost>;
440 locked_posts: Array<ModLockPost>;
441 stickied_posts: Array<ModStickyPost>;
442 removed_comments: Array<ModRemoveComment>;
443 removed_communities: Array<ModRemoveCommunity>;
444 banned_from_community: Array<ModBanFromCommunity>;
445 banned: Array<ModBan>;
446 added_to_community: Array<ModAddCommunity>;
447 added: Array<ModAdd>;
450 export interface ModRemovePost {
457 mod_user_name: string;
459 community_id: number;
460 community_name: string;
463 export interface ModLockPost {
469 mod_user_name: string;
471 community_id: number;
472 community_name: string;
475 export interface ModStickyPost {
481 mod_user_name: string;
483 community_id: number;
484 community_name: string;
487 export interface ModRemoveComment {
494 mod_user_name: string;
495 comment_user_id: number;
496 comment_user_name: string;
497 comment_content: string;
500 community_id: number;
501 community_name: string;
504 export interface ModRemoveCommunity {
507 community_id: number;
512 mod_user_name: string;
513 community_name: string;
516 export interface ModBanFromCommunity {
519 other_user_id: number;
520 community_id: number;
525 mod_user_name: string;
526 other_user_name: string;
527 community_name: string;
530 export interface ModBan {
533 other_user_id: number;
538 mod_user_name: string;
539 other_user_name: string;
542 export interface ModAddCommunity {
545 other_user_id: number;
546 community_id: number;
549 mod_user_name: string;
550 other_user_name: string;
551 community_name: string;
554 export interface ModAdd {
557 other_user_id: number;
560 mod_user_name: string;
561 other_user_name: string;
564 export interface LoginForm {
565 username_or_email: string;
569 export interface RegisterForm {
573 password_verify: string;
576 captcha_uuid?: string;
577 captcha_answer?: string;
580 export interface GetCaptchaResponse {
588 export interface LoginResponse {
592 export interface UserSettingsForm {
595 default_sort_type: SortType;
596 default_listing_type: ListingType;
600 matrix_user_id?: string;
601 new_password?: string;
602 new_password_verify?: string;
603 old_password?: string;
604 show_avatars: boolean;
605 send_notifications_to_email: boolean;
609 export interface CommunityForm {
613 description?: string;
619 export interface DeleteCommunityForm {
625 export interface RemoveCommunityForm {
633 export interface GetCommunityForm {
639 export interface GetCommunityResponse {
640 community: Community;
641 moderators: Array<CommunityUser>;
645 export interface CommunityResponse {
646 community: Community;
649 export interface ListCommunitiesForm {
656 export interface ListCommunitiesResponse {
657 communities: Array<Community>;
660 export interface ListCategoriesResponse {
661 categories: Array<Category>;
664 export interface PostForm {
668 community_id?: number;
674 export interface DeletePostForm {
680 export interface RemovePostForm {
687 export interface LockPostForm {
693 export interface StickyPostForm {
699 export interface PostFormParams {
706 export interface GetPostForm {
711 export interface GetPostResponse {
713 comments: Array<Comment>;
714 community: Community;
715 moderators: Array<CommunityUser>;
719 export interface SavePostForm {
725 export interface PostResponse {
729 export interface CommentForm {
739 export interface DeleteCommentForm {
745 export interface RemoveCommentForm {
752 export interface MarkCommentAsReadForm {
758 export interface SaveCommentForm {
764 export interface CommentResponse {
766 recipient_ids: Array<number>;
770 export interface CommentLikeForm {
776 export interface CommentNode {
778 children?: Array<CommentNode>;
781 export interface GetPostsForm {
786 community_id?: number;
790 export interface GetPostsResponse {
794 export interface GetCommentsForm {
799 community_id?: number;
803 export interface GetCommentsResponse {
804 comments: Array<Comment>;
807 export interface CreatePostLikeForm {
813 export interface SiteForm {
815 description?: string;
816 enable_downvotes: boolean;
817 open_registration: boolean;
818 enable_nsfw: boolean;
822 export interface GetSiteConfig {
826 export interface GetSiteForm {
830 export interface GetSiteConfigResponse {
831 config_hjson: string;
834 export interface SiteConfigForm {
835 config_hjson: string;
839 export interface GetSiteResponse {
841 admins: Array<UserView>;
842 banned: Array<UserView>;
848 export interface SiteResponse {
852 export interface BanUserForm {
860 export interface BanUserResponse {
865 export interface AddAdminForm {
871 export interface AddAdminResponse {
872 admins: Array<UserView>;
875 export interface SearchForm {
878 community_id?: number;
885 export interface SearchResponse {
888 comments?: Array<Comment>;
889 communities: Array<Community>;
890 users: Array<UserView>;
893 export interface DeleteAccountForm {
897 export interface PasswordResetForm {
901 // export interface PasswordResetResponse {
904 export interface PasswordChangeForm {
907 password_verify: string;
910 export interface PrivateMessageForm {
912 recipient_id: number;
916 export interface PrivateMessageFormParams {
917 recipient_id: number;
920 export interface EditPrivateMessageForm {
926 export interface DeletePrivateMessageForm {
932 export interface MarkPrivateMessageAsReadForm {
938 export interface GetPrivateMessagesForm {
939 unread_only: boolean;
945 export interface PrivateMessagesResponse {
946 messages: Array<PrivateMessage>;
949 export interface PrivateMessageResponse {
950 message: PrivateMessage;
953 export interface UserJoinForm {
957 export interface UserJoinResponse {
961 export type MessageType =
965 | DeleteCommunityForm
966 | RemoveCommunityForm
967 | FollowCommunityForm
968 | ListCommunitiesForm
969 | GetFollowedCommunitiesForm
981 | MarkCommentAsReadForm
985 | BanFromCommunityForm
987 | AddModToCommunityForm
988 | TransferCommunityForm
995 | GetUserMentionsForm
996 | MarkUserMentionAsReadForm
1003 | PasswordChangeForm
1004 | PrivateMessageForm
1005 | EditPrivateMessageForm
1006 | DeletePrivateMessageForm
1007 | MarkPrivateMessageAsReadForm
1008 | GetPrivateMessagesForm
1013 | GetFollowedCommunitiesResponse
1014 | ListCommunitiesResponse
1017 | GetRepliesResponse
1018 | GetUserMentionsResponse
1019 | ListCategoriesResponse
1022 | UserMentionResponse
1024 | GetCaptchaResponse
1027 | BanFromCommunityResponse
1028 | AddModToCommunityResponse
1031 | PrivateMessageResponse
1032 | PrivateMessagesResponse
1033 | GetSiteConfigResponse
1036 export interface WebSocketResponse {
1041 export interface WebSocketJsonResponse {
1043 data?: ResponseType;
1045 reconnect?: boolean;
1048 export enum UserDetailsView {