From dae4c8d8803690d2a26985360a853051f62af3a6 Mon Sep 17 00:00:00 2001 From: Varrience <105261606+Varrience@users.noreply.github.com> Date: Sat, 28 Dec 2024 20:09:06 -0500 Subject: [PATCH] cleaner API notation --- Pages/api.txt | 126 ++++++++++++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 55 deletions(-) diff --git a/Pages/api.txt b/Pages/api.txt index 7a90182..159b4fa 100644 --- a/Pages/api.txt +++ b/Pages/api.txt @@ -1,67 +1,83 @@ -path method auth data +method path auth data data = ?queryStringProperty=&(optional)= ?alternateSyntax= data = { requestBodyProperty: , (optional): } { alternateSyntax: } Admin API -/api/admin/transfer GET Admin ?uid=&project= ?uid=&post= -/api/admin/resetpassword GET Admin ?uid=&password= -/api/admin/reports/create POST User { content: , link: } -/api/admin/reports/list GET Admin + [GET] + /api/admin/transfer Admin ?uid=&project= ?uid=&post= + /api/admin/resetpassword Admin ?uid=&password= + /api/admin/reports/list Admin + [POST] + /api/admin/reports/create User { content: , link: } Auth API -/api/auth/register POST None { username: , password: } -/api/auth/login POST None { username: , password: } -/api/auth/changePassword POST User { currentPassword: , newPassword: } -/api/auth/update PUT User { username: , avatar: , banner: , biography: , mature: } -/api/auth/updateRole PUT Admin { role: , id: } -/api/auth/deleteUser DELETE Admin { id: } -/api/auth/deleteSelf DELETE User { confirmationPswd: } -/api/auth/listUsers GET None ?(role)=&(customQuery)= -/api/auth/check GET Check -/api/auth/userdata GET None ?id= ?username= -/api/auth/follow GET User ?id= ?username= -/api/auth/unfollow GET User ?id= ?username= -/api/auth/verify/send POST User { email: } -/api/auth/verify/email GET None ?id= -/api/auth/resetPassword/send POST None { email: } -/api/auth/resetPassword/reset POST None { id: , password: } -/notification/ GET User + [DELETE] + /api/auth/deleteUser Admin { id: } + /api/auth/deleteSelf User { confirmationPswd: } + [GET] + /api/auth/listUsers None ?(role)=&(customQuery)= + /api/auth/check Check + /api/auth/userdata None ?id= ?username= + /api/auth/follow User ?id= ?username= + /api/auth/unfollow User ?id= ?username= + /api/auth/verify/email None ?id= + /notification/ User + [POST] + /api/auth/register None { username: , password: } + /api/auth/login None { username: , password: } + /api/auth/changePassword User { currentPassword: , newPassword: } + /api/auth/verify/send User { email: } + /api/auth/resetPassword/send None { email: } + /api/auth/resetPassword/reset None { id: , password: } + [PUT] + /api/auth/update User { username: , avatar: , banner: , biography: , mature: } + /api/auth/updateRole Admin { role: , id: } Project API -/api/project/publish POST User { title: , link: , content: , thumbnail: , tags: [ ], mature: , hidden: , privateRecipients: [ ], platform: } -/api/project/list GET ?(poster)=&(platform)=&(postedBefore)=&(postedAfter)=&(includeTags)=[]&(excludeTags)=[]&(featured)=&(showMature)=&(showHidden)=&(recipient)=&(customQuery)= -/api/project/search GET ?query=&(showMature)=&(showHidden)= -/api/project/data/ GET this.data.bind(this)); -/api/project/update/ PUT User { title: , link: , content: , thumbnail: , tags: [ ], mature: , hidden: , privateRecipients: [ ], platform: } -/api/project/delete/ DELETE User -/api/project/delete/ GET User -/api/project/favorite/ GET User -/api/project/unfavorite/ GET User -/api/project/feature/ GET Admin -/api/project/unfeature/ GET Admin -/api/project/comment/ POST User { content: } -/api/project/comment//edit PUT User { content: , index: } -/api/project/comment//delete DELETE User { index: } -/api/project/comment//upvote GET User ?index= -/api/project/comment//downvote GET User ?index= + [DELETE] + /api/project/delete/ User + /api/project/comment//delete User { index: } + [GET] + /api/project/list ?(poster)=&(platform)=&(postedBefore)=&(postedAfter)=&(includeTags)=[]&(excludeTags)=[]&(featured)=&(showMature)=&(showHidden)=&(recipient)=&(customQuery)= + /api/project/search ?query=&(showMature)=&(showHidden)= + /api/project/data/ this.data.bind(this)); + /api/project/delete/ User + /api/project/favorite/ User + /api/project/unfavorite/ User + /api/project/feature/ Admin + /api/project/unfeature/ Admin + /api/project/comment//upvote User ?index= + /api/project/comment//downvote User ?index= + [POST] + /api/project/publish User { title: , link: , content: , thumbnail: , tags: [ ], mature: , hidden: , privateRecipients: [ ], platform: } + /api/project/comment/ User { content: } + [PUT] + /api/project/update/ User { title: , link: , content: , thumbnail: , tags: [ ], mature: , hidden: , privateRecipients: [ ], platform: } + /api/project/comment//edit User { content: , index: } Forum API -/api/forum/publish POST User { title: , content: , tags: [ ], mature: , hidden: , privateRecipients: [ ] } -/api/forum/list GET None ?(poster)=&(platform)=&(postedBefore)=&(postedAfter)=&(includeTags)=[]&(excludeTags)=[]&(featured)=&(showMature)=&(showHidden)=&(recipient)=&(customQuery)= -/api/forum/search GET ?query=&(showMature)=&(showHidden)= -/api/forum/data/ GET None -/api/forum/update/ PUT User { title: , content: , tags: [ ], mature: , hidden: , privateRecipients: [ ] } -/api/forum/delete/ DELETE User -/api/forum/delete/ GET User -/api/forum/feature/ GET Admin -/api/forum/unfeature/ GET Admin -/api/forum/comment/ POST User { content: } -/api/forum/comment//edit PUT User { content: , index: } -/api/forum/comment//delete DELETE User { index: } -/api/forum/comment//upvote GET User ?index= -/api/forum/comment//downvote GET User ?index= + [DELETE] + /api/forum/delete/ User + /api/forum/comment//delete User { index: } + [GET] + /api/forum/list None ?(poster)=&(platform)=&(postedBefore)=&(postedAfter)=&(includeTags)=[]&(excludeTags)=[]&(featured)=&(showMature)=&(showHidden)=&(recipient)=&(customQuery)= + /api/forum/search ?query=&(showMature)=&(showHidden)= + /api/forum/data/ None + /api/forum/delete/ User + /api/forum/feature/ Admin + /api/forum/unfeature/ Admin + /api/forum/comment//upvote User ?index= + /api/forum/comment//downvote User ?index= + [POST] + /api/forum/publish User { title: , content: , tags: [ ], mature: , hidden: , privateRecipients: [ ] } + /api/forum/comment/ User { content: } + [PUT] + /api/forum/update/ User { title: , content: , tags: [ ], mature: , hidden: , privateRecipients: [ ] } + /api/forum/comment//edit User { content: , index: } Media API -/api/media/upload POST User -/api/media/get// GET None -/api/media/list GET None ?(poster)=&(customQuery)= + [GET] + /api/media/get// None + /api/media/list None ?(poster)=&(customQuery)= + [POST] + /api/media/upload User