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 {
82 banned_from_community: boolean;
86 community_name: string;
87 community_removed: boolean;
88 community_deleted: boolean;
89 community_nsfw: boolean;
90 number_of_comments: number;
102 export interface Comment {
113 community_id: number,
115 banned_from_community: boolean;
116 creator_name: string;
125 export interface Category {
130 export interface Site {
133 description?: string;
137 creator_name: string;
138 number_of_users: number;
139 number_of_posts: number;
140 number_of_comments: number;
141 number_of_communities: number;
144 export enum BanType {Community, Site};
146 export interface FollowCommunityForm {
147 community_id: number;
152 export interface GetFollowedCommunitiesResponse {
154 communities: Array<CommunityUser>;
157 export interface GetUserDetailsForm {
163 community_id?: number;
167 export interface UserDetailsResponse {
170 follows: Array<CommunityUser>;
171 moderates: Array<CommunityUser>;
172 comments: Array<Comment>;
176 export interface GetRepliesForm {
177 sort: string; // TODO figure this one out
180 unread_only: boolean;
184 export interface GetRepliesResponse {
186 replies: Array<Comment>;
189 export interface BanFromCommunityForm {
190 community_id: number;
198 export interface BanFromCommunityResponse {
204 export interface AddModToCommunityForm {
205 community_id: number;
211 export interface TransferCommunityForm {
212 community_id: number;
217 export interface TransferSiteForm {
222 export interface AddModToCommunityResponse {
224 moderators: Array<CommunityUser>;
227 export interface GetModlogForm {
228 mod_user_id?: number;
229 community_id?: number;
234 export interface GetModlogResponse {
236 removed_posts: Array<ModRemovePost>,
237 locked_posts: Array<ModLockPost>,
238 removed_comments: Array<ModRemoveComment>,
239 removed_communities: Array<ModRemoveCommunity>,
240 banned_from_community: Array<ModBanFromCommunity>,
241 banned: Array<ModBan>,
242 added_to_community: Array<ModAddCommunity>,
243 added: Array<ModAdd>,
246 export interface ModRemovePost {
253 mod_user_name: string;
255 community_id: number;
256 community_name: string;
259 export interface ModLockPost {
265 mod_user_name: string,
267 community_id: number,
268 community_name: string,
271 export interface ModRemoveComment {
278 mod_user_name: string,
279 comment_user_id: number,
280 comment_user_name: string,
281 comment_content: string,
284 community_id: number,
285 community_name: string,
288 export interface ModRemoveCommunity {
291 community_id: number,
296 mod_user_name: string,
297 community_name: string,
300 export interface ModBanFromCommunity {
303 other_user_id: number,
304 community_id: number,
309 mod_user_name: string,
310 other_user_name: string,
311 community_name: string,
314 export interface ModBan {
317 other_user_id: number,
322 mod_user_name: string,
323 other_user_name: string,
326 export interface ModAddCommunity {
329 other_user_id: number,
330 community_id: number,
333 mod_user_name: string,
334 other_user_name: string,
335 community_name: string,
338 export interface ModAdd {
341 other_user_id: number,
344 mod_user_name: string,
345 other_user_name: string,
348 export interface LoginForm {
349 username_or_email: string;
353 export interface RegisterForm {
357 password_verify: string;
362 export interface LoginResponse {
367 export interface UserSettingsForm {
372 export interface CommunityForm {
375 description?: string,
386 export interface GetCommunityResponse {
388 community: Community;
389 moderators: Array<CommunityUser>;
390 admins: Array<UserView>;
394 export interface CommunityResponse {
396 community: Community;
399 export interface ListCommunitiesForm {
406 export interface ListCommunitiesResponse {
408 communities: Array<Community>;
411 export interface ListCategoriesResponse {
413 categories: Array<Category>;
416 export interface PostForm {
420 community_id: number;
432 export interface PostFormParams {
439 export interface GetPostResponse {
442 comments: Array<Comment>;
443 community: Community;
444 moderators: Array<CommunityUser>;
445 admins: Array<UserView>;
448 export interface SavePostForm {
454 export interface PostResponse {
459 export interface CommentForm {
472 export interface SaveCommentForm {
478 export interface CommentResponse {
483 export interface CommentLikeForm {
490 export interface CommentNode {
492 children?: Array<CommentNode>;
495 export interface GetPostsForm {
500 community_id?: number;
504 export interface GetPostsResponse {
509 export interface CreatePostLikeForm {
515 export interface CreatePostLikeResponse {
520 export interface SiteForm {
522 description?: string,
529 export interface GetSiteResponse {
532 admins: Array<UserView>;
533 banned: Array<UserView>;
537 export interface SiteResponse {
542 export interface BanUserForm {
550 export interface BanUserResponse {
556 export interface AddAdminForm {
562 export interface AddAdminResponse {
564 admins: Array<UserView>;
567 export interface SearchForm {
570 community_id?: number;
576 export interface SearchResponse {
580 comments?: Array<Comment>;
581 communities: Array<Community>;
582 users: Array<UserView>;