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 {
106 matrix_user_id?: string;
108 number_of_posts: number;
110 number_of_comments: number;
111 comment_score: number;
113 show_avatars: boolean;
114 send_notifications_to_email: boolean;
117 export interface CommunityUser {
122 community_id: number;
123 community_name: string;
127 export interface Community {
131 description?: string;
139 creator_name: string;
140 creator_avatar?: string;
141 category_name: string;
142 number_of_subscribers: number;
143 number_of_posts: number;
144 number_of_comments: number;
146 subscribed?: boolean;
149 export interface Post {
155 community_id: number;
160 embed_title?: string;
161 embed_description?: string;
163 thumbnail_url?: string;
166 banned_from_community: boolean;
169 creator_name: string;
170 creator_avatar?: string;
171 community_name: string;
172 community_removed: boolean;
173 community_deleted: boolean;
174 community_nsfw: boolean;
175 number_of_comments: number;
180 newest_activity_time: string;
183 subscribed?: boolean;
186 duplicates?: Array<Post>;
189 export interface Comment {
200 community_id: number;
201 community_name: string;
203 banned_from_community: boolean;
204 creator_name: string;
205 creator_avatar?: string;
214 user_mention_id?: number; // For mention type
215 recipient_id?: number;
219 export interface Category {
224 export interface Site {
227 description?: string;
231 creator_name: string;
232 number_of_users: number;
233 number_of_posts: number;
234 number_of_comments: number;
235 number_of_communities: number;
236 enable_downvotes: boolean;
237 open_registration: boolean;
238 enable_nsfw: boolean;
241 export interface PrivateMessage {
244 recipient_id: number;
250 creator_name: string;
251 creator_avatar?: string;
252 recipient_name: string;
253 recipient_avatar?: string;
256 export enum BanType {
261 export interface FollowCommunityForm {
262 community_id: number;
267 export interface GetFollowedCommunitiesForm {
271 export interface GetFollowedCommunitiesResponse {
272 communities: Array<CommunityUser>;
275 export interface GetUserDetailsForm {
281 community_id?: number;
285 export interface UserDetailsResponse {
287 follows: Array<CommunityUser>;
288 moderates: Array<CommunityUser>;
289 comments: Array<Comment>;
291 admins: Array<UserView>;
294 export interface GetRepliesForm {
298 unread_only: boolean;
302 export interface GetRepliesResponse {
303 replies: Array<Comment>;
306 export interface GetUserMentionsForm {
310 unread_only: boolean;
314 export interface GetUserMentionsResponse {
315 mentions: Array<Comment>;
318 export interface EditUserMentionForm {
319 user_mention_id: number;
324 export interface UserMentionResponse {
328 export interface BanFromCommunityForm {
329 community_id: number;
337 export interface BanFromCommunityResponse {
342 export interface AddModToCommunityForm {
343 community_id: number;
349 export interface TransferCommunityForm {
350 community_id: number;
355 export interface TransferSiteForm {
360 export interface AddModToCommunityResponse {
361 moderators: Array<CommunityUser>;
364 export interface GetModlogForm {
365 mod_user_id?: number;
366 community_id?: number;
371 export interface GetModlogResponse {
372 removed_posts: Array<ModRemovePost>;
373 locked_posts: Array<ModLockPost>;
374 stickied_posts: Array<ModStickyPost>;
375 removed_comments: Array<ModRemoveComment>;
376 removed_communities: Array<ModRemoveCommunity>;
377 banned_from_community: Array<ModBanFromCommunity>;
378 banned: Array<ModBan>;
379 added_to_community: Array<ModAddCommunity>;
380 added: Array<ModAdd>;
383 export interface ModRemovePost {
390 mod_user_name: string;
392 community_id: number;
393 community_name: string;
396 export interface ModLockPost {
402 mod_user_name: string;
404 community_id: number;
405 community_name: string;
408 export interface ModStickyPost {
414 mod_user_name: string;
416 community_id: number;
417 community_name: string;
420 export interface ModRemoveComment {
427 mod_user_name: string;
428 comment_user_id: number;
429 comment_user_name: string;
430 comment_content: string;
433 community_id: number;
434 community_name: string;
437 export interface ModRemoveCommunity {
440 community_id: number;
445 mod_user_name: string;
446 community_name: string;
449 export interface ModBanFromCommunity {
452 other_user_id: number;
453 community_id: number;
458 mod_user_name: string;
459 other_user_name: string;
460 community_name: string;
463 export interface ModBan {
466 other_user_id: number;
471 mod_user_name: string;
472 other_user_name: string;
475 export interface ModAddCommunity {
478 other_user_id: number;
479 community_id: number;
482 mod_user_name: string;
483 other_user_name: string;
484 community_name: string;
487 export interface ModAdd {
490 other_user_id: number;
493 mod_user_name: string;
494 other_user_name: string;
497 export interface LoginForm {
498 username_or_email: string;
502 export interface RegisterForm {
506 password_verify: string;
511 export interface LoginResponse {
515 export interface UserSettingsForm {
518 default_sort_type: SortType;
519 default_listing_type: ListingType;
523 matrix_user_id?: string;
524 new_password?: string;
525 new_password_verify?: string;
526 old_password?: string;
527 show_avatars: boolean;
528 send_notifications_to_email: boolean;
532 export interface CommunityForm {
535 description?: string;
546 export interface GetCommunityForm {
552 export interface GetCommunityResponse {
553 community: Community;
554 moderators: Array<CommunityUser>;
555 admins: Array<UserView>;
559 export interface CommunityResponse {
560 community: Community;
563 export interface ListCommunitiesForm {
570 export interface ListCommunitiesResponse {
571 communities: Array<Community>;
574 export interface ListCategoriesResponse {
575 categories: Array<Category>;
578 export interface PostForm {
582 community_id: number;
595 export interface PostFormParams {
602 export interface GetPostForm {
607 export interface GetPostResponse {
609 comments: Array<Comment>;
610 community: Community;
611 moderators: Array<CommunityUser>;
612 admins: Array<UserView>;
616 export interface SavePostForm {
622 export interface PostResponse {
626 export interface CommentForm {
639 export interface SaveCommentForm {
645 export interface CommentResponse {
647 recipient_ids: Array<number>;
650 export interface CommentLikeForm {
657 export interface CommentNode {
659 children?: Array<CommentNode>;
662 export interface GetPostsForm {
667 community_id?: number;
671 export interface GetPostsResponse {
675 export interface GetCommentsForm {
680 community_id?: number;
684 export interface GetCommentsResponse {
685 comments: Array<Comment>;
688 export interface CreatePostLikeForm {
694 export interface SiteForm {
696 description?: string;
697 enable_downvotes: boolean;
698 open_registration: boolean;
699 enable_nsfw: boolean;
703 export interface GetSiteConfig {
707 export interface GetSiteConfigResponse {
708 config_hjson: string;
711 export interface SiteConfigForm {
712 config_hjson: string;
716 export interface GetSiteResponse {
718 admins: Array<UserView>;
719 banned: Array<UserView>;
723 export interface SiteResponse {
727 export interface BanUserForm {
735 export interface BanUserResponse {
740 export interface AddAdminForm {
746 export interface AddAdminResponse {
747 admins: Array<UserView>;
750 export interface SearchForm {
753 community_id?: number;
760 export interface SearchResponse {
763 comments?: Array<Comment>;
764 communities: Array<Community>;
765 users: Array<UserView>;
768 export interface DeleteAccountForm {
772 export interface PasswordResetForm {
776 // export interface PasswordResetResponse {
779 export interface PasswordChangeForm {
782 password_verify: string;
785 export interface PrivateMessageForm {
787 recipient_id: number;
791 export interface PrivateMessageFormParams {
792 recipient_id: number;
795 export interface EditPrivateMessageForm {
803 export interface GetPrivateMessagesForm {
804 unread_only: boolean;
810 export interface PrivateMessagesResponse {
811 messages: Array<PrivateMessage>;
814 export interface PrivateMessageResponse {
815 message: PrivateMessage;
818 export interface UserJoinForm {
822 export interface UserJoinResponse {
826 export type MessageType =
827 | EditPrivateMessageForm
831 | FollowCommunityForm
832 | ListCommunitiesForm
833 | GetFollowedCommunitiesForm
842 | BanFromCommunityForm
844 | AddModToCommunityForm
845 | TransferCommunityForm
852 | GetUserMentionsForm
853 | EditUserMentionForm
862 | EditPrivateMessageForm
863 | GetPrivateMessagesForm
868 | GetFollowedCommunitiesResponse
869 | ListCommunitiesResponse
873 | GetUserMentionsResponse
874 | ListCategoriesResponse
877 | UserMentionResponse
881 | BanFromCommunityResponse
882 | AddModToCommunityResponse
885 | PrivateMessageResponse
886 | PrivateMessagesResponse
887 | GetSiteConfigResponse;
889 export interface WebSocketResponse {
894 export interface WebSocketJsonResponse {