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 Claims {
108 export interface User {
111 preferred_username?: string;
120 default_sort_type: SortType;
121 default_listing_type: ListingType;
123 show_avatars: boolean;
124 send_notifications_to_email: boolean;
125 matrix_user_id?: string;
129 last_refreshed_at: string;
132 export interface UserView {
138 matrix_user_id?: string;
142 number_of_posts: number;
144 number_of_comments: number;
145 comment_score: number;
147 show_avatars: boolean;
148 send_notifications_to_email: boolean;
151 export interface CommunityUser {
154 user_actor_id: string;
158 community_id: number;
159 community_actor_id: string;
160 community_local: boolean;
161 community_name: string;
165 export interface Community {
171 description?: string;
179 creator_actor_id: string;
180 creator_local: boolean;
181 last_refreshed_at: string;
182 creator_name: string;
183 creator_avatar?: string;
184 category_name: string;
185 number_of_subscribers: number;
186 number_of_posts: number;
187 number_of_comments: number;
189 subscribed?: boolean;
192 export interface Post {
198 community_id: number;
203 embed_title?: string;
204 embed_description?: string;
206 thumbnail_url?: string;
211 banned_from_community: boolean;
214 creator_actor_id: string;
215 creator_local: boolean;
216 creator_name: string;
217 creator_published: string;
218 creator_avatar?: string;
219 community_actor_id: string;
220 community_local: boolean;
221 community_name: string;
222 community_removed: boolean;
223 community_deleted: boolean;
224 community_nsfw: boolean;
225 number_of_comments: number;
230 newest_activity_time: string;
233 subscribed?: boolean;
236 duplicates?: Array<Post>;
239 export interface Comment {
253 community_id: number;
254 community_actor_id: string;
255 community_local: boolean;
256 community_name: string;
258 banned_from_community: boolean;
259 creator_actor_id: string;
260 creator_local: boolean;
261 creator_name: string;
262 creator_avatar?: string;
263 creator_published: string;
272 user_mention_id?: number; // For mention type
273 recipient_id?: number;
274 recipient_actor_id?: string;
275 recipient_local?: boolean;
279 export interface Category {
284 export interface Site {
287 description?: string;
291 creator_name: string;
292 number_of_users: number;
293 number_of_posts: number;
294 number_of_comments: number;
295 number_of_communities: number;
296 enable_downvotes: boolean;
297 open_registration: boolean;
298 enable_nsfw: boolean;
301 export interface PrivateMessage {
304 recipient_id: number;
312 creator_name: string;
313 creator_avatar?: string;
314 creator_actor_id: string;
315 creator_local: boolean;
316 recipient_name: string;
317 recipient_avatar?: string;
318 recipient_actor_id: string;
319 recipient_local: boolean;
322 export enum BanType {
327 export interface FollowCommunityForm {
328 community_id: number;
333 export interface GetFollowedCommunitiesForm {
337 export interface GetFollowedCommunitiesResponse {
338 communities: Array<CommunityUser>;
341 export interface GetUserDetailsForm {
347 community_id?: number;
351 export interface UserDetailsResponse {
353 follows: Array<CommunityUser>;
354 moderates: Array<CommunityUser>;
355 comments: Array<Comment>;
357 admins: Array<UserView>;
360 export interface GetRepliesForm {
364 unread_only: boolean;
368 export interface GetRepliesResponse {
369 replies: Array<Comment>;
372 export interface GetUserMentionsForm {
376 unread_only: boolean;
380 export interface GetUserMentionsResponse {
381 mentions: Array<Comment>;
384 export interface MarkUserMentionAsReadForm {
385 user_mention_id: number;
390 export interface UserMentionResponse {
394 export interface BanFromCommunityForm {
395 community_id: number;
403 export interface BanFromCommunityResponse {
408 export interface AddModToCommunityForm {
409 community_id: number;
415 export interface TransferCommunityForm {
416 community_id: number;
421 export interface TransferSiteForm {
426 export interface AddModToCommunityResponse {
427 moderators: Array<CommunityUser>;
430 export interface GetModlogForm {
431 mod_user_id?: number;
432 community_id?: number;
437 export interface GetModlogResponse {
438 removed_posts: Array<ModRemovePost>;
439 locked_posts: Array<ModLockPost>;
440 stickied_posts: Array<ModStickyPost>;
441 removed_comments: Array<ModRemoveComment>;
442 removed_communities: Array<ModRemoveCommunity>;
443 banned_from_community: Array<ModBanFromCommunity>;
444 banned: Array<ModBan>;
445 added_to_community: Array<ModAddCommunity>;
446 added: Array<ModAdd>;
449 export interface ModRemovePost {
456 mod_user_name: string;
458 community_id: number;
459 community_name: string;
462 export interface ModLockPost {
468 mod_user_name: string;
470 community_id: number;
471 community_name: string;
474 export interface ModStickyPost {
480 mod_user_name: string;
482 community_id: number;
483 community_name: string;
486 export interface ModRemoveComment {
493 mod_user_name: string;
494 comment_user_id: number;
495 comment_user_name: string;
496 comment_content: string;
499 community_id: number;
500 community_name: string;
503 export interface ModRemoveCommunity {
506 community_id: number;
511 mod_user_name: string;
512 community_name: string;
515 export interface ModBanFromCommunity {
518 other_user_id: number;
519 community_id: number;
524 mod_user_name: string;
525 other_user_name: string;
526 community_name: string;
529 export interface ModBan {
532 other_user_id: number;
537 mod_user_name: string;
538 other_user_name: string;
541 export interface ModAddCommunity {
544 other_user_id: number;
545 community_id: number;
548 mod_user_name: string;
549 other_user_name: string;
550 community_name: string;
553 export interface ModAdd {
556 other_user_id: number;
559 mod_user_name: string;
560 other_user_name: string;
563 export interface LoginForm {
564 username_or_email: string;
568 export interface RegisterForm {
572 password_verify: string;
577 export interface LoginResponse {
581 export interface UserSettingsForm {
584 default_sort_type: SortType;
585 default_listing_type: ListingType;
589 matrix_user_id?: string;
590 new_password?: string;
591 new_password_verify?: string;
592 old_password?: string;
593 show_avatars: boolean;
594 send_notifications_to_email: boolean;
598 export interface CommunityForm {
602 description?: string;
608 export interface DeleteCommunityForm {
614 export interface RemoveCommunityForm {
622 export interface GetCommunityForm {
628 export interface GetCommunityResponse {
629 community: Community;
630 moderators: Array<CommunityUser>;
634 export interface CommunityResponse {
635 community: Community;
638 export interface ListCommunitiesForm {
645 export interface ListCommunitiesResponse {
646 communities: Array<Community>;
649 export interface ListCategoriesResponse {
650 categories: Array<Category>;
653 export interface PostForm {
657 community_id?: number;
663 export interface DeletePostForm {
669 export interface RemovePostForm {
676 export interface LockPostForm {
682 export interface StickyPostForm {
688 export interface PostFormParams {
695 export interface GetPostForm {
700 export interface GetPostResponse {
702 comments: Array<Comment>;
703 community: Community;
704 moderators: Array<CommunityUser>;
708 export interface SavePostForm {
714 export interface PostResponse {
718 export interface CommentForm {
728 export interface DeleteCommentForm {
734 export interface RemoveCommentForm {
741 export interface MarkCommentAsReadForm {
747 export interface SaveCommentForm {
753 export interface CommentResponse {
755 recipient_ids: Array<number>;
759 export interface CommentLikeForm {
765 export interface CommentNode {
767 children?: Array<CommentNode>;
770 export interface GetPostsForm {
775 community_id?: number;
779 export interface GetPostsResponse {
783 export interface GetCommentsForm {
788 community_id?: number;
792 export interface GetCommentsResponse {
793 comments: Array<Comment>;
796 export interface CreatePostLikeForm {
802 export interface SiteForm {
804 description?: string;
805 enable_downvotes: boolean;
806 open_registration: boolean;
807 enable_nsfw: boolean;
811 export interface GetSiteConfig {
815 export interface GetSiteForm {
819 export interface GetSiteConfigResponse {
820 config_hjson: string;
823 export interface SiteConfigForm {
824 config_hjson: string;
828 export interface GetSiteResponse {
830 admins: Array<UserView>;
831 banned: Array<UserView>;
837 export interface SiteResponse {
841 export interface BanUserForm {
849 export interface BanUserResponse {
854 export interface AddAdminForm {
860 export interface AddAdminResponse {
861 admins: Array<UserView>;
864 export interface SearchForm {
867 community_id?: number;
874 export interface SearchResponse {
877 comments?: Array<Comment>;
878 communities: Array<Community>;
879 users: Array<UserView>;
882 export interface DeleteAccountForm {
886 export interface PasswordResetForm {
890 // export interface PasswordResetResponse {
893 export interface PasswordChangeForm {
896 password_verify: string;
899 export interface PrivateMessageForm {
901 recipient_id: number;
905 export interface PrivateMessageFormParams {
906 recipient_id: number;
909 export interface EditPrivateMessageForm {
915 export interface DeletePrivateMessageForm {
921 export interface MarkPrivateMessageAsReadForm {
927 export interface GetPrivateMessagesForm {
928 unread_only: boolean;
934 export interface PrivateMessagesResponse {
935 messages: Array<PrivateMessage>;
938 export interface PrivateMessageResponse {
939 message: PrivateMessage;
942 export interface UserJoinForm {
946 export interface UserJoinResponse {
950 export type MessageType =
954 | DeleteCommunityForm
955 | RemoveCommunityForm
956 | FollowCommunityForm
957 | ListCommunitiesForm
958 | GetFollowedCommunitiesForm
970 | MarkCommentAsReadForm
974 | BanFromCommunityForm
976 | AddModToCommunityForm
977 | TransferCommunityForm
984 | GetUserMentionsForm
985 | MarkUserMentionAsReadForm
994 | EditPrivateMessageForm
995 | DeletePrivateMessageForm
996 | MarkPrivateMessageAsReadForm
997 | GetPrivateMessagesForm
1002 | GetFollowedCommunitiesResponse
1003 | ListCommunitiesResponse
1006 | GetRepliesResponse
1007 | GetUserMentionsResponse
1008 | ListCategoriesResponse
1011 | UserMentionResponse
1015 | BanFromCommunityResponse
1016 | AddModToCommunityResponse
1019 | PrivateMessageResponse
1020 | PrivateMessagesResponse
1021 | GetSiteConfigResponse
1024 export interface WebSocketResponse {
1029 export interface WebSocketJsonResponse {
1031 data?: ResponseType;
1033 reconnect?: boolean;
1036 export enum UserDetailsView {