1 export enum UserOperation {
22 GetFollowedCommunities,
26 MarkUserMentionAsRead,
46 MarkPrivateMessageAsRead,
54 export enum CommentSortType {
61 export enum CommentViewType {
66 export enum ListingType {
72 export enum DataType {
77 export enum SortType {
87 export enum SearchType {
96 export interface User {
102 default_sort_type: SortType;
103 default_listing_type: ListingType;
106 show_avatars: boolean;
107 unreadCount?: number;
110 export interface UserView {
116 matrix_user_id?: string;
120 number_of_posts: number;
122 number_of_comments: number;
123 comment_score: number;
125 show_avatars: boolean;
126 send_notifications_to_email: boolean;
129 export interface CommunityUser {
132 user_actor_id: string;
136 community_id: number;
137 community_actor_id: string;
138 community_local: boolean;
139 community_name: string;
143 export interface Community {
149 description?: string;
157 creator_actor_id: string;
158 creator_local: boolean;
159 last_refreshed_at: string;
160 creator_name: string;
161 creator_avatar?: string;
162 category_name: string;
163 number_of_subscribers: number;
164 number_of_posts: number;
165 number_of_comments: number;
167 subscribed?: boolean;
170 export interface Post {
176 community_id: number;
181 embed_title?: string;
182 embed_description?: string;
184 thumbnail_url?: string;
189 banned_from_community: boolean;
192 creator_actor_id: string;
193 creator_local: boolean;
194 creator_name: string;
195 creator_published: string;
196 creator_avatar?: string;
197 community_actor_id: string;
198 community_local: boolean;
199 community_name: string;
200 community_removed: boolean;
201 community_deleted: boolean;
202 community_nsfw: boolean;
203 number_of_comments: number;
208 newest_activity_time: string;
211 subscribed?: boolean;
214 duplicates?: Array<Post>;
217 export interface Comment {
231 community_id: number;
232 community_actor_id: string;
233 community_local: boolean;
234 community_name: string;
236 banned_from_community: boolean;
237 creator_actor_id: string;
238 creator_local: boolean;
239 creator_name: string;
240 creator_avatar?: string;
241 creator_published: string;
250 user_mention_id?: number; // For mention type
251 recipient_id?: number;
252 recipient_actor_id?: string;
253 recipient_local?: boolean;
257 export interface Category {
262 export interface Site {
265 description?: string;
269 creator_name: string;
270 number_of_users: number;
271 number_of_posts: number;
272 number_of_comments: number;
273 number_of_communities: number;
274 enable_downvotes: boolean;
275 open_registration: boolean;
276 enable_nsfw: boolean;
279 export interface PrivateMessage {
282 recipient_id: number;
290 creator_name: string;
291 creator_avatar?: string;
292 creator_actor_id: string;
293 creator_local: boolean;
294 recipient_name: string;
295 recipient_avatar?: string;
296 recipient_actor_id: string;
297 recipient_local: boolean;
300 export enum BanType {
305 export interface FollowCommunityForm {
306 community_id: number;
311 export interface GetFollowedCommunitiesForm {
315 export interface GetFollowedCommunitiesResponse {
316 communities: Array<CommunityUser>;
319 export interface GetUserDetailsForm {
325 community_id?: number;
329 export interface UserDetailsResponse {
331 follows: Array<CommunityUser>;
332 moderates: Array<CommunityUser>;
333 comments: Array<Comment>;
335 admins: Array<UserView>;
338 export interface GetRepliesForm {
342 unread_only: boolean;
346 export interface GetRepliesResponse {
347 replies: Array<Comment>;
350 export interface GetUserMentionsForm {
354 unread_only: boolean;
358 export interface GetUserMentionsResponse {
359 mentions: Array<Comment>;
362 export interface MarkUserMentionAsReadForm {
363 user_mention_id: number;
368 export interface UserMentionResponse {
372 export interface BanFromCommunityForm {
373 community_id: number;
381 export interface BanFromCommunityResponse {
386 export interface AddModToCommunityForm {
387 community_id: number;
393 export interface TransferCommunityForm {
394 community_id: number;
399 export interface TransferSiteForm {
404 export interface AddModToCommunityResponse {
405 moderators: Array<CommunityUser>;
408 export interface GetModlogForm {
409 mod_user_id?: number;
410 community_id?: number;
415 export interface GetModlogResponse {
416 removed_posts: Array<ModRemovePost>;
417 locked_posts: Array<ModLockPost>;
418 stickied_posts: Array<ModStickyPost>;
419 removed_comments: Array<ModRemoveComment>;
420 removed_communities: Array<ModRemoveCommunity>;
421 banned_from_community: Array<ModBanFromCommunity>;
422 banned: Array<ModBan>;
423 added_to_community: Array<ModAddCommunity>;
424 added: Array<ModAdd>;
427 export interface ModRemovePost {
434 mod_user_name: string;
436 community_id: number;
437 community_name: string;
440 export interface ModLockPost {
446 mod_user_name: string;
448 community_id: number;
449 community_name: string;
452 export interface ModStickyPost {
458 mod_user_name: string;
460 community_id: number;
461 community_name: string;
464 export interface ModRemoveComment {
471 mod_user_name: string;
472 comment_user_id: number;
473 comment_user_name: string;
474 comment_content: string;
477 community_id: number;
478 community_name: string;
481 export interface ModRemoveCommunity {
484 community_id: number;
489 mod_user_name: string;
490 community_name: string;
493 export interface ModBanFromCommunity {
496 other_user_id: number;
497 community_id: number;
502 mod_user_name: string;
503 other_user_name: string;
504 community_name: string;
507 export interface ModBan {
510 other_user_id: number;
515 mod_user_name: string;
516 other_user_name: string;
519 export interface ModAddCommunity {
522 other_user_id: number;
523 community_id: number;
526 mod_user_name: string;
527 other_user_name: string;
528 community_name: string;
531 export interface ModAdd {
534 other_user_id: number;
537 mod_user_name: string;
538 other_user_name: string;
541 export interface LoginForm {
542 username_or_email: string;
546 export interface RegisterForm {
550 password_verify: string;
555 export interface LoginResponse {
559 export interface UserSettingsForm {
562 default_sort_type: SortType;
563 default_listing_type: ListingType;
567 matrix_user_id?: string;
568 new_password?: string;
569 new_password_verify?: string;
570 old_password?: string;
571 show_avatars: boolean;
572 send_notifications_to_email: boolean;
576 export interface CommunityForm {
580 description?: string;
586 export interface DeleteCommunityForm {
592 export interface RemoveCommunityForm {
600 export interface GetCommunityForm {
606 export interface GetCommunityResponse {
607 community: Community;
608 moderators: Array<CommunityUser>;
609 admins: Array<UserView>;
613 export interface CommunityResponse {
614 community: Community;
617 export interface ListCommunitiesForm {
624 export interface ListCommunitiesResponse {
625 communities: Array<Community>;
628 export interface ListCategoriesResponse {
629 categories: Array<Category>;
632 export interface PostForm {
636 community_id: number;
649 export interface PostFormParams {
656 export interface GetPostForm {
661 export interface GetPostResponse {
663 comments: Array<Comment>;
664 community: Community;
665 moderators: Array<CommunityUser>;
666 admins: Array<UserView>;
670 export interface SavePostForm {
676 export interface PostResponse {
680 export interface CommentForm {
693 export interface SaveCommentForm {
699 export interface CommentResponse {
701 recipient_ids: Array<number>;
704 export interface CommentLikeForm {
711 export interface CommentNode {
713 children?: Array<CommentNode>;
716 export interface GetPostsForm {
721 community_id?: number;
725 export interface GetPostsResponse {
729 export interface GetCommentsForm {
734 community_id?: number;
738 export interface GetCommentsResponse {
739 comments: Array<Comment>;
742 export interface CreatePostLikeForm {
748 export interface SiteForm {
750 description?: string;
751 enable_downvotes: boolean;
752 open_registration: boolean;
753 enable_nsfw: boolean;
757 export interface GetSiteConfig {
761 export interface GetSiteConfigResponse {
762 config_hjson: string;
765 export interface SiteConfigForm {
766 config_hjson: string;
770 export interface GetSiteResponse {
772 admins: Array<UserView>;
773 banned: Array<UserView>;
777 export interface SiteResponse {
781 export interface BanUserForm {
789 export interface BanUserResponse {
794 export interface AddAdminForm {
800 export interface AddAdminResponse {
801 admins: Array<UserView>;
804 export interface SearchForm {
807 community_id?: number;
814 export interface SearchResponse {
817 comments?: Array<Comment>;
818 communities: Array<Community>;
819 users: Array<UserView>;
822 export interface DeleteAccountForm {
826 export interface PasswordResetForm {
830 // export interface PasswordResetResponse {
833 export interface PasswordChangeForm {
836 password_verify: string;
839 export interface PrivateMessageForm {
841 recipient_id: number;
845 export interface PrivateMessageFormParams {
846 recipient_id: number;
849 export interface EditPrivateMessageForm {
855 export interface DeletePrivateMessageForm {
861 export interface MarkPrivateMessageAsReadForm {
867 export interface GetPrivateMessagesForm {
868 unread_only: boolean;
874 export interface PrivateMessagesResponse {
875 messages: Array<PrivateMessage>;
878 export interface PrivateMessageResponse {
879 message: PrivateMessage;
882 export interface UserJoinForm {
886 export interface UserJoinResponse {
890 export type MessageType =
894 | DeleteCommunityForm
895 | RemoveCommunityForm
896 | FollowCommunityForm
897 | ListCommunitiesForm
898 | GetFollowedCommunitiesForm
907 | BanFromCommunityForm
909 | AddModToCommunityForm
910 | TransferCommunityForm
917 | GetUserMentionsForm
918 | MarkUserMentionAsReadForm
927 | EditPrivateMessageForm
928 | DeletePrivateMessageForm
929 | MarkPrivateMessageAsReadForm
930 | GetPrivateMessagesForm
935 | GetFollowedCommunitiesResponse
936 | ListCommunitiesResponse
940 | GetUserMentionsResponse
941 | ListCategoriesResponse
944 | UserMentionResponse
948 | BanFromCommunityResponse
949 | AddModToCommunityResponse
952 | PrivateMessageResponse
953 | PrivateMessagesResponse
954 | GetSiteConfigResponse;
956 export interface WebSocketResponse {
961 export interface WebSocketJsonResponse {
968 export enum UserDetailsView {