1 export enum UserOperation {
25 GetFollowedCommunities,
29 MarkUserMentionAsRead,
49 MarkPrivateMessageAsRead,
57 export enum CommentSortType {
64 export enum CommentViewType {
69 export enum ListingType {
75 export enum DataType {
80 export enum SortType {
90 export enum SearchType {
99 export interface User {
105 default_sort_type: SortType;
106 default_listing_type: ListingType;
109 show_avatars: boolean;
110 unreadCount?: number;
113 export interface UserView {
119 matrix_user_id?: string;
123 number_of_posts: number;
125 number_of_comments: number;
126 comment_score: number;
128 show_avatars: boolean;
129 send_notifications_to_email: boolean;
132 export interface CommunityUser {
135 user_actor_id: string;
139 community_id: number;
140 community_actor_id: string;
141 community_local: boolean;
142 community_name: string;
146 export interface Community {
152 description?: string;
160 creator_actor_id: string;
161 creator_local: boolean;
162 last_refreshed_at: string;
163 creator_name: string;
164 creator_avatar?: string;
165 category_name: string;
166 number_of_subscribers: number;
167 number_of_posts: number;
168 number_of_comments: number;
170 subscribed?: boolean;
173 export interface Post {
179 community_id: number;
184 embed_title?: string;
185 embed_description?: string;
187 thumbnail_url?: string;
192 banned_from_community: boolean;
195 creator_actor_id: string;
196 creator_local: boolean;
197 creator_name: string;
198 creator_published: string;
199 creator_avatar?: string;
200 community_actor_id: string;
201 community_local: boolean;
202 community_name: string;
203 community_removed: boolean;
204 community_deleted: boolean;
205 community_nsfw: boolean;
206 number_of_comments: number;
211 newest_activity_time: string;
214 subscribed?: boolean;
217 duplicates?: Array<Post>;
220 export interface Comment {
234 community_id: number;
235 community_actor_id: string;
236 community_local: boolean;
237 community_name: string;
239 banned_from_community: boolean;
240 creator_actor_id: string;
241 creator_local: boolean;
242 creator_name: string;
243 creator_avatar?: string;
244 creator_published: string;
253 user_mention_id?: number; // For mention type
254 recipient_id?: number;
255 recipient_actor_id?: string;
256 recipient_local?: boolean;
260 export interface Category {
265 export interface Site {
268 description?: string;
272 creator_name: string;
273 number_of_users: number;
274 number_of_posts: number;
275 number_of_comments: number;
276 number_of_communities: number;
277 enable_downvotes: boolean;
278 open_registration: boolean;
279 enable_nsfw: boolean;
282 export interface PrivateMessage {
285 recipient_id: number;
293 creator_name: string;
294 creator_avatar?: string;
295 creator_actor_id: string;
296 creator_local: boolean;
297 recipient_name: string;
298 recipient_avatar?: string;
299 recipient_actor_id: string;
300 recipient_local: boolean;
303 export enum BanType {
308 export interface FollowCommunityForm {
309 community_id: number;
314 export interface GetFollowedCommunitiesForm {
318 export interface GetFollowedCommunitiesResponse {
319 communities: Array<CommunityUser>;
322 export interface GetUserDetailsForm {
328 community_id?: number;
332 export interface UserDetailsResponse {
334 follows: Array<CommunityUser>;
335 moderates: Array<CommunityUser>;
336 comments: Array<Comment>;
338 admins: Array<UserView>;
341 export interface GetRepliesForm {
345 unread_only: boolean;
349 export interface GetRepliesResponse {
350 replies: Array<Comment>;
353 export interface GetUserMentionsForm {
357 unread_only: boolean;
361 export interface GetUserMentionsResponse {
362 mentions: Array<Comment>;
365 export interface MarkUserMentionAsReadForm {
366 user_mention_id: number;
371 export interface UserMentionResponse {
375 export interface BanFromCommunityForm {
376 community_id: number;
384 export interface BanFromCommunityResponse {
389 export interface AddModToCommunityForm {
390 community_id: number;
396 export interface TransferCommunityForm {
397 community_id: number;
402 export interface TransferSiteForm {
407 export interface AddModToCommunityResponse {
408 moderators: Array<CommunityUser>;
411 export interface GetModlogForm {
412 mod_user_id?: number;
413 community_id?: number;
418 export interface GetModlogResponse {
419 removed_posts: Array<ModRemovePost>;
420 locked_posts: Array<ModLockPost>;
421 stickied_posts: Array<ModStickyPost>;
422 removed_comments: Array<ModRemoveComment>;
423 removed_communities: Array<ModRemoveCommunity>;
424 banned_from_community: Array<ModBanFromCommunity>;
425 banned: Array<ModBan>;
426 added_to_community: Array<ModAddCommunity>;
427 added: Array<ModAdd>;
430 export interface ModRemovePost {
437 mod_user_name: string;
439 community_id: number;
440 community_name: string;
443 export interface ModLockPost {
449 mod_user_name: string;
451 community_id: number;
452 community_name: string;
455 export interface ModStickyPost {
461 mod_user_name: string;
463 community_id: number;
464 community_name: string;
467 export interface ModRemoveComment {
474 mod_user_name: string;
475 comment_user_id: number;
476 comment_user_name: string;
477 comment_content: string;
480 community_id: number;
481 community_name: string;
484 export interface ModRemoveCommunity {
487 community_id: number;
492 mod_user_name: string;
493 community_name: string;
496 export interface ModBanFromCommunity {
499 other_user_id: number;
500 community_id: number;
505 mod_user_name: string;
506 other_user_name: string;
507 community_name: string;
510 export interface ModBan {
513 other_user_id: number;
518 mod_user_name: string;
519 other_user_name: string;
522 export interface ModAddCommunity {
525 other_user_id: number;
526 community_id: number;
529 mod_user_name: string;
530 other_user_name: string;
531 community_name: string;
534 export interface ModAdd {
537 other_user_id: number;
540 mod_user_name: string;
541 other_user_name: string;
544 export interface LoginForm {
545 username_or_email: string;
549 export interface RegisterForm {
553 password_verify: string;
558 export interface LoginResponse {
562 export interface UserSettingsForm {
565 default_sort_type: SortType;
566 default_listing_type: ListingType;
570 matrix_user_id?: string;
571 new_password?: string;
572 new_password_verify?: string;
573 old_password?: string;
574 show_avatars: boolean;
575 send_notifications_to_email: boolean;
579 export interface CommunityForm {
583 description?: string;
589 export interface DeleteCommunityForm {
595 export interface RemoveCommunityForm {
603 export interface GetCommunityForm {
609 export interface GetCommunityResponse {
610 community: Community;
611 moderators: Array<CommunityUser>;
612 admins: Array<UserView>;
616 export interface CommunityResponse {
617 community: Community;
620 export interface ListCommunitiesForm {
627 export interface ListCommunitiesResponse {
628 communities: Array<Community>;
631 export interface ListCategoriesResponse {
632 categories: Array<Category>;
635 export interface PostForm {
639 community_id: number;
652 export interface PostFormParams {
659 export interface GetPostForm {
664 export interface GetPostResponse {
666 comments: Array<Comment>;
667 community: Community;
668 moderators: Array<CommunityUser>;
669 admins: Array<UserView>;
673 export interface SavePostForm {
679 export interface PostResponse {
683 export interface CommentForm {
692 export interface DeleteCommentForm {
698 export interface RemoveCommentForm {
705 export interface MarkCommentAsReadForm {
711 export interface SaveCommentForm {
717 export interface CommentResponse {
719 recipient_ids: Array<number>;
722 export interface CommentLikeForm {
728 export interface CommentNode {
730 children?: Array<CommentNode>;
733 export interface GetPostsForm {
738 community_id?: number;
742 export interface GetPostsResponse {
746 export interface GetCommentsForm {
751 community_id?: number;
755 export interface GetCommentsResponse {
756 comments: Array<Comment>;
759 export interface CreatePostLikeForm {
765 export interface SiteForm {
767 description?: string;
768 enable_downvotes: boolean;
769 open_registration: boolean;
770 enable_nsfw: boolean;
774 export interface GetSiteConfig {
778 export interface GetSiteConfigResponse {
779 config_hjson: string;
782 export interface SiteConfigForm {
783 config_hjson: string;
787 export interface GetSiteResponse {
789 admins: Array<UserView>;
790 banned: Array<UserView>;
794 export interface SiteResponse {
798 export interface BanUserForm {
806 export interface BanUserResponse {
811 export interface AddAdminForm {
817 export interface AddAdminResponse {
818 admins: Array<UserView>;
821 export interface SearchForm {
824 community_id?: number;
831 export interface SearchResponse {
834 comments?: Array<Comment>;
835 communities: Array<Community>;
836 users: Array<UserView>;
839 export interface DeleteAccountForm {
843 export interface PasswordResetForm {
847 // export interface PasswordResetResponse {
850 export interface PasswordChangeForm {
853 password_verify: string;
856 export interface PrivateMessageForm {
858 recipient_id: number;
862 export interface PrivateMessageFormParams {
863 recipient_id: number;
866 export interface EditPrivateMessageForm {
872 export interface DeletePrivateMessageForm {
878 export interface MarkPrivateMessageAsReadForm {
884 export interface GetPrivateMessagesForm {
885 unread_only: boolean;
891 export interface PrivateMessagesResponse {
892 messages: Array<PrivateMessage>;
895 export interface PrivateMessageResponse {
896 message: PrivateMessage;
899 export interface UserJoinForm {
903 export interface UserJoinResponse {
907 export type MessageType =
911 | DeleteCommunityForm
912 | RemoveCommunityForm
913 | FollowCommunityForm
914 | ListCommunitiesForm
915 | GetFollowedCommunitiesForm
923 | MarkCommentAsReadForm
927 | BanFromCommunityForm
929 | AddModToCommunityForm
930 | TransferCommunityForm
937 | GetUserMentionsForm
938 | MarkUserMentionAsReadForm
947 | EditPrivateMessageForm
948 | DeletePrivateMessageForm
949 | MarkPrivateMessageAsReadForm
950 | GetPrivateMessagesForm
955 | GetFollowedCommunitiesResponse
956 | ListCommunitiesResponse
960 | GetUserMentionsResponse
961 | ListCategoriesResponse
964 | UserMentionResponse
968 | BanFromCommunityResponse
969 | AddModToCommunityResponse
972 | PrivateMessageResponse
973 | PrivateMessagesResponse
974 | GetSiteConfigResponse;
976 export interface WebSocketResponse {
981 export interface WebSocketJsonResponse {
988 export enum UserDetailsView {