3 This may lag behind the actual API endpoints [here](../server/src/api).
5 The data types, such as `Vec<CommentView>`, are listed [here](../server/src/db).
11 ### Testing with [Websocat](https://github.com/vi/websocat)
12 `websocat ws://127.0.0.1:8536/api/v1/ws -nt`
14 A simple test command:
15 `{"op": "ListCategories"}`
18 - 3 actions per 3 minutes for signups, post, and community creation.
19 - 30 actions per minute for everything else.
31 `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`
34 These go wherever there is a `sort` field.
35 `Hot, New, TopDay, TopWeek, TopMonth, TopYear, TopAll`
37 ### User / Authentication / Admin
39 The `jwt` string should be stored and used anywhere `auth` is called for.
46 username_or_email: String,
61 Only the first user will be able to be the admin.
69 email: Option<String>,
71 password_verify: String,
91 username: Option<String>,
95 community_id: Option<i32>,
106 follows: Vec<CommunityFollowerView>,
107 moderates: Vec<CommunityModeratorView>,
108 comments: Vec<CommentView>,
109 posts: Vec<PostView>,
113 #### Get Replies / Inbox
131 replies: Vec<ReplyView>,
135 #### Mark all replies as read
149 replies: Vec<ReplyView>,
169 admins: Vec<UserView>,
181 reason: Option<String>,
182 expires: Option<i64>,
208 categories: Vec<Category>
213 Search types are `Both, Comments, Posts`.
222 community_id: Option<i32>,
233 comments: Vec<CommentView>,
234 posts: Vec<PostView>,
244 mod_user_id: Option<i32>,
245 community_id: Option<i32>,
255 removed_posts: Vec<ModRemovePostView>,
256 locked_posts: Vec<ModLockPostView>,
257 removed_comments: Vec<ModRemoveCommentView>,
258 removed_communities: Vec<ModRemoveCommunityView>,
259 banned_from_community: Vec<ModBanFromCommunityView>,
260 banned: Vec<ModBanView>,
261 added_to_community: Vec<ModAddCommunityView>,
262 added: Vec<ModAddView>,
273 description: Option<String>,
293 description: Option<String>,
317 site: Option<SiteView>,
318 admins: Vec<UserView>,
319 banned: Vec<UserView>,
331 name: Option<String>,
340 community: CommunityView,
341 moderators: Vec<CommunityModeratorView>,
342 admins: Vec<UserView>,
346 #### Create Community
350 op: "CreateCommunity",
354 description: Option<String>,
364 community: CommunityView
368 #### List Communities
372 op: "ListCommunities",
385 communities: Vec<CommunityView>
389 #### Ban from Community
393 op: "BanFromCommunity",
398 reason: Option<String>,
399 expires: Option<i64>,
413 #### Add Mod to Community
417 op: "AddModToCommunity",
430 moderators: Vec<CommunityModeratorView>,
435 Mods and admins can remove and lock a community, creators can delete it.
445 description: Option<String>,
447 removed: Option<bool>,
448 deleted: Option<bool>,
449 reason: Option<String>,
450 expires: Option<i64>,
459 community: CommunityView
463 #### Follow Community
467 op: "FollowCommunity",
479 community: CommunityView
483 #### Get Followed Communities
487 op: "GetFollowedCommunities",
497 communities: Vec<CommunityFollowerView>
510 body: Option<String>,
540 comments: Vec<CommentView>,
541 community: CommunityView,
542 moderators: Vec<CommunityModeratorView>,
543 admins: Vec<UserView>,
548 Post listing types are `All, Subscribed, Community`
559 community_id: Option<i32>,
568 posts: Vec<PostView>,
572 #### Create Post Like
573 `score` can be 0, -1, or 1
578 op: "CreatePostLike",
595 Mods and admins can remove and lock a post, creators can delete it.
607 body: Option<String>,
608 removed: Option<bool>,
609 deleted: Option<bool>,
610 locked: Option<bool>,
611 reason: Option<String>,
652 parent_id: Option<i32>,
653 edit_id: Option<i32>,
668 Mods and admins can remove a comment, creators can delete it.
676 parent_id: Option<i32>,
680 removed: Option<bool>,
681 deleted: Option<bool>,
682 reason: Option<String>,
716 #### Create Comment Like
717 `score` can be 0, -1, or 1
722 op: "CreateCommentLike",