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>;
175 admins: Array<UserView>;
178 export interface GetRepliesForm {
179 sort: string; // TODO figure this one out
182 unread_only: boolean;
186 export interface GetRepliesResponse {
188 replies: Array<Comment>;
191 export interface BanFromCommunityForm {
192 community_id: number;
200 export interface BanFromCommunityResponse {
206 export interface AddModToCommunityForm {
207 community_id: number;
213 export interface TransferCommunityForm {
214 community_id: number;
219 export interface TransferSiteForm {
224 export interface AddModToCommunityResponse {
226 moderators: Array<CommunityUser>;
229 export interface GetModlogForm {
230 mod_user_id?: number;
231 community_id?: number;
236 export interface GetModlogResponse {
238 removed_posts: Array<ModRemovePost>,
239 locked_posts: Array<ModLockPost>,
240 stickied_posts: Array<ModStickyPost>,
241 removed_comments: Array<ModRemoveComment>,
242 removed_communities: Array<ModRemoveCommunity>,
243 banned_from_community: Array<ModBanFromCommunity>,
244 banned: Array<ModBan>,
245 added_to_community: Array<ModAddCommunity>,
246 added: Array<ModAdd>,
249 export interface ModRemovePost {
256 mod_user_name: string;
258 community_id: number;
259 community_name: string;
262 export interface ModLockPost {
268 mod_user_name: string,
270 community_id: number,
271 community_name: string,
274 export interface ModStickyPost {
280 mod_user_name: string,
282 community_id: number,
283 community_name: string,
286 export interface ModRemoveComment {
293 mod_user_name: string,
294 comment_user_id: number,
295 comment_user_name: string,
296 comment_content: string,
299 community_id: number,
300 community_name: string,
303 export interface ModRemoveCommunity {
306 community_id: number,
311 mod_user_name: string,
312 community_name: string,
315 export interface ModBanFromCommunity {
318 other_user_id: number,
319 community_id: number,
324 mod_user_name: string,
325 other_user_name: string,
326 community_name: string,
329 export interface ModBan {
332 other_user_id: number,
337 mod_user_name: string,
338 other_user_name: string,
341 export interface ModAddCommunity {
344 other_user_id: number,
345 community_id: number,
348 mod_user_name: string,
349 other_user_name: string,
350 community_name: string,
353 export interface ModAdd {
356 other_user_id: number,
359 mod_user_name: string,
360 other_user_name: string,
363 export interface LoginForm {
364 username_or_email: string;
368 export interface RegisterForm {
372 password_verify: string;
377 export interface LoginResponse {
382 export interface UserSettingsForm {
387 export interface CommunityForm {
390 description?: string,
401 export interface GetCommunityResponse {
403 community: Community;
404 moderators: Array<CommunityUser>;
405 admins: Array<UserView>;
409 export interface CommunityResponse {
411 community: Community;
414 export interface ListCommunitiesForm {
421 export interface ListCommunitiesResponse {
423 communities: Array<Community>;
426 export interface ListCategoriesResponse {
428 categories: Array<Category>;
431 export interface PostForm {
435 community_id: number;
448 export interface PostFormParams {
455 export interface GetPostResponse {
458 comments: Array<Comment>;
459 community: Community;
460 moderators: Array<CommunityUser>;
461 admins: Array<UserView>;
464 export interface SavePostForm {
470 export interface PostResponse {
475 export interface CommentForm {
488 export interface SaveCommentForm {
494 export interface CommentResponse {
499 export interface CommentLikeForm {
506 export interface CommentNode {
508 children?: Array<CommentNode>;
511 export interface GetPostsForm {
516 community_id?: number;
520 export interface GetPostsResponse {
525 export interface CreatePostLikeForm {
531 export interface CreatePostLikeResponse {
536 export interface SiteForm {
538 description?: string,
545 export interface GetSiteResponse {
548 admins: Array<UserView>;
549 banned: Array<UserView>;
554 export interface SiteResponse {
559 export interface BanUserForm {
567 export interface BanUserResponse {
573 export interface AddAdminForm {
579 export interface AddAdminResponse {
581 admins: Array<UserView>;
584 export interface SearchForm {
587 community_id?: number;
593 export interface SearchResponse {
597 comments?: Array<Comment>;
598 communities: Array<Community>;
599 users: Array<UserView>;