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_avatar?: string;
187 community_actor_id: string;
188 community_local: boolean;
189 community_name: string;
190 community_removed: boolean;
191 community_deleted: boolean;
192 community_nsfw: boolean;
193 number_of_comments: number;
198 newest_activity_time: string;
201 subscribed?: boolean;
204 duplicates?: Array<Post>;
207 export interface Comment {
220 community_id: number;
221 community_actor_id: string;
222 community_local: boolean;
223 community_name: string;
225 banned_from_community: boolean;
226 creator_actor_id: string;
227 creator_local: boolean;
228 creator_name: string;
229 creator_avatar?: string;
238 user_mention_id?: number; // For mention type
239 recipient_id?: number;
240 recipient_actor_id?: string;
241 recipient_local?: boolean;
245 export interface Category {
250 export interface Site {
253 description?: string;
257 creator_name: string;
258 number_of_users: number;
259 number_of_posts: number;
260 number_of_comments: number;
261 number_of_communities: number;
262 enable_downvotes: boolean;
263 open_registration: boolean;
264 enable_nsfw: boolean;
267 export interface PrivateMessage {
270 recipient_id: number;
276 creator_name: string;
277 creator_avatar?: string;
278 recipient_name: string;
279 recipient_avatar?: string;
282 export enum BanType {
287 export interface FollowCommunityForm {
288 community_id: number;
293 export interface GetFollowedCommunitiesForm {
297 export interface GetFollowedCommunitiesResponse {
298 communities: Array<CommunityUser>;
301 export interface GetUserDetailsForm {
307 community_id?: number;
311 export interface UserDetailsResponse {
313 follows: Array<CommunityUser>;
314 moderates: Array<CommunityUser>;
315 comments: Array<Comment>;
317 admins: Array<UserView>;
320 export interface GetRepliesForm {
324 unread_only: boolean;
328 export interface GetRepliesResponse {
329 replies: Array<Comment>;
332 export interface GetUserMentionsForm {
336 unread_only: boolean;
340 export interface GetUserMentionsResponse {
341 mentions: Array<Comment>;
344 export interface EditUserMentionForm {
345 user_mention_id: number;
350 export interface UserMentionResponse {
354 export interface BanFromCommunityForm {
355 community_id: number;
363 export interface BanFromCommunityResponse {
368 export interface AddModToCommunityForm {
369 community_id: number;
375 export interface TransferCommunityForm {
376 community_id: number;
381 export interface TransferSiteForm {
386 export interface AddModToCommunityResponse {
387 moderators: Array<CommunityUser>;
390 export interface GetModlogForm {
391 mod_user_id?: number;
392 community_id?: number;
397 export interface GetModlogResponse {
398 removed_posts: Array<ModRemovePost>;
399 locked_posts: Array<ModLockPost>;
400 stickied_posts: Array<ModStickyPost>;
401 removed_comments: Array<ModRemoveComment>;
402 removed_communities: Array<ModRemoveCommunity>;
403 banned_from_community: Array<ModBanFromCommunity>;
404 banned: Array<ModBan>;
405 added_to_community: Array<ModAddCommunity>;
406 added: Array<ModAdd>;
409 export interface ModRemovePost {
416 mod_user_name: string;
418 community_id: number;
419 community_name: string;
422 export interface ModLockPost {
428 mod_user_name: string;
430 community_id: number;
431 community_name: string;
434 export interface ModStickyPost {
440 mod_user_name: string;
442 community_id: number;
443 community_name: string;
446 export interface ModRemoveComment {
453 mod_user_name: string;
454 comment_user_id: number;
455 comment_user_name: string;
456 comment_content: string;
459 community_id: number;
460 community_name: string;
463 export interface ModRemoveCommunity {
466 community_id: number;
471 mod_user_name: string;
472 community_name: string;
475 export interface ModBanFromCommunity {
478 other_user_id: number;
479 community_id: number;
484 mod_user_name: string;
485 other_user_name: string;
486 community_name: string;
489 export interface ModBan {
492 other_user_id: number;
497 mod_user_name: string;
498 other_user_name: string;
501 export interface ModAddCommunity {
504 other_user_id: number;
505 community_id: number;
508 mod_user_name: string;
509 other_user_name: string;
510 community_name: string;
513 export interface ModAdd {
516 other_user_id: number;
519 mod_user_name: string;
520 other_user_name: string;
523 export interface LoginForm {
524 username_or_email: string;
528 export interface RegisterForm {
532 password_verify: string;
537 export interface LoginResponse {
541 export interface UserSettingsForm {
544 default_sort_type: SortType;
545 default_listing_type: ListingType;
549 matrix_user_id?: string;
550 new_password?: string;
551 new_password_verify?: string;
552 old_password?: string;
553 show_avatars: boolean;
554 send_notifications_to_email: boolean;
558 export interface CommunityForm {
561 description?: string;
572 export interface GetCommunityForm {
578 export interface GetCommunityResponse {
579 community: Community;
580 moderators: Array<CommunityUser>;
581 admins: Array<UserView>;
585 export interface CommunityResponse {
586 community: Community;
589 export interface ListCommunitiesForm {
596 export interface ListCommunitiesResponse {
597 communities: Array<Community>;
600 export interface ListCategoriesResponse {
601 categories: Array<Category>;
604 export interface PostForm {
608 community_id: number;
621 export interface PostFormParams {
628 export interface GetPostForm {
633 export interface GetPostResponse {
635 comments: Array<Comment>;
636 community: Community;
637 moderators: Array<CommunityUser>;
638 admins: Array<UserView>;
642 export interface SavePostForm {
648 export interface PostResponse {
652 export interface CommentForm {
665 export interface SaveCommentForm {
671 export interface CommentResponse {
673 recipient_ids: Array<number>;
676 export interface CommentLikeForm {
683 export interface CommentNode {
685 children?: Array<CommentNode>;
688 export interface GetPostsForm {
693 community_id?: number;
697 export interface GetPostsResponse {
701 export interface GetCommentsForm {
706 community_id?: number;
710 export interface GetCommentsResponse {
711 comments: Array<Comment>;
714 export interface CreatePostLikeForm {
720 export interface SiteForm {
722 description?: string;
723 enable_downvotes: boolean;
724 open_registration: boolean;
725 enable_nsfw: boolean;
729 export interface GetSiteConfig {
733 export interface GetSiteConfigResponse {
734 config_hjson: string;
737 export interface SiteConfigForm {
738 config_hjson: string;
742 export interface GetSiteResponse {
744 admins: Array<UserView>;
745 banned: Array<UserView>;
749 export interface SiteResponse {
753 export interface BanUserForm {
761 export interface BanUserResponse {
766 export interface AddAdminForm {
772 export interface AddAdminResponse {
773 admins: Array<UserView>;
776 export interface SearchForm {
779 community_id?: number;
786 export interface SearchResponse {
789 comments?: Array<Comment>;
790 communities: Array<Community>;
791 users: Array<UserView>;
794 export interface DeleteAccountForm {
798 export interface PasswordResetForm {
802 // export interface PasswordResetResponse {
805 export interface PasswordChangeForm {
808 password_verify: string;
811 export interface PrivateMessageForm {
813 recipient_id: number;
817 export interface PrivateMessageFormParams {
818 recipient_id: number;
821 export interface EditPrivateMessageForm {
829 export interface GetPrivateMessagesForm {
830 unread_only: boolean;
836 export interface PrivateMessagesResponse {
837 messages: Array<PrivateMessage>;
840 export interface PrivateMessageResponse {
841 message: PrivateMessage;
844 export interface UserJoinForm {
848 export interface UserJoinResponse {
852 export type MessageType =
853 | EditPrivateMessageForm
857 | FollowCommunityForm
858 | ListCommunitiesForm
859 | GetFollowedCommunitiesForm
868 | BanFromCommunityForm
870 | AddModToCommunityForm
871 | TransferCommunityForm
878 | GetUserMentionsForm
879 | EditUserMentionForm
888 | EditPrivateMessageForm
889 | GetPrivateMessagesForm
894 | GetFollowedCommunitiesResponse
895 | ListCommunitiesResponse
899 | GetUserMentionsResponse
900 | ListCategoriesResponse
903 | UserMentionResponse
907 | BanFromCommunityResponse
908 | AddModToCommunityResponse
911 | PrivateMessageResponse
912 | PrivateMessagesResponse
913 | GetSiteConfigResponse;
915 export interface WebSocketResponse {
920 export interface WebSocketJsonResponse {