1 export enum UserOperation {
20 GetFollowedCommunities,
48 export enum CommentSortType {
55 export enum ListingType {
61 export enum DataType {
66 export enum SortType {
76 export enum SearchType {
85 export interface User {
91 default_sort_type: SortType;
92 default_listing_type: ListingType;
95 show_avatars: boolean;
99 export interface UserView {
105 matrix_user_id?: string;
109 number_of_posts: number;
111 number_of_comments: number;
112 comment_score: number;
114 show_avatars: boolean;
115 send_notifications_to_email: boolean;
118 export interface CommunityUser {
121 user_actor_id: string;
125 community_id: number;
126 community_actor_id: string;
127 community_local: boolean;
128 community_name: string;
132 export interface Community {
138 description?: string;
146 creator_actor_id: string;
147 creator_local: boolean;
148 last_refreshed_at: string;
149 creator_name: string;
150 creator_avatar?: string;
151 category_name: string;
152 number_of_subscribers: number;
153 number_of_posts: number;
154 number_of_comments: number;
156 subscribed?: boolean;
159 export interface Post {
165 community_id: number;
170 embed_title?: string;
171 embed_description?: string;
173 thumbnail_url?: string;
178 banned_from_community: boolean;
181 creator_actor_id: string;
182 creator_local: boolean;
183 creator_name: string;
184 creator_avatar?: string;
185 community_actor_id: string;
186 community_local: boolean;
187 community_name: string;
188 community_removed: boolean;
189 community_deleted: boolean;
190 community_nsfw: boolean;
191 number_of_comments: number;
196 newest_activity_time: string;
199 subscribed?: boolean;
202 duplicates?: Array<Post>;
205 export interface Comment {
218 community_id: number;
219 community_actor_id: string;
220 community_local: boolean;
221 community_name: string;
223 banned_from_community: boolean;
224 creator_actor_id: string;
225 creator_local: boolean;
226 creator_name: string;
227 creator_avatar?: string;
236 user_mention_id?: number; // For mention type
237 recipient_id?: number;
238 recipient_actor_id?: string;
239 recipient_local?: boolean;
243 export interface Category {
248 export interface Site {
251 description?: string;
255 creator_name: string;
256 number_of_users: number;
257 number_of_posts: number;
258 number_of_comments: number;
259 number_of_communities: number;
260 enable_downvotes: boolean;
261 open_registration: boolean;
262 enable_nsfw: boolean;
265 export interface PrivateMessage {
268 recipient_id: number;
274 creator_name: string;
275 creator_avatar?: string;
276 recipient_name: string;
277 recipient_avatar?: string;
280 export enum BanType {
285 export interface FollowCommunityForm {
286 community_id: number;
291 export interface GetFollowedCommunitiesForm {
295 export interface GetFollowedCommunitiesResponse {
296 communities: Array<CommunityUser>;
299 export interface GetUserDetailsForm {
305 community_id?: number;
309 export interface UserDetailsResponse {
311 follows: Array<CommunityUser>;
312 moderates: Array<CommunityUser>;
313 comments: Array<Comment>;
315 admins: Array<UserView>;
318 export interface GetRepliesForm {
322 unread_only: boolean;
326 export interface GetRepliesResponse {
327 replies: Array<Comment>;
330 export interface GetUserMentionsForm {
334 unread_only: boolean;
338 export interface GetUserMentionsResponse {
339 mentions: Array<Comment>;
342 export interface EditUserMentionForm {
343 user_mention_id: number;
348 export interface UserMentionResponse {
352 export interface BanFromCommunityForm {
353 community_id: number;
361 export interface BanFromCommunityResponse {
366 export interface AddModToCommunityForm {
367 community_id: number;
373 export interface TransferCommunityForm {
374 community_id: number;
379 export interface TransferSiteForm {
384 export interface AddModToCommunityResponse {
385 moderators: Array<CommunityUser>;
388 export interface GetModlogForm {
389 mod_user_id?: number;
390 community_id?: number;
395 export interface GetModlogResponse {
396 removed_posts: Array<ModRemovePost>;
397 locked_posts: Array<ModLockPost>;
398 stickied_posts: Array<ModStickyPost>;
399 removed_comments: Array<ModRemoveComment>;
400 removed_communities: Array<ModRemoveCommunity>;
401 banned_from_community: Array<ModBanFromCommunity>;
402 banned: Array<ModBan>;
403 added_to_community: Array<ModAddCommunity>;
404 added: Array<ModAdd>;
407 export interface ModRemovePost {
414 mod_user_name: string;
416 community_id: number;
417 community_name: string;
420 export interface ModLockPost {
426 mod_user_name: string;
428 community_id: number;
429 community_name: string;
432 export interface ModStickyPost {
438 mod_user_name: string;
440 community_id: number;
441 community_name: string;
444 export interface ModRemoveComment {
451 mod_user_name: string;
452 comment_user_id: number;
453 comment_user_name: string;
454 comment_content: string;
457 community_id: number;
458 community_name: string;
461 export interface ModRemoveCommunity {
464 community_id: number;
469 mod_user_name: string;
470 community_name: string;
473 export interface ModBanFromCommunity {
476 other_user_id: number;
477 community_id: number;
482 mod_user_name: string;
483 other_user_name: string;
484 community_name: string;
487 export interface ModBan {
490 other_user_id: number;
495 mod_user_name: string;
496 other_user_name: string;
499 export interface ModAddCommunity {
502 other_user_id: number;
503 community_id: number;
506 mod_user_name: string;
507 other_user_name: string;
508 community_name: string;
511 export interface ModAdd {
514 other_user_id: number;
517 mod_user_name: string;
518 other_user_name: string;
521 export interface LoginForm {
522 username_or_email: string;
526 export interface RegisterForm {
530 password_verify: string;
535 export interface LoginResponse {
539 export interface UserSettingsForm {
542 default_sort_type: SortType;
543 default_listing_type: ListingType;
547 matrix_user_id?: string;
548 new_password?: string;
549 new_password_verify?: string;
550 old_password?: string;
551 show_avatars: boolean;
552 send_notifications_to_email: boolean;
556 export interface CommunityForm {
559 description?: string;
570 export interface GetCommunityForm {
576 export interface GetCommunityResponse {
577 community: Community;
578 moderators: Array<CommunityUser>;
579 admins: Array<UserView>;
583 export interface CommunityResponse {
584 community: Community;
587 export interface ListCommunitiesForm {
594 export interface ListCommunitiesResponse {
595 communities: Array<Community>;
598 export interface ListCategoriesResponse {
599 categories: Array<Category>;
602 export interface PostForm {
606 community_id: number;
619 export interface PostFormParams {
626 export interface GetPostForm {
631 export interface GetPostResponse {
633 comments: Array<Comment>;
634 community: Community;
635 moderators: Array<CommunityUser>;
636 admins: Array<UserView>;
640 export interface SavePostForm {
646 export interface PostResponse {
650 export interface CommentForm {
663 export interface SaveCommentForm {
669 export interface CommentResponse {
671 recipient_ids: Array<number>;
674 export interface CommentLikeForm {
681 export interface CommentNode {
683 children?: Array<CommentNode>;
686 export interface GetPostsForm {
691 community_id?: number;
695 export interface GetPostsResponse {
699 export interface GetCommentsForm {
704 community_id?: number;
708 export interface GetCommentsResponse {
709 comments: Array<Comment>;
712 export interface CreatePostLikeForm {
718 export interface SiteForm {
720 description?: string;
721 enable_downvotes: boolean;
722 open_registration: boolean;
723 enable_nsfw: boolean;
727 export interface GetSiteResponse {
729 admins: Array<UserView>;
730 banned: Array<UserView>;
734 export interface SiteResponse {
738 export interface BanUserForm {
746 export interface BanUserResponse {
751 export interface AddAdminForm {
757 export interface AddAdminResponse {
758 admins: Array<UserView>;
761 export interface SearchForm {
764 community_id?: number;
771 export interface SearchResponse {
774 comments?: Array<Comment>;
775 communities: Array<Community>;
776 users: Array<UserView>;
779 export interface DeleteAccountForm {
783 export interface PasswordResetForm {
787 // export interface PasswordResetResponse {
790 export interface PasswordChangeForm {
793 password_verify: string;
796 export interface PrivateMessageForm {
798 recipient_id: number;
802 export interface PrivateMessageFormParams {
803 recipient_id: number;
806 export interface EditPrivateMessageForm {
814 export interface GetPrivateMessagesForm {
815 unread_only: boolean;
821 export interface PrivateMessagesResponse {
822 messages: Array<PrivateMessage>;
825 export interface PrivateMessageResponse {
826 message: PrivateMessage;
829 export interface UserJoinForm {
833 export interface UserJoinResponse {
837 export type MessageType =
838 | EditPrivateMessageForm
842 | FollowCommunityForm
843 | ListCommunitiesForm
844 | GetFollowedCommunitiesForm
853 | BanFromCommunityForm
855 | AddModToCommunityForm
856 | TransferCommunityForm
863 | GetUserMentionsForm
864 | EditUserMentionForm
873 | EditPrivateMessageForm
874 | GetPrivateMessagesForm;
878 | GetFollowedCommunitiesResponse
879 | ListCommunitiesResponse
883 | GetUserMentionsResponse
884 | ListCategoriesResponse
887 | UserMentionResponse
891 | BanFromCommunityResponse
892 | AddModToCommunityResponse
895 | PrivateMessageResponse
896 | PrivateMessagesResponse;
898 export interface WebSocketResponse {
903 export interface WebSocketJsonResponse {