Mlem icon indicating copy to clipboard operation
Mlem copied to clipboard

Write internal API Client and add all API types

Open ShadowJonathan opened this issue 1 year ago • 6 comments

This has been corroborated with the matrix room; I'd like to rewrite the internal API Client (the functions and data models) that calls out to the Lemmy servers.

I'll put the application Logic under Logic/Networking/Lemmy Interface, and the data models under Models/Lemmy Interface.

Doing this correctly is a bit of a challenge since Lemmy currently does not have HTTP API Docs, but ill reverse engineer the API from the rust source.


The current progress on the API endpoints:

Site

  • [x] GET /site GetSite
    • [ ] APIMyUserInfo needs to be stubbed out more
  • [ ] #123
  • [x] PUT /site EditSite

Community

  • [x] GET /community GetCommunity
  • [x] POST /community CreateCommunity
  • [x] PUT /community EditCommunity
  • [x] PUT /community/hide HideCommunity
  • [x] GET /community/list ListCommunities
  • [x] POST /community/follow FollowCommunity
  • [x] POST /community/block BlockCommunity
  • [x] POST /community/delete DeleteCommunity
  • [x] POST /community/remove RemoveCommunity
  • [x] POST /community/transfer TransferCommunity
  • [x] POST /community/ban_user BanFromCommunity
  • [x] POST /community/mod AddModToCommunity
  • [ ] ~~POST /community/join CommunityJoin~~
  • [ ] ~~POST /community/mod/join ModJoin~~

Post

  • [x] GET /post GetPost
  • [x] POST /post CreatePost
  • [x] PUT /post EditPost
  • [x] POST /post/delete DeletePost
  • [x] POST /post/remove RemovePost
  • [x] POST /post/mark_as_read MarkPostAsRead
  • [x] POST /post/lock LockPost
  • [x] POST /post/feature FeaturePost
  • [x] GET /post/list GetPosts
  • [x] POST /post/like CreatePostLike
  • [x] PUT /post/save SavePost
  • [ ] ~~POST /post/join PostJoin~~
  • [x] POST /post/report CreatePostReport
  • [x] PUT /post/report/resolve ResolvePostReport
  • [x] GET /post/report/list ListPostReports
  • [x] GET /post/site_metadata GetSiteMetadata

Comment

  • [x] GET /comment GetComment
  • [x] POST /comment CreateComment
  • [x] PUT /comment EditComment
  • [x] POST /comment/delete DeleteComment
  • [x] POST /comment/remove RemoveComment
  • [x] POST /comment/mark_as_read MarkCommentReplyAsRead
  • [x] POST /comment/like CreateCommentLike
  • [x] PUT /comment/save SaveComment
  • [x] GET /comment/list GetComments
  • [x] POST /comment/report CreateCommentReport
  • [x] PUT /comment/report/resolve ResolveCommentReport
  • [x] GET /comment/report/list ListCommentReports

Private Message

  • [ ] GET /private_message/list GetPrivateMessages
  • [ ] POST /private_message CreatePrivateMessage
  • [ ] PUT /private_message EditPrivateMessage
  • [ ] POST /private_message/delete DeletePrivateMessage
  • [ ] POST /private_message/mark_as_read MarkPrivateMessageAsRead
  • [ ] POST /private_message/report CreatePrivateMessageReport
  • [ ] PUT /private_message/report/resolve ResolvePrivateMessageReport
  • [ ] GET /private_message/report/list ListPrivateMessageReports

User

  • [ ] POST /user/register register
  • [ ] GET /user/get_captcha GetCaptcha
  • [x] GET /user GetPersonDetails
  • [ ] GET /user/mention GetPersonMentions
  • [ ] POST /user/mention/mark_as_read MarkPersonMentionAsRead
  • [ ] GET /user/replies GetReplies
  • [ ] ~~POST /user/join UserJoin~~
  • [ ] POST /user/ban Banperson
  • [ ] GET /user/banned GetBannedPersons
  • [ ] POST /user/block BlockPerson
  • [x] POST /user/login Login
  • [ ] POST /user/delete_account DeleteAccount
  • [ ] POST /user/password_reset PasswordReset
  • [ ] POST /user/password_change PasswordChangeAfterReset
  • [ ] POST /user/mark_all_as_read MarkAllAsRead
  • [ ] PUT /user/save_user_settings SaveUserSettings
  • [ ] PUT /user/change_password ChangePassword
  • [ ] GET /user/report_count GetReportCount
  • [ ] GET /user/unread_count GetUnreadCount
  • [ ] POST /user/verify_email VerifyEmail
  • [ ] POST /user/leave_admin LeaveAdmin

Admin

  • [ ] POST /admin/add AddAdmin
  • [ ] GET /admin/registration_application/count GetUnreadRegistrationApplicationCount
  • [ ] GET /admin/registration_application/list ListRegistrationApplications
  • [ ] PUT /admin/registration_application/approve ApproveRegistrationApplication
  • [ ] POST /admin/purge/person PurgePerson
  • [ ] POST /admin/purge/community PurgeCommunity
  • [ ] POST /admin/purge/post PurgePost
  • [ ] POST /admin/purge/comment PurgeComment

Misc

  • [ ] GET /modlog GetModlog
  • [x] GET /search Search
  • [x] GET /resolve_object ResolveObject

ShadowJonathan avatar Jun 08 '23 21:06 ShadowJonathan