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
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 {
28 export interface UserView {
33 number_of_posts: number;
35 number_of_comments: number;
36 comment_score: number;
39 export interface CommunityUser {
44 community_name: string;
48 export interface Community {
61 category_name: string;
62 number_of_subscribers: number;
63 number_of_posts: number;
64 number_of_comments: number;
69 export interface Post {
83 community_name: string;
84 community_removed: boolean;
85 community_deleted: boolean;
86 community_nsfw: boolean;
87 number_of_comments: number;
99 export interface Comment {
110 community_id: number,
112 banned_from_community: boolean;
113 creator_name: string;
122 export interface Category {
127 export interface Site {
130 description?: string;
134 creator_name: string;
135 number_of_users: number;
136 number_of_posts: number;
137 number_of_comments: number;
140 export interface FollowCommunityForm {
141 community_id: number;
146 export interface GetFollowedCommunitiesResponse {
148 communities: Array<CommunityUser>;
151 export interface GetUserDetailsForm {
157 community_id?: number;
161 export interface UserDetailsResponse {
164 follows: Array<CommunityUser>;
165 moderates: Array<CommunityUser>;
166 comments: Array<Comment>;
170 export interface GetRepliesForm {
171 sort: string; // TODO figure this one out
174 unread_only: boolean;
178 export interface GetRepliesResponse {
180 replies: Array<Comment>;
183 export interface BanFromCommunityForm {
184 community_id: number;
192 export interface BanFromCommunityResponse {
198 export interface AddModToCommunityForm {
199 community_id: number;
205 export interface AddModToCommunityResponse {
207 moderators: Array<CommunityUser>;
210 export interface GetModlogForm {
211 mod_user_id?: number;
212 community_id?: number;
217 export interface GetModlogResponse {
219 removed_posts: Array<ModRemovePost>,
220 locked_posts: Array<ModLockPost>,
221 removed_comments: Array<ModRemoveComment>,
222 removed_communities: Array<ModRemoveCommunity>,
223 banned_from_community: Array<ModBanFromCommunity>,
224 banned: Array<ModBan>,
225 added_to_community: Array<ModAddCommunity>,
226 added: Array<ModAdd>,
229 export interface ModRemovePost {
236 mod_user_name: string;
238 community_id: number;
239 community_name: string;
242 export interface ModLockPost {
248 mod_user_name: string,
250 community_id: number,
251 community_name: string,
254 export interface ModRemoveComment {
261 mod_user_name: string,
262 comment_user_id: number,
263 comment_user_name: string,
264 comment_content: string,
267 community_id: number,
268 community_name: string,
271 export interface ModRemoveCommunity {
274 community_id: number,
279 mod_user_name: string,
280 community_name: string,
283 export interface ModBanFromCommunity {
286 other_user_id: number,
287 community_id: number,
292 mod_user_name: string,
293 other_user_name: string,
294 community_name: string,
297 export interface ModBan {
300 other_user_id: number,
305 mod_user_name: string,
306 other_user_name: string,
309 export interface ModAddCommunity {
312 other_user_id: number,
313 community_id: number,
316 mod_user_name: string,
317 other_user_name: string,
318 community_name: string,
321 export interface ModAdd {
324 other_user_id: number,
327 mod_user_name: string,
328 other_user_name: string,
331 export interface LoginForm {
332 username_or_email: string;
336 export interface RegisterForm {
340 password_verify: string;
345 export interface LoginResponse {
350 export interface UserSettingsForm {
355 export interface CommunityForm {
358 description?: string,
369 export interface GetCommunityResponse {
371 community: Community;
372 moderators: Array<CommunityUser>;
373 admins: Array<UserView>;
377 export interface CommunityResponse {
379 community: Community;
382 export interface ListCommunitiesForm {
389 export interface ListCommunitiesResponse {
391 communities: Array<Community>;
394 export interface ListCategoriesResponse {
396 categories: Array<Category>;
399 export interface PostForm {
403 community_id: number;
415 export interface PostFormParams {
422 export interface GetPostResponse {
425 comments: Array<Comment>;
426 community: Community;
427 moderators: Array<CommunityUser>;
428 admins: Array<UserView>;
431 export interface SavePostForm {
437 export interface PostResponse {
442 export interface CommentForm {
455 export interface SaveCommentForm {
461 export interface CommentResponse {
466 export interface CommentLikeForm {
473 export interface CommentNode {
475 children?: Array<CommentNode>;
478 export interface GetPostsForm {
483 community_id?: number;
487 export interface GetPostsResponse {
492 export interface CreatePostLikeForm {
498 export interface CreatePostLikeResponse {
503 export interface SiteForm {
505 description?: string,
512 export interface GetSiteResponse {
515 admins: Array<UserView>;
516 banned: Array<UserView>;
520 export interface SiteResponse {
525 export interface BanUserForm {
533 export interface BanUserResponse {
539 export interface AddAdminForm {
545 export interface AddAdminResponse {
547 admins: Array<UserView>;
550 export interface SearchForm {
553 community_id?: number;
559 export interface SearchResponse {
563 comments?: Array<Comment>;
564 communities: Array<Community>;
565 users: Array<UserView>;