lemmy-js-client 1.0.0-add-liked.0 → 1.0.0-admin-block-expiry.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/README.md +6 -0
  2. package/dist/http.d.ts +65 -29
  3. package/dist/http.js +184 -59
  4. package/dist/index.d.ts +50 -32
  5. package/dist/index.js +3 -0
  6. package/dist/other_types.d.ts +8 -2
  7. package/dist/types/AdminAdd.d.ts +12 -0
  8. package/dist/types/AdminAddId.d.ts +1 -0
  9. package/dist/types/{ModAddView.d.ts → AdminAddView.d.ts} +3 -3
  10. package/dist/types/AdminAllowInstance.d.ts +2 -2
  11. package/dist/types/AdminAllowInstanceParams.d.ts +1 -1
  12. package/dist/types/{ModBan.d.ts → AdminBan.d.ts} +6 -6
  13. package/dist/types/AdminBanId.d.ts +1 -0
  14. package/dist/types/{ModBanView.d.ts → AdminBanView.d.ts} +3 -3
  15. package/dist/types/AdminBlockInstance.d.ts +3 -3
  16. package/dist/types/AdminBlockInstanceParams.d.ts +7 -2
  17. package/dist/types/AdminPurgeComment.d.ts +2 -2
  18. package/dist/types/AdminPurgeCommunity.d.ts +2 -2
  19. package/dist/types/AdminPurgePerson.d.ts +2 -2
  20. package/dist/types/AdminPurgePost.d.ts +2 -2
  21. package/dist/types/{ModRemoveCommunity.d.ts → AdminRemoveCommunity.d.ts} +5 -5
  22. package/dist/types/AdminRemoveCommunityId.d.ts +1 -0
  23. package/dist/types/AdminRemoveCommunityView.d.ts +11 -0
  24. package/dist/types/AllLemmyErrors.d.ts +1 -0
  25. package/dist/types/AllLemmyErrors.js +119 -0
  26. package/dist/types/BanFromCommunity.d.ts +2 -2
  27. package/dist/types/BanPerson.d.ts +2 -2
  28. package/dist/types/Comment.d.ts +6 -2
  29. package/dist/types/CommentActions.d.ts +2 -2
  30. package/dist/types/CommentReport.d.ts +2 -2
  31. package/dist/types/CommentReportView.d.ts +5 -1
  32. package/dist/types/CommentResponse.d.ts +0 -2
  33. package/dist/types/CommentSlimView.d.ts +2 -6
  34. package/dist/types/CommentView.d.ts +4 -5
  35. package/dist/types/Community.d.ts +2 -2
  36. package/dist/types/CommunityActions.d.ts +7 -5
  37. package/dist/types/CommunityNotificationsMode.d.ts +4 -0
  38. package/dist/types/CommunityReport.d.ts +2 -2
  39. package/dist/types/CommunityReportView.d.ts +6 -0
  40. package/dist/types/CommunityView.d.ts +0 -2
  41. package/dist/types/CreateCommunityTag.d.ts +3 -1
  42. package/dist/types/CreateCustomEmoji.d.ts +2 -1
  43. package/dist/types/CreateCustomEmoji.js +0 -1
  44. package/dist/types/CreateMultiCommunity.d.ts +5 -0
  45. package/dist/types/CreateOrDeleteMultiCommunityEntry.d.ts +6 -0
  46. package/dist/types/CreatePost.d.ts +1 -1
  47. package/dist/types/CreateSite.d.ts +16 -13
  48. package/dist/types/CustomEmoji.d.ts +2 -2
  49. package/dist/types/EditCustomEmoji.d.ts +7 -5
  50. package/dist/types/EditPost.d.ts +1 -1
  51. package/dist/types/EditSite.d.ts +26 -16
  52. package/dist/types/ExportDataResponse.d.ts +13 -0
  53. package/dist/types/FederationBlockList.d.ts +3 -3
  54. package/dist/types/FollowMultiCommunity.d.ts +5 -0
  55. package/dist/types/GetMultiCommunity.d.ts +4 -0
  56. package/dist/types/GetMultiCommunityResponse.d.ts +6 -0
  57. package/dist/types/GetPosts.d.ts +2 -0
  58. package/dist/types/HideCommunity.d.ts +1 -1
  59. package/dist/types/Instance.d.ts +2 -2
  60. package/dist/types/InstanceActions.d.ts +8 -4
  61. package/dist/types/InstanceWithFederationState.d.ts +2 -2
  62. package/dist/types/LemmyErrorType.d.ts +25 -140
  63. package/dist/types/LinkMetadata.d.ts +4 -0
  64. package/dist/types/ListMultiCommunities.d.ts +5 -0
  65. package/dist/types/ListMultiCommunitiesResponse.d.ts +4 -0
  66. package/dist/types/{ListInbox.d.ts → ListNotifications.d.ts} +3 -3
  67. package/dist/types/{ListInboxResponse.d.ts → ListNotificationsResponse.d.ts} +3 -3
  68. package/dist/types/ListingType.d.ts +1 -1
  69. package/dist/types/LocalImage.d.ts +2 -2
  70. package/dist/types/LocalSite.d.ts +5 -6
  71. package/dist/types/LocalSiteRateLimit.d.ts +16 -16
  72. package/dist/types/LocalSiteUrlBlocklist.d.ts +2 -2
  73. package/dist/types/LocalUser.d.ts +11 -13
  74. package/dist/types/LocalUserView.d.ts +2 -2
  75. package/dist/types/LockComment.d.ts +9 -0
  76. package/dist/types/LockPost.d.ts +1 -1
  77. package/dist/types/LoginToken.d.ts +1 -1
  78. package/dist/types/MarkNotificationAsRead.d.ts +8 -0
  79. package/dist/types/{ModAddCommunity.d.ts → ModAddToCommunity.d.ts} +4 -4
  80. package/dist/types/ModAddToCommunityId.d.ts +1 -0
  81. package/dist/types/{ModAddCommunityView.d.ts → ModAddToCommunityView.d.ts} +3 -3
  82. package/dist/types/ModBanFromCommunity.d.ts +3 -3
  83. package/dist/types/ModChangeCommunityVisibility.d.ts +1 -1
  84. package/dist/types/ModEditPost.d.ts +10 -0
  85. package/dist/types/ModFeaturePost.d.ts +1 -1
  86. package/dist/types/ModLockComment.d.ts +14 -0
  87. package/dist/types/ModLockCommentId.d.ts +1 -0
  88. package/dist/types/ModLockCommentView.d.ts +16 -0
  89. package/dist/types/ModLockPost.d.ts +2 -2
  90. package/dist/types/ModRemoveComment.d.ts +2 -2
  91. package/dist/types/ModRemovePost.d.ts +2 -2
  92. package/dist/types/ModTransferCommunity.d.ts +1 -1
  93. package/dist/types/ModlogActionType.d.ts +1 -1
  94. package/dist/types/ModlogCombinedView.d.ts +16 -13
  95. package/dist/types/MultiCommunity.d.ts +17 -0
  96. package/dist/types/MultiCommunityFollow.d.ts +8 -0
  97. package/dist/types/MultiCommunityFollow.js +2 -0
  98. package/dist/types/MultiCommunityId.d.ts +1 -0
  99. package/dist/types/MultiCommunityView.d.ts +6 -0
  100. package/dist/types/MultiCommunityView.js +2 -0
  101. package/dist/types/MyUserInfo.d.ts +2 -1
  102. package/dist/types/NotePerson.d.ts +10 -0
  103. package/dist/types/NotePerson.js +2 -0
  104. package/dist/types/Notification.d.ts +36 -0
  105. package/dist/types/Notification.js +2 -0
  106. package/dist/types/NotificationData.d.ts +40 -0
  107. package/dist/types/NotificationData.js +2 -0
  108. package/dist/types/NotificationDataType.d.ts +4 -0
  109. package/dist/types/NotificationId.d.ts +1 -0
  110. package/dist/types/NotificationId.js +3 -0
  111. package/dist/types/NotificationType.d.ts +4 -0
  112. package/dist/types/NotificationType.js +3 -0
  113. package/dist/types/NotificationView.d.ts +6 -0
  114. package/dist/types/NotificationView.js +2 -0
  115. package/dist/types/OAuthAccount.d.ts +2 -2
  116. package/dist/types/OAuthProvider.d.ts +2 -2
  117. package/dist/types/OpenGraphData.d.ts +4 -0
  118. package/dist/types/Person.d.ts +2 -2
  119. package/dist/types/PersonActions.d.ts +21 -1
  120. package/dist/types/PersonView.d.ts +4 -4
  121. package/dist/types/Post.d.ts +6 -4
  122. package/dist/types/PostActions.d.ts +7 -5
  123. package/dist/types/PostActions.js +0 -1
  124. package/dist/types/PostNotificationsMode.d.ts +4 -0
  125. package/dist/types/PostNotificationsMode.js +3 -0
  126. package/dist/types/PostOrCommentOrPrivateMessage.d.ts +10 -0
  127. package/dist/types/PostOrCommentOrPrivateMessage.js +2 -0
  128. package/dist/types/PostReport.d.ts +2 -2
  129. package/dist/types/PostReportView.d.ts +5 -1
  130. package/dist/types/PostView.d.ts +4 -5
  131. package/dist/types/PrivateMessage.d.ts +2 -3
  132. package/dist/types/PrivateMessageReport.d.ts +2 -2
  133. package/dist/types/PrivateMessageReportView.d.ts +3 -0
  134. package/dist/types/PurgeComment.d.ts +1 -1
  135. package/dist/types/PurgeCommunity.d.ts +1 -1
  136. package/dist/types/PurgePerson.d.ts +1 -1
  137. package/dist/types/PurgePost.d.ts +1 -1
  138. package/dist/types/ReadableFederationState.d.ts +3 -3
  139. package/dist/types/RegistrationApplication.d.ts +1 -1
  140. package/dist/types/RemoveComment.d.ts +1 -1
  141. package/dist/types/RemoveCommunity.d.ts +1 -1
  142. package/dist/types/RemovePost.d.ts +1 -1
  143. package/dist/types/SaveUserSettings.d.ts +9 -5
  144. package/dist/types/Search.d.ts +1 -1
  145. package/dist/types/SearchCombinedView.d.ts +4 -1
  146. package/dist/types/SearchType.d.ts +1 -1
  147. package/dist/types/Site.d.ts +2 -2
  148. package/dist/types/Tag.d.ts +8 -16
  149. package/dist/types/Tagline.d.ts +2 -2
  150. package/dist/types/TagsView.d.ts +1 -1
  151. package/dist/types/UntranslatedError.d.ts +12 -0
  152. package/dist/types/UntranslatedError.js +3 -0
  153. package/dist/types/UpdateCommunityNotifications.d.ts +9 -0
  154. package/dist/types/UpdateCommunityNotifications.js +2 -0
  155. package/dist/types/UpdateCommunityTag.d.ts +3 -2
  156. package/dist/types/UpdateMultiCommunity.d.ts +7 -0
  157. package/dist/types/UpdateMultiCommunity.js +2 -0
  158. package/dist/types/UpdatePostNotifications.d.ts +9 -0
  159. package/dist/types/UpdatePostNotifications.js +2 -0
  160. package/dist/types/UserBlockInstanceCommunitiesParams.d.ts +8 -0
  161. package/dist/types/UserBlockInstanceCommunitiesParams.js +2 -0
  162. package/dist/types/{UserBlockInstanceParams.d.ts → UserBlockInstancePersonsParams.d.ts} +2 -2
  163. package/dist/types/UserBlockInstancePersonsParams.js +2 -0
  164. package/dist/types/UserSettingsBackup.d.ts +27 -0
  165. package/dist/types/UserSettingsBackup.js +2 -0
  166. package/dist/types/VoteView.d.ts +1 -0
  167. package/package.json +6 -5
  168. package/dist/types/CommentReply.d.ts +0 -13
  169. package/dist/types/CommentReplyId.d.ts +0 -4
  170. package/dist/types/CommentReplyView.d.ts +0 -32
  171. package/dist/types/FederationError.d.ts +0 -10
  172. package/dist/types/InboxCombinedView.d.ts +0 -13
  173. package/dist/types/InboxDataType.d.ts +0 -4
  174. package/dist/types/MarkCommentReplyAsRead.d.ts +0 -8
  175. package/dist/types/MarkPersonCommentMentionAsRead.d.ts +0 -8
  176. package/dist/types/MarkPersonPostMentionAsRead.d.ts +0 -8
  177. package/dist/types/MarkPrivateMessageAsRead.d.ts +0 -8
  178. package/dist/types/ModAdd.d.ts +0 -12
  179. package/dist/types/ModAddCommunityId.d.ts +0 -1
  180. package/dist/types/ModAddId.d.ts +0 -1
  181. package/dist/types/ModBanId.d.ts +0 -1
  182. package/dist/types/ModRemoveCommunityId.d.ts +0 -1
  183. package/dist/types/ModRemoveCommunityView.d.ts +0 -11
  184. package/dist/types/PersonCommentMention.d.ts +0 -13
  185. package/dist/types/PersonCommentMentionId.d.ts +0 -4
  186. package/dist/types/PersonCommentMentionView.d.ts +0 -30
  187. package/dist/types/PersonPostMention.d.ts +0 -13
  188. package/dist/types/PersonPostMentionId.d.ts +0 -4
  189. package/dist/types/PersonPostMentionView.d.ts +0 -32
  190. package/dist/types/ResolveObjectResponse.d.ts +0 -13
  191. /package/dist/types/{CommentReply.js → AdminAdd.js} +0 -0
  192. /package/dist/types/{CommentReplyId.js → AdminAddId.js} +0 -0
  193. /package/dist/types/{CommentReplyView.js → AdminAddView.js} +0 -0
  194. /package/dist/types/{InboxCombinedView.js → AdminBan.js} +0 -0
  195. /package/dist/types/{FederationError.js → AdminBanId.js} +0 -0
  196. /package/dist/types/{ListInbox.js → AdminBanView.js} +0 -0
  197. /package/dist/types/{ListInboxResponse.js → AdminRemoveCommunity.js} +0 -0
  198. /package/dist/types/{InboxDataType.js → AdminRemoveCommunityId.js} +0 -0
  199. /package/dist/types/{MarkCommentReplyAsRead.js → AdminRemoveCommunityView.js} +0 -0
  200. /package/dist/types/{ModAddCommunityId.js → CommunityNotificationsMode.js} +0 -0
  201. /package/dist/types/{ModAddId.js → CreateMultiCommunity.js} +0 -0
  202. /package/dist/types/{MarkPersonCommentMentionAsRead.js → CreateOrDeleteMultiCommunityEntry.js} +0 -0
  203. /package/dist/types/{MarkPersonPostMentionAsRead.js → ExportDataResponse.js} +0 -0
  204. /package/dist/types/{MarkPrivateMessageAsRead.js → FollowMultiCommunity.js} +0 -0
  205. /package/dist/types/{ModAdd.js → GetMultiCommunity.js} +0 -0
  206. /package/dist/types/{ModAddCommunity.js → GetMultiCommunityResponse.js} +0 -0
  207. /package/dist/types/{ModAddCommunityView.js → ListMultiCommunities.js} +0 -0
  208. /package/dist/types/{ModAddView.js → ListMultiCommunitiesResponse.js} +0 -0
  209. /package/dist/types/{ModBan.js → ListNotifications.js} +0 -0
  210. /package/dist/types/{ModBanView.js → ListNotificationsResponse.js} +0 -0
  211. /package/dist/types/{ModRemoveCommunity.js → LockComment.js} +0 -0
  212. /package/dist/types/{ModRemoveCommunityView.js → MarkNotificationAsRead.js} +0 -0
  213. /package/dist/types/{PersonCommentMention.js → ModAddToCommunity.js} +0 -0
  214. /package/dist/types/{ModBanId.js → ModAddToCommunityId.js} +0 -0
  215. /package/dist/types/{PersonCommentMentionView.js → ModAddToCommunityView.js} +0 -0
  216. /package/dist/types/{PersonPostMention.js → ModEditPost.js} +0 -0
  217. /package/dist/types/{PersonPostMentionView.js → ModLockComment.js} +0 -0
  218. /package/dist/types/{ModRemoveCommunityId.js → ModLockCommentId.js} +0 -0
  219. /package/dist/types/{ResolveObjectResponse.js → ModLockCommentView.js} +0 -0
  220. /package/dist/types/{UserBlockInstanceParams.js → MultiCommunity.js} +0 -0
  221. /package/dist/types/{PersonCommentMentionId.js → MultiCommunityId.js} +0 -0
  222. /package/dist/types/{PersonPostMentionId.js → NotificationDataType.js} +0 -0
