summaryrefslogtreecommitdiffstats
path: root/ui/src/interfaces.ts
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-03-26 11:00:18 -0700
committerDessalines <tyhou13@gmx.com>2019-03-26 11:00:18 -0700
commit25dcb8f4f4f80e401d1d3154923e2dcd05664c76 (patch)
tree85e9644b64e0eb3fa139db18075dbfd73f854a38 /ui/src/interfaces.ts
parente1cb805cfc719d6266ec50e5f1ef3ac1edf74656 (diff)
Adding a few endpoints.
- Adding CreatePost, CreateComment, CreateCommunity
Diffstat (limited to 'ui/src/interfaces.ts')
-rw-r--r--ui/src/interfaces.ts81
1 files changed, 70 insertions, 11 deletions
diff --git a/ui/src/interfaces.ts b/ui/src/interfaces.ts
index e620aa4e..14c28438 100644
--- a/ui/src/interfaces.ts
+++ b/ui/src/interfaces.ts
@@ -1,5 +1,5 @@
export enum UserOperation {
- Login, Register, CreateCommunity
+ Login, Register, CreateCommunity, CreatePost, ListCommunities, GetPost, GetCommunity, CreateComment
}
export interface User {
@@ -10,8 +10,71 @@ export interface User {
export interface Community {
id: number;
name: string;
- published: Date;
- updated?: Date;
+ published: string;
+ updated?: string;
+}
+
+export interface CommunityForm {
+ name: string;
+ auth?: string;
+}
+
+export interface CommunityResponse {
+ op: string;
+ community: Community;
+}
+
+export interface ListCommunitiesResponse {
+ op: string;
+ communities: Array<Community>;
+}
+
+export interface Post {
+ id: number;
+ name: string;
+ url?: string;
+ body?: string;
+ attributed_to: string;
+ community_id: number;
+ published: string;
+ updated?: string;
+}
+
+export interface PostForm {
+ name: string;
+ url?: string;
+ body?: string;
+ community_id: number;
+ updated?: number;
+ auth: string;
+}
+
+export interface PostResponse {
+ op: string;
+ post: Post;
+ comments: Array<Comment>;
+}
+
+export interface Comment {
+ id: number;
+ content: string;
+ attributed_to: string;
+ post_id: number,
+ parent_id?: number;
+ published: string;
+ updated?: string;
+}
+
+export interface CommentForm {
+ content: string;
+ post_id: number;
+ parent_id?: number;
+ auth: string;
+}
+
+export interface CommentResponse {
+ op: string;
+ comment: Comment;
}
export interface LoginForm {
@@ -26,13 +89,9 @@ export interface RegisterForm {
password_verify: string;
}
-export interface CommunityForm {
- name: string;
+export interface LoginResponse {
+ op: string;
+ jwt: string;
}
-export interface PostForm {
- name: string;
- url: string;
- attributed_to: string;
- updated?: number
-}
+