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 {
221 community_id: number;
222 community_actor_id: string;
223 community_local: boolean;
224 community_name: string;
226 banned_from_community: boolean;
227 creator_actor_id: string;
228 creator_local: boolean;
229 creator_name: string;
230 creator_avatar?: string;
231 creator_published: string;
240 user_mention_id?: number; // For mention type
241 recipient_id?: number;
242 recipient_actor_id?: string;
243 recipient_local?: boolean;
247 export interface Category {
252 export interface Site {
255 description?: string;
259 creator_name: string;
260 number_of_users: number;
261 number_of_posts: number;
262 number_of_comments: number;
263 number_of_communities: number;
264 enable_downvotes: boolean;
265 open_registration: boolean;
266 enable_nsfw: boolean;
269 export interface PrivateMessage {
272 recipient_id: number;
280 creator_name: string;
281 creator_avatar?: string;
282 creator_actor_id: string;
283 creator_local: boolean;
284 recipient_name: string;
285 recipient_avatar?: string;
286 recipient_actor_id: string;
287 recipient_local: boolean;
290 export enum BanType {
295 export interface FollowCommunityForm {
296 community_id: number;
301 export interface GetFollowedCommunitiesForm {
305 export interface GetFollowedCommunitiesResponse {
306 communities: Array<CommunityUser>;
309 export interface GetUserDetailsForm {
315 community_id?: number;
319 export interface UserDetailsResponse {
321 follows: Array<CommunityUser>;
322 moderates: Array<CommunityUser>;
323 comments: Array<Comment>;
325 admins: Array<UserView>;
328 export interface GetRepliesForm {
332 unread_only: boolean;
336 export interface GetRepliesResponse {
337 replies: Array<Comment>;
340 export interface GetUserMentionsForm {
344 unread_only: boolean;
348 export interface GetUserMentionsResponse {
349 mentions: Array<Comment>;
352 export interface EditUserMentionForm {
353 user_mention_id: number;
358 export interface UserMentionResponse {
362 export interface BanFromCommunityForm {
363 community_id: number;
371 export interface BanFromCommunityResponse {
376 export interface AddModToCommunityForm {
377 community_id: number;
383 export interface TransferCommunityForm {
384 community_id: number;
389 export interface TransferSiteForm {
394 export interface AddModToCommunityResponse {
395 moderators: Array<CommunityUser>;
398 export interface GetModlogForm {
399 mod_user_id?: number;
400 community_id?: number;
405 export interface GetModlogResponse {
406 removed_posts: Array<ModRemovePost>;
407 locked_posts: Array<ModLockPost>;
408 stickied_posts: Array<ModStickyPost>;
409 removed_comments: Array<ModRemoveComment>;
410 removed_communities: Array<ModRemoveCommunity>;
411 banned_from_community: Array<ModBanFromCommunity>;
412 banned: Array<ModBan>;
413 added_to_community: Array<ModAddCommunity>;
414 added: Array<ModAdd>;
417 export interface ModRemovePost {
424 mod_user_name: string;
426 community_id: number;
427 community_name: string;
430 export interface ModLockPost {
436 mod_user_name: string;
438 community_id: number;
439 community_name: string;
442 export interface ModStickyPost {
448 mod_user_name: string;
450 community_id: number;
451 community_name: string;
454 export interface ModRemoveComment {
461 mod_user_name: string;
462 comment_user_id: number;
463 comment_user_name: string;
464 comment_content: string;
467 community_id: number;
468 community_name: string;
471 export interface ModRemoveCommunity {
474 community_id: number;
479 mod_user_name: string;
480 community_name: string;
483 export interface ModBanFromCommunity {
486 other_user_id: number;
487 community_id: number;
492 mod_user_name: string;
493 other_user_name: string;
494 community_name: string;
497 export interface ModBan {
500 other_user_id: number;
505 mod_user_name: string;
506 other_user_name: string;
509 export interface ModAddCommunity {
512 other_user_id: number;
513 community_id: number;
516 mod_user_name: string;
517 other_user_name: string;
518 community_name: string;
521 export interface ModAdd {
524 other_user_id: number;
527 mod_user_name: string;
528 other_user_name: string;
531 export interface LoginForm {
532 username_or_email: string;
536 export interface RegisterForm {
540 password_verify: string;
545 export interface LoginResponse {
549 export interface UserSettingsForm {
552 default_sort_type: SortType;
553 default_listing_type: ListingType;
557 matrix_user_id?: string;
558 new_password?: string;
559 new_password_verify?: string;
560 old_password?: string;
561 show_avatars: boolean;
562 send_notifications_to_email: boolean;
566 export interface CommunityForm {
569 description?: string;
580 export interface GetCommunityForm {
586 export interface GetCommunityResponse {
587 community: Community;
588 moderators: Array<CommunityUser>;
589 admins: Array<UserView>;
593 export interface CommunityResponse {
594 community: Community;
597 export interface ListCommunitiesForm {
604 export interface ListCommunitiesResponse {
605 communities: Array<Community>;
608 export interface ListCategoriesResponse {
609 categories: Array<Category>;
612 export interface PostForm {
616 community_id: number;
629 export interface PostFormParams {
636 export interface GetPostForm {
641 export interface GetPostResponse {
643 comments: Array<Comment>;
644 community: Community;
645 moderators: Array<CommunityUser>;
646 admins: Array<UserView>;
650 export interface SavePostForm {
656 export interface PostResponse {
660 export interface CommentForm {
673 export interface SaveCommentForm {
679 export interface CommentResponse {
681 recipient_ids: Array<number>;
684 export interface CommentLikeForm {
691 export interface CommentNode {
693 children?: Array<CommentNode>;
696 export interface GetPostsForm {
701 community_id?: number;
705 export interface GetPostsResponse {
709 export interface GetCommentsForm {
714 community_id?: number;
718 export interface GetCommentsResponse {
719 comments: Array<Comment>;
722 export interface CreatePostLikeForm {
728 export interface SiteForm {
730 description?: string;
731 enable_downvotes: boolean;
732 open_registration: boolean;
733 enable_nsfw: boolean;
737 export interface GetSiteConfig {
741 export interface GetSiteConfigResponse {
742 config_hjson: string;
745 export interface SiteConfigForm {
746 config_hjson: string;
750 export interface GetSiteResponse {
752 admins: Array<UserView>;
753 banned: Array<UserView>;
757 export interface SiteResponse {
761 export interface BanUserForm {
769 export interface BanUserResponse {
774 export interface AddAdminForm {
780 export interface AddAdminResponse {
781 admins: Array<UserView>;
784 export interface SearchForm {
787 community_id?: number;
794 export interface SearchResponse {
797 comments?: Array<Comment>;
798 communities: Array<Community>;
799 users: Array<UserView>;
802 export interface DeleteAccountForm {
806 export interface PasswordResetForm {
810 // export interface PasswordResetResponse {
813 export interface PasswordChangeForm {
816 password_verify: string;
819 export interface PrivateMessageForm {
821 recipient_id: number;
825 export interface PrivateMessageFormParams {
826 recipient_id: number;
829 export interface EditPrivateMessageForm {
837 export interface GetPrivateMessagesForm {
838 unread_only: boolean;
844 export interface PrivateMessagesResponse {
845 messages: Array<PrivateMessage>;
848 export interface PrivateMessageResponse {
849 message: PrivateMessage;
852 export interface UserJoinForm {
856 export interface UserJoinResponse {
860 export type MessageType =
861 | EditPrivateMessageForm
865 | FollowCommunityForm
866 | ListCommunitiesForm
867 | GetFollowedCommunitiesForm
876 | BanFromCommunityForm
878 | AddModToCommunityForm
879 | TransferCommunityForm
886 | GetUserMentionsForm
887 | EditUserMentionForm
896 | EditPrivateMessageForm
897 | GetPrivateMessagesForm
902 | GetFollowedCommunitiesResponse
903 | ListCommunitiesResponse
907 | GetUserMentionsResponse
908 | ListCategoriesResponse
911 | UserMentionResponse
915 | BanFromCommunityResponse
916 | AddModToCommunityResponse
919 | PrivateMessageResponse
920 | PrivateMessagesResponse
921 | GetSiteConfigResponse;
923 export interface WebSocketResponse {
928 export interface WebSocketJsonResponse {