1 export enum UserOperation {
20 GetFollowedCommunities,
50 export enum CommentSortType {
57 export enum CommentViewType {
62 export enum ListingType {
68 export enum DataType {
73 export enum SortType {
83 export enum SearchType {
92 export interface User {
98 default_sort_type: SortType;
99 default_listing_type: ListingType;
102 show_avatars: boolean;
103 unreadCount?: number;
106 export interface UserView {
112 matrix_user_id?: string;
116 number_of_posts: number;
118 number_of_comments: number;
119 comment_score: number;
121 show_avatars: boolean;
122 send_notifications_to_email: boolean;
125 export interface CommunityUser {
128 user_actor_id: string;
132 community_id: number;
133 community_actor_id: string;
134 community_local: boolean;
135 community_name: string;
139 export interface Community {
145 description?: string;
153 creator_actor_id: string;
154 creator_local: boolean;
155 last_refreshed_at: string;
156 creator_name: string;
157 creator_avatar?: string;
158 category_name: string;
159 number_of_subscribers: number;
160 number_of_posts: number;
161 number_of_comments: number;
163 subscribed?: boolean;
166 export interface Post {
172 community_id: number;
177 embed_title?: string;
178 embed_description?: string;
180 thumbnail_url?: string;
185 banned_from_community: boolean;
188 creator_actor_id: string;
189 creator_local: boolean;
190 creator_name: string;
191 creator_published: string;
192 creator_avatar?: string;
193 community_actor_id: string;
194 community_local: boolean;
195 community_name: string;
196 community_removed: boolean;
197 community_deleted: boolean;
198 community_nsfw: boolean;
199 number_of_comments: number;
204 newest_activity_time: string;
207 subscribed?: boolean;
210 duplicates?: Array<Post>;
213 export interface Comment {
226 community_id: number;
227 community_actor_id: string;
228 community_local: boolean;
229 community_name: string;
231 banned_from_community: boolean;
232 creator_actor_id: string;
233 creator_local: boolean;
234 creator_name: string;
235 creator_avatar?: string;
236 creator_published: string;
245 user_mention_id?: number; // For mention type
246 recipient_id?: number;
247 recipient_actor_id?: string;
248 recipient_local?: boolean;
252 export interface Category {
257 export interface Site {
260 description?: string;
264 creator_name: string;
265 number_of_users: number;
266 number_of_posts: number;
267 number_of_comments: number;
268 number_of_communities: number;
269 enable_downvotes: boolean;
270 open_registration: boolean;
271 enable_nsfw: boolean;
274 export interface PrivateMessage {
277 recipient_id: number;
285 creator_name: string;
286 creator_avatar?: string;
287 creator_actor_id: string;
288 creator_local: boolean;
289 recipient_name: string;
290 recipient_avatar?: string;
291 recipient_actor_id: string;
292 recipient_local: boolean;
295 export enum BanType {
300 export interface FollowCommunityForm {
301 community_id: number;
306 export interface GetFollowedCommunitiesForm {
310 export interface GetFollowedCommunitiesResponse {
311 communities: Array<CommunityUser>;
314 export interface GetUserDetailsForm {
320 community_id?: number;
324 export interface UserDetailsResponse {
326 follows: Array<CommunityUser>;
327 moderates: Array<CommunityUser>;
328 comments: Array<Comment>;
330 admins: Array<UserView>;
333 export interface GetRepliesForm {
337 unread_only: boolean;
341 export interface GetRepliesResponse {
342 replies: Array<Comment>;
345 export interface GetUserMentionsForm {
349 unread_only: boolean;
353 export interface GetUserMentionsResponse {
354 mentions: Array<Comment>;
357 export interface EditUserMentionForm {
358 user_mention_id: number;
363 export interface UserMentionResponse {
367 export interface BanFromCommunityForm {
368 community_id: number;
376 export interface BanFromCommunityResponse {
381 export interface AddModToCommunityForm {
382 community_id: number;
388 export interface TransferCommunityForm {
389 community_id: number;
394 export interface TransferSiteForm {
399 export interface AddModToCommunityResponse {
400 moderators: Array<CommunityUser>;
403 export interface GetModlogForm {
404 mod_user_id?: number;
405 community_id?: number;
410 export interface GetModlogResponse {
411 removed_posts: Array<ModRemovePost>;
412 locked_posts: Array<ModLockPost>;
413 stickied_posts: Array<ModStickyPost>;
414 removed_comments: Array<ModRemoveComment>;
415 removed_communities: Array<ModRemoveCommunity>;
416 banned_from_community: Array<ModBanFromCommunity>;
417 banned: Array<ModBan>;
418 added_to_community: Array<ModAddCommunity>;
419 added: Array<ModAdd>;
422 export interface ModRemovePost {
429 mod_user_name: string;
431 community_id: number;
432 community_name: string;
435 export interface ModLockPost {
441 mod_user_name: string;
443 community_id: number;
444 community_name: string;
447 export interface ModStickyPost {
453 mod_user_name: string;
455 community_id: number;
456 community_name: string;
459 export interface ModRemoveComment {
466 mod_user_name: string;
467 comment_user_id: number;
468 comment_user_name: string;
469 comment_content: string;
472 community_id: number;
473 community_name: string;
476 export interface ModRemoveCommunity {
479 community_id: number;
484 mod_user_name: string;
485 community_name: string;
488 export interface ModBanFromCommunity {
491 other_user_id: number;
492 community_id: number;
497 mod_user_name: string;
498 other_user_name: string;
499 community_name: string;
502 export interface ModBan {
505 other_user_id: number;
510 mod_user_name: string;
511 other_user_name: string;
514 export interface ModAddCommunity {
517 other_user_id: number;
518 community_id: number;
521 mod_user_name: string;
522 other_user_name: string;
523 community_name: string;
526 export interface ModAdd {
529 other_user_id: number;
532 mod_user_name: string;
533 other_user_name: string;
536 export interface LoginForm {
537 username_or_email: string;
541 export interface RegisterForm {
545 password_verify: string;
550 export interface LoginResponse {
554 export interface UserSettingsForm {
557 default_sort_type: SortType;
558 default_listing_type: ListingType;
562 matrix_user_id?: string;
563 new_password?: string;
564 new_password_verify?: string;
565 old_password?: string;
566 show_avatars: boolean;
567 send_notifications_to_email: boolean;
571 export interface CommunityForm {
574 description?: string;
585 export interface GetCommunityForm {
591 export interface GetCommunityResponse {
592 community: Community;
593 moderators: Array<CommunityUser>;
594 admins: Array<UserView>;
598 export interface CommunityResponse {
599 community: Community;
602 export interface ListCommunitiesForm {
609 export interface ListCommunitiesResponse {
610 communities: Array<Community>;
613 export interface ListCategoriesResponse {
614 categories: Array<Category>;
617 export interface PostForm {
621 community_id: number;
634 export interface PostFormParams {
641 export interface GetPostForm {
646 export interface GetPostResponse {
648 comments: Array<Comment>;
649 community: Community;
650 moderators: Array<CommunityUser>;
651 admins: Array<UserView>;
655 export interface SavePostForm {
661 export interface PostResponse {
665 export interface CommentForm {
678 export interface SaveCommentForm {
684 export interface CommentResponse {
686 recipient_ids: Array<number>;
689 export interface CommentLikeForm {
696 export interface CommentNode {
698 children?: Array<CommentNode>;
701 export interface GetPostsForm {
706 community_id?: number;
710 export interface GetPostsResponse {
714 export interface GetCommentsForm {
719 community_id?: number;
723 export interface GetCommentsResponse {
724 comments: Array<Comment>;
727 export interface CreatePostLikeForm {
733 export interface SiteForm {
735 description?: string;
736 enable_downvotes: boolean;
737 open_registration: boolean;
738 enable_nsfw: boolean;
742 export interface GetSiteConfig {
746 export interface GetSiteConfigResponse {
747 config_hjson: string;
750 export interface SiteConfigForm {
751 config_hjson: string;
755 export interface GetSiteResponse {
757 admins: Array<UserView>;
758 banned: Array<UserView>;
762 export interface SiteResponse {
766 export interface BanUserForm {
774 export interface BanUserResponse {
779 export interface AddAdminForm {
785 export interface AddAdminResponse {
786 admins: Array<UserView>;
789 export interface SearchForm {
792 community_id?: number;
799 export interface SearchResponse {
802 comments?: Array<Comment>;
803 communities: Array<Community>;
804 users: Array<UserView>;
807 export interface DeleteAccountForm {
811 export interface PasswordResetForm {
815 // export interface PasswordResetResponse {
818 export interface PasswordChangeForm {
821 password_verify: string;
824 export interface PrivateMessageForm {
826 recipient_id: number;
830 export interface PrivateMessageFormParams {
831 recipient_id: number;
834 export interface EditPrivateMessageForm {
842 export interface GetPrivateMessagesForm {
843 unread_only: boolean;
849 export interface PrivateMessagesResponse {
850 messages: Array<PrivateMessage>;
853 export interface PrivateMessageResponse {
854 message: PrivateMessage;
857 export interface UserJoinForm {
861 export interface UserJoinResponse {
865 export type MessageType =
866 | EditPrivateMessageForm
870 | FollowCommunityForm
871 | ListCommunitiesForm
872 | GetFollowedCommunitiesForm
881 | BanFromCommunityForm
883 | AddModToCommunityForm
884 | TransferCommunityForm
891 | GetUserMentionsForm
892 | EditUserMentionForm
901 | EditPrivateMessageForm
902 | GetPrivateMessagesForm
907 | GetFollowedCommunitiesResponse
908 | ListCommunitiesResponse
912 | GetUserMentionsResponse
913 | ListCategoriesResponse
916 | UserMentionResponse
920 | BanFromCommunityResponse
921 | AddModToCommunityResponse
924 | PrivateMessageResponse
925 | PrivateMessagesResponse
926 | GetSiteConfigResponse;
928 export interface WebSocketResponse {
933 export interface WebSocketJsonResponse {