lemmy-js-client 0.20.0-reports-combined.3 → 0.20.0-search-combined.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. package/dist/http.d.ts +118 -35
  2. package/dist/http.js +179 -56
  3. package/dist/index.d.ts +55 -16
  4. package/dist/other_types.d.ts +0 -17
  5. package/dist/types/AdminAllowInstance.d.ts +3 -2
  6. package/dist/types/AdminAllowInstanceId.d.ts +1 -0
  7. package/dist/types/AdminAllowInstanceView.d.ts +1 -1
  8. package/dist/types/AdminBlockInstance.d.ts +3 -2
  9. package/dist/types/AdminBlockInstanceId.d.ts +1 -0
  10. package/dist/types/AdminPurgeComment.d.ts +3 -2
  11. package/dist/types/AdminPurgeCommentId.d.ts +1 -0
  12. package/dist/types/AdminPurgeCommentId.js +3 -0
  13. package/dist/types/AdminPurgeCommunity.d.ts +3 -2
  14. package/dist/types/AdminPurgeCommunityId.d.ts +1 -0
  15. package/dist/types/AdminPurgeCommunityId.js +3 -0
  16. package/dist/types/AdminPurgePerson.d.ts +3 -2
  17. package/dist/types/AdminPurgePersonId.d.ts +1 -0
  18. package/dist/types/AdminPurgePersonId.js +3 -0
  19. package/dist/types/AdminPurgePost.d.ts +3 -2
  20. package/dist/types/AdminPurgePostId.d.ts +1 -0
  21. package/dist/types/AdminPurgePostId.js +3 -0
  22. package/dist/types/CommunityAggregates.d.ts +2 -0
  23. package/dist/types/CommunityReport.d.ts +22 -0
  24. package/dist/types/CommunityReportId.d.ts +4 -0
  25. package/dist/types/CommunityReportId.js +3 -0
  26. package/dist/types/CommunityReportView.d.ts +16 -0
  27. package/dist/types/CreatePost.d.ts +2 -0
  28. package/dist/types/CreateSite.d.ts +1 -4
  29. package/dist/types/DeleteImageParams.d.ts +3 -0
  30. package/dist/types/DeleteImageParams.js +3 -0
  31. package/dist/types/EditCommunity.d.ts +0 -8
  32. package/dist/types/EditPost.d.ts +2 -0
  33. package/dist/types/EditSite.d.ts +5 -16
  34. package/dist/types/FederationError.d.ts +1 -1
  35. package/dist/types/GetComments.d.ts +0 -1
  36. package/dist/types/GetModlog.d.ts +3 -2
  37. package/dist/types/GetModlogResponse.d.ts +2 -34
  38. package/dist/types/GetPersonDetails.d.ts +0 -7
  39. package/dist/types/GetPersonDetailsResponse.d.ts +0 -4
  40. package/dist/types/GetPosts.d.ts +5 -0
  41. package/dist/types/GetRandomCommunity.d.ts +1 -0
  42. package/dist/types/GetSiteResponse.d.ts +1 -8
  43. package/dist/types/GetUnreadCountResponse.d.ts +2 -4
  44. package/dist/types/ImageGetParams.d.ts +4 -0
  45. package/dist/types/ImageGetParams.js +3 -0
  46. package/dist/types/ImageProxyParams.d.ts +5 -0
  47. package/dist/types/ImageProxyParams.js +3 -0
  48. package/dist/types/InboxCombinedPaginationCursor.d.ts +4 -0
  49. package/dist/types/InboxCombinedPaginationCursor.js +3 -0
  50. package/dist/types/InboxCombinedView.d.ts +13 -0
  51. package/dist/types/InboxDataType.d.ts +4 -0
  52. package/dist/types/InboxDataType.js +3 -0
  53. package/dist/types/LemmyErrorType.d.ts +5 -3
  54. package/dist/types/ListInbox.d.ts +11 -0
  55. package/dist/types/ListInboxResponse.d.ts +7 -0
  56. package/dist/types/ListPersonContent.d.ts +18 -0
  57. package/dist/types/ListPersonContentResponse.d.ts +7 -0
  58. package/dist/types/ListPersonSaved.d.ts +10 -0
  59. package/dist/types/ListPersonSavedResponse.d.ts +7 -0
  60. package/dist/types/LocalImage.d.ts +0 -1
  61. package/dist/types/LocalSite.d.ts +5 -0
  62. package/dist/types/LocalUser.d.ts +9 -0
  63. package/dist/types/MarkPersonCommentMentionAsRead.d.ts +8 -0
  64. package/dist/types/MarkPersonPostMentionAsRead.d.ts +8 -0
  65. package/dist/types/ModAdd.d.ts +3 -2
  66. package/dist/types/ModAddCommunity.d.ts +3 -2
  67. package/dist/types/ModAddCommunityId.d.ts +1 -0
  68. package/dist/types/ModAddCommunityId.js +3 -0
  69. package/dist/types/ModAddCommunityView.d.ts +1 -1
  70. package/dist/types/ModAddId.d.ts +1 -0
  71. package/dist/types/ModAddId.js +3 -0
  72. package/dist/types/ModAddView.d.ts +1 -1
  73. package/dist/types/ModBan.d.ts +3 -2
  74. package/dist/types/ModBanFromCommunity.d.ts +3 -2
  75. package/dist/types/ModBanFromCommunityId.d.ts +1 -0
  76. package/dist/types/ModBanFromCommunityId.js +3 -0
  77. package/dist/types/ModBanFromCommunityView.d.ts +1 -1
  78. package/dist/types/ModBanId.d.ts +1 -0
  79. package/dist/types/ModBanId.js +3 -0
  80. package/dist/types/ModBanView.d.ts +1 -1
  81. package/dist/types/ModFeaturePost.d.ts +3 -2
  82. package/dist/types/ModFeaturePostId.d.ts +1 -0
  83. package/dist/types/ModFeaturePostId.js +3 -0
  84. package/dist/types/ModFeaturePostView.d.ts +1 -0
  85. package/dist/types/ModHideCommunity.d.ts +3 -2
  86. package/dist/types/ModHideCommunityId.d.ts +1 -0
  87. package/dist/types/ModHideCommunityId.js +3 -0
  88. package/dist/types/ModLockPost.d.ts +3 -2
  89. package/dist/types/ModLockPostId.d.ts +1 -0
  90. package/dist/types/ModLockPostId.js +3 -0
  91. package/dist/types/ModLockPostView.d.ts +1 -0
  92. package/dist/types/ModRemoveComment.d.ts +3 -2
  93. package/dist/types/ModRemoveCommentId.d.ts +1 -0
  94. package/dist/types/ModRemoveCommentId.js +3 -0
  95. package/dist/types/ModRemoveCommentView.d.ts +1 -1
  96. package/dist/types/ModRemoveCommunity.d.ts +3 -2
  97. package/dist/types/ModRemoveCommunityId.d.ts +1 -0
  98. package/dist/types/ModRemoveCommunityId.js +3 -0
  99. package/dist/types/ModRemovePost.d.ts +3 -2
  100. package/dist/types/ModRemovePostId.d.ts +1 -0
  101. package/dist/types/ModRemovePostId.js +3 -0
  102. package/dist/types/ModRemovePostView.d.ts +1 -0
  103. package/dist/types/ModTransferCommunity.d.ts +3 -2
  104. package/dist/types/ModTransferCommunityId.d.ts +1 -0
  105. package/dist/types/ModTransferCommunityId.js +3 -0
  106. package/dist/types/ModTransferCommunityView.d.ts +1 -1
  107. package/dist/types/ModlogCombinedPaginationCursor.d.ts +4 -0
  108. package/dist/types/ModlogCombinedPaginationCursor.js +3 -0
  109. package/dist/types/ModlogCombinedView.d.ts +52 -0
  110. package/dist/types/{PersonMention.d.ts → PersonCommentMention.d.ts} +3 -3
  111. package/dist/types/PersonCommentMentionId.d.ts +4 -0
  112. package/dist/types/PersonCommentMentionId.js +3 -0
  113. package/dist/types/{PersonMentionView.d.ts → PersonCommentMentionView.d.ts} +4 -4
  114. package/dist/types/PersonCommentMentionView.js +2 -0
  115. package/dist/types/PersonContentCombinedPaginationCursor.d.ts +4 -0
  116. package/dist/types/PersonContentCombinedPaginationCursor.js +3 -0
  117. package/dist/types/PersonContentCombinedView.d.ts +7 -0
  118. package/dist/types/PersonContentCombinedView.js +2 -0
  119. package/dist/types/PersonContentType.d.ts +4 -0
  120. package/dist/types/PersonContentType.js +3 -0
  121. package/dist/types/PersonPostMention.d.ts +13 -0
  122. package/dist/types/PersonPostMention.js +2 -0
  123. package/dist/types/PersonPostMentionId.d.ts +4 -0
  124. package/dist/types/PersonPostMentionId.js +3 -0
  125. package/dist/types/PersonPostMentionView.d.ts +32 -0
  126. package/dist/types/PersonPostMentionView.js +2 -0
  127. package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +4 -0
  128. package/dist/types/PersonSavedCombinedPaginationCursor.js +3 -0
  129. package/dist/types/PostTags.d.ts +7 -0
  130. package/dist/types/PostTags.js +2 -0
  131. package/dist/types/PostView.d.ts +2 -0
  132. package/dist/types/ReportCombinedView.d.ts +4 -1
  133. package/dist/types/SaveUserSettings.d.ts +4 -8
  134. package/dist/types/Search.d.ts +7 -7
  135. package/dist/types/SearchCombinedId.d.ts +4 -0
  136. package/dist/types/SearchCombinedId.js +3 -0
  137. package/dist/types/SearchCombinedPaginationCursor.d.ts +4 -0
  138. package/dist/types/SearchCombinedPaginationCursor.js +3 -0
  139. package/dist/types/SearchCombinedView.d.ts +13 -0
  140. package/dist/types/SearchCombinedView.js +2 -0
  141. package/dist/types/SearchResponse.d.ts +2 -10
  142. package/dist/types/SearchSortType.d.ts +4 -0
  143. package/dist/types/SearchSortType.js +3 -0
  144. package/dist/types/SiteResponse.d.ts +1 -1
  145. package/dist/types/Tag.d.ts +27 -0
  146. package/dist/types/Tag.js +2 -0
  147. package/dist/types/TagId.d.ts +4 -0
  148. package/dist/types/TagId.js +3 -0
  149. package/dist/types/UploadImageResponse.d.ts +4 -0
  150. package/dist/types/UploadImageResponse.js +3 -0
  151. package/package.json +2 -2
  152. package/dist/types/CommentReplyResponse.d.ts +0 -7
  153. package/dist/types/GetPersonMentions.d.ts +0 -10
  154. package/dist/types/GetPersonMentionsResponse.d.ts +0 -7
  155. package/dist/types/GetPrivateMessages.d.ts +0 -10
  156. package/dist/types/GetReplies.d.ts +0 -10
  157. package/dist/types/GetRepliesResponse.d.ts +0 -7
  158. package/dist/types/MarkPersonMentionAsRead.d.ts +0 -8
  159. package/dist/types/ModlogListParams.d.ts +0 -17
  160. package/dist/types/PersonMentionId.d.ts +0 -4
  161. package/dist/types/PersonMentionResponse.d.ts +0 -7
  162. package/dist/types/PrivateMessagesResponse.d.ts +0 -7
  163. package/dist/types/ReportCombined.d.ts +0 -14
  164. package/dist/types/ReportCombinedId.d.ts +0 -4
  165. /package/dist/types/{PersonMentionId.js → AdminAllowInstanceId.js} +0 -0
  166. /package/dist/types/{ReportCombinedId.js → AdminBlockInstanceId.js} +0 -0
  167. /package/dist/types/{CommentReplyResponse.js → CommunityReport.js} +0 -0
  168. /package/dist/types/{GetPersonMentions.js → CommunityReportView.js} +0 -0
  169. /package/dist/types/{GetPersonMentionsResponse.js → InboxCombinedView.js} +0 -0
  170. /package/dist/types/{GetPrivateMessages.js → ListInbox.js} +0 -0
  171. /package/dist/types/{GetReplies.js → ListInboxResponse.js} +0 -0
  172. /package/dist/types/{GetRepliesResponse.js → ListPersonContent.js} +0 -0
  173. /package/dist/types/{MarkPersonMentionAsRead.js → ListPersonContentResponse.js} +0 -0
  174. /package/dist/types/{ModlogListParams.js → ListPersonSaved.js} +0 -0
  175. /package/dist/types/{PersonMention.js → ListPersonSavedResponse.js} +0 -0
  176. /package/dist/types/{PersonMentionResponse.js → MarkPersonCommentMentionAsRead.js} +0 -0
  177. /package/dist/types/{PersonMentionView.js → MarkPersonPostMentionAsRead.js} +0 -0
  178. /package/dist/types/{PrivateMessagesResponse.js → ModlogCombinedView.js} +0 -0
  179. /package/dist/types/{ReportCombined.js → PersonCommentMention.js} +0 -0