package/README.md CHANGED
@@ -52,6 +52,12 @@ Use `pnpm add` to develop and test changes locally:
52
52
 
53
53
  `pnpm add path/to/lemmy-js-client`
54
54
 
55
+ Alternatively, use `yalc publish` and `yalc add lemmy-js-client`
56
+
57
+ ## Generating typescript types from lemmy structs
58
+
59
+ Run `./scripts/copy_generated_types_from_lemmy.sh`
60
+
55
61
  ## OpenAPI
56
62
 
57
63
  To generate OpenAPI docs, run `pnpm tsoa`
package/dist/http.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Controller } from "@tsoa/runtime";
2
- import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListInboxI, ListMediaI, ListPersonContentI, ListPersonHiddenI, ListPersonLikedI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
2
+ import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, GetCommunityPendingFollowsCountI, GetModlogI, GetMultiCommunityI, GetPersonDetailsI, GetPostI, GetPostsI, GetRandomCommunityI, GetRegistrationApplicationI, GetReportCountI, GetSiteMetadataI, ListCommentLikesI, ListCommunitiesI, ListCommunityPendingFollowsI, ListCustomEmojisI, ListNotificationsI, ListMediaI, ListMultiCommunitiesI, ListPersonContentI, ListPersonHiddenI, ListPersonLikedI, ListPersonReadI, ListPersonSavedI, ListPostLikesI, ListRegistrationApplicationsI, ListReportsI, ListTaglinesI, ResolveObjectI, SearchI, UploadImage } from "./other_types";
3
3
  import { AddAdmin } from "./types/AddAdmin";
