1 export enum UserOperation {
29 GetFollowedCommunities,
33 MarkUserMentionAsRead,
53 MarkPrivateMessageAsRead,
61 export enum CommentSortType {
68 export enum CommentViewType {
73 export enum ListingType {
79 export enum DataType {
84 export enum SortType {
94 export enum SearchType {
103 export interface User {
109 default_sort_type: SortType;
110 default_listing_type: ListingType;
113 show_avatars: boolean;
114 unreadCount?: number;
117 export interface UserView {
123 matrix_user_id?: string;
127 number_of_posts: number;
129 number_of_comments: number;
130 comment_score: number;
132 show_avatars: boolean;
133 send_notifications_to_email: boolean;
136 export interface CommunityUser {
139 user_actor_id: string;
143 community_id: number;
144 community_actor_id: string;
145 community_local: boolean;
146 community_name: string;
150 export interface Community {
156 description?: string;
164 creator_actor_id: string;
165 creator_local: boolean;
166 last_refreshed_at: string;
167 creator_name: string;
168 creator_avatar?: string;
169 category_name: string;
170 number_of_subscribers: number;
171 number_of_posts: number;
172 number_of_comments: number;
174 subscribed?: boolean;
177 export interface Post {
183 community_id: number;
188 embed_title?: string;
189 embed_description?: string;
191 thumbnail_url?: string;
196 banned_from_community: boolean;
199 creator_actor_id: string;
200 creator_local: boolean;
201 creator_name: string;
202 creator_published: string;
203 creator_avatar?: string;
204 community_actor_id: string;
205 community_local: boolean;
206 community_name: string;
207 community_removed: boolean;
208 community_deleted: boolean;
209 community_nsfw: boolean;
210 number_of_comments: number;
215 newest_activity_time: string;
218 subscribed?: boolean;
221 duplicates?: Array<Post>;
224 export interface Comment {
238 community_id: number;
239 community_actor_id: string;
240 community_local: boolean;
241 community_name: string;
243 banned_from_community: boolean;
244 creator_actor_id: string;
245 creator_local: boolean;
246 creator_name: string;
247 creator_avatar?: string;
248 creator_published: string;
257 user_mention_id?: number; // For mention type
258 recipient_id?: number;
259 recipient_actor_id?: string;
260 recipient_local?: boolean;
264 export interface Category {
269 export interface Site {
272 description?: string;
276 creator_name: string;
277 number_of_users: number;
278 number_of_posts: number;
279 number_of_comments: number;
280 number_of_communities: number;
281 enable_downvotes: boolean;
282 open_registration: boolean;
283 enable_nsfw: boolean;
286 export interface PrivateMessage {
289 recipient_id: number;
297 creator_name: string;
298 creator_avatar?: string;
299 creator_actor_id: string;
300 creator_local: boolean;
301 recipient_name: string;
302 recipient_avatar?: string;
303 recipient_actor_id: string;
304 recipient_local: boolean;
307 export enum BanType {
312 export interface FollowCommunityForm {
313 community_id: number;
318 export interface GetFollowedCommunitiesForm {
322 export interface GetFollowedCommunitiesResponse {
323 communities: Array<CommunityUser>;
326 export interface GetUserDetailsForm {
332 community_id?: number;
336 export interface UserDetailsResponse {
338 follows: Array<CommunityUser>;
339 moderates: Array<CommunityUser>;
340 comments: Array<Comment>;
342 admins: Array<UserView>;
345 export interface GetRepliesForm {
349 unread_only: boolean;
353 export interface GetRepliesResponse {
354 replies: Array<Comment>;
357 export interface GetUserMentionsForm {
361 unread_only: boolean;
365 export interface GetUserMentionsResponse {
366 mentions: Array<Comment>;
369 export interface MarkUserMentionAsReadForm {
370 user_mention_id: number;
375 export interface UserMentionResponse {
379 export interface BanFromCommunityForm {
380 community_id: number;
388 export interface BanFromCommunityResponse {
393 export interface AddModToCommunityForm {
394 community_id: number;
400 export interface TransferCommunityForm {
401 community_id: number;
406 export interface TransferSiteForm {
411 export interface AddModToCommunityResponse {
412 moderators: Array<CommunityUser>;
415 export interface GetModlogForm {
416 mod_user_id?: number;
417 community_id?: number;
422 export interface GetModlogResponse {
423 removed_posts: Array<ModRemovePost>;
424 locked_posts: Array<ModLockPost>;
425 stickied_posts: Array<ModStickyPost>;
426 removed_comments: Array<ModRemoveComment>;
427 removed_communities: Array<ModRemoveCommunity>;
428 banned_from_community: Array<ModBanFromCommunity>;
429 banned: Array<ModBan>;
430 added_to_community: Array<ModAddCommunity>;
431 added: Array<ModAdd>;
434 export interface ModRemovePost {
441 mod_user_name: string;
443 community_id: number;
444 community_name: string;
447 export interface ModLockPost {
453 mod_user_name: string;
455 community_id: number;
456 community_name: string;
459 export interface ModStickyPost {
465 mod_user_name: string;
467 community_id: number;
468 community_name: string;
471 export interface ModRemoveComment {
478 mod_user_name: string;
479 comment_user_id: number;
480 comment_user_name: string;
481 comment_content: string;
484 community_id: number;
485 community_name: string;
488 export interface ModRemoveCommunity {
491 community_id: number;
496 mod_user_name: string;
497 community_name: string;
500 export interface ModBanFromCommunity {
503 other_user_id: number;
504 community_id: number;
509 mod_user_name: string;
510 other_user_name: string;
511 community_name: string;
514 export interface ModBan {
517 other_user_id: number;
522 mod_user_name: string;
523 other_user_name: string;
526 export interface ModAddCommunity {
529 other_user_id: number;
530 community_id: number;
533 mod_user_name: string;
534 other_user_name: string;
535 community_name: string;
538 export interface ModAdd {
541 other_user_id: number;
544 mod_user_name: string;
545 other_user_name: string;
548 export interface LoginForm {
549 username_or_email: string;
553 export interface RegisterForm {
557 password_verify: string;
562 export interface LoginResponse {
566 export interface UserSettingsForm {
569 default_sort_type: SortType;
570 default_listing_type: ListingType;
574 matrix_user_id?: string;
575 new_password?: string;
576 new_password_verify?: string;
577 old_password?: string;
578 show_avatars: boolean;
579 send_notifications_to_email: boolean;
583 export interface CommunityForm {
587 description?: string;
593 export interface DeleteCommunityForm {
599 export interface RemoveCommunityForm {
607 export interface GetCommunityForm {
613 export interface GetCommunityResponse {
614 community: Community;
615 moderators: Array<CommunityUser>;
616 admins: Array<UserView>;
620 export interface CommunityResponse {
621 community: Community;
624 export interface ListCommunitiesForm {
631 export interface ListCommunitiesResponse {
632 communities: Array<Community>;
635 export interface ListCategoriesResponse {
636 categories: Array<Category>;
639 export interface PostForm {
643 community_id?: number;
649 export interface DeletePostForm {
655 export interface RemovePostForm {
662 export interface LockPostForm {
668 export interface StickyPostForm {
674 export interface PostFormParams {
681 export interface GetPostForm {
686 export interface GetPostResponse {
688 comments: Array<Comment>;
689 community: Community;
690 moderators: Array<CommunityUser>;
691 admins: Array<UserView>;
695 export interface SavePostForm {
701 export interface PostResponse {
705 export interface CommentForm {
715 export interface DeleteCommentForm {
721 export interface RemoveCommentForm {
728 export interface MarkCommentAsReadForm {
734 export interface SaveCommentForm {
740 export interface CommentResponse {
742 recipient_ids: Array<number>;
746 export interface CommentLikeForm {
752 export interface CommentNode {
754 children?: Array<CommentNode>;
757 export interface GetPostsForm {
762 community_id?: number;
766 export interface GetPostsResponse {
770 export interface GetCommentsForm {
775 community_id?: number;
779 export interface GetCommentsResponse {
780 comments: Array<Comment>;
783 export interface CreatePostLikeForm {
789 export interface SiteForm {
791 description?: string;
792 enable_downvotes: boolean;
793 open_registration: boolean;
794 enable_nsfw: boolean;
798 export interface GetSiteConfig {
802 export interface GetSiteConfigResponse {
803 config_hjson: string;
806 export interface SiteConfigForm {
807 config_hjson: string;
811 export interface GetSiteResponse {
813 admins: Array<UserView>;
814 banned: Array<UserView>;
819 export interface SiteResponse {
823 export interface BanUserForm {
831 export interface BanUserResponse {
836 export interface AddAdminForm {
842 export interface AddAdminResponse {
843 admins: Array<UserView>;
846 export interface SearchForm {
849 community_id?: number;
856 export interface SearchResponse {
859 comments?: Array<Comment>;
860 communities: Array<Community>;
861 users: Array<UserView>;
864 export interface DeleteAccountForm {
868 export interface PasswordResetForm {
872 // export interface PasswordResetResponse {
875 export interface PasswordChangeForm {
878 password_verify: string;
881 export interface PrivateMessageForm {
883 recipient_id: number;
887 export interface PrivateMessageFormParams {
888 recipient_id: number;
891 export interface EditPrivateMessageForm {
897 export interface DeletePrivateMessageForm {
903 export interface MarkPrivateMessageAsReadForm {
909 export interface GetPrivateMessagesForm {
910 unread_only: boolean;
916 export interface PrivateMessagesResponse {
917 messages: Array<PrivateMessage>;
920 export interface PrivateMessageResponse {
921 message: PrivateMessage;
924 export interface UserJoinForm {
928 export interface UserJoinResponse {
932 export type MessageType =
936 | DeleteCommunityForm
937 | RemoveCommunityForm
938 | FollowCommunityForm
939 | ListCommunitiesForm
940 | GetFollowedCommunitiesForm
952 | MarkCommentAsReadForm
956 | BanFromCommunityForm
958 | AddModToCommunityForm
959 | TransferCommunityForm
966 | GetUserMentionsForm
967 | MarkUserMentionAsReadForm
976 | EditPrivateMessageForm
977 | DeletePrivateMessageForm
978 | MarkPrivateMessageAsReadForm
979 | GetPrivateMessagesForm
984 | GetFollowedCommunitiesResponse
985 | ListCommunitiesResponse
989 | GetUserMentionsResponse
990 | ListCategoriesResponse
993 | UserMentionResponse
997 | BanFromCommunityResponse
998 | AddModToCommunityResponse
1001 | PrivateMessageResponse
1002 | PrivateMessagesResponse
1003 | GetSiteConfigResponse;
1005 export interface WebSocketResponse {
1010 export interface WebSocketJsonResponse {
1012 data?: ResponseType;
1014 reconnect?: boolean;
1017 export enum UserDetailsView {