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_published: string;
187 creator_avatar?: string;
188 community_actor_id: string;
189 community_local: boolean;
190 community_name: string;
191 community_removed: boolean;
192 community_deleted: boolean;
193 community_nsfw: boolean;
194 number_of_comments: number;
199 newest_activity_time: string;
202 subscribed?: boolean;
205 duplicates?: Array<Post>;
208 export interface Comment {
222 community_id: number;
223 community_actor_id: string;
224 community_local: boolean;
225 community_name: string;
227 banned_from_community: boolean;
228 creator_actor_id: string;
229 creator_local: boolean;
230 creator_name: string;
231 creator_avatar?: string;
232 creator_published: string;
241 user_mention_id?: number; // For mention type
242 recipient_id?: number;
243 recipient_actor_id?: string;
244 recipient_local?: boolean;
248 export interface Category {
253 export interface Site {
256 description?: string;
260 creator_name: string;
261 number_of_users: number;
262 number_of_posts: number;
263 number_of_comments: number;
264 number_of_communities: number;
265 enable_downvotes: boolean;
266 open_registration: boolean;
267 enable_nsfw: boolean;
270 export interface PrivateMessage {
273 recipient_id: number;
281 creator_name: string;
282 creator_avatar?: string;
283 creator_actor_id: string;
284 creator_local: boolean;
285 recipient_name: string;
286 recipient_avatar?: string;
287 recipient_actor_id: string;
288 recipient_local: boolean;
291 export enum BanType {
296 export interface FollowCommunityForm {
297 community_id: number;
302 export interface GetFollowedCommunitiesForm {
306 export interface GetFollowedCommunitiesResponse {
307 communities: Array<CommunityUser>;
310 export interface GetUserDetailsForm {
316 community_id?: number;
320 export interface UserDetailsResponse {
322 follows: Array<CommunityUser>;
323 moderates: Array<CommunityUser>;
324 comments: Array<Comment>;
326 admins: Array<UserView>;
329 export interface GetRepliesForm {
333 unread_only: boolean;
337 export interface GetRepliesResponse {
338 replies: Array<Comment>;
341 export interface GetUserMentionsForm {
345 unread_only: boolean;
349 export interface GetUserMentionsResponse {
350 mentions: Array<Comment>;
353 export interface EditUserMentionForm {
354 user_mention_id: number;
359 export interface UserMentionResponse {
363 export interface BanFromCommunityForm {
364 community_id: number;
372 export interface BanFromCommunityResponse {
377 export interface AddModToCommunityForm {
378 community_id: number;
384 export interface TransferCommunityForm {
385 community_id: number;
390 export interface TransferSiteForm {
395 export interface AddModToCommunityResponse {
396 moderators: Array<CommunityUser>;
399 export interface GetModlogForm {
400 mod_user_id?: number;
401 community_id?: number;
406 export interface GetModlogResponse {
407 removed_posts: Array<ModRemovePost>;
408 locked_posts: Array<ModLockPost>;
409 stickied_posts: Array<ModStickyPost>;
410 removed_comments: Array<ModRemoveComment>;
411 removed_communities: Array<ModRemoveCommunity>;
412 banned_from_community: Array<ModBanFromCommunity>;
413 banned: Array<ModBan>;
414 added_to_community: Array<ModAddCommunity>;
415 added: Array<ModAdd>;
418 export interface ModRemovePost {
425 mod_user_name: string;
427 community_id: number;
428 community_name: string;
431 export interface ModLockPost {
437 mod_user_name: string;
439 community_id: number;
440 community_name: string;
443 export interface ModStickyPost {
449 mod_user_name: string;
451 community_id: number;
452 community_name: string;
455 export interface ModRemoveComment {
462 mod_user_name: string;
463 comment_user_id: number;
464 comment_user_name: string;
465 comment_content: string;
468 community_id: number;
469 community_name: string;
472 export interface ModRemoveCommunity {
475 community_id: number;
480 mod_user_name: string;
481 community_name: string;
484 export interface ModBanFromCommunity {
487 other_user_id: number;
488 community_id: number;
493 mod_user_name: string;
494 other_user_name: string;
495 community_name: string;
498 export interface ModBan {
501 other_user_id: number;
506 mod_user_name: string;
507 other_user_name: string;
510 export interface ModAddCommunity {
513 other_user_id: number;
514 community_id: number;
517 mod_user_name: string;
518 other_user_name: string;
519 community_name: string;
522 export interface ModAdd {
525 other_user_id: number;
528 mod_user_name: string;
529 other_user_name: string;
532 export interface LoginForm {
533 username_or_email: string;
537 export interface RegisterForm {
541 password_verify: string;
546 export interface LoginResponse {
550 export interface UserSettingsForm {
553 default_sort_type: SortType;
554 default_listing_type: ListingType;
558 matrix_user_id?: string;
559 new_password?: string;
560 new_password_verify?: string;
561 old_password?: string;
562 show_avatars: boolean;
563 send_notifications_to_email: boolean;
567 export interface CommunityForm {
570 description?: string;
581 export interface GetCommunityForm {
587 export interface GetCommunityResponse {
588 community: Community;
589 moderators: Array<CommunityUser>;
590 admins: Array<UserView>;
594 export interface CommunityResponse {
595 community: Community;
598 export interface ListCommunitiesForm {
605 export interface ListCommunitiesResponse {
606 communities: Array<Community>;
609 export interface ListCategoriesResponse {
610 categories: Array<Category>;
613 export interface PostForm {
617 community_id: number;
630 export interface PostFormParams {
637 export interface GetPostForm {
642 export interface GetPostResponse {
644 comments: Array<Comment>;
645 community: Community;
646 moderators: Array<CommunityUser>;
647 admins: Array<UserView>;
651 export interface SavePostForm {
657 export interface PostResponse {
661 export interface CommentForm {
674 export interface SaveCommentForm {
680 export interface CommentResponse {
682 recipient_ids: Array<number>;
685 export interface CommentLikeForm {
692 export interface CommentNode {
694 children?: Array<CommentNode>;
697 export interface GetPostsForm {
702 community_id?: number;
706 export interface GetPostsResponse {
710 export interface GetCommentsForm {
715 community_id?: number;
719 export interface GetCommentsResponse {
720 comments: Array<Comment>;
723 export interface CreatePostLikeForm {
729 export interface SiteForm {
731 description?: string;
732 enable_downvotes: boolean;
733 open_registration: boolean;
734 enable_nsfw: boolean;
738 export interface GetSiteConfig {
742 export interface GetSiteConfigResponse {
743 config_hjson: string;
746 export interface SiteConfigForm {
747 config_hjson: string;
751 export interface GetSiteResponse {
753 admins: Array<UserView>;
754 banned: Array<UserView>;
758 export interface SiteResponse {
762 export interface BanUserForm {
770 export interface BanUserResponse {
775 export interface AddAdminForm {
781 export interface AddAdminResponse {
782 admins: Array<UserView>;
785 export interface SearchForm {
788 community_id?: number;
795 export interface SearchResponse {
798 comments?: Array<Comment>;
799 communities: Array<Community>;
800 users: Array<UserView>;
803 export interface DeleteAccountForm {
807 export interface PasswordResetForm {
811 // export interface PasswordResetResponse {
814 export interface PasswordChangeForm {
817 password_verify: string;
820 export interface PrivateMessageForm {
822 recipient_id: number;
826 export interface PrivateMessageFormParams {
827 recipient_id: number;
830 export interface EditPrivateMessageForm {
838 export interface GetPrivateMessagesForm {
839 unread_only: boolean;
845 export interface PrivateMessagesResponse {
846 messages: Array<PrivateMessage>;
849 export interface PrivateMessageResponse {
850 message: PrivateMessage;
853 export interface UserJoinForm {
857 export interface UserJoinResponse {
861 export type MessageType =
862 | EditPrivateMessageForm
866 | FollowCommunityForm
867 | ListCommunitiesForm
868 | GetFollowedCommunitiesForm
877 | BanFromCommunityForm
879 | AddModToCommunityForm
880 | TransferCommunityForm
887 | GetUserMentionsForm
888 | EditUserMentionForm
897 | EditPrivateMessageForm
898 | GetPrivateMessagesForm
903 | GetFollowedCommunitiesResponse
904 | ListCommunitiesResponse
908 | GetUserMentionsResponse
909 | ListCategoriesResponse
912 | UserMentionResponse
916 | BanFromCommunityResponse
917 | AddModToCommunityResponse
920 | PrivateMessageResponse
921 | PrivateMessagesResponse
922 | GetSiteConfigResponse;
924 export interface WebSocketResponse {
929 export interface WebSocketJsonResponse {