4
4
  import { AddAdminResponse } from "./types/AddAdminResponse";
5
5
  import { AddModToCommunity } from "./types/AddModToCommunity";
@@ -25,6 +25,7 @@ import { CreateCommentReport } from "./types/CreateCommentReport";
25
25
  import { CreateCommunity } from "./types/CreateCommunity";
26
26
  import { CreateCommunityReport } from "./types/CreateCommunityReport";
27
27
  import { CreateCommunityTag } from "./types/CreateCommunityTag";
28
+ import { UpdateCommunityTag } from "./types/UpdateCommunityTag";
28
29
  import { CreateCustomEmoji } from "./types/CreateCustomEmoji";
29
30
  import { CreateOAuthProvider } from "./types/CreateOAuthProvider";
30
31
  import { CreatePost } from "./types/CreatePost";
@@ -69,11 +70,10 @@ import { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnread
69
70
  import { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
70
71
  import { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
71
72
  import { LockPost } from "./types/LockPost";
73
+ import { LockComment } from "./types/LockComment";
72
74
  import { Login } from "./types/Login";
73
75
  import { LoginResponse } from "./types/LoginResponse";
74
- import { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
75
76
  import { MarkPostAsRead } from "./types/MarkPostAsRead";
76
- import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
77
77
  import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
78
78
  import { PasswordReset } from "./types/PasswordReset";
79
79
  import { PostReportResponse } from "./types/PostReportResponse";
@@ -99,7 +99,6 @@ import { SaveUserSettings } from "./types/SaveUserSettings";
99
99
  import { SearchResponse } from "./types/SearchResponse";
100
100
  import { SiteResponse } from "./types/SiteResponse";
101
101
  import { TransferCommunity } from "./types/TransferCommunity";
102
- import { UpdateCommunityTag } from "./types/UpdateCommunityTag";
103
102
  import { VerifyEmail } from "./types/VerifyEmail";
104
103
  import { HideCommunity } from "./types/HideCommunity";
105
104
  import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
@@ -122,24 +121,34 @@ import { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPen
122
121
  import { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
123
122
  import { ListReportsResponse } from "./types/ListReportsResponse";
124
123
  import { MyUserInfo } from "./types/MyUserInfo";
125
- import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
126
124
  import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
127
125
  import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
128
126
  import { ListPersonContentResponse } from "./types/ListPersonContentResponse";
129
127
  import { ListPersonSavedResponse } from "./types/ListPersonSavedResponse";
130
128
  import { UploadImageResponse } from "./types/UploadImageResponse";
131
- import { ListInboxResponse } from "./types/ListInboxResponse";
132
- import { MarkPersonCommentMentionAsRead } from "./types/MarkPersonCommentMentionAsRead";
133
- import { MarkPersonPostMentionAsRead } from "./types/MarkPersonPostMentionAsRead";
134
129
  import { GetCommentsSlimResponse } from "./types/GetCommentsSlimResponse";
135
130
  import { Tag } from "./types/Tag";
136
131
  import { ResendVerificationEmail } from "./types/ResendVerificationEmail";
137
132
  import { ListPersonReadResponse } from "./types/ListPersonReadResponse";
138
133
  import { ListPersonHiddenResponse } from "./types/ListPersonHiddenResponse";
139
134
  import { CommunityIdQuery } from "./types/CommunityIdQuery";
135
+ import { CreateMultiCommunity } from "./types/CreateMultiCommunity";
136
+ import { UpdateMultiCommunity } from "./types/UpdateMultiCommunity";
137
+ import { ListMultiCommunitiesResponse } from "./types/ListMultiCommunitiesResponse";
140
138
  import { AdminListUsersResponse } from "./types/AdminListUsersResponse";
139
+ import { CreateOrDeleteMultiCommunityEntry } from "./types/CreateOrDeleteMultiCommunityEntry";
140
+ import { GetMultiCommunityResponse } from "./types/GetMultiCommunityResponse";
141
+ import { FollowMultiCommunity } from "./types/FollowMultiCommunity";
141
142
  import { ListLoginsResponse } from "./types/ListLoginsResponse";
142
143
  import { ListPersonLikedResponse } from "./types/ListPersonLikedResponse";
144
+ import { NotePerson } from "./types/NotePerson";
145
+ import { UserBlockInstanceCommunitiesParams } from "./types/UserBlockInstanceCommunitiesParams";
146
+ import { UserBlockInstancePersonsParams } from "./types/UserBlockInstancePersonsParams";
147
+ import { MarkNotificationAsRead } from "./types/MarkNotificationAsRead";
148
+ import { ListNotificationsResponse } from "./types/ListNotificationsResponse";
149
+ import { ModEditPost } from "./types/ModEditPost";
150
+ import { UpdateCommunityNotifications } from "./types/UpdateCommunityNotifications";
151
+ import { UpdatePostNotifications } from "./types/UpdatePostNotifications";
143
152
  type RequestOptions = Pick<RequestInit, "signal">;
144
153
  /**
145
154
  * Helps build lemmy HTTP requests.
@@ -323,6 +332,10 @@ export declare class LemmyHttp extends Controller {
323
332
  * @summary Edit a post.
324
333
  */
325
334
  editPost(form: EditPost, options?: RequestOptions): Promise<PostResponse>;
335
+ /**
336
+ * @summary Mods can change nsfw flag and tags for a post
337
+ */
338
+ modEditPost(form: ModEditPost, options?: RequestOptions): Promise<PostResponse>;
326
339
  /**
327
340
  * @summary Delete a post.
328
341
  */
@@ -342,7 +355,7 @@ export declare class LemmyHttp extends Controller {
342
355
  /**
343
356
  * @summary Hide a post from list views.
344
357
  */
345
- hidePost(form: HidePost, options?: RequestOptions): Promise<SuccessResponse>;
358
+ hidePost(form: HidePost, options?: RequestOptions): Promise<PostResponse>;
346
359
  /**
347
360
  * @summary A moderator can lock a post ( IE disable new comments ).
348
361
  */
@@ -396,11 +409,11 @@ export declare class LemmyHttp extends Controller {
396
409
  */
397
410
  removeComment(form: RemoveComment, options?: RequestOptions): Promise<CommentResponse>;
398
411
  /**
399
- * @summary Mark a comment as read.
412
+ * @summary A moderator can lock a comment (IE disable replies).
400
413
  */
401
- markCommentReplyAsRead(form: MarkCommentReplyAsRead, options?: RequestOptions): Promise<SuccessResponse>;
414
+ lockComment(form: LockComment, options?: RequestOptions): Promise<CommentResponse>;
402
415
  /**
403
- * @summary Like / vote on a comment.
416
+ * @Summary Like / vote on a comment.
404
417
  */
405
418
  likeComment(form: CreateCommentLike, options?: RequestOptions): Promise<CommentResponse>;
406
419
  /**
@@ -447,10 +460,6 @@ export declare class LemmyHttp extends Controller {
447
460
  * @summary Delete a private message.
448
461
  */
449
462
  deletePrivateMessage(form: DeletePrivateMessage, options?: RequestOptions): Promise<PrivateMessageResponse>;
450
- /**
451
- * @summary Mark a private message as read.
452
- */
453
- markPrivateMessageAsRead(form: MarkPrivateMessageAsRead, options?: RequestOptions): Promise<SuccessResponse>;
454
463
  /**
455
464
  * @summary Create a report for a private message.
456
465
  */
@@ -480,13 +489,9 @@ export declare class LemmyHttp extends Controller {
480
489
  */
481
490
  listPersonContent(form?: ListPersonContentI, options?: RequestOptions): Promise<ListPersonContentResponse>;
482
491
  /**
483
- * @summary Mark a person mention as read.
484
- */
485
- markCommentMentionAsRead(form: MarkPersonCommentMentionAsRead, options?: RequestOptions): Promise<SuccessResponse>;
486
- /**
487
- * @summary Mark a person post body mention as read.
492
+ * @summary Make a note for a person.
488
493
  */
489
- markPostMentionAsRead(form: MarkPersonPostMentionAsRead, options?: RequestOptions): Promise<SuccessResponse>;
494
+ notePerson(form: NotePerson, options?: RequestOptions): Promise<SuccessResponse>;
490
495
  /**
491
496
  * @summary Ban a person from your site.
492
497
  */
@@ -519,6 +524,10 @@ export declare class LemmyHttp extends Controller {
519
524
  * @summary Mark all replies as read.
520
525
  */
521
526
  markAllNotificationsAsRead(options?: RequestOptions): Promise<SuccessResponse>;
527
+ /**
528
+ * @summary Mark a notification as read.
529
+ */
530
+ markNotificationAsRead(form: MarkNotificationAsRead, options?: RequestOptions): Promise<SuccessResponse>;
522
531
  /**
523
532
  * @summary Save your user settings.
524
533
  */
@@ -538,7 +547,7 @@ export declare class LemmyHttp extends Controller {
538
547
  /**
539
548
  * @summary Get your inbox (replies, comment mentions, post mentions, and messages)
540
549
  */
541
- listInbox(form: ListInboxI, options?: RequestOptions): Promise<ListInboxResponse>;
550
+ listNotifications(form: ListNotificationsI, options?: RequestOptions): Promise<ListNotificationsResponse>;
542
551
  /**
543
552
  * @summary Verify your email
544
553
  */
@@ -636,7 +645,7 @@ export declare class LemmyHttp extends Controller {
636
645
  */
637
646
  createCommunityTag(form: CreateCommunityTag, options?: RequestOptions): Promise<Tag>;
638
647
  /**
639
- * @summary Update a community post tag.
648
+ * @summary Edit a community post tag.
640
649
  */
641
650
  updateCommunityTag(form: UpdateCommunityTag, options?: RequestOptions): Promise<Tag>;
642
651
  /**
@@ -668,9 +677,13 @@ export declare class LemmyHttp extends Controller {
668
677
  */
669
678
  listReports(form: ListReportsI, options?: RequestOptions): Promise<ListReportsResponse>;
670
679
  /**
671
- * @summary Block an instance as user.
680
+ * @summary Block an instance's communities as a user.
672
681
  */
673
- userBlockInstance(form: UserBlockInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
682
+ userBlockInstanceCommunities(form: UserBlockInstanceCommunitiesParams, options?: RequestOptions): Promise<SuccessResponse>;
683
+ /**
684
+ * @summary Block an instance's persons as a user.
685
+ */
686
+ userBlockInstancePersons(form: UserBlockInstancePersonsParams, options?: RequestOptions): Promise<SuccessResponse>;
674
687
  /**
675
688
  * @summary Globally block an instance as admin.
676
689
  */
@@ -737,10 +750,23 @@ export declare class LemmyHttp extends Controller {
737
750
  imageHealth(options?: RequestOptions): Promise<SuccessResponse>;
738
751
  /**
739
752
  * Mark donation dialog as shown, so it isn't displayed anymore.
740
- *
741
- * `HTTP.POST /user/donation_dialog_shown`
742
753
  */
743
- donation_dialog_shown(options?: RequestOptions): Promise<SuccessResponse>;
754
+ donationDialogShown(options?: RequestOptions): Promise<SuccessResponse>;
755
+ createMultiCommunity(form: CreateMultiCommunity, options?: RequestOptions): Promise<GetMultiCommunityResponse>;
756
+ updateMultiCommunity(form: UpdateMultiCommunity, options?: RequestOptions): Promise<SuccessResponse>;
757
+ getMultiCommunity(form: GetMultiCommunityI, options?: RequestOptions): Promise<GetMultiCommunityResponse>;
758
+ createMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<SuccessResponse>;
759
+ deleteMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<SuccessResponse>;
760
+ listMultiCommunities(form: ListMultiCommunitiesI, options?: RequestOptions): Promise<ListMultiCommunitiesResponse>;
761
+ followMultiCommunity(form: FollowMultiCommunity, options?: RequestOptions): Promise<SuccessResponse>;
762
+ /**
763
+ * @summary Change notification settings for a community
764
+ */
765
+ updateCommunityNotifications(form: UpdateCommunityNotifications, options?: RequestOptions): Promise<SuccessResponse>;
766
+ /**
767
+ * @summary Change notification settings for a post
768
+ */
769
+ updatePostNotifications(form: UpdatePostNotifications, options?: RequestOptions): Promise<SuccessResponse>;
744
770
  /**
745
771
  * Set the headers (can be used to set the auth header)
746
772
  */
@@ -748,4 +774,14 @@ export declare class LemmyHttp extends Controller {
748
774
  [key: string]: string;
749
775
  }): void;
750
776
  }
777
+ /**
778
+ * A Lemmy error type.
779
+ *
780
+ * The name is the i18n translatable error code.
781
+ * The msg is either an empty string, or extra non-translatable info.
782
+ */
783
+ export declare class LemmyError extends Error {
784
+ status: number;
785
+ constructor(name: string, status: number, msg?: string);
786
+ }
751
787
  export {};
package/dist/http.js CHANGED
@@ -21,7 +21,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
21
21
  };
22
22
  var _LemmyHttp_instances, _LemmyHttp_apiUrl, _LemmyHttp_headers, _LemmyHttp_fetchFunction, _LemmyHttp_buildFullUrl, _LemmyHttp_upload, _LemmyHttp_uploadWithQuery, _LemmyHttp_wrapper;
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.LemmyHttp = void 0;
24
+ exports.LemmyError = exports.LemmyHttp = void 0;
25
25
  const runtime_1 = require("@tsoa/runtime");
26
26
  const other_types_1 = require("./other_types");
27
27
  var HttpType;
@@ -298,6 +298,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
298
298
  async editPost(form, options) {
299
299
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post", form, options);
300
300
  }
301
+ /**
302
+ * @summary Mods can change nsfw flag and tags for a post
303
+ */
304
+ async modEditPost(form, options) {
305
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/post/mod_update", form, options);
306
+ }
301
307
  /**
302
308
  * @summary Delete a post.
303
309
  */
@@ -407,13 +413,13 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
407
413
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/remove", form, options);
408
414
  }
409
415
  /**
410
- * @summary Mark a comment as read.
416
+ * @summary A moderator can lock a comment (IE disable replies).
411
417
  */
412
- async markCommentReplyAsRead(form, options) {
413
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/mark_as_read", form, options);
418
+ async lockComment(form, options) {
419
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/lock", form, options);
414
420
  }
415
421
  /**
416
- * @summary Like / vote on a comment.
422
+ * @Summary Like / vote on a comment.
417
423
  */
418
424
  async likeComment(form, options) {
419
425
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/like", form, options);
@@ -484,12 +490,6 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
484
490
  async deletePrivateMessage(form, options) {
485
491
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/delete", form, options);
486
492
  }
487
- /**
488
- * @summary Mark a private message as read.
489
- */
490
- async markPrivateMessageAsRead(form, options) {
491
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/mark_as_read", form, options);
492
- }
493
493
  /**
494
494
  * @summary Create a report for a private message.
495
495
  */
@@ -533,16 +533,10 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
533
533
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/person/content", form, options);
534
534
  }
535
535
  /**
536
- * @summary Mark a person mention as read.
536
+ * @summary Make a note for a person.
537
537
  */
538
- async markCommentMentionAsRead(form, options) {
539
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/comment/mark_as_read", form, options);
540
- }
541
- /**
542
- * @summary Mark a person post body mention as read.
543
- */
544
- async markPostMentionAsRead(form, options) {
545
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mention/post/mark_as_read", form, options);
538
+ async notePerson(form, options) {
539
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/person/note", form, options);
546
540
  }
547
541
  /**
548
542
  * @summary Ban a person from your site.
@@ -592,6 +586,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
592
586
  async markAllNotificationsAsRead(options) {
593
587
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read/all", {}, options);
594
588
  }
589
+ /**
590
+ * @summary Mark a notification as read.
591
+ */
592
+ async markNotificationAsRead(form, options) {
593
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read", form, options);
594
+ }
595
595
  /**
596
596
  * @summary Save your user settings.
597
597
  */
@@ -619,8 +619,8 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
619
619
  /**
620
620
  * @summary Get your inbox (replies, comment mentions, post mentions, and messages)
621
621
  */
622
- async listInbox(form, options) {
623
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/inbox", form, options);
622
+ async listNotifications(form, options) {
623
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/account/notifications", form, options);
624
624
  }
625
625
  /**
626
626
  * @summary Verify your email
@@ -767,10 +767,10 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
767
767
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
768
768
  }
769
769
  /**
770
- * @summary Update a community post tag.
770
+ * @summary Edit a community post tag.
771
771
  */
772
772
  updateCommunityTag(form, options) {
773
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community/tag", form, options);
773
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
774
774
  }
775
775
  /**
776
776
  * @summary Delete a post tag in a community.
@@ -815,10 +815,16 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
815
815
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/report/list", form, options);
816
816
  }
817
817
  /**
818
- * @summary Block an instance as user.
818
+ * @summary Block an instance's communities as a user.
819
819
  */
820
- async userBlockInstance(form, options) {
821
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance", form, options);
820
+ async userBlockInstanceCommunities(form, options) {
821
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance/communities", form, options);
822
+ }
823
+ /**
824
+ * @summary Block an instance's persons as a user.
825
+ */
826
+ async userBlockInstancePersons(form, options) {
827
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance/persons", form, options);
822
828
  }
823
829
  /**
824
830
  * @summary Globally block an instance as admin.
@@ -918,11 +924,42 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
918
924
  }
919
925
  /**
920
926
  * Mark donation dialog as shown, so it isn't displayed anymore.
921
- *
922
- * `HTTP.POST /user/donation_dialog_shown`
923
927
  */
924
- donation_dialog_shown(options) {
925
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/donation_dialog_shown", {}, options);
928
+ donationDialogShown(options) {
929
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/donation_dialog_shown", {}, options);
930
+ }
931
+ createMultiCommunity(form, options) {
932
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community", form, options);
933
+ }
934
+ updateMultiCommunity(form, options) {
935
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/multi_community", form, options);
936
+ }
937
+ getMultiCommunity(form, options) {
938
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/multi_community", form, options);
939
+ }
940
+ createMultiCommunityEntry(form, options) {
941
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community/entry", form, options);
942
+ }
943
+ deleteMultiCommunityEntry(form, options) {
944
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Delete, "/multi_community/entry", form, options);
945
+ }
946
+ listMultiCommunities(form, options) {
947
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/multi_community/list", form, options);
948
+ }
949
+ followMultiCommunity(form, options) {
950
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community/follow", form, options);
951
+ }
952
+ /**
953
+ * @summary Change notification settings for a community
954
+ */
955
+ updateCommunityNotifications(form, options) {
956
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/notifications", form, options);
957
+ }
958
+ /**
959
+ * @summary Change notification settings for a post
960
+ */
961
+ updatePostNotifications(form, options) {
962
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/notifications", form, options);
926
963
  }
927
964
  /**
928
965
  * Set the headers (can be used to set the auth header)
@@ -978,10 +1015,12 @@ _LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, op
978
1015
  json = await response.json();
979
1016
  }
980
1017
  catch {
981
- throw new Error(response.statusText);
1018
+ throw new LemmyError(response.statusText, response.status);
982
1019
  }
983
1020
  if (!response.ok) {
984
- throw new Error(json["error"] ?? response.statusText);
1021
+ console.error(`Request error while calling ${type_} ${endpoint} with ${form}`);
1022
+ let err = new LemmyError(json.error ?? response.statusText, response.status, json.message);
1023
+ throw err;
985
1024
  }
986
1025
  else {
987
1026
  return json;
@@ -1262,6 +1301,13 @@ __decorate([
1262
1301
  __param(0, (0, runtime_1.Body)()),
1263
1302
  __param(1, (0, runtime_1.Inject)())
1264
1303
  ], LemmyHttp.prototype, "editPost", null);
1304
+ __decorate([
1305
+ (0, runtime_1.Security)("bearerAuth"),
1306
+ (0, runtime_1.Put)("/post/mod_update"),
1307
+ (0, runtime_1.Tags)("Post"),
1308
+ __param(0, (0, runtime_1.Body)()),
1309
+ __param(1, (0, runtime_1.Inject)())
1310
+ ], LemmyHttp.prototype, "modEditPost", null);
1265
1311
  __decorate([
1266
1312
  (0, runtime_1.Security)("bearerAuth"),
1267
1313
  (0, runtime_1.Post)("/post/delete"),
@@ -1391,11 +1437,11 @@ __decorate([
1391
1437
  ], LemmyHttp.prototype, "removeComment", null);
1392
1438
  __decorate([
1393
1439
  (0, runtime_1.Security)("bearerAuth"),
1394
- (0, runtime_1.Post)("/comment/mark_as_read"),
1395
- (0, runtime_1.Tags)("Comment"),
1440
+ (0, runtime_1.Post)("/comment/lock"),
1441
+ (0, runtime_1.Tags)("Comment", "Moderator"),
1396
1442
  __param(0, (0, runtime_1.Body)()),
1397
1443
  __param(1, (0, runtime_1.Inject)())
1398
- ], LemmyHttp.prototype, "markCommentReplyAsRead", null);
1444
+ ], LemmyHttp.prototype, "lockComment", null);
1399
1445
  __decorate([
1400
1446
  (0, runtime_1.Security)("bearerAuth"),
1401
1447
  (0, runtime_1.Post)("/comment/like"),
@@ -1483,13 +1529,6 @@ __decorate([
1483
1529
  __param(0, (0, runtime_1.Body)()),
1484
1530
  __param(1, (0, runtime_1.Inject)())
1485
1531
  ], LemmyHttp.prototype, "deletePrivateMessage", null);
1486
- __decorate([
1487
- (0, runtime_1.Security)("bearerAuth"),
1488
- (0, runtime_1.Post)("/private_message/mark_as_read"),
1489
- (0, runtime_1.Tags)("PrivateMessage"),
1490
- __param(0, (0, runtime_1.Body)()),
1491
- __param(1, (0, runtime_1.Inject)())
1492
- ], LemmyHttp.prototype, "markPrivateMessageAsRead", null);
1493
1532
  __decorate([
1494
1533
  (0, runtime_1.Security)("bearerAuth"),
1495
1534
  (0, runtime_1.Post)("/private_message/report"),
@@ -1540,18 +1579,11 @@ __decorate([
1540
1579
  ], LemmyHttp.prototype, "listPersonContent", null);
1541
1580
  __decorate([
1542
1581
  (0, runtime_1.Security)("bearerAuth"),
1543
- (0, runtime_1.Post)("/account/mention/comment/mark_as_read"),
1544
- (0, runtime_1.Tags)("Account", "Person"),
1545
- __param(0, (0, runtime_1.Body)()),
1546
- __param(1, (0, runtime_1.Inject)())
1547
- ], LemmyHttp.prototype, "markCommentMentionAsRead", null);
1548
- __decorate([
1549
- (0, runtime_1.Security)("bearerAuth"),
1550
- (0, runtime_1.Post)("/account/mention/post/mark_as_read"),
1551
- (0, runtime_1.Tags)("Account", "Post"),
1582
+ (0, runtime_1.Post)("/person/note"),
1583
+ (0, runtime_1.Tags)("Person"),
1552
1584
  __param(0, (0, runtime_1.Body)()),
1553
1585
  __param(1, (0, runtime_1.Inject)())
1554
- ], LemmyHttp.prototype, "markPostMentionAsRead", null);
1586
+ ], LemmyHttp.prototype, "notePerson", null);
1555
1587
  __decorate([
1556
1588
  (0, runtime_1.Security)("bearerAuth"),
1557
1589
  (0, runtime_1.Post)("/admin/ban"),
@@ -1605,6 +1637,13 @@ __decorate([
1605
1637
  (0, runtime_1.Tags)("Account"),
1606
1638
  __param(0, (0, runtime_1.Inject)())
1607
1639
  ], LemmyHttp.prototype, "markAllNotificationsAsRead", null);
1640
+ __decorate([
1641
+ (0, runtime_1.Security)("bearerAuth"),
1642
+ (0, runtime_1.Post)("/account/mark_as_read"),
1643
+ (0, runtime_1.Tags)("Account"),
1644
+ __param(0, (0, runtime_1.Body)()),
1645
+ __param(1, (0, runtime_1.Inject)())
1646
+ ], LemmyHttp.prototype, "markNotificationAsRead", null);
1608
1647
  __decorate([
1609
1648
  (0, runtime_1.Security)("bearerAuth"),
1610
1649
  (0, runtime_1.Put)("/account/settings/save"),
@@ -1634,11 +1673,11 @@ __decorate([
1634
1673
  ], LemmyHttp.prototype, "getUnreadCount", null);
1635
1674
  __decorate([
1636
1675
  (0, runtime_1.Security)("bearerAuth"),
1637
- (0, runtime_1.Get)("/account/inbox"),
1676
+ (0, runtime_1.Get)("/account/notifications"),
1638
1677
  (0, runtime_1.Tags)("Account"),
1639
1678
  __param(0, (0, runtime_1.Queries)()),
1640
1679
  __param(1, (0, runtime_1.Inject)())
1641
- ], LemmyHttp.prototype, "listInbox", null);
1680
+ ], LemmyHttp.prototype, "listNotifications", null);
1642
1681
  __decorate([
1643
1682
  (0, runtime_1.Post)("/account/auth/verify_email"),
1644
1683
  (0, runtime_1.Tags)("Account"),
@@ -1862,11 +1901,18 @@ __decorate([
1862
1901
  ], LemmyHttp.prototype, "listReports", null);
1863
1902
  __decorate([
1864
1903
  (0, runtime_1.Security)("bearerAuth"),
1865
- (0, runtime_1.Post)("/account/block/instance"),
1866
- (0, runtime_1.Tags)("Account"),
1904
+ (0, runtime_1.Post)("/account/block/instance/communities"),
1905
+ (0, runtime_1.Tags)("Account", "Community"),
1867
1906
  __param(0, (0, runtime_1.Body)()),
1868
1907
  __param(1, (0, runtime_1.Inject)())
1869
- ], LemmyHttp.prototype, "userBlockInstance", null);
1908
+ ], LemmyHttp.prototype, "userBlockInstanceCommunities", null);
1909
+ __decorate([
1910
+ (0, runtime_1.Security)("bearerAuth"),
1911
+ (0, runtime_1.Post)("/account/block/instance/persons"),
1912
+ (0, runtime_1.Tags)("Account", "Person"),
1913
+ __param(0, (0, runtime_1.Body)()),
1914
+ __param(1, (0, runtime_1.Inject)())
1915
+ ], LemmyHttp.prototype, "userBlockInstancePersons", null);
1870
1916
  __decorate([
1871
1917
  (0, runtime_1.Security)("bearerAuth"),
1872
1918
  (0, runtime_1.Post)("/admin/instance/block"),
@@ -1976,8 +2022,71 @@ __decorate([
1976
2022
  __param(0, (0, runtime_1.Inject)())
1977
2023
  ], LemmyHttp.prototype, "imageHealth", null);
1978
2024
  __decorate([
2025
+ (0, runtime_1.Security)("bearerAuth"),
2026
+ (0, runtime_1.Post)("/account/donation_dialog_shown"),
2027
+ (0, runtime_1.Tags)("Account"),
1979
2028
  __param(0, (0, runtime_1.Inject)())
1980
- ], LemmyHttp.prototype, "donation_dialog_shown", null);
2029
+ ], LemmyHttp.prototype, "donationDialogShown", null);
2030
+ __decorate([
2031
+ (0, runtime_1.Security)("bearerAuth"),
2032
+ (0, runtime_1.Post)("/multi_community"),
2033
+ (0, runtime_1.Tags)("Multicommunity"),
2034
+ __param(0, (0, runtime_1.Body)()),
2035
+ __param(1, (0, runtime_1.Inject)())
2036
+ ], LemmyHttp.prototype, "createMultiCommunity", null);
2037
+ __decorate([
2038
+ (0, runtime_1.Security)("bearerAuth"),
2039
+ (0, runtime_1.Put)("/multi_community"),
2040
+ (0, runtime_1.Tags)("Multicommunity"),
2041
+ __param(0, (0, runtime_1.Body)()),
2042
+ __param(1, (0, runtime_1.Inject)())
2043
+ ], LemmyHttp.prototype, "updateMultiCommunity", null);
2044
+ __decorate([
2045
+ (0, runtime_1.Get)("/multi_community"),
2046
+ (0, runtime_1.Tags)("Multicommunity"),
2047
+ __param(0, (0, runtime_1.Queries)()),
2048
+ __param(1, (0, runtime_1.Inject)())
2049
+ ], LemmyHttp.prototype, "getMultiCommunity", null);
2050
+ __decorate([
2051
+ (0, runtime_1.Security)("bearerAuth"),
2052
+ (0, runtime_1.Post)("/multi_community/entry"),
2053
+ (0, runtime_1.Tags)("Multicommunity"),
2054
+ __param(0, (0, runtime_1.Body)()),
2055
+ __param(1, (0, runtime_1.Inject)())
2056
+ ], LemmyHttp.prototype, "createMultiCommunityEntry", null);
2057
+ __decorate([
2058
+ (0, runtime_1.Security)("bearerAuth"),
2059
+ (0, runtime_1.Delete)("/multi_community/entry"),
2060
+ (0, runtime_1.Tags)("Multicommunity"),
2061
+ __param(0, (0, runtime_1.Body)()),
2062
+ __param(1, (0, runtime_1.Inject)())
2063
+ ], LemmyHttp.prototype, "deleteMultiCommunityEntry", null);
2064
+ __decorate([
2065
+ (0, runtime_1.Get)("/multi_community/list"),
2066
+ (0, runtime_1.Tags)("Multicommunity"),
2067
+ __param(0, (0, runtime_1.Queries)()),
2068
+ __param(1, (0, runtime_1.Inject)())
2069
+ ], LemmyHttp.prototype, "listMultiCommunities", null);
2070
+ __decorate([
2071
+ (0, runtime_1.Post)("/multi_community/follow"),
2072
+ (0, runtime_1.Tags)("Multicommunity"),
2073
+ __param(0, (0, runtime_1.Body)()),
2074
+ __param(1, (0, runtime_1.Inject)())
2075
+ ], LemmyHttp.prototype, "followMultiCommunity", null);
2076
+ __decorate([
2077
+ (0, runtime_1.Security)("bearerAuth"),
2078
+ (0, runtime_1.Put)("/community/notifications"),
2079
+ (0, runtime_1.Tags)("Community"),
2080
+ __param(0, (0, runtime_1.Body)()),
2081
+ __param(1, (0, runtime_1.Inject)())
2082
+ ], LemmyHttp.prototype, "updateCommunityNotifications", null);
2083
+ __decorate([
2084
+ (0, runtime_1.Security)("bearerAuth"),
2085
+ (0, runtime_1.Put)("/post/notifications"),
2086
+ (0, runtime_1.Tags)("Post"),
2087
+ __param(0, (0, runtime_1.Body)()),
2088
+ __param(1, (0, runtime_1.Inject)())
2089
+ ], LemmyHttp.prototype, "updatePostNotifications", null);
1981
2090
  exports.LemmyHttp = LemmyHttp = __decorate([
1982
2091
  (0, runtime_1.Route)("api/v4")
1983
2092
  ], LemmyHttp);
@@ -1998,3 +2107,19 @@ function createFormData(image) {
1998
2107
  }
1999
2108
  return formData;
2000
2109
  }
2110
+ /**
2111
+ * A Lemmy error type.
2112
+ *
2113
+ * The name is the i18n translatable error code.
2114
+ * The msg is either an empty string, or extra non-translatable info.
2115
+ */
2116
+ class LemmyError extends Error {
2117
+ constructor(name, status, msg) {
2118
+ super(msg ?? "");
2119
+ this.name = name;
2120
+ this.status = status;
2121
+ // Set the prototype explicitly.
2122
+ Object.setPrototypeOf(this, LemmyError.prototype);
2123
+ }
2124
+ }
2125
+ exports.LemmyError = LemmyError;