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, SaveUserSettings, TransferCommunity,
35 These go wherever there is a `sort` field.
36 `Hot, New, TopDay, TopWeek, TopMonth, TopYear, TopAll`
38 ### User / Authentication / Admin
40 The `jwt` string should be stored and used anywhere `auth` is called for.
47 username_or_email: String,
62 Only the first user will be able to be the admin.
70 email: Option<String>,
72 password_verify: String,
92 username: Option<String>,
96 community_id: Option<i32>,
107 follows: Vec<CommunityFollowerView>,
108 moderates: Vec<CommunityModeratorView>,
109 comments: Vec<CommentView>,
110 posts: Vec<PostView>,
113 #### Save User Settings
128 #### Get Replies / Inbox
146 replies: Vec<ReplyView>,
150 #### Mark all replies as read
164 replies: Vec<ReplyView>,
184 admins: Vec<UserView>,
196 reason: Option<String>,
197 expires: Option<i64>,
223 categories: Vec<Category>
228 Search types are `Both, Comments, Posts`.
237 community_id: Option<i32>,
248 comments: Vec<CommentView>,
249 posts: Vec<PostView>,
259 mod_user_id: Option<i32>,
260 community_id: Option<i32>,
270 removed_posts: Vec<ModRemovePostView>,
271 locked_posts: Vec<ModLockPostView>,
272 removed_comments: Vec<ModRemoveCommentView>,
273 removed_communities: Vec<ModRemoveCommunityView>,
274 banned_from_community: Vec<ModBanFromCommunityView>,
275 banned: Vec<ModBanView>,
276 added_to_community: Vec<ModAddCommunityView>,
277 added: Vec<ModAddView>,
288 description: Option<String>,
308 description: Option<String>,
332 site: Option<SiteView>,
333 admins: Vec<UserView>,
334 banned: Vec<UserView>,
353 site: Option<SiteView>,
354 admins: Vec<UserView>,
355 banned: Vec<UserView>,
367 name: Option<String>,
376 community: CommunityView,
377 moderators: Vec<CommunityModeratorView>,
378 admins: Vec<UserView>,
382 #### Create Community
386 op: "CreateCommunity",
390 description: Option<String>,
400 community: CommunityView
404 #### List Communities
408 op: "ListCommunities",
421 communities: Vec<CommunityView>
425 #### Ban from Community
429 op: "BanFromCommunity",
434 reason: Option<String>,
435 expires: Option<i64>,
449 #### Add Mod to Community
453 op: "AddModToCommunity",
466 moderators: Vec<CommunityModeratorView>,
471 Mods and admins can remove and lock a community, creators can delete it.
481 description: Option<String>,
483 removed: Option<bool>,
484 deleted: Option<bool>,
485 reason: Option<String>,
486 expires: Option<i64>,
495 community: CommunityView
499 #### Follow Community
503 op: "FollowCommunity",
515 community: CommunityView
519 #### Get Followed Communities
523 op: "GetFollowedCommunities",
533 communities: Vec<CommunityFollowerView>
537 #### Transfer Community
541 op: "TransferCommunity",
553 community: CommunityView,
554 moderators: Vec<CommunityModeratorView>,
555 admins: Vec<UserView>,
568 body: Option<String>,
598 comments: Vec<CommentView>,
599 community: CommunityView,
600 moderators: Vec<CommunityModeratorView>,
601 admins: Vec<UserView>,
606 Post listing types are `All, Subscribed, Community`
617 community_id: Option<i32>,
626 posts: Vec<PostView>,
630 #### Create Post Like
631 `score` can be 0, -1, or 1
636 op: "CreatePostLike",
653 Mods and admins can remove and lock a post, creators can delete it.
665 body: Option<String>,
666 removed: Option<bool>,
667 deleted: Option<bool>,
668 locked: Option<bool>,
669 reason: Option<String>,
710 parent_id: Option<i32>,
711 edit_id: Option<i32>,
726 Mods and admins can remove a comment, creators can delete it.
734 parent_id: Option<i32>,
738 removed: Option<bool>,
739 deleted: Option<bool>,
740 reason: Option<String>,
774 #### Create Comment Like
775 `score` can be 0, -1, or 1
780 op: "CreateCommentLike",