1 export enum UserOperation {
2 Login, Register, CreateCommunity, CreatePost, ListCommunities, ListCategories, GetPost, GetCommunity, CreateComment, EditComment, SaveComment, CreateCommentLike, GetPosts, CreatePostLike, EditPost, SavePost, EditCommunity, FollowCommunity, GetFollowedCommunities, GetUserDetails, GetReplies, GetModlog, BanFromCommunity, AddModToCommunity, CreateSite, EditSite, GetSite, AddAdmin, BanUser, Search, MarkAllAsRead, SaveUserSettings, TransferCommunity, TransferSite
5 export enum CommentSortType {
9 export enum ListingType {
10 All, Subscribed, Community
13 export enum SortType {
14 Hot, New, TopDay, TopWeek, TopMonth, TopYear, TopAll
17 export enum SearchType {
18 All, Comments, Posts, Communities, Users, Url
21 export interface User {
29 export interface UserView {
34 number_of_posts: number;
36 number_of_comments: number;
37 comment_score: number;
41 export interface CommunityUser {
46 community_name: string;
50 export interface Community {
63 category_name: string;
64 number_of_subscribers: number;
65 number_of_posts: number;
66 number_of_comments: number;
71 export interface Post {
84 banned_from_community: boolean;
88 community_name: string;
89 community_removed: boolean;
90 community_deleted: boolean;
91 community_nsfw: boolean;
92 number_of_comments: number;
104 export interface Comment {
115 community_id: number,
117 banned_from_community: boolean;
118 creator_name: string;
127 export interface Category {
132 export interface Site {
135 description?: string;
139 creator_name: string;
140 number_of_users: number;
141 number_of_posts: number;
142 number_of_comments: number;
143 number_of_communities: number;
146 export enum BanType {Community, Site};
148 export interface FollowCommunityForm {
149 community_id: number;
154 export interface GetFollowedCommunitiesResponse {
156 communities: Array<CommunityUser>;
159 export interface GetUserDetailsForm {
165 community_id?: number;
169 export interface UserDetailsResponse {
172 follows: Array<CommunityUser>;
173 moderates: Array<CommunityUser>;
174 comments: Array<Comment>;
176 admins: Array<UserView>;
179 export interface GetRepliesForm {
180 sort: string; // TODO figure this one out
183 unread_only: boolean;
187 export interface GetRepliesResponse {
189 replies: Array<Comment>;
192 export interface BanFromCommunityForm {
193 community_id: number;
201 export interface BanFromCommunityResponse {
207 export interface AddModToCommunityForm {
208 community_id: number;
214 export interface TransferCommunityForm {
215 community_id: number;
220 export interface TransferSiteForm {
225 export interface AddModToCommunityResponse {
227 moderators: Array<CommunityUser>;
230 export interface GetModlogForm {
231 mod_user_id?: number;
232 community_id?: number;
237 export interface GetModlogResponse {
239 removed_posts: Array<ModRemovePost>,
240 locked_posts: Array<ModLockPost>,
241 stickied_posts: Array<ModStickyPost>,
242 removed_comments: Array<ModRemoveComment>,
243 removed_communities: Array<ModRemoveCommunity>,
244 banned_from_community: Array<ModBanFromCommunity>,
245 banned: Array<ModBan>,
246 added_to_community: Array<ModAddCommunity>,
247 added: Array<ModAdd>,
250 export interface ModRemovePost {
257 mod_user_name: string;
259 community_id: number;
260 community_name: string;
263 export interface ModLockPost {
269 mod_user_name: string,
271 community_id: number,
272 community_name: string,
275 export interface ModStickyPost {
281 mod_user_name: string,
283 community_id: number,
284 community_name: string,
287 export interface ModRemoveComment {
294 mod_user_name: string,
295 comment_user_id: number,
296 comment_user_name: string,
297 comment_content: string,
300 community_id: number,
301 community_name: string,
304 export interface ModRemoveCommunity {
307 community_id: number,
312 mod_user_name: string,
313 community_name: string,
316 export interface ModBanFromCommunity {
319 other_user_id: number,
320 community_id: number,
325 mod_user_name: string,
326 other_user_name: string,
327 community_name: string,
330 export interface ModBan {
333 other_user_id: number,
338 mod_user_name: string,
339 other_user_name: string,
342 export interface ModAddCommunity {
345 other_user_id: number,
346 community_id: number,
349 mod_user_name: string,
350 other_user_name: string,
351 community_name: string,
354 export interface ModAdd {
357 other_user_id: number,
360 mod_user_name: string,
361 other_user_name: string,
364 export interface LoginForm {
365 username_or_email: string;
369 export interface RegisterForm {
373 password_verify: string;
378 export interface LoginResponse {
383 export interface UserSettingsForm {
389 export interface CommunityForm {
392 description?: string,
403 export interface GetCommunityResponse {
405 community: Community;
406 moderators: Array<CommunityUser>;
407 admins: Array<UserView>;
411 export interface CommunityResponse {
413 community: Community;
416 export interface ListCommunitiesForm {
423 export interface ListCommunitiesResponse {
425 communities: Array<Community>;
428 export interface ListCategoriesResponse {
430 categories: Array<Category>;
433 export interface PostForm {
437 community_id: number;
450 export interface PostFormParams {
457 export interface GetPostResponse {
460 comments: Array<Comment>;
461 community: Community;
462 moderators: Array<CommunityUser>;
463 admins: Array<UserView>;
466 export interface SavePostForm {
472 export interface PostResponse {
477 export interface CommentForm {
490 export interface SaveCommentForm {
496 export interface CommentResponse {
501 export interface CommentLikeForm {
508 export interface CommentNode {
510 children?: Array<CommentNode>;
513 export interface GetPostsForm {
518 community_id?: number;
522 export interface GetPostsResponse {
527 export interface CreatePostLikeForm {
533 export interface CreatePostLikeResponse {
538 export interface SiteForm {
540 description?: string,
547 export interface GetSiteResponse {
550 admins: Array<UserView>;
551 banned: Array<UserView>;
556 export interface SiteResponse {
561 export interface BanUserForm {
569 export interface BanUserResponse {
575 export interface AddAdminForm {
581 export interface AddAdminResponse {
583 admins: Array<UserView>;
586 export interface SearchForm {
589 community_id?: number;
595 export interface SearchResponse {
599 comments?: Array<Comment>;
600 communities: Array<Community>;
601 users: Array<UserView>;