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;
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;
138 number_of_communities: number;
141 export interface FollowCommunityForm {
142 community_id: number;
147 export interface GetFollowedCommunitiesResponse {
149 communities: Array<CommunityUser>;
152 export interface GetUserDetailsForm {
158 community_id?: number;
162 export interface UserDetailsResponse {
165 follows: Array<CommunityUser>;
166 moderates: Array<CommunityUser>;
167 comments: Array<Comment>;
171 export interface GetRepliesForm {
172 sort: string; // TODO figure this one out
175 unread_only: boolean;
179 export interface GetRepliesResponse {
181 replies: Array<Comment>;
184 export interface BanFromCommunityForm {
185 community_id: number;
193 export interface BanFromCommunityResponse {
199 export interface AddModToCommunityForm {
200 community_id: number;
206 export interface TransferCommunityForm {
207 community_id: number;
212 export interface TransferSiteForm {
217 export interface AddModToCommunityResponse {
219 moderators: Array<CommunityUser>;
222 export interface GetModlogForm {
223 mod_user_id?: number;
224 community_id?: number;
229 export interface GetModlogResponse {
231 removed_posts: Array<ModRemovePost>,
232 locked_posts: Array<ModLockPost>,
233 removed_comments: Array<ModRemoveComment>,
234 removed_communities: Array<ModRemoveCommunity>,
235 banned_from_community: Array<ModBanFromCommunity>,
236 banned: Array<ModBan>,
237 added_to_community: Array<ModAddCommunity>,
238 added: Array<ModAdd>,
241 export interface ModRemovePost {
248 mod_user_name: string;
250 community_id: number;
251 community_name: string;
254 export interface ModLockPost {
260 mod_user_name: string,
262 community_id: number,
263 community_name: string,
266 export interface ModRemoveComment {
273 mod_user_name: string,
274 comment_user_id: number,
275 comment_user_name: string,
276 comment_content: string,
279 community_id: number,
280 community_name: string,
283 export interface ModRemoveCommunity {
286 community_id: number,
291 mod_user_name: string,
292 community_name: string,
295 export interface ModBanFromCommunity {
298 other_user_id: number,
299 community_id: number,
304 mod_user_name: string,
305 other_user_name: string,
306 community_name: string,
309 export interface ModBan {
312 other_user_id: number,
317 mod_user_name: string,
318 other_user_name: string,
321 export interface ModAddCommunity {
324 other_user_id: number,
325 community_id: number,
328 mod_user_name: string,
329 other_user_name: string,
330 community_name: string,
333 export interface ModAdd {
336 other_user_id: number,
339 mod_user_name: string,
340 other_user_name: string,
343 export interface LoginForm {
344 username_or_email: string;
348 export interface RegisterForm {
352 password_verify: string;
357 export interface LoginResponse {
362 export interface UserSettingsForm {
367 export interface CommunityForm {
370 description?: string,
381 export interface GetCommunityResponse {
383 community: Community;
384 moderators: Array<CommunityUser>;
385 admins: Array<UserView>;
389 export interface CommunityResponse {
391 community: Community;
394 export interface ListCommunitiesForm {
401 export interface ListCommunitiesResponse {
403 communities: Array<Community>;
406 export interface ListCategoriesResponse {
408 categories: Array<Category>;
411 export interface PostForm {
415 community_id: number;
427 export interface PostFormParams {
434 export interface GetPostResponse {
437 comments: Array<Comment>;
438 community: Community;
439 moderators: Array<CommunityUser>;
440 admins: Array<UserView>;
443 export interface SavePostForm {
449 export interface PostResponse {
454 export interface CommentForm {
467 export interface SaveCommentForm {
473 export interface CommentResponse {
478 export interface CommentLikeForm {
485 export interface CommentNode {
487 children?: Array<CommentNode>;
490 export interface GetPostsForm {
495 community_id?: number;
499 export interface GetPostsResponse {
504 export interface CreatePostLikeForm {
510 export interface CreatePostLikeResponse {
515 export interface SiteForm {
517 description?: string,
524 export interface GetSiteResponse {
527 admins: Array<UserView>;
528 banned: Array<UserView>;
532 export interface SiteResponse {
537 export interface BanUserForm {
545 export interface BanUserResponse {
551 export interface AddAdminForm {
557 export interface AddAdminResponse {
559 admins: Array<UserView>;
562 export interface SearchForm {
565 community_id?: number;
571 export interface SearchResponse {
575 comments?: Array<Comment>;
576 communities: Array<Community>;
577 users: Array<UserView>;