package/dist/http.d.ts CHANGED
@@ -14,7 +14,6 @@ import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
14
14
  import { BlockPerson } from "./types/BlockPerson";
15
15
  import { BlockPersonResponse } from "./types/BlockPersonResponse";
16
16
  import { ChangePassword } from "./types/ChangePassword";
17
- import { CommentReplyResponse } from "./types/CommentReplyResponse";
18
17
  import { CommentReportResponse } from "./types/CommentReportResponse";
19
18
  import { CommentResponse } from "./types/CommentResponse";
20
19
  import { CommunityResponse } from "./types/CommunityResponse";
@@ -60,15 +59,10 @@ import { GetModlog } from "./types/GetModlog";
60
59
  import { GetModlogResponse } from "./types/GetModlogResponse";
61
60
  import { GetPersonDetails } from "./types/GetPersonDetails";
62
61
  import { GetPersonDetailsResponse } from "./types/GetPersonDetailsResponse";
63
- import { GetPersonMentions } from "./types/GetPersonMentions";
64
- import { GetPersonMentionsResponse } from "./types/GetPersonMentionsResponse";
65
62
  import { GetPost } from "./types/GetPost";
66
63
  import { GetPostResponse } from "./types/GetPostResponse";
67
64
  import { GetPosts } from "./types/GetPosts";
