1 export enum UserOperation {
20 GetFollowedCommunities,
44 MarkPrivateMessageAsRead,
52 export enum CommentSortType {
59 export enum CommentViewType {
64 export enum ListingType {
70 export enum DataType {
75 export enum SortType {
85 export enum SearchType {
94 export interface User {
100 default_sort_type: SortType;
101 default_listing_type: ListingType;
104 show_avatars: boolean;
105 unreadCount?: number;
108 export interface UserView {
114 matrix_user_id?: string;
118 number_of_posts: number;
120 number_of_comments: number;
121 comment_score: number;
123 show_avatars: boolean;
124 send_notifications_to_email: boolean;
127 export interface CommunityUser {
130 user_actor_id: string;
134 community_id: number;
135 community_actor_id: string;
136 community_local: boolean;
137 community_name: string;
141 export interface Community {
147 description?: string;
155 creator_actor_id: string;
156 creator_local: boolean;
157 last_refreshed_at: string;
158 creator_name: string;
159 creator_avatar?: string;
160 category_name: string;
161 number_of_subscribers: number;
162 number_of_posts: number;
163 number_of_comments: number;
165 subscribed?: boolean;
168 export interface Post {
174 community_id: number;
179 embed_title?: string;
180 embed_description?: string;
182 thumbnail_url?: string;
187 banned_from_community: boolean;
190 creator_actor_id: string;
191 creator_local: boolean;
192 creator_name: string;
193 creator_published: string;
194 creator_avatar?: string;
195 community_actor_id: string;
196 community_local: boolean;
197 community_name: string;
198 community_removed: boolean;
199 community_deleted: boolean;
200 community_nsfw: boolean;
201 number_of_comments: number;
206 newest_activity_time: string;
209 subscribed?: boolean;
212 duplicates?: Array<Post>;
215 export interface Comment {
229 community_id: number;
230 community_actor_id: string;
231 community_local: boolean;
232 community_name: string;
234 banned_from_community: boolean;
235 creator_actor_id: string;
236 creator_local: boolean;
237 creator_name: string;
238 creator_avatar?: string;
239 creator_published: string;
248 user_mention_id?: number; // For mention type
249 recipient_id?: number;
250 recipient_actor_id?: string;
251 recipient_local?: boolean;
255 export interface Category {
260 export interface Site {
263 description?: string;
267 creator_name: string;
268 number_of_users: number;
269 number_of_posts: number;
270 number_of_comments: number;
271 number_of_communities: number;
272 enable_downvotes: boolean;
273 open_registration: boolean;
274 enable_nsfw: boolean;
277 export interface PrivateMessage {
280 recipient_id: number;
288 creator_name: string;
289 creator_avatar?: string;
290 creator_actor_id: string;
291 creator_local: boolean;
292 recipient_name: string;
293 recipient_avatar?: string;
294 recipient_actor_id: string;
295 recipient_local: boolean;
298 export enum BanType {
303 export interface FollowCommunityForm {
304 community_id: number;
309 export interface GetFollowedCommunitiesForm {
313 export interface GetFollowedCommunitiesResponse {
314 communities: Array<CommunityUser>;
317 export interface GetUserDetailsForm {
323 community_id?: number;
327 export interface UserDetailsResponse {
329 follows: Array<CommunityUser>;
330 moderates: Array<CommunityUser>;
331 comments: Array<Comment>;
333 admins: Array<UserView>;
336 export interface GetRepliesForm {
340 unread_only: boolean;
344 export interface GetRepliesResponse {
345 replies: Array<Comment>;
348 export interface GetUserMentionsForm {
352 unread_only: boolean;
356 export interface GetUserMentionsResponse {
357 mentions: Array<Comment>;
360 export interface EditUserMentionForm {
361 user_mention_id: number;
366 export interface UserMentionResponse {
370 export interface BanFromCommunityForm {
371 community_id: number;
379 export interface BanFromCommunityResponse {
384 export interface AddModToCommunityForm {
385 community_id: number;
391 export interface TransferCommunityForm {
392 community_id: number;
397 export interface TransferSiteForm {
402 export interface AddModToCommunityResponse {
403 moderators: Array<CommunityUser>;
406 export interface GetModlogForm {
407 mod_user_id?: number;
408 community_id?: number;
413 export interface GetModlogResponse {
414 removed_posts: Array<ModRemovePost>;
415 locked_posts: Array<ModLockPost>;
416 stickied_posts: Array<ModStickyPost>;
417 removed_comments: Array<ModRemoveComment>;
418 removed_communities: Array<ModRemoveCommunity>;
419 banned_from_community: Array<ModBanFromCommunity>;
420 banned: Array<ModBan>;
421 added_to_community: Array<ModAddCommunity>;
422 added: Array<ModAdd>;
425 export interface ModRemovePost {
432 mod_user_name: string;
434 community_id: number;
435 community_name: string;
438 export interface ModLockPost {
444 mod_user_name: string;
446 community_id: number;
447 community_name: string;
450 export interface ModStickyPost {
456 mod_user_name: string;
458 community_id: number;
459 community_name: string;
462 export interface ModRemoveComment {
469 mod_user_name: string;
470 comment_user_id: number;
471 comment_user_name: string;
472 comment_content: string;
475 community_id: number;
476 community_name: string;
479 export interface ModRemoveCommunity {
482 community_id: number;
487 mod_user_name: string;
488 community_name: string;
491 export interface ModBanFromCommunity {
494 other_user_id: number;
495 community_id: number;
500 mod_user_name: string;
501 other_user_name: string;
502 community_name: string;
505 export interface ModBan {
508 other_user_id: number;
513 mod_user_name: string;
514 other_user_name: string;
517 export interface ModAddCommunity {
520 other_user_id: number;
521 community_id: number;
524 mod_user_name: string;
525 other_user_name: string;
526 community_name: string;
529 export interface ModAdd {
532 other_user_id: number;
535 mod_user_name: string;
536 other_user_name: string;
539 export interface LoginForm {
540 username_or_email: string;
544 export interface RegisterForm {
548 password_verify: string;
553 export interface LoginResponse {
557 export interface UserSettingsForm {
560 default_sort_type: SortType;
561 default_listing_type: ListingType;
565 matrix_user_id?: string;
566 new_password?: string;
567 new_password_verify?: string;
568 old_password?: string;
569 show_avatars: boolean;
570 send_notifications_to_email: boolean;
574 export interface CommunityForm {
577 description?: string;
588 export interface GetCommunityForm {
594 export interface GetCommunityResponse {
595 community: Community;
596 moderators: Array<CommunityUser>;
597 admins: Array<UserView>;
601 export interface CommunityResponse {
602 community: Community;
605 export interface ListCommunitiesForm {
612 export interface ListCommunitiesResponse {
613 communities: Array<Community>;
616 export interface ListCategoriesResponse {
617 categories: Array<Category>;
620 export interface PostForm {
624 community_id: number;
637 export interface PostFormParams {
644 export interface GetPostForm {
649 export interface GetPostResponse {
651 comments: Array<Comment>;
652 community: Community;
653 moderators: Array<CommunityUser>;
654 admins: Array<UserView>;
658 export interface SavePostForm {
664 export interface PostResponse {
668 export interface CommentForm {
681 export interface SaveCommentForm {
687 export interface CommentResponse {
689 recipient_ids: Array<number>;
692 export interface CommentLikeForm {
699 export interface CommentNode {
701 children?: Array<CommentNode>;
704 export interface GetPostsForm {
709 community_id?: number;
713 export interface GetPostsResponse {
717 export interface GetCommentsForm {
722 community_id?: number;
726 export interface GetCommentsResponse {
727 comments: Array<Comment>;
730 export interface CreatePostLikeForm {
736 export interface SiteForm {
738 description?: string;
739 enable_downvotes: boolean;
740 open_registration: boolean;
741 enable_nsfw: boolean;
745 export interface GetSiteConfig {
749 export interface GetSiteConfigResponse {
750 config_hjson: string;
753 export interface SiteConfigForm {
754 config_hjson: string;
758 export interface GetSiteResponse {
760 admins: Array<UserView>;
761 banned: Array<UserView>;
765 export interface SiteResponse {
769 export interface BanUserForm {
777 export interface BanUserResponse {
782 export interface AddAdminForm {
788 export interface AddAdminResponse {
789 admins: Array<UserView>;
792 export interface SearchForm {
795 community_id?: number;
802 export interface SearchResponse {
805 comments?: Array<Comment>;
806 communities: Array<Community>;
807 users: Array<UserView>;
810 export interface DeleteAccountForm {
814 export interface PasswordResetForm {
818 // export interface PasswordResetResponse {
821 export interface PasswordChangeForm {
824 password_verify: string;
827 export interface PrivateMessageForm {
829 recipient_id: number;
833 export interface PrivateMessageFormParams {
834 recipient_id: number;
837 export interface EditPrivateMessageForm {
843 export interface DeletePrivateMessageForm {
849 export interface MarkPrivateMessageAsReadForm {
855 export interface GetPrivateMessagesForm {
856 unread_only: boolean;
862 export interface PrivateMessagesResponse {
863 messages: Array<PrivateMessage>;
866 export interface PrivateMessageResponse {
867 message: PrivateMessage;
870 export interface UserJoinForm {
874 export interface UserJoinResponse {
878 export type MessageType =
882 | FollowCommunityForm
883 | ListCommunitiesForm
884 | GetFollowedCommunitiesForm
893 | BanFromCommunityForm
895 | AddModToCommunityForm
896 | TransferCommunityForm
903 | GetUserMentionsForm
904 | EditUserMentionForm
913 | EditPrivateMessageForm
914 | DeletePrivateMessageForm
915 | MarkPrivateMessageAsReadForm
916 | GetPrivateMessagesForm
921 | GetFollowedCommunitiesResponse
922 | ListCommunitiesResponse
926 | GetUserMentionsResponse
927 | ListCategoriesResponse
930 | UserMentionResponse
934 | BanFromCommunityResponse
935 | AddModToCommunityResponse
938 | PrivateMessageResponse
939 | PrivateMessagesResponse
940 | GetSiteConfigResponse;
942 export interface WebSocketResponse {
947 export interface WebSocketJsonResponse {
954 export enum UserDetailsView {