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;
85 export interface UserView {
90 number_of_posts: number;
92 number_of_comments: number;
93 comment_score: number;
97 export interface CommunityUser {
101 community_id: number;
102 community_name: string;
106 export interface Community {
110 description?: string;
118 creator_name: string;
119 category_name: string;
120 number_of_subscribers: number;
121 number_of_posts: number;
122 number_of_comments: number;
124 subscribed?: boolean;
127 export interface Post {
133 community_id: number;
140 banned_from_community: boolean;
143 creator_name: string;
144 community_name: string;
145 community_removed: boolean;
146 community_deleted: boolean;
147 community_nsfw: boolean;
148 number_of_comments: number;
155 subscribed?: boolean;
160 export interface Comment {
171 community_id: number;
173 banned_from_community: boolean;
174 creator_name: string;
181 user_mention_id?: number; // For mention type
182 recipient_id?: number;
185 export interface Category {
190 export interface Site {
193 description?: string;
197 creator_name: string;
198 number_of_users: number;
199 number_of_posts: number;
200 number_of_comments: number;
201 number_of_communities: number;
202 enable_downvotes: boolean;
203 open_registration: boolean;
204 enable_nsfw: boolean;
207 export enum BanType {
212 export interface FollowCommunityForm {
213 community_id: number;
218 export interface GetFollowedCommunitiesResponse {
220 communities: Array<CommunityUser>;
223 export interface GetUserDetailsForm {
229 community_id?: number;
233 export interface UserDetailsResponse {
236 follows: Array<CommunityUser>;
237 moderates: Array<CommunityUser>;
238 comments: Array<Comment>;
240 admins: Array<UserView>;
243 export interface GetRepliesForm {
247 unread_only: boolean;
251 export interface GetRepliesResponse {
253 replies: Array<Comment>;
256 export interface GetUserMentionsForm {
260 unread_only: boolean;
264 export interface GetUserMentionsResponse {
266 mentions: Array<Comment>;
269 export interface EditUserMentionForm {
270 user_mention_id: number;
275 export interface UserMentionResponse {
280 export interface BanFromCommunityForm {
281 community_id: number;
289 export interface BanFromCommunityResponse {
295 export interface AddModToCommunityForm {
296 community_id: number;
302 export interface TransferCommunityForm {
303 community_id: number;
308 export interface TransferSiteForm {
313 export interface AddModToCommunityResponse {
315 moderators: Array<CommunityUser>;
318 export interface GetModlogForm {
319 mod_user_id?: number;
320 community_id?: number;
325 export interface GetModlogResponse {
327 removed_posts: Array<ModRemovePost>;
328 locked_posts: Array<ModLockPost>;
329 stickied_posts: Array<ModStickyPost>;
330 removed_comments: Array<ModRemoveComment>;
331 removed_communities: Array<ModRemoveCommunity>;
332 banned_from_community: Array<ModBanFromCommunity>;
333 banned: Array<ModBan>;
334 added_to_community: Array<ModAddCommunity>;
335 added: Array<ModAdd>;
338 export interface ModRemovePost {
345 mod_user_name: string;
347 community_id: number;
348 community_name: string;
351 export interface ModLockPost {
357 mod_user_name: string;
359 community_id: number;
360 community_name: string;
363 export interface ModStickyPost {
369 mod_user_name: string;
371 community_id: number;
372 community_name: string;
375 export interface ModRemoveComment {
382 mod_user_name: string;
383 comment_user_id: number;
384 comment_user_name: string;
385 comment_content: string;
388 community_id: number;
389 community_name: string;
392 export interface ModRemoveCommunity {
395 community_id: number;
400 mod_user_name: string;
401 community_name: string;
404 export interface ModBanFromCommunity {
407 other_user_id: number;
408 community_id: number;
413 mod_user_name: string;
414 other_user_name: string;
415 community_name: string;
418 export interface ModBan {
421 other_user_id: number;
426 mod_user_name: string;
427 other_user_name: string;
430 export interface ModAddCommunity {
433 other_user_id: number;
434 community_id: number;
437 mod_user_name: string;
438 other_user_name: string;
439 community_name: string;
442 export interface ModAdd {
445 other_user_id: number;
448 mod_user_name: string;
449 other_user_name: string;
452 export interface LoginForm {
453 username_or_email: string;
457 export interface RegisterForm {
461 password_verify: string;
466 export interface LoginResponse {
471 export interface UserSettingsForm {
474 default_sort_type: SortType;
475 default_listing_type: ListingType;
480 export interface CommunityForm {
483 description?: string;
494 export interface GetCommunityResponse {
496 community: Community;
497 moderators: Array<CommunityUser>;
498 admins: Array<UserView>;
501 export interface CommunityResponse {
503 community: Community;
506 export interface ListCommunitiesForm {
513 export interface ListCommunitiesResponse {
515 communities: Array<Community>;
518 export interface ListCategoriesResponse {
520 categories: Array<Category>;
523 export interface PostForm {
527 community_id: number;
540 export interface PostFormParams {
547 export interface GetPostResponse {
550 comments: Array<Comment>;
551 community: Community;
552 moderators: Array<CommunityUser>;
553 admins: Array<UserView>;
556 export interface SavePostForm {
562 export interface PostResponse {
567 export interface CommentForm {
580 export interface SaveCommentForm {
586 export interface CommentResponse {
591 export interface CommentLikeForm {
598 export interface CommentNode {
600 children?: Array<CommentNode>;
603 export interface GetPostsForm {
608 community_id?: number;
612 export interface GetPostsResponse {
617 export interface CreatePostLikeForm {
623 export interface CreatePostLikeResponse {
628 export interface SiteForm {
630 description?: string;
631 enable_downvotes: boolean;
632 open_registration: boolean;
633 enable_nsfw: boolean;
637 export interface GetSiteResponse {
640 admins: Array<UserView>;
641 banned: Array<UserView>;
645 export interface SiteResponse {
650 export interface BanUserForm {
658 export interface BanUserResponse {
664 export interface AddAdminForm {
670 export interface AddAdminResponse {
672 admins: Array<UserView>;
675 export interface SearchForm {
678 community_id?: number;
684 export interface SearchResponse {
688 comments?: Array<Comment>;
689 communities: Array<Community>;
690 users: Array<UserView>;
693 export interface DeleteAccountForm {
697 export interface PasswordResetForm {
701 export interface PasswordResetResponse {
705 export interface PasswordChangeForm {
708 password_verify: string;