68
65
  import { GetPostsResponse } from "./types/GetPostsResponse";
69
- import { GetPrivateMessages } from "./types/GetPrivateMessages";
70
- import { GetReplies } from "./types/GetReplies";
71
- import { GetRepliesResponse } from "./types/GetRepliesResponse";
72
66
  import { GetReportCount } from "./types/GetReportCount";
73
67
  import { GetReportCountResponse } from "./types/GetReportCountResponse";
74
68
  import { GetSiteMetadata } from "./types/GetSiteMetadata";
@@ -84,17 +78,14 @@ import { LockPost } from "./types/LockPost";
84
78
  import { Login } from "./types/Login";
85
79
  import { LoginResponse } from "./types/LoginResponse";
86
80
  import { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
87
- import { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
88
81
  import { MarkPostAsRead } from "./types/MarkPostAsRead";
89
82
  import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
90
83
  import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
91
84
  import { PasswordReset } from "./types/PasswordReset";
92
- import { PersonMentionResponse } from "./types/PersonMentionResponse";
93
85
  import { PostReportResponse } from "./types/PostReportResponse";
94
86
  import { PostResponse } from "./types/PostResponse";
95
87
  import { PrivateMessageReportResponse } from "./types/PrivateMessageReportResponse";
96
88
  import { PrivateMessageResponse } from "./types/PrivateMessageResponse";
97
- import { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
98
89
  import { PurgeComment } from "./types/PurgeComment";
99
90
  import { PurgeCommunity } from "./types/PurgeCommunity";
100
91
  import { PurgePerson } from "./types/PurgePerson";
@@ -117,7 +108,7 @@ import { SearchResponse } from "./types/SearchResponse";
117
108
  import { SiteResponse } from "./types/SiteResponse";
118
109
  import { TransferCommunity } from "./types/TransferCommunity";
119
110
  import { VerifyEmail } from "./types/VerifyEmail";
120
- import { DeleteImage, UploadImage, UploadImageResponse } from "./other_types";
111
+ import { UploadImage } from "./other_types";
121
112
  import { HideCommunity } from "./types/HideCommunity";
122
113
  import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
123
114
  import { UpdateTotp } from "./types/UpdateTotp";
@@ -153,6 +144,16 @@ import { MyUserInfo } from "./types/MyUserInfo";
153
144
  import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
154
145
  import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
155
146
  import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
147
+ import { ListPersonContent } from "./types/ListPersonContent";
148
+ import { ListPersonContentResponse } from "./types/ListPersonContentResponse";
149
+ import { ListPersonSaved } from "./types/ListPersonSaved";
150
+ import { ListPersonSavedResponse } from "./types/ListPersonSavedResponse";
151
+ import { DeleteImageParams } from "./types/DeleteImageParams";
152
+ import { UploadImageResponse } from "./types/UploadImageResponse";
153
+ import { ListInboxResponse } from "./types/ListInboxResponse";
154
+ import { ListInbox } from "./types/ListInbox";
155
+ import { MarkPersonCommentMentionAsRead } from "./types/MarkPersonCommentMentionAsRead";
156
+ import { MarkPersonPostMentionAsRead } from "./types/MarkPersonPostMentionAsRead";
156
157
  type RequestOptions = Pick<RequestInit, "signal">;
157
158
  /**
158
159
  * Helps build lemmy HTTP requests.
@@ -485,7 +486,7 @@ export declare class LemmyHttp {
485
486
  *
486
487
  * `HTTP.POST /comment/mark_as_read`
487
488
  */
488
- markCommentReplyAsRead(form: MarkCommentReplyAsRead, options?: RequestOptions): Promise<CommentReplyResponse>;
489
+ markCommentReplyAsRead(form: MarkCommentReplyAsRead, options?: RequestOptions): Promise<SuccessResponse>;
489
490
  /**
490
491
  * Like / vote on a comment.
491
492
  *
@@ -534,12 +535,6 @@ export declare class LemmyHttp {
534
535
  * `HTTP.PUT /comment/report/resolve`
535
536
  */
536
537
  resolveCommentReport(form: ResolveCommentReport, options?: RequestOptions): Promise<CommentReportResponse>;
537
- /**
538
- * Get / fetch private messages.
539
- *
540
- * `HTTP.GET /private_message/list`
541
- */
542
- getPrivateMessages(form: GetPrivateMessages, options?: RequestOptions): Promise<PrivateMessagesResponse>;
543
538
  /**
544
539
  * Create a private message.
545
540
  *
@@ -601,29 +596,23 @@ export declare class LemmyHttp {
601
596
  */
602
597
  getPersonDetails(form?: GetPersonDetails, options?: RequestOptions): Promise<GetPersonDetailsResponse>;
603
598
  /**
604
- * Get mentions for your user.
605
- *
606
- * `HTTP.GET /account/mention`
607
- */
608
- getPersonMentions(form: GetPersonMentions, options?: RequestOptions): Promise<GetPersonMentionsResponse>;
609
- /**
610
- * Mark a person mention as read.
599
+ * List the content for a person.
611
600
  *
612
- * `HTTP.POST /account/mention/mark_as_read`
601
+ * `HTTP.GET /person/content`
613
602
  */
614
- markPersonMentionAsRead(form: MarkPersonMentionAsRead, options?: RequestOptions): Promise<PersonMentionResponse>;
603
+ listPersonContent(form?: ListPersonContent, options?: RequestOptions): Promise<ListPersonContentResponse>;
615
604
  /**
616
605
  * Mark a person mention as read.
617
606
  *
618
- * `HTTP.POST /account/mention/mark_as_read`
607
+ * `HTTP.POST /account/mention/comment/mark_as_read`
619
608
  */
620
- markPersonAllMentionAsRead(options?: RequestOptions): Promise<PersonMentionResponse>;
609
+ markCommentMentionAsRead(form: MarkPersonCommentMentionAsRead, options?: RequestOptions): Promise<SuccessResponse>;
621
610
  /**
622
- * Get comment replies.
611
+ * Mark a person post body mention as read.
623
612
  *
624
- * `HTTP.GET /account/replies`
613
+ * `HTTP.POST /account/mention/post/mark_as_read`
625
614
  */
626
- getReplies(form: GetReplies, options?: RequestOptions): Promise<GetRepliesResponse>;
615
+ markPostMentionAsRead(form: MarkPersonPostMentionAsRead, options?: RequestOptions): Promise<SuccessResponse>;
627
616
  /**
628
617
  * Ban a person from your site.
629
618
  *
@@ -669,9 +658,9 @@ export declare class LemmyHttp {
669
658
  /**
670
659
  * Mark all replies as read.
671
660
  *
672
- * `HTTP.POST /account/mention/mark_as_read/all`
661
+ * `HTTP.POST /account/mark_as_read/all`
673
662
  */
674
- markAllAsRead(options?: RequestOptions): Promise<GetRepliesResponse>;
663
+ markAllNotificationsAsRead(options?: RequestOptions): Promise<SuccessResponse>;
675
664
  /**
676
665
  * Save your user settings.
677
666
  *
@@ -696,12 +685,24 @@ export declare class LemmyHttp {
696
685
  * `HTTP.GET /account/unread_count`
697
686
  */
698
687
  getUnreadCount(options?: RequestOptions): Promise<GetUnreadCountResponse>;
688
+ /**
689
+ * Get your inbox (replies, comment mentions, post mentions, and messages)
690
+ *
691
+ * `HTTP.GET /account/inbox`
692
+ */
693
+ listInbox(form: ListInbox, options?: RequestOptions): Promise<ListInboxResponse>;
699
694
  /**
700
695
  * Verify your email
701
696
  *
702
697
  * `HTTP.POST /account/auth/verify_email`
703
698
  */
704
699
  verifyEmail(form: VerifyEmail, options?: RequestOptions): Promise<SuccessResponse>;
700
+ /**
701
+ * List your saved content.
702
+ *
703
+ * `HTTP.GET /account/auth/saved`
704
+ */
705
+ listPersonSaved(form: ListPersonSaved, options?: RequestOptions): Promise<ListPersonSavedResponse>;
705
706
  /**
706
707
  * Add an admin to your site.
707
708
  *
@@ -858,14 +859,96 @@ export declare class LemmyHttp {
858
859
  * `HTTP.Post /admin/instance/allow`
859
860
  */
860
861
  adminAllowInstance(form: AdminAllowInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
862
+ /**
863
+ * Upload new user avatar.
864
+ *
865
+ * `HTTP.Post /account/avatar`
866
+ */
867
+ uploadUserAvatar(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
868
+ /**
869
+ * Delete the user avatar.
870
+ *
871
+ * `HTTP.Delete /account/avatar`
872
+ */
873
+ deleteUserAvatar(options?: RequestOptions): Promise<SuccessResponse>;
874
+ /**
875
+ * Upload new user banner.
876
+ *
877
+ * `HTTP.Post /account/banner`
878
+ */
879
+ uploadUserBanner(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
880
+ /**
881
+ * Delete the user banner.
882
+ *
883
+ * `HTTP.Delete /account/banner`
884
+ */
885
+ deleteUserBanner(options?: RequestOptions): Promise<SuccessResponse>;
886
+ /**
887
+ * Upload new community icon.
888
+ *
889
+ * `HTTP.Post /community/icon`
890
+ */
891
+ uploadCommunityIcon(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
892
+ /**
893
+ * Delete the community icon.
894
+ *
895
+ * `HTTP.Delete /community/icon`
896
+ */
897
+ deleteCommunityIcon(options?: RequestOptions): Promise<SuccessResponse>;
898
+ /**
899
+ * Upload new community banner.
900
+ *
901
+ * `HTTP.Post /community/banner`
902
+ */
903
+ uploadCommunityBanner(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
904
+ /**
905
+ * Delete the community banner.
906
+ *
907
+ * `HTTP.Delete /community/banner`
908
+ */
909
+ deleteCommunityBanner(options?: RequestOptions): Promise<SuccessResponse>;
910
+ /**
911
+ * Upload new site icon.
912
+ *
913
+ * `HTTP.Post /site/icon`
914
+ */
915
+ uploadSiteIcon(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
916
+ /**
917
+ * Delete the site icon.
918
+ *
919
+ * `HTTP.Delete /site/icon`
920
+ */
921
+ deleteSiteIcon(options?: RequestOptions): Promise<SuccessResponse>;
922
+ /**
923
+ * Upload new site banner.
924
+ *
925
+ * `HTTP.Post /site/banner`
926
+ */
927
+ uploadSiteBanner(image: UploadImage, options?: RequestOptions): Promise<SuccessResponse>;
928
+ /**
929
+ * Delete the site banner.
930
+ *
931
+ * `HTTP.Delete /site/banner`
932
+ */
933
+ deleteSiteBanner(options?: RequestOptions): Promise<SuccessResponse>;
861
934
  /**
862
935
  * Upload an image to the server.
936
+ *
937
+ * `HTTP.Post /image`
863
938
  */
864
- uploadImage({ image }: UploadImage, options?: RequestOptions): Promise<UploadImageResponse>;
939
+ uploadImage(image: UploadImage, options?: RequestOptions): Promise<UploadImageResponse>;
865
940
  /**
866
941
  * Delete a pictrs image
942
+ *
943
+ * `HTTP.Delete /image`
944
+ */
945
+ deleteImage(form: DeleteImageParams, options?: RequestOptions): Promise<SuccessResponse>;
946
+ /**
947
+ * Health check for image functionality
948
+ *
949
+ * `HTTP.Get /image/health`
867
950
  */
868
- deleteImage({ token, filename }: DeleteImage, options?: RequestOptions): Promise<boolean>;
951
+ imageHealth(options?: RequestOptions): Promise<SuccessResponse>;
869
952
  /**
870
953
  * Set the headers (can be used to set the auth header)
871
954
  */
package/dist/http.js CHANGED
@@ -19,7 +19,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
19
19
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
20
20
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
21
21
  };
22
- var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_pictrsUrl, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_wrapper;
22
+ var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_upload, _LemmyHttp_wrapper;
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.LemmyHttp = void 0;
25
25
  const other_types_1 = require("./other_types");
@@ -28,6 +28,7 @@ var HttpType;
28
28
  HttpType["Get"] = "GET";
29
29
  HttpType["Post"] = "POST";
30
30
  HttpType["Put"] = "PUT";
31
+ HttpType["Delete"] = "DELETE";
31
32
  })(HttpType || (HttpType = {}));
32
33
  /**
33
34
  * Helps build lemmy HTTP requests.
@@ -42,10 +43,8 @@ class LemmyHttp {
42
43
  _LemmyHttp_instances.add(this);
43
44
  _LemmyHttp_apiUrl.set(this, void 0);
44
45
  _LemmyHttp_headers.set(this, {});
45
- _LemmyHttp_pictrsUrl.set(this, void 0);
46
46
  _LemmyHttp_fetchFunction.set(this, fetch.bind(globalThis));
47
47
  __classPrivateFieldSet(this, _LemmyHttp_apiUrl, `${baseUrl.replace(/\/+$/, "")}/api/${other_types_1.VERSION}`, "f");
48
- __classPrivateFieldSet(this, _LemmyHttp_pictrsUrl, `${baseUrl}/pictrs/image`, "f");
49
48
  if (options === null || options === void 0 ? void 0 : options.headers) {
50
49
  __classPrivateFieldSet(this, _LemmyHttp_headers, options.headers, "f");
51
50
  }
@@ -542,14 +541,6 @@ class LemmyHttp {
542
541
  resolveCommentReport(form, options) {
543
542
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/comment/report/resolve", form, options);
544
543
  }
545
- /**
546
- * Get / fetch private messages.
547
- *
548
- * `HTTP.GET /private_message/list`
549
- */
550
- getPrivateMessages(form, options) {
551
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/private_message/list", form, options);
552
- }
553
544
  /**
554
545
  * Create a private message.
555
546
  *
@@ -631,36 +622,28 @@ class LemmyHttp {
631
622
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/person", form, options);
632
623
  }
633
624
  /**
634
- * Get mentions for your user.
625
+ * List the content for a person.
635
626
  *
636
- * `HTTP.GET /account/mention`
627
+ * `HTTP.GET /person/content`
637
628
  */
638
- getPersonMentions(form, options) {
639
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/mention", form, options);
629
+ listPersonContent(form = {}, options) {
630
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/person/content", form, options);
640
631
  }
641
632
  /**
642
633
  * Mark a person mention as read.
643
634
  *
644
- * `HTTP.POST /account/mention/mark_as_read`
635
+ * `HTTP.POST /account/mention/comment/mark_as_read`
645
636
  */
646
- markPersonMentionAsRead(form, options) {
647
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/mark_as_read", form, options);
637
+ markCommentMentionAsRead(form, options) {
638
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/comment/mark_as_read", form, options);
648
639
  }
649
640
  /**
650
- * Mark a person mention as read.
641
+ * Mark a person post body mention as read.
651
642
  *
652
- * `HTTP.POST /account/mention/mark_as_read`
643
+ * `HTTP.POST /account/mention/post/mark_as_read`
653
644
  */
654
- markPersonAllMentionAsRead(options) {
655
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/mark_as_read", {}, options);
656
- }
657
- /**
658
- * Get comment replies.
659
- *
660
- * `HTTP.GET /account/replies`
661
- */
662
- getReplies(form, options) {
663
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/replies", form, options);
645
+ markPostMentionAsRead(form, options) {
646
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/post/mark_as_read", form, options);
664
647
  }
665
648
  /**
666
649
  * Ban a person from your site.
@@ -721,10 +704,10 @@ class LemmyHttp {
721
704
  /**
722
705
  * Mark all replies as read.
723
706
  *
724
- * `HTTP.POST /account/mention/mark_as_read/all`
707
+ * `HTTP.POST /account/mark_as_read/all`
725
708
  */
726
- markAllAsRead(options) {
727
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/mark_as_read/all", {}, options);
709
+ markAllNotificationsAsRead(options) {
710
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read/all", {}, options);
728
711
  }
729
712
  /**
730
713
  * Save your user settings.
@@ -758,6 +741,14 @@ class LemmyHttp {
758
741
  getUnreadCount(options) {
759
742
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/unread_count", {}, options);
760
743
  }
744
+ /**
745
+ * Get your inbox (replies, comment mentions, post mentions, and messages)
746
+ *
747
+ * `HTTP.GET /account/inbox`
748
+ */
749
+ listInbox(form, options) {
750
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/inbox", form, options);
751
+ }
761
752
  /**
762
753
  * Verify your email
763
754
  *
@@ -766,6 +757,14 @@ class LemmyHttp {
766
757
  verifyEmail(form, options) {
767
758
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/verify_email", form, options);
768
759
  }
760
+ /**
761
+ * List your saved content.
762
+ *
763
+ * `HTTP.GET /account/auth/saved`
764
+ */
765
+ listPersonSaved(form, options) {
766
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/auth/saved", form, options);
767
+ }
769
768
  /**
770
769
  * Add an admin to your site.
771
770
  *
@@ -974,36 +973,154 @@ class LemmyHttp {
974
973
  adminAllowInstance(form, options) {
975
974
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/admin/instance/allow", form, options);
976
975
  }
976
+ /**
977
+ * Upload new user avatar.
978
+ *
979
+ * `HTTP.Post /account/avatar`
980
+ */
981
+ uploadUserAvatar(image, options) {
982
+ return __awaiter(this, void 0, void 0, function* () {
983
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/avatar", image, options);
984
+ });
985
+ }
986
+ /**
987
+ * Delete the user avatar.
988
+ *
989
+ * `HTTP.Delete /account/avatar`
990
+ */
991
+ deleteUserAvatar(options) {
992
+ return __awaiter(this, void 0, void 0, function* () {
993
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/avatar", {}, options);
994
+ });
995
+ }
996
+ /**
997
+ * Upload new user banner.
998
+ *
999
+ * `HTTP.Post /account/banner`
1000
+ */
1001
+ uploadUserBanner(image, options) {
1002
+ return __awaiter(this, void 0, void 0, function* () {
1003
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/account/banner", image, options);
1004
+ });
1005
+ }
1006
+ /**
1007
+ * Delete the user banner.
1008
+ *
1009
+ * `HTTP.Delete /account/banner`
1010
+ */
1011
+ deleteUserBanner(options) {
1012
+ return __awaiter(this, void 0, void 0, function* () {
1013
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/account/banner", {}, options);
1014
+ });
1015
+ }
1016
+ /**
1017
+ * Upload new community icon.
1018
+ *
1019
+ * `HTTP.Post /community/icon`
1020
+ */
1021
+ uploadCommunityIcon(image, options) {
1022
+ return __awaiter(this, void 0, void 0, function* () {
1023
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/icon", image, options);
1024
+ });
1025
+ }
1026
+ /**
1027
+ * Delete the community icon.
1028
+ *
1029
+ * `HTTP.Delete /community/icon`
1030
+ */
1031
+ deleteCommunityIcon(options) {
1032
+ return __awaiter(this, void 0, void 0, function* () {
1033
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/icon", {}, options);
1034
+ });
1035
+ }
1036
+ /**
1037
+ * Upload new community banner.
1038
+ *
1039
+ * `HTTP.Post /community/banner`
1040
+ */
1041
+ uploadCommunityBanner(image, options) {
1042
+ return __awaiter(this, void 0, void 0, function* () {
1043
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/community/banner", image, options);
1044
+ });
1045
+ }
1046
+ /**
1047
+ * Delete the community banner.
1048
+ *
1049
+ * `HTTP.Delete /community/banner`
1050
+ */
1051
+ deleteCommunityBanner(options) {
1052
+ return __awaiter(this, void 0, void 0, function* () {
1053
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/community/banner", {}, options);
1054
+ });
1055
+ }
1056
+ /**
1057
+ * Upload new site icon.
1058
+ *
1059
+ * `HTTP.Post /site/icon`
1060
+ */
1061
+ uploadSiteIcon(image, options) {
1062
+ return __awaiter(this, void 0, void 0, function* () {
1063
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/icon", image, options);
1064
+ });
1065
+ }
1066
+ /**
1067
+ * Delete the site icon.
1068
+ *
1069
+ * `HTTP.Delete /site/icon`
1070
+ */
1071
+ deleteSiteIcon(options) {
1072
+ return __awaiter(this, void 0, void 0, function* () {
1073
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/icon", {}, options);
1074
+ });
1075
+ }
1076
+ /**
1077
+ * Upload new site banner.
1078
+ *
1079
+ * `HTTP.Post /site/banner`
1080
+ */
1081
+ uploadSiteBanner(image, options) {
1082
+ return __awaiter(this, void 0, void 0, function* () {
1083
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/site/banner", image, options);
1084
+ });
1085
+ }
1086
+ /**
1087
+ * Delete the site banner.
1088
+ *
1089
+ * `HTTP.Delete /site/banner`
1090
+ */
1091
+ deleteSiteBanner(options) {
1092
+ return __awaiter(this, void 0, void 0, function* () {
1093
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/site/banner", {}, options);
1094
+ });
1095
+ }
977
1096
  /**
978
1097
  * Upload an image to the server.
1098
+ *
1099
+ * `HTTP.Post /image`
979
1100
  */
980
- uploadImage(_a, options_1) {
981
- return __awaiter(this, arguments, void 0, function* ({ image }, options) {
982
- const formData = createFormData(image);
983
- let url = undefined;
984
- let delete_url = undefined;
985
- const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f"), Object.assign(Object.assign({}, options), { method: HttpType.Post, body: formData, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
986
- if (response.status === 413) {
987
- return { msg: "too_large" };
988
- }
989
- const responseJson = yield response.json();
990
- if (responseJson.msg === "ok") {
991
- const { file: hash, delete_token: deleteToken } = responseJson.files[0];
992
- delete_url = `${__classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f")}/delete/${deleteToken}/${hash}`;
993
- url = `${__classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f")}/${hash}`;
994
- }
995
- return Object.assign(Object.assign({}, responseJson), { url,
996
- delete_url });
1101
+ uploadImage(image, options) {
1102
+ return __awaiter(this, void 0, void 0, function* () {
1103
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_upload).call(this, "/image", image, options);
997
1104
  });
998
1105
  }
999
1106
  /**
1000
1107
  * Delete a pictrs image
1108
+ *
1109
+ * `HTTP.Delete /image`
1110
+ */
1111
+ deleteImage(form, options) {
1112
+ return __awaiter(this, void 0, void 0, function* () {
1113
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/image", form, options);
1114
+ });
1115
+ }
1116
+ /**
1117
+ * Health check for image functionality
1118
+ *
1119
+ * `HTTP.Get /image/health`
1001
1120
  */
1002
- deleteImage(_a, options_1) {
1003
- return __awaiter(this, arguments, void 0, function* ({ token, filename }, options) {
1004
- const deleteUrl = `${__classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f")}/delete/${token}/${filename}`;
1005
- const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, deleteUrl, Object.assign(Object.assign({}, options), { method: HttpType.Get, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
1006
- return response.status == 204;
1121
+ imageHealth(options) {
1122
+ return __awaiter(this, void 0, void 0, function* () {
1123
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/image/health", {}, options);
1007
1124
  });
1008
1125
  }
1009
1126
  /**
@@ -1014,8 +1131,14 @@ class LemmyHttp {
1014
1131
  }
1015
1132
  }
1016
1133
  exports.LemmyHttp = LemmyHttp;
1017
- _LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHttp_pictrsUrl = new WeakMap(), _LemmyHttp_fetchFunction = new WeakMap(), _LemmyHttp_instances = new WeakSet(), _LemmyHttp_buildFullUrl = function _LemmyHttp_buildFullUrl(endpoint) {
1134
+ _LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHttp_fetchFunction = new WeakMap(), _LemmyHttp_instances = new WeakSet(), _LemmyHttp_buildFullUrl = function _LemmyHttp_buildFullUrl(endpoint) {
1018
1135
  return `${__classPrivateFieldGet(this, _LemmyHttp_apiUrl, "f")}${endpoint}`;
1136
+ }, _LemmyHttp_upload = function _LemmyHttp_upload(path_1, _a, options_1) {
1137
+ return __awaiter(this, arguments, void 0, function* (path, { image }, options) {
1138
+ const formData = createFormData(image);
1139
+ const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_buildFullUrl).call(this, path), Object.assign(Object.assign({}, options), { method: HttpType.Post, body: formData, headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f") }));
1140
+ return response.json();
1141
+ });
1019
1142
  }, _LemmyHttp_wrapper = function _LemmyHttp_wrapper(type_, endpoint, form, options) {
1020
1143
  return __awaiter(this, void 0, void 0, function* () {
1021
1144
  var _a;