export enum UserOperation {
Login, Register, CreateCommunity, CreatePost, ListCommunities, GetPost, GetCommunity, CreateComment, CreateCommentLike
}
export interface User {
id: number;
username: string;
export interface Community {
name: string;
published: string;
updated?: string;
export interface CommunityForm {
auth?: string;
export interface CommunityResponse {
op: string;
community: Community;
export interface ListCommunitiesResponse {
communities: Array<Community>;
export interface Post {
url?: string;
body?: string;
attributed_to: string;
community_id: number;
export interface PostForm {
updated?: number;
auth: string;
export interface PostResponse {
post: Post;
comments: Array<Comment>;
export interface Comment {
content: string;
post_id: number,
parent_id?: number;
score: number;
upvotes: number;
downvotes: number;
my_vote?: number;
export interface CommentForm {
post_id: number;
export interface CommentResponse {
comment: Comment;
export interface CommentLikeForm {
comment_id: number;
export interface CreateCommentLikeResponse {
export interface LoginForm {
username_or_email: string;
password: string;
export interface RegisterForm {
email?: string;
password_verify: string;
export interface LoginResponse {
jwt: string;