2019-03-23 01:42:57 +00:00
|
|
|
export enum UserOperation {
|
2019-10-19 00:20:27 +00:00
|
|
|
Login,
|
|
|
|
Register,
|
|
|
|
CreateCommunity,
|
|
|
|
CreatePost,
|
|
|
|
ListCommunities,
|
|
|
|
ListCategories,
|
|
|
|
GetPost,
|
|
|
|
GetCommunity,
|
|
|
|
CreateComment,
|
|
|
|
EditComment,
|
|
|
|
SaveComment,
|
|
|
|
CreateCommentLike,
|
|
|
|
GetPosts,
|
|
|
|
CreatePostLike,
|
|
|
|
EditPost,
|
|
|
|
SavePost,
|
|
|
|
EditCommunity,
|
|
|
|
FollowCommunity,
|
|
|
|
GetFollowedCommunities,
|
|
|
|
GetUserDetails,
|
|
|
|
GetReplies,
|
2019-10-20 00:46:29 +00:00
|
|
|
GetUserMentions,
|
|
|
|
EditUserMention,
|
2019-10-19 00:20:27 +00:00
|
|
|
GetModlog,
|
|
|
|
BanFromCommunity,
|
|
|
|
AddModToCommunity,
|
|
|
|
CreateSite,
|
|
|
|
EditSite,
|
|
|
|
GetSite,
|
|
|
|
AddAdmin,
|
|
|
|
BanUser,
|
|
|
|
Search,
|
|
|
|
MarkAllAsRead,
|
|
|
|
SaveUserSettings,
|
|
|
|
TransferCommunity,
|
|
|
|
TransferSite,
|
|
|
|
DeleteAccount,
|
2019-10-30 03:35:39 +00:00
|
|
|
PasswordReset,
|
|
|
|
PasswordChange,
|
2020-01-22 21:35:29 +00:00
|
|
|
CreatePrivateMessage,
|
|
|
|
EditPrivateMessage,
|
|
|
|
GetPrivateMessages,
|
2020-01-26 17:23:28 +00:00
|
|
|
UserJoin,
|
2020-02-08 04:05:15 +00:00
|
|
|
GetComments,
|
2020-04-10 20:55:57 +00:00
|
|
|
GetSiteConfig,
|
|
|
|
SaveSiteConfig,
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export enum CommentSortType {
|
2019-10-19 00:20:27 +00:00
|
|
|
Hot,
|
|
|
|
Top,
|
|
|
|
New,
|
2020-01-28 18:52:28 +00:00
|
|
|
Old,
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export enum ListingType {
|
2019-10-19 00:20:27 +00:00
|
|
|
All,
|
|
|
|
Subscribed,
|
|
|
|
Community,
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
2020-02-08 04:05:15 +00:00
|
|
|
export enum DataType {
|
|
|
|
Post,
|
|
|
|
Comment,
|
|
|
|
}
|
|
|
|
|
2019-04-15 23:12:06 +00:00
|
|
|
export enum SortType {
|
2019-10-19 00:20:27 +00:00
|
|
|
Hot,
|
|
|
|
New,
|
|
|
|
TopDay,
|
|
|
|
TopWeek,
|
|
|
|
TopMonth,
|
|
|
|
TopYear,
|
|
|
|
TopAll,
|
2019-03-23 01:42:57 +00:00
|
|
|
}
|
|
|
|
|
2019-04-23 22:05:50 +00:00
|
|
|
export enum SearchType {
|
2019-10-19 00:20:27 +00:00
|
|
|
All,
|
|
|
|
Comments,
|
|
|
|
Posts,
|
|
|
|
Communities,
|
|
|
|
Users,
|
|
|
|
Url,
|
2019-04-23 22:05:50 +00:00
|
|
|
}
|
|
|
|
|
2019-03-23 01:42:57 +00:00
|
|
|
export interface User {
|
2019-03-25 03:51:27 +00:00
|
|
|
id: number;
|
2019-03-29 04:56:23 +00:00
|
|
|
iss: string;
|
2019-03-21 01:22:31 +00:00
|
|
|
username: string;
|
2019-08-14 02:52:43 +00:00
|
|
|
show_nsfw: boolean;
|
2019-10-15 19:21:27 +00:00
|
|
|
theme: string;
|
2019-10-21 04:21:54 +00:00
|
|
|
default_sort_type: SortType;
|
|
|
|
default_listing_type: ListingType;
|
2019-12-09 08:24:53 +00:00
|
|
|
lang: string;
|
2019-12-29 20:39:48 +00:00
|
|
|
avatar?: string;
|
2020-01-02 21:55:54 +00:00
|
|
|
show_avatars: boolean;
|
2020-02-11 15:14:09 +00:00
|
|
|
unreadCount?: number;
|
2019-03-23 01:42:57 +00:00
|
|
|
}
|
|
|
|
|
2019-04-08 05:19:02 +00:00
|
|
|
export interface UserView {
|
|
|
|
id: number;
|
2020-04-14 19:12:19 +00:00
|
|
|
actor_id: string;
|
2019-04-08 05:19:02 +00:00
|
|
|
name: string;
|
2019-12-29 20:39:48 +00:00
|
|
|
avatar?: string;
|
2020-01-01 20:46:14 +00:00
|
|
|
email?: string;
|
2020-01-22 21:35:29 +00:00
|
|
|
matrix_user_id?: string;
|
2020-04-14 19:12:19 +00:00
|
|
|
bio?: string;
|
|
|
|
local: boolean;
|
2019-04-08 05:19:02 +00:00
|
|
|
published: string;
|
|
|
|
number_of_posts: number;
|
|
|
|
post_score: number;
|
|
|
|
number_of_comments: number;
|
|
|
|
comment_score: number;
|
2019-09-06 00:18:48 +00:00
|
|
|
banned: boolean;
|
2020-01-02 21:55:54 +00:00
|
|
|
show_avatars: boolean;
|
|
|
|
send_notifications_to_email: boolean;
|
2019-04-08 05:19:02 +00:00
|
|
|
}
|
|
|
|
|
2019-04-04 20:53:32 +00:00
|
|
|
export interface CommunityUser {
|
|
|
|
id: number;
|
|
|
|
user_id: number;
|
2020-04-14 19:12:19 +00:00
|
|
|
user_actor_id: string;
|
|
|
|
user_local: boolean;
|
2019-04-04 20:53:32 +00:00
|
|
|
user_name: string;
|
2019-12-29 20:39:48 +00:00
|
|
|
avatar?: string;
|
2019-04-04 20:53:32 +00:00
|
|
|
community_id: number;
|
2020-04-14 19:12:19 +00:00
|
|
|
community_actor_id: string;
|
|
|
|
community_local: boolean;
|
2019-04-04 20:53:32 +00:00
|
|
|
community_name: string;
|
|
|
|
published: string;
|
|
|
|
}
|
|
|
|
|
2019-03-25 03:51:27 +00:00
|
|
|
export interface Community {
|
|
|
|
id: number;
|
2020-04-14 19:12:19 +00:00
|
|
|
actor_id: string;
|
|
|
|
local: boolean;
|
2019-03-25 03:51:27 +00:00
|
|
|
name: string;
|
2019-04-03 23:01:20 +00:00
|
|
|
title: string;
|
|
|
|
description?: string;
|
2019-04-20 04:06:25 +00:00
|
|
|
category_id: number;
|
2019-04-03 23:01:20 +00:00
|
|
|
creator_id: number;
|
2019-04-20 04:06:25 +00:00
|
|
|
removed: boolean;
|
2019-04-29 19:14:54 +00:00
|
|
|
deleted: boolean;
|
2019-08-14 02:52:43 +00:00
|
|
|
nsfw: boolean;
|
2019-04-20 04:06:25 +00:00
|
|
|
published: string;
|
|
|
|
updated?: string;
|
2020-04-14 19:12:19 +00:00
|
|
|
creator_actor_id: string;
|
|
|
|
creator_local: boolean;
|
|
|
|
last_refreshed_at: string;
|
2019-04-03 23:01:20 +00:00
|
|
|
creator_name: string;
|
2019-12-29 20:39:48 +00:00
|
|
|
creator_avatar?: string;
|
2019-04-03 23:01:20 +00:00
|
|
|
category_name: string;
|
|
|
|
number_of_subscribers: number;
|
|
|
|
number_of_posts: number;
|
2019-04-04 20:00:19 +00:00
|
|
|
number_of_comments: number;
|
2019-04-20 04:06:25 +00:00
|
|
|
user_id?: number;
|
|
|
|
subscribed?: boolean;
|
2019-03-26 18:00:18 +00:00
|
|
|
}
|
|
|
|
|
2019-04-15 23:12:06 +00:00
|
|
|
export interface Post {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
url?: string;
|
|
|
|
body?: string;
|
|
|
|
creator_id: number;
|
|
|
|
community_id: number;
|
2019-04-20 04:06:25 +00:00
|
|
|
removed: boolean;
|
2019-04-29 19:14:54 +00:00
|
|
|
deleted: boolean;
|
2019-04-20 04:06:25 +00:00
|
|
|
locked: boolean;
|
2019-09-09 06:14:13 +00:00
|
|
|
stickied: boolean;
|
2020-03-07 23:31:13 +00:00
|
|
|
embed_title?: string;
|
|
|
|
embed_description?: string;
|
|
|
|
embed_html?: string;
|
|
|
|
thumbnail_url?: string;
|
2020-04-14 19:12:19 +00:00
|
|
|
ap_id: string;
|
|
|
|
local: boolean;
|
2019-08-14 02:52:43 +00:00
|
|
|
nsfw: boolean;
|
2019-09-06 00:18:48 +00:00
|
|
|
banned: boolean;
|
|
|
|
banned_from_community: boolean;
|
2019-04-20 04:06:25 +00:00
|
|
|
published: string;
|
|
|
|
updated?: string;
|
2020-04-14 19:12:19 +00:00
|
|
|
creator_actor_id: string;
|
|
|
|
creator_local: boolean;
|
2019-04-20 04:06:25 +00:00
|
|
|
creator_name: string;
|
2020-07-08 00:28:47 +00:00
|
|
|
creator_published: string;
|
2019-12-29 20:39:48 +00:00
|
|
|
creator_avatar?: string;
|
2020-04-14 19:12:19 +00:00
|
|
|
community_actor_id: string;
|
|
|
|
community_local: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
community_name: string;
|
2019-04-21 20:52:55 +00:00
|
|
|
community_removed: boolean;
|
2019-08-14 02:52:43 +00:00
|
|
|
community_deleted: boolean;
|
|
|
|
community_nsfw: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
number_of_comments: number;
|
|
|
|
score: number;
|
|
|
|
upvotes: number;
|
|
|
|
downvotes: number;
|
|
|
|
hot_rank: number;
|
2020-02-08 16:16:58 +00:00
|
|
|
newest_activity_time: string;
|
2019-04-20 04:06:25 +00:00
|
|
|
user_id?: number;
|
|
|
|
my_vote?: number;
|
|
|
|
subscribed?: boolean;
|
|
|
|
read?: boolean;
|
|
|
|
saved?: boolean;
|
2020-02-04 00:52:39 +00:00
|
|
|
duplicates?: Array<Post>;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface Comment {
|
|
|
|
id: number;
|
2020-04-14 19:12:19 +00:00
|
|
|
ap_id: string;
|
|
|
|
local: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
creator_id: number;
|
2019-10-19 00:20:27 +00:00
|
|
|
post_id: number;
|
2019-04-15 23:12:06 +00:00
|
|
|
parent_id?: number;
|
2019-04-20 04:06:25 +00:00
|
|
|
content: string;
|
|
|
|
removed: boolean;
|
2019-04-29 19:14:54 +00:00
|
|
|
deleted: boolean;
|
2019-04-20 04:06:25 +00:00
|
|
|
read: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
published: string;
|
|
|
|
updated?: string;
|
2019-10-19 00:20:27 +00:00
|
|
|
community_id: number;
|
2020-04-14 19:12:19 +00:00
|
|
|
community_actor_id: string;
|
|
|
|
community_local: boolean;
|
2020-02-08 04:05:15 +00:00
|
|
|
community_name: string;
|
2019-04-20 04:06:25 +00:00
|
|
|
banned: boolean;
|
|
|
|
banned_from_community: boolean;
|
2020-04-14 19:12:19 +00:00
|
|
|
creator_actor_id: string;
|
|
|
|
creator_local: boolean;
|
2019-04-20 04:06:25 +00:00
|
|
|
creator_name: string;
|
2019-12-29 20:39:48 +00:00
|
|
|
creator_avatar?: string;
|
2020-07-08 00:28:47 +00:00
|
|
|
creator_published: string;
|
2019-04-15 23:12:06 +00:00
|
|
|
score: number;
|
|
|
|
upvotes: number;
|
|
|
|
downvotes: number;
|
2020-02-08 04:05:15 +00:00
|
|
|
hot_rank: number;
|
2019-04-20 04:06:25 +00:00
|
|
|
user_id?: number;
|
2019-04-15 23:12:06 +00:00
|
|
|
my_vote?: number;
|
2020-02-08 04:05:15 +00:00
|
|
|
subscribed?: number;
|
2019-04-20 04:06:25 +00:00
|
|
|
saved?: boolean;
|
2019-10-20 00:46:29 +00:00
|
|
|
user_mention_id?: number; // For mention type
|
|
|
|
recipient_id?: number;
|
2020-04-14 19:12:19 +00:00
|
|
|
recipient_actor_id?: string;
|
|
|
|
recipient_local?: boolean;
|
2020-03-05 20:10:46 +00:00
|
|
|
depth?: number;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface Category {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
2019-04-16 23:04:23 +00:00
|
|
|
export interface Site {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
description?: string;
|
|
|
|
creator_id: number;
|
|
|
|
published: string;
|
|
|
|
updated?: string;
|
|
|
|
creator_name: string;
|
|
|
|
number_of_users: number;
|
|
|
|
number_of_posts: number;
|
|
|
|
number_of_comments: number;
|
2019-08-29 04:28:06 +00:00
|
|
|
number_of_communities: number;
|
2019-12-11 20:21:47 +00:00
|
|
|
enable_downvotes: boolean;
|
|
|
|
open_registration: boolean;
|
|
|
|
enable_nsfw: boolean;
|
2019-04-16 23:04:23 +00:00
|
|
|
}
|
|
|
|
|
2020-01-22 21:35:29 +00:00
|
|
|
export interface PrivateMessage {
|
|
|
|
id: number;
|
|
|
|
creator_id: number;
|
|
|
|
recipient_id: number;
|
|
|
|
content: string;
|
|
|
|
deleted: boolean;
|
|
|
|
read: boolean;
|
|
|
|
published: string;
|
|
|
|
updated?: string;
|
2020-05-06 02:06:24 +00:00
|
|
|
ap_id: string;
|
|
|
|
local: boolean;
|
2020-01-22 21:35:29 +00:00
|
|
|
creator_name: string;
|
|
|
|
creator_avatar?: string;
|
2020-05-06 02:06:24 +00:00
|
|
|
creator_actor_id: string;
|
|
|
|
creator_local: boolean;
|
2020-01-22 21:35:29 +00:00
|
|
|
recipient_name: string;
|
|
|
|
recipient_avatar?: string;
|
2020-05-06 02:06:24 +00:00
|
|
|
recipient_actor_id: string;
|
|
|
|
recipient_local: boolean;
|
2020-01-22 21:35:29 +00:00
|
|
|
}
|
|
|
|
|
2019-10-19 00:20:27 +00:00
|
|
|
export enum BanType {
|
|
|
|
Community,
|
|
|
|
Site,
|
|
|
|
}
|
2019-09-06 00:18:48 +00:00
|
|
|
|
2019-04-15 23:12:06 +00:00
|
|
|
export interface FollowCommunityForm {
|
|
|
|
community_id: number;
|
|
|
|
follow: boolean;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2020-01-28 02:04:30 +00:00
|
|
|
export interface GetFollowedCommunitiesForm {
|
|
|
|
auth: string;
|
|
|
|
}
|
|
|
|
|
2019-04-15 23:12:06 +00:00
|
|
|
export interface GetFollowedCommunitiesResponse {
|
|
|
|
communities: Array<CommunityUser>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GetUserDetailsForm {
|
2019-04-25 21:52:18 +00:00
|
|
|
user_id?: number;
|
|
|
|
username?: string;
|
|
|
|
sort: string;
|
2019-04-17 18:30:13 +00:00
|
|
|
page?: number;
|
|
|
|
limit?: number;
|
2019-04-15 23:12:06 +00:00
|
|
|
community_id?: number;
|
2019-04-20 04:06:25 +00:00
|
|
|
saved_only: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface UserDetailsResponse {
|
|
|
|
user: UserView;
|
|
|
|
follows: Array<CommunityUser>;
|
|
|
|
moderates: Array<CommunityUser>;
|
|
|
|
comments: Array<Comment>;
|
|
|
|
posts: Array<Post>;
|
2019-10-14 00:36:35 +00:00
|
|
|
admins: Array<UserView>;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
2019-04-20 18:17:00 +00:00
|
|
|
export interface GetRepliesForm {
|
2019-10-20 00:46:29 +00:00
|
|
|
sort: string;
|
2019-04-20 18:17:00 +00:00
|
|
|
page?: number;
|
|
|
|
limit?: number;
|
|
|
|
unread_only: boolean;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GetRepliesResponse {
|
|
|
|
replies: Array<Comment>;
|
|
|
|
}
|
|
|
|
|
2019-10-20 00:46:29 +00:00
|
|
|
export interface GetUserMentionsForm {
|
|
|
|
sort: string;
|
|
|
|
page?: number;
|
|
|
|
limit?: number;
|
|
|
|
unread_only: boolean;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GetUserMentionsResponse {
|
|
|
|
mentions: Array<Comment>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface EditUserMentionForm {
|
|
|
|
user_mention_id: number;
|
|
|
|
read?: boolean;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UserMentionResponse {
|
|
|
|
mention: Comment;
|
|
|
|
}
|
|
|
|
|
2019-04-15 23:12:06 +00:00
|
|
|
export interface BanFromCommunityForm {
|
|
|
|
community_id: number;
|
|
|
|
user_id: number;
|
|
|
|
ban: boolean;
|
2019-10-19 00:20:27 +00:00
|
|
|
reason?: string;
|
|
|
|
expires?: number;
|
2019-04-15 23:12:06 +00:00
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface BanFromCommunityResponse {
|
2019-10-19 00:20:27 +00:00
|
|
|
user: UserView;
|
|
|
|
banned: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AddModToCommunityForm {
|
|
|
|
community_id: number;
|
|
|
|
user_id: number;
|
|
|
|
added: boolean;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2019-08-24 02:40:41 +00:00
|
|
|
export interface TransferCommunityForm {
|
|
|
|
community_id: number;
|
|
|
|
user_id: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface TransferSiteForm {
|
|
|
|
user_id: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2019-04-15 23:12:06 +00:00
|
|
|
export interface AddModToCommunityResponse {
|
|
|
|
moderators: Array<CommunityUser>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GetModlogForm {
|
|
|
|
mod_user_id?: number;
|
|
|
|
community_id?: number;
|
|
|
|
page?: number;
|
2019-04-17 18:30:13 +00:00
|
|
|
limit?: number;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface GetModlogResponse {
|
2019-10-19 00:20:27 +00:00
|
|
|
removed_posts: Array<ModRemovePost>;
|
|
|
|
locked_posts: Array<ModLockPost>;
|
|
|
|
stickied_posts: Array<ModStickyPost>;
|
|
|
|
removed_comments: Array<ModRemoveComment>;
|
|
|
|
removed_communities: Array<ModRemoveCommunity>;
|
|
|
|
banned_from_community: Array<ModBanFromCommunity>;
|
|
|
|
banned: Array<ModBan>;
|
|
|
|
added_to_community: Array<ModAddCommunity>;
|
|
|
|
added: Array<ModAdd>;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModRemovePost {
|
2019-07-13 21:14:59 +00:00
|
|
|
id: number;
|
|
|
|
mod_user_id: number;
|
|
|
|
post_id: number;
|
|
|
|
reason?: string;
|
|
|
|
removed?: boolean;
|
2019-10-19 00:20:27 +00:00
|
|
|
when_: string;
|
2019-07-13 21:14:59 +00:00
|
|
|
mod_user_name: string;
|
|
|
|
post_name: string;
|
|
|
|
community_id: number;
|
|
|
|
community_name: string;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModLockPost {
|
2019-10-19 00:20:27 +00:00
|
|
|
id: number;
|
|
|
|
mod_user_id: number;
|
|
|
|
post_id: number;
|
|
|
|
locked?: boolean;
|
|
|
|
when_: string;
|
|
|
|
mod_user_name: string;
|
|
|
|
post_name: string;
|
|
|
|
community_id: number;
|
|
|
|
community_name: string;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
2019-09-09 06:14:13 +00:00
|
|
|
export interface ModStickyPost {
|
2019-10-19 00:20:27 +00:00
|
|
|
id: number;
|
|
|
|
mod_user_id: number;
|
|
|
|
post_id: number;
|
|
|
|
stickied?: boolean;
|
|
|
|
when_: string;
|
|
|
|
mod_user_name: string;
|
|
|
|
post_name: string;
|
|
|
|
community_id: number;
|
|
|
|
community_name: string;
|
2019-09-09 06:14:13 +00:00
|
|
|
}
|
|
|
|
|
2019-04-15 23:12:06 +00:00
|
|
|
export interface ModRemoveComment {
|
2019-10-19 00:20:27 +00:00
|
|
|
id: number;
|
|
|
|
mod_user_id: number;
|
|
|
|
comment_id: number;
|
|
|
|
reason?: string;
|
|
|
|
removed?: boolean;
|
|
|
|
when_: string;
|
|
|
|
mod_user_name: string;
|
|
|
|
comment_user_id: number;
|
|
|
|
comment_user_name: string;
|
|
|
|
comment_content: string;
|
|
|
|
post_id: number;
|
|
|
|
post_name: string;
|
|
|
|
community_id: number;
|
|
|
|
community_name: string;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModRemoveCommunity {
|
2019-10-19 00:20:27 +00:00
|
|
|
id: number;
|
|
|
|
mod_user_id: number;
|
|
|
|
community_id: number;
|
|
|
|
reason?: string;
|
|
|
|
removed?: boolean;
|
|
|
|
expires?: number;
|
|
|
|
when_: string;
|
|
|
|
mod_user_name: string;
|
|
|
|
community_name: string;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModBanFromCommunity {
|
2019-10-19 00:20:27 +00:00
|
|
|
id: number;
|
|
|
|
mod_user_id: number;
|
|
|
|
other_user_id: number;
|
|
|
|
community_id: number;
|
|
|
|
reason?: string;
|
|
|
|
banned?: boolean;
|
|
|
|
expires?: number;
|
|
|
|
when_: string;
|
|
|
|
mod_user_name: string;
|
|
|
|
other_user_name: string;
|
|
|
|
community_name: string;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModBan {
|
2019-10-19 00:20:27 +00:00
|
|
|
id: number;
|
|
|
|
mod_user_id: number;
|
|
|
|
other_user_id: number;
|
|
|
|
reason?: string;
|
|
|
|
banned?: boolean;
|
|
|
|
expires?: number;
|
|
|
|
when_: string;
|
|
|
|
mod_user_name: string;
|
|
|
|
other_user_name: string;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModAddCommunity {
|
2019-10-19 00:20:27 +00:00
|
|
|
id: number;
|
|
|
|
mod_user_id: number;
|
|
|
|
other_user_id: number;
|
|
|
|
community_id: number;
|
|
|
|
removed?: boolean;
|
|
|
|
when_: string;
|
|
|
|
mod_user_name: string;
|
|
|
|
other_user_name: string;
|
|
|
|
community_name: string;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ModAdd {
|
2019-10-19 00:20:27 +00:00
|
|
|
id: number;
|
|
|
|
mod_user_id: number;
|
|
|
|
other_user_id: number;
|
|
|
|
removed?: boolean;
|
|
|
|
when_: string;
|
|
|
|
mod_user_name: string;
|
|
|
|
other_user_name: string;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface LoginForm {
|
|
|
|
username_or_email: string;
|
|
|
|
password: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RegisterForm {
|
|
|
|
username: string;
|
|
|
|
email?: string;
|
|
|
|
password: string;
|
|
|
|
password_verify: string;
|
2019-04-16 23:04:23 +00:00
|
|
|
admin: boolean;
|
2019-08-14 02:52:43 +00:00
|
|
|
show_nsfw: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface LoginResponse {
|
|
|
|
jwt: string;
|
|
|
|
}
|
|
|
|
|
2019-08-14 02:52:43 +00:00
|
|
|
export interface UserSettingsForm {
|
|
|
|
show_nsfw: boolean;
|
2019-10-15 19:21:27 +00:00
|
|
|
theme: string;
|
2019-10-21 04:21:54 +00:00
|
|
|
default_sort_type: SortType;
|
|
|
|
default_listing_type: ListingType;
|
2019-12-09 08:24:53 +00:00
|
|
|
lang: string;
|
2019-12-29 20:39:48 +00:00
|
|
|
avatar?: string;
|
2020-01-01 20:46:14 +00:00
|
|
|
email?: string;
|
2020-01-22 21:35:29 +00:00
|
|
|
matrix_user_id?: string;
|
2020-01-01 20:46:14 +00:00
|
|
|
new_password?: string;
|
|
|
|
new_password_verify?: string;
|
|
|
|
old_password?: string;
|
2020-01-02 21:55:54 +00:00
|
|
|
show_avatars: boolean;
|
|
|
|
send_notifications_to_email: boolean;
|
2019-08-14 02:52:43 +00:00
|
|
|
auth: string;
|
|
|
|
}
|
2019-04-15 23:12:06 +00:00
|
|
|
|
2019-03-26 18:00:18 +00:00
|
|
|
export interface CommunityForm {
|
|
|
|
name: string;
|
2019-04-03 23:01:20 +00:00
|
|
|
title: string;
|
2019-10-19 00:20:27 +00:00
|
|
|
description?: string;
|
|
|
|
category_id: number;
|
2019-04-04 22:29:14 +00:00
|
|
|
edit_id?: number;
|
2019-04-21 21:38:57 +00:00
|
|
|
removed?: boolean;
|
2019-04-29 19:14:54 +00:00
|
|
|
deleted?: boolean;
|
2019-08-14 02:52:43 +00:00
|
|
|
nsfw: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
reason?: string;
|
|
|
|
expires?: number;
|
2019-03-26 18:00:18 +00:00
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2020-01-28 02:04:30 +00:00
|
|
|
export interface GetCommunityForm {
|
|
|
|
id?: number;
|
|
|
|
name?: string;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2019-04-04 22:29:14 +00:00
|
|
|
export interface GetCommunityResponse {
|
2019-03-26 18:00:18 +00:00
|
|
|
community: Community;
|
2019-04-04 20:53:32 +00:00
|
|
|
moderators: Array<CommunityUser>;
|
2019-04-21 20:52:55 +00:00
|
|
|
admins: Array<UserView>;
|
2020-02-01 01:02:20 +00:00
|
|
|
online: number;
|
2019-03-26 18:00:18 +00:00
|
|
|
}
|
|
|
|
|
2019-04-04 22:29:14 +00:00
|
|
|
export interface CommunityResponse {
|
|
|
|
community: Community;
|
|
|
|
}
|
|
|
|
|
2019-04-10 06:19:12 +00:00
|
|
|
export interface ListCommunitiesForm {
|
|
|
|
sort: string;
|
2019-04-17 18:30:13 +00:00
|
|
|
page?: number;
|
2019-04-10 06:19:12 +00:00
|
|
|
limit?: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2019-03-26 18:00:18 +00:00
|
|
|
export interface ListCommunitiesResponse {
|
|
|
|
communities: Array<Community>;
|
|
|
|
}
|
|
|
|
|
2019-04-03 23:01:20 +00:00
|
|
|
export interface ListCategoriesResponse {
|
|
|
|
categories: Array<Category>;
|
|
|
|
}
|
2019-04-17 18:30:13 +00:00
|
|
|
|
2019-03-26 18:00:18 +00:00
|
|
|
export interface PostForm {
|
|
|
|
name: string;
|
|
|
|
url?: string;
|
|
|
|
body?: string;
|
|
|
|
community_id: number;
|
|
|
|
updated?: number;
|
2019-04-03 20:59:37 +00:00
|
|
|
edit_id?: number;
|
2019-04-15 23:12:06 +00:00
|
|
|
creator_id: number;
|
2019-04-20 07:24:59 +00:00
|
|
|
removed?: boolean;
|
2019-04-29 19:14:54 +00:00
|
|
|
deleted?: boolean;
|
2019-08-14 02:52:43 +00:00
|
|
|
nsfw: boolean;
|
2019-04-20 07:24:59 +00:00
|
|
|
locked?: boolean;
|
2019-09-09 06:14:13 +00:00
|
|
|
stickied?: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
reason?: string;
|
2019-03-26 18:00:18 +00:00
|
|
|
auth: string;
|
|
|
|
}
|
|
|
|
|
2019-08-22 23:13:26 +00:00
|
|
|
export interface PostFormParams {
|
|
|
|
name: string;
|
|
|
|
url?: string;
|
|
|
|
body?: string;
|
|
|
|
community?: string;
|
|
|
|
}
|
|
|
|
|
2020-01-28 02:04:30 +00:00
|
|
|
export interface GetPostForm {
|
|
|
|
id: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2019-04-03 20:59:37 +00:00
|
|
|
export interface GetPostResponse {
|
2019-03-26 18:00:18 +00:00
|
|
|
post: Post;
|
|
|
|
comments: Array<Comment>;
|
2019-04-03 23:01:20 +00:00
|
|
|
community: Community;
|
2019-04-04 20:53:32 +00:00
|
|
|
moderators: Array<CommunityUser>;
|
2019-04-20 04:06:25 +00:00
|
|
|
admins: Array<UserView>;
|
2020-02-01 01:02:20 +00:00
|
|
|
online: number;
|
2019-04-20 04:06:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SavePostForm {
|
|
|
|
post_id: number;
|
|
|
|
save: boolean;
|
|
|
|
auth?: string;
|
2019-03-26 18:00:18 +00:00
|
|
|
}
|
|
|
|
|
2019-04-03 20:59:37 +00:00
|
|
|
export interface PostResponse {
|
|
|
|
post: Post;
|
|
|
|
}
|
|
|
|
|
2019-03-26 18:00:18 +00:00
|
|
|
export interface CommentForm {
|
|
|
|
content: string;
|
|
|
|
post_id: number;
|
|
|
|
parent_id?: number;
|
2019-03-29 04:56:23 +00:00
|
|
|
edit_id?: number;
|
2020-04-23 18:13:22 +00:00
|
|
|
creator_id?: number;
|
2019-04-20 07:24:59 +00:00
|
|
|
removed?: boolean;
|
2019-04-29 19:14:54 +00:00
|
|
|
deleted?: boolean;
|
2019-04-15 23:12:06 +00:00
|
|
|
reason?: string;
|
2019-04-20 18:17:00 +00:00
|
|
|
read?: boolean;
|
2019-03-26 18:00:18 +00:00
|
|
|
auth: string;
|
|
|
|
}
|
|
|
|
|
2019-04-20 04:06:25 +00:00
|
|
|
export interface SaveCommentForm {
|
|
|
|
comment_id: number;
|
|
|
|
save: boolean;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2019-03-26 18:00:18 +00:00
|
|
|
export interface CommentResponse {
|
|
|
|
comment: Comment;
|
2020-02-01 01:02:20 +00:00
|
|
|
recipient_ids: Array<number>;
|
2019-03-25 03:51:27 +00:00
|
|
|
}
|
|
|
|
|
2019-03-28 19:32:08 +00:00
|
|
|
export interface CommentLikeForm {
|
|
|
|
comment_id: number;
|
|
|
|
post_id: number;
|
|
|
|
score: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2019-04-08 05:19:02 +00:00
|
|
|
export interface CommentNode {
|
|
|
|
comment: Comment;
|
|
|
|
children?: Array<CommentNode>;
|
|
|
|
}
|
|
|
|
|
2019-04-03 06:49:32 +00:00
|
|
|
export interface GetPostsForm {
|
|
|
|
type_: string;
|
|
|
|
sort: string;
|
2019-04-17 18:30:13 +00:00
|
|
|
page?: number;
|
|
|
|
limit?: number;
|
2019-04-03 06:49:32 +00:00
|
|
|
community_id?: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GetPostsResponse {
|
|
|
|
posts: Array<Post>;
|
|
|
|
}
|
|
|
|
|
2020-02-08 04:05:15 +00:00
|
|
|
export interface GetCommentsForm {
|
|
|
|
type_: string;
|
|
|
|
sort: string;
|
|
|
|
page?: number;
|
|
|
|
limit: number;
|
|
|
|
community_id?: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GetCommentsResponse {
|
|
|
|
comments: Array<Comment>;
|
|
|
|
}
|
|
|
|
|
2019-04-03 06:49:32 +00:00
|
|
|
export interface CreatePostLikeForm {
|
|
|
|
post_id: number;
|
|
|
|
score: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2019-04-16 23:04:23 +00:00
|
|
|
export interface SiteForm {
|
|
|
|
name: string;
|
2019-10-19 00:20:27 +00:00
|
|
|
description?: string;
|
2019-12-11 20:21:47 +00:00
|
|
|
enable_downvotes: boolean;
|
|
|
|
open_registration: boolean;
|
|
|
|
enable_nsfw: boolean;
|
2019-04-16 23:04:23 +00:00
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2020-04-10 20:55:57 +00:00
|
|
|
export interface GetSiteConfig {
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GetSiteConfigResponse {
|
|
|
|
config_hjson: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SiteConfigForm {
|
|
|
|
config_hjson: string;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
2019-04-16 23:04:23 +00:00
|
|
|
export interface GetSiteResponse {
|
|
|
|
site: Site;
|
|
|
|
admins: Array<UserView>;
|
|
|
|
banned: Array<UserView>;
|
2019-09-13 16:09:01 +00:00
|
|
|
online: number;
|
2019-04-16 23:04:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SiteResponse {
|
|
|
|
site: Site;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface BanUserForm {
|
|
|
|
user_id: number;
|
|
|
|
ban: boolean;
|
2019-10-19 00:20:27 +00:00
|
|
|
reason?: string;
|
|
|
|
expires?: number;
|
2019-04-16 23:04:23 +00:00
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface BanUserResponse {
|
2019-10-19 00:20:27 +00:00
|
|
|
user: UserView;
|
|
|
|
banned: boolean;
|
2019-04-16 23:04:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface AddAdminForm {
|
|
|
|
user_id: number;
|
|
|
|
added: boolean;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AddAdminResponse {
|
|
|
|
admins: Array<UserView>;
|
|
|
|
}
|
2019-04-23 22:05:50 +00:00
|
|
|
|
|
|
|
export interface SearchForm {
|
|
|
|
q: string;
|
|
|
|
type_: string;
|
|
|
|
community_id?: number;
|
|
|
|
sort: string;
|
|
|
|
page?: number;
|
|
|
|
limit?: number;
|
2020-01-20 23:39:45 +00:00
|
|
|
auth?: string;
|
2019-04-23 22:05:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SearchResponse {
|
2019-08-22 05:17:15 +00:00
|
|
|
type_: string;
|
2019-04-23 22:05:50 +00:00
|
|
|
posts?: Array<Post>;
|
|
|
|
comments?: Array<Comment>;
|
2019-10-19 00:20:27 +00:00
|
|
|
communities: Array<Community>;
|
2019-08-10 17:32:06 +00:00
|
|
|
users: Array<UserView>;
|
2019-04-23 22:05:50 +00:00
|
|
|
}
|
2019-10-18 04:25:23 +00:00
|
|
|
|
|
|
|
export interface DeleteAccountForm {
|
|
|
|
password: string;
|
|
|
|
}
|
2019-10-30 03:35:39 +00:00
|
|
|
|
|
|
|
export interface PasswordResetForm {
|
|
|
|
email: string;
|
|
|
|
}
|
|
|
|
|
2020-01-19 04:54:10 +00:00
|
|
|
// export interface PasswordResetResponse {
|
|
|
|
// }
|
2019-10-30 03:35:39 +00:00
|
|
|
|
|
|
|
export interface PasswordChangeForm {
|
|
|
|
token: string;
|
|
|
|
password: string;
|
|
|
|
password_verify: string;
|
|
|
|
}
|
2020-01-22 21:35:29 +00:00
|
|
|
|
|
|
|
export interface PrivateMessageForm {
|
|
|
|
content: string;
|
|
|
|
recipient_id: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PrivateMessageFormParams {
|
|
|
|
recipient_id: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface EditPrivateMessageForm {
|
|
|
|
edit_id: number;
|
|
|
|
content?: string;
|
|
|
|
deleted?: boolean;
|
|
|
|
read?: boolean;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GetPrivateMessagesForm {
|
|
|
|
unread_only: boolean;
|
|
|
|
page?: number;
|
|
|
|
limit?: number;
|
|
|
|
auth?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PrivateMessagesResponse {
|
|
|
|
messages: Array<PrivateMessage>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PrivateMessageResponse {
|
|
|
|
message: PrivateMessage;
|
|
|
|
}
|
2020-01-24 00:17:42 +00:00
|
|
|
|
2020-02-01 01:02:20 +00:00
|
|
|
export interface UserJoinForm {
|
|
|
|
auth: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface UserJoinResponse {
|
|
|
|
user_id: number;
|
|
|
|
}
|
|
|
|
|
2020-01-28 02:04:30 +00:00
|
|
|
export type MessageType =
|
|
|
|
| EditPrivateMessageForm
|
|
|
|
| LoginForm
|
|
|
|
| RegisterForm
|
|
|
|
| CommunityForm
|
|
|
|
| FollowCommunityForm
|
|
|
|
| ListCommunitiesForm
|
|
|
|
| GetFollowedCommunitiesForm
|
|
|
|
| PostForm
|
|
|
|
| GetPostForm
|
|
|
|
| GetPostsForm
|
|
|
|
| GetCommunityForm
|
|
|
|
| CommentForm
|
|
|
|
| CommentLikeForm
|
|
|
|
| SaveCommentForm
|
|
|
|
| CreatePostLikeForm
|
|
|
|
| BanFromCommunityForm
|
|
|
|
| AddAdminForm
|
|
|
|
| AddModToCommunityForm
|
|
|
|
| TransferCommunityForm
|
|
|
|
| TransferSiteForm
|
|
|
|
| SaveCommentForm
|
|
|
|
| BanUserForm
|
|
|
|
| AddAdminForm
|
|
|
|
| GetUserDetailsForm
|
|
|
|
| GetRepliesForm
|
|
|
|
| GetUserMentionsForm
|
|
|
|
| EditUserMentionForm
|
|
|
|
| GetModlogForm
|
|
|
|
| SiteForm
|
|
|
|
| SearchForm
|
|
|
|
| UserSettingsForm
|
|
|
|
| DeleteAccountForm
|
|
|
|
| PasswordResetForm
|
|
|
|
| PasswordChangeForm
|
|
|
|
| PrivateMessageForm
|
|
|
|
| EditPrivateMessageForm
|
2020-04-10 20:55:57 +00:00
|
|
|
| GetPrivateMessagesForm
|
|
|
|
| SiteConfigForm;
|
2020-01-28 02:04:30 +00:00
|
|
|
|
2020-01-19 04:54:10 +00:00
|
|
|
type ResponseType =
|
|
|
|
| SiteResponse
|
|
|
|
| GetFollowedCommunitiesResponse
|
|
|
|
| ListCommunitiesResponse
|
|
|
|
| GetPostsResponse
|
2020-02-02 17:45:41 +00:00
|
|
|
| PostResponse
|
2020-01-19 04:54:10 +00:00
|
|
|
| GetRepliesResponse
|
|
|
|
| GetUserMentionsResponse
|
|
|
|
| ListCategoriesResponse
|
|
|
|
| CommunityResponse
|
|
|
|
| CommentResponse
|
|
|
|
| UserMentionResponse
|
|
|
|
| LoginResponse
|
|
|
|
| GetModlogResponse
|
|
|
|
| SearchResponse
|
|
|
|
| BanFromCommunityResponse
|
|
|
|
| AddModToCommunityResponse
|
|
|
|
| BanUserResponse
|
2020-01-24 00:17:42 +00:00
|
|
|
| AddAdminResponse
|
|
|
|
| PrivateMessageResponse
|
2020-04-10 20:55:57 +00:00
|
|
|
| PrivateMessagesResponse
|
|
|
|
| GetSiteConfigResponse;
|
2020-01-19 04:54:10 +00:00
|
|
|
|
|
|
|
export interface WebSocketResponse {
|
|
|
|
op: UserOperation;
|
|
|
|
data: ResponseType;
|
|
|
|
}
|
2020-01-19 05:38:45 +00:00
|
|
|
|
|
|
|
export interface WebSocketJsonResponse {
|
2020-01-25 14:58:53 +00:00
|
|
|
op?: string;
|
|
|
|
data?: ResponseType;
|
2020-01-19 05:38:45 +00:00
|
|
|
error?: string;
|
2020-02-04 16:19:05 +00:00
|
|
|
reconnect?: boolean;
|
2020-01-19 05:38:45 +00:00
|
|
|
}
|