1 export enum UserOperation {
20 GetFollowedCommunities,
50 export enum CommentSortType {
57 export enum ListingType {
63 export enum DataType {
68 export enum SortType {
78 export enum SearchType {
87 export interface User {
93 default_sort_type: SortType;
94 default_listing_type: ListingType;
97 show_avatars: boolean;
101 export interface UserView {
107 matrix_user_id?: string;
111 number_of_posts: number;
113 number_of_comments: number;
114 comment_score: number;
116 show_avatars: boolean;
117 send_notifications_to_email: boolean;
120 export interface CommunityUser {
123 user_actor_id: string;
127 community_id: number;
128 community_actor_id: string;
129 community_local: boolean;
130 community_name: string;
134 export interface Community {
140 description?: string;
148 creator_actor_id: string;
149 creator_local: boolean;
150 last_refreshed_at: string;
151 creator_name: string;
152 creator_avatar?: string;
153 category_name: string;
154 number_of_subscribers: number;
155 number_of_posts: number;
156 number_of_comments: number;
158 subscribed?: boolean;
161 export interface Post {
167 community_id: number;
172 embed_title?: string;
173 embed_description?: string;
175 thumbnail_url?: string;
180 banned_from_community: boolean;
183 creator_actor_id: string;
184 creator_local: boolean;
185 creator_name: string;
186 creator_avatar?: string;
187 community_actor_id: string;
188 community_local: boolean;
189 community_name: string;
190 community_removed: boolean;
191 community_deleted: boolean;
192 community_nsfw: boolean;
193 number_of_comments: number;
198 newest_activity_time: string;
201 subscribed?: boolean;
204 duplicates?: Array<Post>;
207 export interface Comment {
220 community_id: number;
221 community_actor_id: string;
222 community_local: boolean;
223 community_name: string;
225 banned_from_community: boolean;
226 creator_actor_id: string;
227 creator_local: boolean;
228 creator_name: string;
229 creator_avatar?: string;
238 user_mention_id?: number; // For mention type
239 recipient_id?: number;
240 recipient_actor_id?: string;
241 recipient_local?: boolean;
245 export interface Category {
250 export interface Site {
253 description?: string;
257 creator_name: string;
258 number_of_users: number;
259 number_of_posts: number;
260 number_of_comments: number;
261 number_of_communities: number;
262 enable_downvotes: boolean;
263 open_registration: boolean;
264 enable_nsfw: boolean;
267 export interface PrivateMessage {
270 recipient_id: number;
278 creator_name: string;
279 creator_avatar?: string;
280 creator_actor_id: string;
281 creator_local: boolean;
282 recipient_name: string;
283 recipient_avatar?: string;
284 recipient_actor_id: string;
285 recipient_local: boolean;
288 export enum BanType {
293 export interface FollowCommunityForm {
294 community_id: number;
299 export interface GetFollowedCommunitiesForm {
303 export interface GetFollowedCommunitiesResponse {
304 communities: Array<CommunityUser>;
307 export interface GetUserDetailsForm {
313 community_id?: number;
317 export interface UserDetailsResponse {
319 follows: Array<CommunityUser>;
320 moderates: Array<CommunityUser>;
321 comments: Array<Comment>;
323 admins: Array<UserView>;
326 export interface GetRepliesForm {
330 unread_only: boolean;
334 export interface GetRepliesResponse {
335 replies: Array<Comment>;
338 export interface GetUserMentionsForm {
342 unread_only: boolean;
346 export interface GetUserMentionsResponse {
347 mentions: Array<Comment>;
350 export interface EditUserMentionForm {
351 user_mention_id: number;
356 export interface UserMentionResponse {
360 export interface BanFromCommunityForm {
361 community_id: number;
369 export interface BanFromCommunityResponse {
374 export interface AddModToCommunityForm {
375 community_id: number;
381 export interface TransferCommunityForm {
382 community_id: number;
387 export interface TransferSiteForm {
392 export interface AddModToCommunityResponse {
393 moderators: Array<CommunityUser>;
396 export interface GetModlogForm {
397 mod_user_id?: number;
398 community_id?: number;
403 export interface GetModlogResponse {
404 removed_posts: Array<ModRemovePost>;
405 locked_posts: Array<ModLockPost>;
406 stickied_posts: Array<ModStickyPost>;
407 removed_comments: Array<ModRemoveComment>;
408 removed_communities: Array<ModRemoveCommunity>;
409 banned_from_community: Array<ModBanFromCommunity>;
410 banned: Array<ModBan>;
411 added_to_community: Array<ModAddCommunity>;
412 added: Array<ModAdd>;
415 export interface ModRemovePost {
422 mod_user_name: string;
424 community_id: number;
425 community_name: string;
428 export interface ModLockPost {
434 mod_user_name: string;
436 community_id: number;
437 community_name: string;
440 export interface ModStickyPost {
446 mod_user_name: string;
448 community_id: number;
449 community_name: string;
452 export interface ModRemoveComment {
459 mod_user_name: string;
460 comment_user_id: number;
461 comment_user_name: string;
462 comment_content: string;
465 community_id: number;
466 community_name: string;
469 export interface ModRemoveCommunity {
472 community_id: number;
477 mod_user_name: string;
478 community_name: string;
481 export interface ModBanFromCommunity {
484 other_user_id: number;
485 community_id: number;
490 mod_user_name: string;
491 other_user_name: string;
492 community_name: string;
495 export interface ModBan {
498 other_user_id: number;
503 mod_user_name: string;
504 other_user_name: string;
507 export interface ModAddCommunity {
510 other_user_id: number;
511 community_id: number;
514 mod_user_name: string;
515 other_user_name: string;
516 community_name: string;
519 export interface ModAdd {
522 other_user_id: number;
525 mod_user_name: string;
526 other_user_name: string;
529 export interface LoginForm {
530 username_or_email: string;
534 export interface RegisterForm {
538 password_verify: string;
543 export interface LoginResponse {
547 export interface UserSettingsForm {
550 default_sort_type: SortType;
551 default_listing_type: ListingType;
555 matrix_user_id?: string;
556 new_password?: string;
557 new_password_verify?: string;
558 old_password?: string;
559 show_avatars: boolean;
560 send_notifications_to_email: boolean;
564 export interface CommunityForm {
567 description?: string;
578 export interface GetCommunityForm {
584 export interface GetCommunityResponse {
585 community: Community;
586 moderators: Array<CommunityUser>;
587 admins: Array<UserView>;
591 export interface CommunityResponse {
592 community: Community;
595 export interface ListCommunitiesForm {
602 export interface ListCommunitiesResponse {
603 communities: Array<Community>;
606 export interface ListCategoriesResponse {
607 categories: Array<Category>;
610 export interface PostForm {
614 community_id: number;
627 export interface PostFormParams {
634 export interface GetPostForm {
639 export interface GetPostResponse {
641 comments: Array<Comment>;
642 community: Community;
643 moderators: Array<CommunityUser>;
644 admins: Array<UserView>;
648 export interface SavePostForm {
654 export interface PostResponse {
658 export interface CommentForm {
671 export interface SaveCommentForm {
677 export interface CommentResponse {
679 recipient_ids: Array<number>;
682 export interface CommentLikeForm {
689 export interface CommentNode {
691 children?: Array<CommentNode>;
694 export interface GetPostsForm {
699 community_id?: number;
703 export interface GetPostsResponse {
707 export interface GetCommentsForm {
712 community_id?: number;
716 export interface GetCommentsResponse {
717 comments: Array<Comment>;
720 export interface CreatePostLikeForm {
726 export interface SiteForm {
728 description?: string;
729 enable_downvotes: boolean;
730 open_registration: boolean;
731 enable_nsfw: boolean;
735 export interface GetSiteConfig {
739 export interface GetSiteConfigResponse {
740 config_hjson: string;
743 export interface SiteConfigForm {
744 config_hjson: string;
748 export interface GetSiteResponse {
750 admins: Array<UserView>;
751 banned: Array<UserView>;
755 export interface SiteResponse {
759 export interface BanUserForm {
767 export interface BanUserResponse {
772 export interface AddAdminForm {
778 export interface AddAdminResponse {
779 admins: Array<UserView>;
782 export interface SearchForm {
785 community_id?: number;
792 export interface SearchResponse {
795 comments?: Array<Comment>;
796 communities: Array<Community>;
797 users: Array<UserView>;
800 export interface DeleteAccountForm {
804 export interface PasswordResetForm {
808 // export interface PasswordResetResponse {
811 export interface PasswordChangeForm {
814 password_verify: string;
817 export interface PrivateMessageForm {
819 recipient_id: number;
823 export interface PrivateMessageFormParams {
824 recipient_id: number;
827 export interface EditPrivateMessageForm {
835 export interface GetPrivateMessagesForm {
836 unread_only: boolean;
842 export interface PrivateMessagesResponse {
843 messages: Array<PrivateMessage>;
846 export interface PrivateMessageResponse {
847 message: PrivateMessage;
850 export interface UserJoinForm {
854 export interface UserJoinResponse {
858 export type MessageType =
859 | EditPrivateMessageForm
863 | FollowCommunityForm
864 | ListCommunitiesForm
865 | GetFollowedCommunitiesForm
874 | BanFromCommunityForm
876 | AddModToCommunityForm
877 | TransferCommunityForm
884 | GetUserMentionsForm
885 | EditUserMentionForm
894 | EditPrivateMessageForm
895 | GetPrivateMessagesForm
900 | GetFollowedCommunitiesResponse
901 | ListCommunitiesResponse
905 | GetUserMentionsResponse
906 | ListCategoriesResponse
909 | UserMentionResponse
913 | BanFromCommunityResponse
914 | AddModToCommunityResponse
917 | PrivateMessageResponse
918 | PrivateMessagesResponse
919 | GetSiteConfigResponse;
921 export interface WebSocketResponse {
926 export interface WebSocketJsonResponse {