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;
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 TransferCommunityForm {
206 community_id: number;
211 export interface TransferSiteForm {
216 export interface AddModToCommunityResponse {
218 moderators: Array<CommunityUser>;
221 export interface GetModlogForm {
222 mod_user_id?: number;
223 community_id?: number;
228 export interface GetModlogResponse {
230 removed_posts: Array<ModRemovePost>,
231 locked_posts: Array<ModLockPost>,
232 removed_comments: Array<ModRemoveComment>,
233 removed_communities: Array<ModRemoveCommunity>,
234 banned_from_community: Array<ModBanFromCommunity>,
235 banned: Array<ModBan>,
236 added_to_community: Array<ModAddCommunity>,
237 added: Array<ModAdd>,
240 export interface ModRemovePost {
247 mod_user_name: string;
249 community_id: number;
250 community_name: string;
253 export interface ModLockPost {
259 mod_user_name: string,
261 community_id: number,
262 community_name: string,
265 export interface ModRemoveComment {
272 mod_user_name: string,
273 comment_user_id: number,
274 comment_user_name: string,
275 comment_content: string,
278 community_id: number,
279 community_name: string,
282 export interface ModRemoveCommunity {
285 community_id: number,
290 mod_user_name: string,
291 community_name: string,
294 export interface ModBanFromCommunity {
297 other_user_id: number,
298 community_id: number,
303 mod_user_name: string,
304 other_user_name: string,
305 community_name: string,
308 export interface ModBan {
311 other_user_id: number,
316 mod_user_name: string,
317 other_user_name: string,
320 export interface ModAddCommunity {
323 other_user_id: number,
324 community_id: number,
327 mod_user_name: string,
328 other_user_name: string,
329 community_name: string,
332 export interface ModAdd {
335 other_user_id: number,
338 mod_user_name: string,
339 other_user_name: string,
342 export interface LoginForm {
343 username_or_email: string;
347 export interface RegisterForm {
351 password_verify: string;
356 export interface LoginResponse {
361 export interface UserSettingsForm {
366 export interface CommunityForm {
369 description?: string,
380 export interface GetCommunityResponse {
382 community: Community;
383 moderators: Array<CommunityUser>;
384 admins: Array<UserView>;
388 export interface CommunityResponse {
390 community: Community;
393 export interface ListCommunitiesForm {
400 export interface ListCommunitiesResponse {
402 communities: Array<Community>;
405 export interface ListCategoriesResponse {
407 categories: Array<Category>;
410 export interface PostForm {
414 community_id: number;
426 export interface PostFormParams {
433 export interface GetPostResponse {
436 comments: Array<Comment>;
437 community: Community;
438 moderators: Array<CommunityUser>;
439 admins: Array<UserView>;
442 export interface SavePostForm {
448 export interface PostResponse {
453 export interface CommentForm {
466 export interface SaveCommentForm {
472 export interface CommentResponse {
477 export interface CommentLikeForm {
484 export interface CommentNode {
486 children?: Array<CommentNode>;
489 export interface GetPostsForm {
494 community_id?: number;
498 export interface GetPostsResponse {
503 export interface CreatePostLikeForm {
509 export interface CreatePostLikeResponse {
514 export interface SiteForm {
516 description?: string,
523 export interface GetSiteResponse {
526 admins: Array<UserView>;
527 banned: Array<UserView>;
531 export interface SiteResponse {
536 export interface BanUserForm {
544 export interface BanUserResponse {
550 export interface AddAdminForm {
556 export interface AddAdminResponse {
558 admins: Array<UserView>;
561 export interface SearchForm {
564 community_id?: number;
570 export interface SearchResponse {
574 comments?: Array<Comment>;
575 communities: Array<Community>;
576 users: Array<UserView>;