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 {
28 export interface UserView {
33 number_of_posts: number;
35 number_of_comments: number;
36 comment_score: number;
40 export interface CommunityUser {
45 community_name: string;
49 export interface Community {
62 category_name: string;
63 number_of_subscribers: number;
64 number_of_posts: number;
65 number_of_comments: number;
70 export interface Post {
83 banned_from_community: boolean;
87 community_name: string;
88 community_removed: boolean;
89 community_deleted: boolean;
90 community_nsfw: boolean;
91 number_of_comments: number;
103 export interface Comment {
114 community_id: number,
116 banned_from_community: boolean;
117 creator_name: string;
126 export interface Category {
131 export interface Site {
134 description?: string;
138 creator_name: string;
139 number_of_users: number;
140 number_of_posts: number;
141 number_of_comments: number;
142 number_of_communities: number;
145 export enum BanType {Community, Site};
147 export interface FollowCommunityForm {
148 community_id: number;
153 export interface GetFollowedCommunitiesResponse {
155 communities: Array<CommunityUser>;
158 export interface GetUserDetailsForm {
164 community_id?: number;
168 export interface UserDetailsResponse {
171 follows: Array<CommunityUser>;
172 moderates: Array<CommunityUser>;
173 comments: Array<Comment>;
177 export interface GetRepliesForm {
178 sort: string; // TODO figure this one out
181 unread_only: boolean;
185 export interface GetRepliesResponse {
187 replies: Array<Comment>;
190 export interface BanFromCommunityForm {
191 community_id: number;
199 export interface BanFromCommunityResponse {
205 export interface AddModToCommunityForm {
206 community_id: number;
212 export interface TransferCommunityForm {
213 community_id: number;
218 export interface TransferSiteForm {
223 export interface AddModToCommunityResponse {
225 moderators: Array<CommunityUser>;
228 export interface GetModlogForm {
229 mod_user_id?: number;
230 community_id?: number;
235 export interface GetModlogResponse {
237 removed_posts: Array<ModRemovePost>,
238 locked_posts: Array<ModLockPost>,
239 stickied_posts: Array<ModStickyPost>,
240 removed_comments: Array<ModRemoveComment>,
241 removed_communities: Array<ModRemoveCommunity>,
242 banned_from_community: Array<ModBanFromCommunity>,
243 banned: Array<ModBan>,
244 added_to_community: Array<ModAddCommunity>,
245 added: Array<ModAdd>,
248 export interface ModRemovePost {
255 mod_user_name: string;
257 community_id: number;
258 community_name: string;
261 export interface ModLockPost {
267 mod_user_name: string,
269 community_id: number,
270 community_name: string,
273 export interface ModStickyPost {
279 mod_user_name: string,
281 community_id: number,
282 community_name: string,
285 export interface ModRemoveComment {
292 mod_user_name: string,
293 comment_user_id: number,
294 comment_user_name: string,
295 comment_content: string,
298 community_id: number,
299 community_name: string,
302 export interface ModRemoveCommunity {
305 community_id: number,
310 mod_user_name: string,
311 community_name: string,
314 export interface ModBanFromCommunity {
317 other_user_id: number,
318 community_id: number,
323 mod_user_name: string,
324 other_user_name: string,
325 community_name: string,
328 export interface ModBan {
331 other_user_id: number,
336 mod_user_name: string,
337 other_user_name: string,
340 export interface ModAddCommunity {
343 other_user_id: number,
344 community_id: number,
347 mod_user_name: string,
348 other_user_name: string,
349 community_name: string,
352 export interface ModAdd {
355 other_user_id: number,
358 mod_user_name: string,
359 other_user_name: string,
362 export interface LoginForm {
363 username_or_email: string;
367 export interface RegisterForm {
371 password_verify: string;
376 export interface LoginResponse {
381 export interface UserSettingsForm {
386 export interface CommunityForm {
389 description?: string,
400 export interface GetCommunityResponse {
402 community: Community;
403 moderators: Array<CommunityUser>;
404 admins: Array<UserView>;
408 export interface CommunityResponse {
410 community: Community;
413 export interface ListCommunitiesForm {
420 export interface ListCommunitiesResponse {
422 communities: Array<Community>;
425 export interface ListCategoriesResponse {
427 categories: Array<Category>;
430 export interface PostForm {
434 community_id: number;
447 export interface PostFormParams {
454 export interface GetPostResponse {
457 comments: Array<Comment>;
458 community: Community;
459 moderators: Array<CommunityUser>;
460 admins: Array<UserView>;
463 export interface SavePostForm {
469 export interface PostResponse {
474 export interface CommentForm {
487 export interface SaveCommentForm {
493 export interface CommentResponse {
498 export interface CommentLikeForm {
505 export interface CommentNode {
507 children?: Array<CommentNode>;
510 export interface GetPostsForm {
515 community_id?: number;
519 export interface GetPostsResponse {
524 export interface CreatePostLikeForm {
530 export interface CreatePostLikeResponse {
535 export interface SiteForm {
537 description?: string,
544 export interface GetSiteResponse {
547 admins: Array<UserView>;
548 banned: Array<UserView>;
553 export interface SiteResponse {
558 export interface BanUserForm {
566 export interface BanUserResponse {
572 export interface AddAdminForm {
578 export interface AddAdminResponse {
580 admins: Array<UserView>;
583 export interface SearchForm {
586 community_id?: number;
592 export interface SearchResponse {
596 comments?: Array<Comment>;
597 communities: Array<Community>;
598 users: Array<UserView>;