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 {
714 export interface DeleteCommentForm {
720 export interface RemoveCommentForm {
727 export interface MarkCommentAsReadForm {
733 export interface SaveCommentForm {
739 export interface CommentResponse {
741 recipient_ids: Array<number>;
744 export interface CommentLikeForm {
750 export interface CommentNode {
752 children?: Array<CommentNode>;
755 export interface GetPostsForm {
760 community_id?: number;
764 export interface GetPostsResponse {
768 export interface GetCommentsForm {
773 community_id?: number;
777 export interface GetCommentsResponse {
778 comments: Array<Comment>;
781 export interface CreatePostLikeForm {
787 export interface SiteForm {
789 description?: string;
790 enable_downvotes: boolean;
791 open_registration: boolean;
792 enable_nsfw: boolean;
796 export interface GetSiteConfig {
800 export interface GetSiteConfigResponse {
801 config_hjson: string;
804 export interface SiteConfigForm {
805 config_hjson: string;
809 export interface GetSiteResponse {
811 admins: Array<UserView>;
812 banned: Array<UserView>;
816 export interface SiteResponse {
820 export interface BanUserForm {
828 export interface BanUserResponse {
833 export interface AddAdminForm {
839 export interface AddAdminResponse {
840 admins: Array<UserView>;
843 export interface SearchForm {
846 community_id?: number;
853 export interface SearchResponse {
856 comments?: Array<Comment>;
857 communities: Array<Community>;
858 users: Array<UserView>;
861 export interface DeleteAccountForm {
865 export interface PasswordResetForm {
869 // export interface PasswordResetResponse {
872 export interface PasswordChangeForm {
875 password_verify: string;
878 export interface PrivateMessageForm {
880 recipient_id: number;
884 export interface PrivateMessageFormParams {
885 recipient_id: number;
888 export interface EditPrivateMessageForm {
894 export interface DeletePrivateMessageForm {
900 export interface MarkPrivateMessageAsReadForm {
906 export interface GetPrivateMessagesForm {
907 unread_only: boolean;
913 export interface PrivateMessagesResponse {
914 messages: Array<PrivateMessage>;
917 export interface PrivateMessageResponse {
918 message: PrivateMessage;
921 export interface UserJoinForm {
925 export interface UserJoinResponse {
929 export type MessageType =
933 | DeleteCommunityForm
934 | RemoveCommunityForm
935 | FollowCommunityForm
936 | ListCommunitiesForm
937 | GetFollowedCommunitiesForm
949 | MarkCommentAsReadForm
953 | BanFromCommunityForm
955 | AddModToCommunityForm
956 | TransferCommunityForm
963 | GetUserMentionsForm
964 | MarkUserMentionAsReadForm
973 | EditPrivateMessageForm
974 | DeletePrivateMessageForm
975 | MarkPrivateMessageAsReadForm
976 | GetPrivateMessagesForm
981 | GetFollowedCommunitiesResponse
982 | ListCommunitiesResponse
986 | GetUserMentionsResponse
987 | ListCategoriesResponse
990 | UserMentionResponse
994 | BanFromCommunityResponse
995 | AddModToCommunityResponse
998 | PrivateMessageResponse
999 | PrivateMessagesResponse
1000 | GetSiteConfigResponse;
1002 export interface WebSocketResponse {
1007 export interface WebSocketJsonResponse {
1009 data?: ResponseType;
1011 reconnect?: boolean;
1014 export enum UserDetailsView {