1 export enum UserOperation {
20 GetFollowedCommunities,
43 export enum CommentSortType {
49 export enum ListingType {
55 export enum SortType {
65 export enum SearchType {
74 export interface User {
80 default_sort_type: SortType;
81 default_listing_type: ListingType;
86 export interface UserView {
92 number_of_posts: number;
94 number_of_comments: number;
95 comment_score: number;
99 export interface CommunityUser {
104 community_id: number;
105 community_name: string;
109 export interface Community {
113 description?: string;
121 creator_name: string;
122 creator_avatar?: string;
123 category_name: string;
124 number_of_subscribers: number;
125 number_of_posts: number;
126 number_of_comments: number;
128 subscribed?: boolean;
131 export interface Post {
137 community_id: number;
144 banned_from_community: boolean;
147 creator_name: string;
148 creator_avatar?: string;
149 community_name: string;
150 community_removed: boolean;
151 community_deleted: boolean;
152 community_nsfw: boolean;
153 number_of_comments: number;
160 subscribed?: boolean;
165 export interface Comment {
176 community_id: number;
178 banned_from_community: boolean;
179 creator_name: string;
180 creator_avatar?: string;
187 user_mention_id?: number; // For mention type
188 recipient_id?: number;
191 export interface Category {
196 export interface Site {
199 description?: string;
203 creator_name: string;
204 number_of_users: number;
205 number_of_posts: number;
206 number_of_comments: number;
207 number_of_communities: number;
208 enable_downvotes: boolean;
209 open_registration: boolean;
210 enable_nsfw: boolean;
213 export enum BanType {
218 export interface FollowCommunityForm {
219 community_id: number;
224 export interface GetFollowedCommunitiesResponse {
226 communities: Array<CommunityUser>;
229 export interface GetUserDetailsForm {
235 community_id?: number;
239 export interface UserDetailsResponse {
242 follows: Array<CommunityUser>;
243 moderates: Array<CommunityUser>;
244 comments: Array<Comment>;
246 admins: Array<UserView>;
249 export interface GetRepliesForm {
253 unread_only: boolean;
257 export interface GetRepliesResponse {
259 replies: Array<Comment>;
262 export interface GetUserMentionsForm {
266 unread_only: boolean;
270 export interface GetUserMentionsResponse {
272 mentions: Array<Comment>;
275 export interface EditUserMentionForm {
276 user_mention_id: number;
281 export interface UserMentionResponse {
286 export interface BanFromCommunityForm {
287 community_id: number;
295 export interface BanFromCommunityResponse {
301 export interface AddModToCommunityForm {
302 community_id: number;
308 export interface TransferCommunityForm {
309 community_id: number;
314 export interface TransferSiteForm {
319 export interface AddModToCommunityResponse {
321 moderators: Array<CommunityUser>;
324 export interface GetModlogForm {
325 mod_user_id?: number;
326 community_id?: number;
331 export interface GetModlogResponse {
333 removed_posts: Array<ModRemovePost>;
334 locked_posts: Array<ModLockPost>;
335 stickied_posts: Array<ModStickyPost>;
336 removed_comments: Array<ModRemoveComment>;
337 removed_communities: Array<ModRemoveCommunity>;
338 banned_from_community: Array<ModBanFromCommunity>;
339 banned: Array<ModBan>;
340 added_to_community: Array<ModAddCommunity>;
341 added: Array<ModAdd>;
344 export interface ModRemovePost {
351 mod_user_name: string;
353 community_id: number;
354 community_name: string;
357 export interface ModLockPost {
363 mod_user_name: string;
365 community_id: number;
366 community_name: string;
369 export interface ModStickyPost {
375 mod_user_name: string;
377 community_id: number;
378 community_name: string;
381 export interface ModRemoveComment {
388 mod_user_name: string;
389 comment_user_id: number;
390 comment_user_name: string;
391 comment_content: string;
394 community_id: number;
395 community_name: string;
398 export interface ModRemoveCommunity {
401 community_id: number;
406 mod_user_name: string;
407 community_name: string;
410 export interface ModBanFromCommunity {
413 other_user_id: number;
414 community_id: number;
419 mod_user_name: string;
420 other_user_name: string;
421 community_name: string;
424 export interface ModBan {
427 other_user_id: number;
432 mod_user_name: string;
433 other_user_name: string;
436 export interface ModAddCommunity {
439 other_user_id: number;
440 community_id: number;
443 mod_user_name: string;
444 other_user_name: string;
445 community_name: string;
448 export interface ModAdd {
451 other_user_id: number;
454 mod_user_name: string;
455 other_user_name: string;
458 export interface LoginForm {
459 username_or_email: string;
463 export interface RegisterForm {
467 password_verify: string;
472 export interface LoginResponse {
477 export interface UserSettingsForm {
480 default_sort_type: SortType;
481 default_listing_type: ListingType;
487 export interface CommunityForm {
490 description?: string;
501 export interface GetCommunityResponse {
503 community: Community;
504 moderators: Array<CommunityUser>;
505 admins: Array<UserView>;
508 export interface CommunityResponse {
510 community: Community;
513 export interface ListCommunitiesForm {
520 export interface ListCommunitiesResponse {
522 communities: Array<Community>;
525 export interface ListCategoriesResponse {
527 categories: Array<Category>;
530 export interface PostForm {
534 community_id: number;
547 export interface PostFormParams {
554 export interface GetPostResponse {
557 comments: Array<Comment>;
558 community: Community;
559 moderators: Array<CommunityUser>;
560 admins: Array<UserView>;
563 export interface SavePostForm {
569 export interface PostResponse {
574 export interface CommentForm {
587 export interface SaveCommentForm {
593 export interface CommentResponse {
598 export interface CommentLikeForm {
605 export interface CommentNode {
607 children?: Array<CommentNode>;
610 export interface GetPostsForm {
615 community_id?: number;
619 export interface GetPostsResponse {
624 export interface CreatePostLikeForm {
630 export interface CreatePostLikeResponse {
635 export interface SiteForm {
637 description?: string;
638 enable_downvotes: boolean;
639 open_registration: boolean;
640 enable_nsfw: boolean;
644 export interface GetSiteResponse {
647 admins: Array<UserView>;
648 banned: Array<UserView>;
652 export interface SiteResponse {
657 export interface BanUserForm {
665 export interface BanUserResponse {
671 export interface AddAdminForm {
677 export interface AddAdminResponse {
679 admins: Array<UserView>;
682 export interface SearchForm {
685 community_id?: number;
691 export interface SearchResponse {
695 comments?: Array<Comment>;
696 communities: Array<Community>;
697 users: Array<UserView>;
700 export interface DeleteAccountForm {
704 export interface PasswordResetForm {
708 export interface PasswordResetResponse {
712 export interface PasswordChangeForm {
715 password_verify: string;