lemmy-js-client 1.0.0-post-tags.1 → 1.0.0-private-community-fixes.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 (146) hide show
  1. package/README.md +6 -0
  2. package/dist/http.d.ts +54 -24
  3. package/dist/http.js +110 -31
  4. package/dist/index.d.ts +26 -29
  5. package/dist/other_types.d.ts +0 -3
  6. package/dist/types/{ModAdd.d.ts → AdminAdd.d.ts} +4 -4
  7. package/dist/types/AdminAddId.d.ts +1 -0
  8. package/dist/types/{ModAddView.d.ts → AdminAddView.d.ts} +3 -3
  9. package/dist/types/AdminAllowInstance.d.ts +1 -1
  10. package/dist/types/AdminAllowInstanceParams.d.ts +1 -1
  11. package/dist/types/{ModBan.d.ts → AdminBan.d.ts} +4 -4
  12. package/dist/types/AdminBanId.d.ts +1 -0
  13. package/dist/types/{ModBanView.d.ts → AdminBanView.d.ts} +3 -3
  14. package/dist/types/AdminBlockInstance.d.ts +1 -1
  15. package/dist/types/AdminBlockInstanceParams.d.ts +7 -2
  16. package/dist/types/AdminPurgeComment.d.ts +1 -1
  17. package/dist/types/AdminPurgeCommunity.d.ts +1 -1
  18. package/dist/types/AdminPurgePerson.d.ts +1 -1
  19. package/dist/types/AdminPurgePost.d.ts +1 -1
  20. package/dist/types/{ModRemoveCommunity.d.ts → AdminRemoveCommunity.d.ts} +4 -4
  21. package/dist/types/AdminRemoveCommunityId.d.ts +1 -0
  22. package/dist/types/AdminRemoveCommunityView.d.ts +11 -0
  23. package/dist/types/AllLemmyErrors.d.ts +1 -0
  24. package/dist/types/AllLemmyErrors.js +117 -0
  25. package/dist/types/BanFromCommunity.d.ts +1 -1
  26. package/dist/types/BanPerson.d.ts +1 -1
  27. package/dist/types/Comment.d.ts +4 -0
  28. package/dist/types/CommentReportView.d.ts +2 -0
  29. package/dist/types/CommentSlimView.d.ts +0 -2
  30. package/dist/types/CommentView.d.ts +2 -2
  31. package/dist/types/CommunityFollowerState.d.ts +1 -1
  32. package/dist/types/CommunityReportView.d.ts +2 -0
  33. package/dist/types/CommunityView.d.ts +0 -2
  34. package/dist/types/CreateCommunityTag.d.ts +2 -0
  35. package/dist/types/CreateCustomEmoji.d.ts +2 -1
  36. package/dist/types/CreateCustomEmoji.js +0 -1
  37. package/dist/types/CreateSite.d.ts +0 -1
  38. package/dist/types/EditCustomEmoji.d.ts +7 -5
  39. package/dist/types/EditSite.d.ts +4 -4
  40. package/dist/types/GetMultiCommunity.d.ts +2 -1
  41. package/dist/types/HideCommunity.d.ts +1 -1
  42. package/dist/types/InstanceActions.d.ts +6 -2
  43. package/dist/types/LemmyErrorType.d.ts +23 -133
  44. package/dist/types/LinkMetadata.d.ts +4 -0
  45. package/dist/types/ListCommunityPendingFollows.d.ts +1 -1
  46. package/dist/types/ListCommunityPendingFollowsResponse.d.ts +2 -2
  47. package/dist/types/LocalSite.d.ts +1 -6
  48. package/dist/types/LocalUser.d.ts +10 -13
  49. package/dist/types/LocalUserView.d.ts +1 -0
  50. package/dist/types/LockComment.d.ts +9 -0
  51. package/dist/types/LockPost.d.ts +1 -1
  52. package/dist/types/{ModAddCommunity.d.ts → ModAddToCommunity.d.ts} +3 -3
  53. package/dist/types/ModAddToCommunityId.d.ts +1 -0
  54. package/dist/types/{ModAddCommunityView.d.ts → ModAddToCommunityView.d.ts} +3 -3
  55. package/dist/types/ModBanFromCommunity.d.ts +1 -1
  56. package/dist/types/ModEditPost.d.ts +10 -0
  57. package/dist/types/ModLockComment.d.ts +14 -0
  58. package/dist/types/ModLockCommentId.d.ts +1 -0
  59. package/dist/types/ModLockCommentView.d.ts +16 -0
  60. package/dist/types/ModLockPost.d.ts +1 -1
  61. package/dist/types/ModRemoveComment.d.ts +1 -1
  62. package/dist/types/ModRemovePost.d.ts +1 -1
  63. package/dist/types/ModlogActionType.d.ts +1 -1
  64. package/dist/types/ModlogCombinedView.d.ts +16 -13
  65. package/dist/types/MultiCommunityResponse.d.ts +4 -0
  66. package/dist/types/MultiCommunityView.d.ts +2 -0
  67. package/dist/types/MyUserInfo.d.ts +2 -1
  68. package/dist/types/Notification.d.ts +22 -2
  69. package/dist/types/NotificationData.d.ts +31 -1
  70. package/dist/types/NotificationType.d.ts +4 -0
  71. package/dist/types/OpenGraphData.d.ts +4 -0
  72. package/dist/types/PendingFollowerView.d.ts +9 -0
  73. package/dist/types/PersonResponse.d.ts +7 -0
  74. package/dist/types/PersonView.d.ts +2 -1
  75. package/dist/types/Post.d.ts +2 -0
  76. package/dist/types/PostOrCommentOrPrivateMessage.d.ts +7 -7
  77. package/dist/types/PostReportView.d.ts +2 -0
  78. package/dist/types/PostView.d.ts +2 -2
  79. package/dist/types/PrivateMessageReportView.d.ts +1 -0
  80. package/dist/types/PurgeComment.d.ts +1 -1
  81. package/dist/types/PurgeCommunity.d.ts +1 -1
  82. package/dist/types/PurgePerson.d.ts +1 -1
  83. package/dist/types/PurgePost.d.ts +1 -1
  84. package/dist/types/ReadableFederationState.d.ts +1 -1
  85. package/dist/types/RemoveComment.d.ts +1 -1
  86. package/dist/types/RemoveCommunity.d.ts +1 -1
  87. package/dist/types/RemovePost.d.ts +1 -1
  88. package/dist/types/SaveUserSettings.d.ts +5 -5
  89. package/dist/types/Tag.d.ts +5 -13
  90. package/dist/types/TagsView.d.ts +1 -1
  91. package/dist/types/UntranslatedError.d.ts +12 -0
  92. package/dist/types/UpdateCommunityTag.d.ts +9 -0
  93. package/dist/types/UserBlockInstanceCommunitiesParams.d.ts +8 -0
  94. package/dist/types/{UserBlockInstanceParams.d.ts → UserBlockInstancePersonsParams.d.ts} +2 -2
  95. package/dist/types/UserSettingsBackup.d.ts +2 -1
  96. package/package.json +6 -5
  97. package/dist/types/BanPersonResponse.d.ts +0 -8
  98. package/dist/types/BlockCommunityResponse.d.ts +0 -8
  99. package/dist/types/BlockPersonResponse.d.ts +0 -8
  100. package/dist/types/CommentReply.d.ts +0 -13
  101. package/dist/types/CommentReplyId.d.ts +0 -4
  102. package/dist/types/FederationError.d.ts +0 -10
  103. package/dist/types/GetCommunityPendingFollowsCount.d.ts +0 -4
  104. package/dist/types/InboxDataType.d.ts +0 -4
  105. package/dist/types/MarkPrivateMessageAsRead.d.ts +0 -8
  106. package/dist/types/ModAddCommunityId.d.ts +0 -1
  107. package/dist/types/ModAddId.d.ts +0 -1
  108. package/dist/types/ModBanId.d.ts +0 -1
  109. package/dist/types/ModRemoveCommunityId.d.ts +0 -1
  110. package/dist/types/ModRemoveCommunityView.d.ts +0 -11
  111. package/dist/types/NotificationTypes.d.ts +0 -4
  112. package/dist/types/NotificationTypes.js +0 -3
  113. package/dist/types/NotificationsMode.d.ts +0 -4
  114. package/dist/types/NotificationsMode.js +0 -3
  115. package/dist/types/PersonCommentMention.d.ts +0 -13
  116. package/dist/types/PersonCommentMentionId.d.ts +0 -4
  117. package/dist/types/PersonCommentMentionId.js +0 -3
  118. package/dist/types/PersonNotification.d.ts +0 -9
  119. package/dist/types/PersonPostMention.d.ts +0 -13
  120. package/dist/types/PersonPostMentionId.d.ts +0 -4
  121. package/dist/types/PersonPostMentionId.js +0 -3
  122. /package/dist/types/{BanPersonResponse.js → AdminAdd.js} +0 -0
  123. /package/dist/types/{CommentReplyId.js → AdminAddId.js} +0 -0
  124. /package/dist/types/{BlockCommunityResponse.js → AdminAddView.js} +0 -0
  125. /package/dist/types/{BlockPersonResponse.js → AdminBan.js} +0 -0
  126. /package/dist/types/{FederationError.js → AdminBanId.js} +0 -0
  127. /package/dist/types/{CommentReply.js → AdminBanView.js} +0 -0
  128. /package/dist/types/{GetCommunityPendingFollowsCount.js → AdminRemoveCommunity.js} +0 -0
  129. /package/dist/types/{InboxDataType.js → AdminRemoveCommunityId.js} +0 -0
  130. /package/dist/types/{MarkPrivateMessageAsRead.js → AdminRemoveCommunityView.js} +0 -0
  131. /package/dist/types/{ModAdd.js → LockComment.js} +0 -0
  132. /package/dist/types/{ModAddCommunity.js → ModAddToCommunity.js} +0 -0
  133. /package/dist/types/{ModAddCommunityId.js → ModAddToCommunityId.js} +0 -0
  134. /package/dist/types/{ModAddCommunityView.js → ModAddToCommunityView.js} +0 -0
  135. /package/dist/types/{ModAddView.js → ModEditPost.js} +0 -0
  136. /package/dist/types/{ModBan.js → ModLockComment.js} +0 -0
  137. /package/dist/types/{ModAddId.js → ModLockCommentId.js} +0 -0
  138. /package/dist/types/{ModBanView.js → ModLockCommentView.js} +0 -0
  139. /package/dist/types/{ModRemoveCommunity.js → MultiCommunityResponse.js} +0 -0
  140. /package/dist/types/{ModBanId.js → NotificationType.js} +0 -0
  141. /package/dist/types/{ModRemoveCommunityView.js → PendingFollowerView.js} +0 -0
  142. /package/dist/types/{PersonCommentMention.js → PersonResponse.js} +0 -0
  143. /package/dist/types/{ModRemoveCommunityId.js → UntranslatedError.js} +0 -0
  144. /package/dist/types/{PersonNotification.js → UpdateCommunityTag.js} +0 -0
  145. /package/dist/types/{PersonPostMention.js → UserBlockInstanceCommunitiesParams.js} +0 -0
  146. /package/dist/types/{UserBlockInstanceParams.js → UserBlockInstancePersonsParams.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, 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";
2
+ import { AdminListUsersI, CommunityIdQueryI, DeleteImageParamsI, GetCommentI, GetCommentsI, GetCommunityI, 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";
@@ -9,11 +9,8 @@ import { BanFromCommunity } from "./types/BanFromCommunity";
9
9
  import { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
10
10
  import { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead";
11
11
  import { BanPerson } from "./types/BanPerson";
12
- import { BanPersonResponse } from "./types/BanPersonResponse";
13
12
  import { BlockCommunity } from "./types/BlockCommunity";
14
- import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
15
13
  import { BlockPerson } from "./types/BlockPerson";
16
- import { BlockPersonResponse } from "./types/BlockPersonResponse";
17
14
  import { ChangePassword } from "./types/ChangePassword";
18
15
  import { CommentReportResponse } from "./types/CommentReportResponse";
19
16
  import { CommentResponse } from "./types/CommentResponse";
@@ -25,6 +22,7 @@ import { CreateCommentReport } from "./types/CreateCommentReport";
25
22
  import { CreateCommunity } from "./types/CreateCommunity";
26
23
  import { CreateCommunityReport } from "./types/CreateCommunityReport";
27
24
  import { CreateCommunityTag } from "./types/CreateCommunityTag";
25
+ import { UpdateCommunityTag } from "./types/UpdateCommunityTag";
28
26
  import { CreateCustomEmoji } from "./types/CreateCustomEmoji";
29
27
  import { CreateOAuthProvider } from "./types/CreateOAuthProvider";
30
28
  import { CreatePost } from "./types/CreatePost";
@@ -69,10 +67,10 @@ import { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnread
69
67
  import { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
70
68
  import { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
71
69
  import { LockPost } from "./types/LockPost";
70
+ import { LockComment } from "./types/LockComment";
72
71
  import { Login } from "./types/Login";
73
72
  import { LoginResponse } from "./types/LoginResponse";
74
73
  import { MarkPostAsRead } from "./types/MarkPostAsRead";
75
- import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
76
74
  import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
77
75
  import { PasswordReset } from "./types/PasswordReset";
78
76
  import { PostReportResponse } from "./types/PostReportResponse";
@@ -120,7 +118,6 @@ import { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPen
120
118
  import { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
121
119
  import { ListReportsResponse } from "./types/ListReportsResponse";
122
120
  import { MyUserInfo } from "./types/MyUserInfo";
123
- import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
124
121
  import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
125
122
  import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
126
123
  import { ListPersonContentResponse } from "./types/ListPersonContentResponse";
@@ -141,8 +138,16 @@ import { GetMultiCommunityResponse } from "./types/GetMultiCommunityResponse";
141
138
  import { FollowMultiCommunity } from "./types/FollowMultiCommunity";
142
139
  import { ListLoginsResponse } from "./types/ListLoginsResponse";
143
140
  import { ListPersonLikedResponse } from "./types/ListPersonLikedResponse";
141
+ import { NotePerson } from "./types/NotePerson";
142
+ import { UserBlockInstanceCommunitiesParams } from "./types/UserBlockInstanceCommunitiesParams";
143
+ import { UserBlockInstancePersonsParams } from "./types/UserBlockInstancePersonsParams";
144
144
  import { MarkNotificationAsRead } from "./types/MarkNotificationAsRead";
145
145
  import { ListNotificationsResponse } from "./types/ListNotificationsResponse";
146
+ import { ModEditPost } from "./types/ModEditPost";
147
+ import { UpdateCommunityNotifications } from "./types/UpdateCommunityNotifications";
148
+ import { UpdatePostNotifications } from "./types/UpdatePostNotifications";
149
+ import { MultiCommunityResponse } from "./types/MultiCommunityResponse";
150
+ import { PersonResponse } from "./types/PersonResponse";
146
151
  type RequestOptions = Pick<RequestInit, "signal">;
147
152
  /**
148
153
  * Helps build lemmy HTTP requests.
@@ -265,7 +270,7 @@ export declare class LemmyHttp extends Controller {
265
270
  /**
266
271
  * @summary Get a community's pending follows count.
267
272
  */
268
- getCommunityPendingFollowsCount(form: GetCommunityPendingFollowsCountI, options?: RequestOptions): Promise<GetCommunityPendingFollowsCountResponse>;
273
+ getCommunityPendingFollowsCount(options?: RequestOptions): Promise<GetCommunityPendingFollowsCountResponse>;
269
274
  /**
270
275
  * @summary Get a community's pending followers.
271
276
  */
@@ -277,7 +282,7 @@ export declare class LemmyHttp extends Controller {
277
282
  /**
278
283
  * @summary Block a community.
279
284
  */
280
- blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<BlockCommunityResponse>;
285
+ blockCommunity(form: BlockCommunity, options?: RequestOptions): Promise<CommunityResponse>;
281
286
  /**
282
287
  * @summary Delete a community.
283
288
  */
@@ -326,6 +331,10 @@ export declare class LemmyHttp extends Controller {
326
331
  * @summary Edit a post.
327
332
  */
328
333
  editPost(form: EditPost, options?: RequestOptions): Promise<PostResponse>;
334
+ /**
335
+ * @summary Mods can change nsfw flag and tags for a post
336
+ */
337
+ modEditPost(form: ModEditPost, options?: RequestOptions): Promise<PostResponse>;
329
338
  /**
330
339
  * @summary Delete a post.
331
340
  */
@@ -345,7 +354,7 @@ export declare class LemmyHttp extends Controller {
345
354
  /**
346
355
  * @summary Hide a post from list views.
347
356
  */
348
- hidePost(form: HidePost, options?: RequestOptions): Promise<SuccessResponse>;
357
+ hidePost(form: HidePost, options?: RequestOptions): Promise<PostResponse>;
349
358
  /**
350
359
  * @summary A moderator can lock a post ( IE disable new comments ).
351
360
  */
@@ -399,7 +408,11 @@ export declare class LemmyHttp extends Controller {
399
408
  */
400
409
  removeComment(form: RemoveComment, options?: RequestOptions): Promise<CommentResponse>;
401
410
  /**
402
- * @summary Like / vote on a comment.
411
+ * @summary A moderator can lock a comment (IE disable replies).
412
+ */
413
+ lockComment(form: LockComment, options?: RequestOptions): Promise<CommentResponse>;
414
+ /**
415
+ * @Summary Like / vote on a comment.
403
416
  */
404
417
  likeComment(form: CreateCommentLike, options?: RequestOptions): Promise<CommentResponse>;
405
418
  /**
@@ -446,10 +459,6 @@ export declare class LemmyHttp extends Controller {
446
459
  * @summary Delete a private message.
447
460
  */
448
461
  deletePrivateMessage(form: DeletePrivateMessage, options?: RequestOptions): Promise<PrivateMessageResponse>;
449
- /**
450
- * @summary Mark a private message as read.
451
- */
452
- markPrivateMessageAsRead(form: MarkPrivateMessageAsRead, options?: RequestOptions): Promise<SuccessResponse>;
453
462
  /**
454
463
  * @summary Create a report for a private message.
455
464
  */
@@ -478,10 +487,14 @@ export declare class LemmyHttp extends Controller {
478
487
  * @summary List the content for a person.
479
488
  */
480
489
  listPersonContent(form?: ListPersonContentI, options?: RequestOptions): Promise<ListPersonContentResponse>;
490
+ /**
491
+ * @summary Make a note for a person.
492
+ */
493
+ notePerson(form: NotePerson, options?: RequestOptions): Promise<SuccessResponse>;
481
494
  /**
482
495
  * @summary Ban a person from your site.
483
496
  */
484
- banPerson(form: BanPerson, options?: RequestOptions): Promise<BanPersonResponse>;
497
+ banPerson(form: BanPerson, options?: RequestOptions): Promise<PersonResponse>;
485
498
  /**
486
499
  * @summary Get a list of users.
487
500
  */
@@ -489,7 +502,7 @@ export declare class LemmyHttp extends Controller {
489
502
  /**
490
503
  * @summary Block a person.
491
504
  */
492
- blockPerson(form: BlockPerson, options?: RequestOptions): Promise<BlockPersonResponse>;
505
+ blockPerson(form: BlockPerson, options?: RequestOptions): Promise<PersonResponse>;
493
506
  /**
494
507
  * @summary Fetch a Captcha.
495
508
  */
@@ -511,7 +524,7 @@ export declare class LemmyHttp extends Controller {
511
524
  */
512
525
  markAllNotificationsAsRead(options?: RequestOptions): Promise<SuccessResponse>;
513
526
  /**
514
- * @summary Mark a comment as read.
527
+ * @summary Mark a notification as read.
515
528
  */
516
529
  markNotificationAsRead(form: MarkNotificationAsRead, options?: RequestOptions): Promise<SuccessResponse>;
517
530
  /**
@@ -630,6 +643,10 @@ export declare class LemmyHttp extends Controller {
630
643
  * @summary Create a community post tag.
631
644
  */
632
645
  createCommunityTag(form: CreateCommunityTag, options?: RequestOptions): Promise<Tag>;
646
+ /**
647
+ * @summary Edit a community post tag.
648
+ */
649
+ updateCommunityTag(form: UpdateCommunityTag, options?: RequestOptions): Promise<Tag>;
633
650
  /**
634
651
  * @summary Delete a post tag in a community.
635
652
  */
@@ -659,9 +676,13 @@ export declare class LemmyHttp extends Controller {
659
676
  */
660
677
  listReports(form: ListReportsI, options?: RequestOptions): Promise<ListReportsResponse>;
661
678
  /**
662
- * @summary Block an instance as user.
679
+ * @summary Block an instance's communities as a user.
680
+ */
681
+ userBlockInstanceCommunities(form: UserBlockInstanceCommunitiesParams, options?: RequestOptions): Promise<SuccessResponse>;
682
+ /**
683
+ * @summary Block an instance's persons as a user.
663
684
  */
664
- userBlockInstance(form: UserBlockInstanceParams, options?: RequestOptions): Promise<SuccessResponse>;
685
+ userBlockInstancePersons(form: UserBlockInstancePersonsParams, options?: RequestOptions): Promise<SuccessResponse>;
665
686
  /**
666
687
  * @summary Globally block an instance as admin.
667
688
  */
@@ -730,13 +751,21 @@ export declare class LemmyHttp extends Controller {
730
751
  * Mark donation dialog as shown, so it isn't displayed anymore.
731
752
  */
732
753
  donationDialogShown(options?: RequestOptions): Promise<SuccessResponse>;
733
- createMultiCommunity(form: CreateMultiCommunity, options?: RequestOptions): Promise<GetMultiCommunityResponse>;
734
- updateMultiCommunity(form: UpdateMultiCommunity, options?: RequestOptions): Promise<SuccessResponse>;
754
+ createMultiCommunity(form: CreateMultiCommunity, options?: RequestOptions): Promise<MultiCommunityResponse>;
755
+ updateMultiCommunity(form: UpdateMultiCommunity, options?: RequestOptions): Promise<MultiCommunityResponse>;
735
756
  getMultiCommunity(form: GetMultiCommunityI, options?: RequestOptions): Promise<GetMultiCommunityResponse>;
736
- createMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<SuccessResponse>;
757
+ createMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<CommunityResponse>;
737
758
  deleteMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<SuccessResponse>;
738
759
  listMultiCommunities(form: ListMultiCommunitiesI, options?: RequestOptions): Promise<ListMultiCommunitiesResponse>;
739
- followMultiCommunity(form: FollowMultiCommunity, options?: RequestOptions): Promise<SuccessResponse>;
760
+ followMultiCommunity(form: FollowMultiCommunity, options?: RequestOptions): Promise<MultiCommunityResponse>;
761
+ /**
762
+ * @summary Change notification settings for a community
763
+ */
764
+ updateCommunityNotifications(form: UpdateCommunityNotifications, options?: RequestOptions): Promise<SuccessResponse>;
765
+ /**
766
+ * @summary Change notification settings for a post
767
+ */
768
+ updatePostNotifications(form: UpdatePostNotifications, options?: RequestOptions): Promise<SuccessResponse>;
740
769
  /**
741
770
  * Set the headers (can be used to set the auth header)
742
771
  */
@@ -751,6 +780,7 @@ export declare class LemmyHttp extends Controller {
751
780
  * The msg is either an empty string, or extra non-translatable info.
752
781
  */
753
782
  export declare class LemmyError extends Error {
754
- constructor(name: string, msg?: string);
783
+ status: number;
784
+ constructor(name: string, status: number, msg?: string);
755
785
  }
756
786
  export {};
package/dist/http.js CHANGED
@@ -205,8 +205,8 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
205
205
  /**
206
206
  * @summary Get a community's pending follows count.
207
207
  */
208
- async getCommunityPendingFollowsCount(form, options) {
209
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/pending_follows/count", form, options);
208
+ async getCommunityPendingFollowsCount(options) {
209
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/community/pending_follows/count", {}, options);
210
210
  }
211
211
  /**
212
212
  * @summary Get a community's pending followers.
@@ -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,7 +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 Like / vote on a comment.
416
+ * @summary A moderator can lock a comment (IE disable replies).
417
+ */
418
+ async lockComment(form, options) {
419
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/lock", form, options);
420
+ }
421
+ /**
422
+ * @Summary Like / vote on a comment.
411
423
  */
412
424
  async likeComment(form, options) {
413
425
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/comment/like", form, options);
@@ -478,12 +490,6 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
478
490
  async deletePrivateMessage(form, options) {
479
491
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/delete", form, options);
480
492
  }
481
- /**
482
- * @summary Mark a private message as read.
483
- */
484
- async markPrivateMessageAsRead(form, options) {
485
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/mark_as_read", form, options);
486
- }
487
493
  /**
488
494
  * @summary Create a report for a private message.
489
495
  */
@@ -526,6 +532,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
526
532
  async listPersonContent(form = {}, options) {
527
533
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/person/content", form, options);
528
534
  }
535
+ /**
536
+ * @summary Make a note for a person.
537
+ */
538
+ async notePerson(form, options) {
539
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/person/note", form, options);
540
+ }
529
541
  /**
530
542
  * @summary Ban a person from your site.
531
543
  */
@@ -575,7 +587,7 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
575
587
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read/all", {}, options);
576
588
  }
577
589
  /**
578
- * @summary Mark a comment as read.
590
+ * @summary Mark a notification as read.
579
591
  */
580
592
  async markNotificationAsRead(form, options) {
581
593
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/mark_as_read", form, options);
@@ -754,6 +766,12 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
754
766
  createCommunityTag(form, options) {
755
767
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
756
768
  }
769
+ /**
770
+ * @summary Edit a community post tag.
771
+ */
772
+ updateCommunityTag(form, options) {
773
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/tag", form, options);
774
+ }
757
775
  /**
758
776
  * @summary Delete a post tag in a community.
759
777
  */
@@ -797,10 +815,16 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
797
815
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/report/list", form, options);
798
816
  }
799
817
  /**
800
- * @summary Block an instance as user.
818
+ * @summary Block an instance's communities as a user.
819
+ */
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.
801
825
  */
802
- async userBlockInstance(form, options) {
803
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance", form, options);
826
+ async userBlockInstancePersons(form, options) {
827
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/block/instance/persons", form, options);
804
828
  }
805
829
  /**
806
830
  * @summary Globally block an instance as admin.
@@ -902,7 +926,7 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
902
926
  * Mark donation dialog as shown, so it isn't displayed anymore.
903
927
  */
904
928
  donationDialogShown(options) {
905
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/donation_dialog_shown", {}, options);
929
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/donation_dialog_shown", {}, options);
906
930
  }
907
931
  createMultiCommunity(form, options) {
908
932
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community", form, options);
@@ -925,6 +949,18 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
925
949
  followMultiCommunity(form, options) {
926
950
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community/follow", form, options);
927
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);
963
+ }
928
964
  /**
929
965
  * Set the headers (can be used to set the auth header)
930
966
  */
@@ -979,10 +1015,11 @@ _LemmyHttp_wrapper = async function _LemmyHttp_wrapper(type_, endpoint, form, op
979
1015
  json = await response.json();
980
1016
  }
981
1017
  catch {
982
- throw new LemmyError(response.statusText);
1018
+ throw new LemmyError(response.statusText, response.status);
983
1019
  }
984
1020
  if (!response.ok) {
985
- let err = new LemmyError(json.error ?? response.statusText, json.message);
1021
+ console.error(`Request error while calling ${type_} ${endpoint} with ${JSON.stringify(form)}`);
1022
+ let err = new LemmyError(json.error ?? response.statusText, response.status, json.message);
986
1023
  throw err;
987
1024
  }
988
1025
  else {
@@ -1154,8 +1191,7 @@ __decorate([
1154
1191
  (0, runtime_1.Security)("bearerAuth"),
1155
1192
  (0, runtime_1.Get)("/community/pending_follows/count"),
1156
1193
  (0, runtime_1.Tags)("Community"),
1157
- __param(0, (0, runtime_1.Queries)()),
1158
- __param(1, (0, runtime_1.Inject)())
1194
+ __param(0, (0, runtime_1.Inject)())
1159
1195
  ], LemmyHttp.prototype, "getCommunityPendingFollowsCount", null);
1160
1196
  __decorate([
1161
1197
  (0, runtime_1.Security)("bearerAuth"),
@@ -1264,6 +1300,13 @@ __decorate([
1264
1300
  __param(0, (0, runtime_1.Body)()),
1265
1301
  __param(1, (0, runtime_1.Inject)())
1266
1302
  ], LemmyHttp.prototype, "editPost", null);
1303
+ __decorate([
1304
+ (0, runtime_1.Security)("bearerAuth"),
1305
+ (0, runtime_1.Put)("/post/mod_update"),
1306
+ (0, runtime_1.Tags)("Post"),
1307
+ __param(0, (0, runtime_1.Body)()),
1308
+ __param(1, (0, runtime_1.Inject)())
1309
+ ], LemmyHttp.prototype, "modEditPost", null);
1267
1310
  __decorate([
1268
1311
  (0, runtime_1.Security)("bearerAuth"),
1269
1312
  (0, runtime_1.Post)("/post/delete"),
@@ -1391,6 +1434,13 @@ __decorate([
1391
1434
  __param(0, (0, runtime_1.Body)()),
1392
1435
  __param(1, (0, runtime_1.Inject)())
1393
1436
  ], LemmyHttp.prototype, "removeComment", null);
1437
+ __decorate([
1438
+ (0, runtime_1.Security)("bearerAuth"),
1439
+ (0, runtime_1.Post)("/comment/lock"),
1440
+ (0, runtime_1.Tags)("Comment", "Moderator"),
1441
+ __param(0, (0, runtime_1.Body)()),
1442
+ __param(1, (0, runtime_1.Inject)())
1443
+ ], LemmyHttp.prototype, "lockComment", null);
1394
1444
  __decorate([
1395
1445
  (0, runtime_1.Security)("bearerAuth"),
1396
1446
  (0, runtime_1.Post)("/comment/like"),
@@ -1478,13 +1528,6 @@ __decorate([
1478
1528
  __param(0, (0, runtime_1.Body)()),
1479
1529
  __param(1, (0, runtime_1.Inject)())
1480
1530
  ], LemmyHttp.prototype, "deletePrivateMessage", null);
1481
- __decorate([
1482
- (0, runtime_1.Security)("bearerAuth"),
1483
- (0, runtime_1.Post)("/private_message/mark_as_read"),
1484
- (0, runtime_1.Tags)("PrivateMessage"),
1485
- __param(0, (0, runtime_1.Body)()),
1486
- __param(1, (0, runtime_1.Inject)())
1487
- ], LemmyHttp.prototype, "markPrivateMessageAsRead", null);
1488
1531
  __decorate([
1489
1532
  (0, runtime_1.Security)("bearerAuth"),
1490
1533
  (0, runtime_1.Post)("/private_message/report"),
@@ -1533,6 +1576,13 @@ __decorate([
1533
1576
  __param(0, (0, runtime_1.Queries)()),
1534
1577
  __param(1, (0, runtime_1.Inject)())
1535
1578
  ], LemmyHttp.prototype, "listPersonContent", null);
1579
+ __decorate([
1580
+ (0, runtime_1.Security)("bearerAuth"),
1581
+ (0, runtime_1.Post)("/person/note"),
1582
+ (0, runtime_1.Tags)("Person"),
1583
+ __param(0, (0, runtime_1.Body)()),
1584
+ __param(1, (0, runtime_1.Inject)())
1585
+ ], LemmyHttp.prototype, "notePerson", null);
1536
1586
  __decorate([
1537
1587
  (0, runtime_1.Security)("bearerAuth"),
1538
1588
  (0, runtime_1.Post)("/admin/ban"),
@@ -1794,6 +1844,13 @@ __decorate([
1794
1844
  __param(0, (0, runtime_1.Body)()),
1795
1845
  __param(1, (0, runtime_1.Inject)())
1796
1846
  ], LemmyHttp.prototype, "createCommunityTag", null);
1847
+ __decorate([
1848
+ (0, runtime_1.Security)("bearerAuth"),
1849
+ (0, runtime_1.Put)("/community/tag"),
1850
+ (0, runtime_1.Tags)("Community"),
1851
+ __param(0, (0, runtime_1.Body)()),
1852
+ __param(1, (0, runtime_1.Inject)())
1853
+ ], LemmyHttp.prototype, "updateCommunityTag", null);
1797
1854
  __decorate([
1798
1855
  (0, runtime_1.Security)("bearerAuth"),
1799
1856
  (0, runtime_1.Delete)("/community/tag"),
@@ -1843,11 +1900,18 @@ __decorate([
1843
1900
  ], LemmyHttp.prototype, "listReports", null);
1844
1901
  __decorate([
1845
1902
  (0, runtime_1.Security)("bearerAuth"),
1846
- (0, runtime_1.Post)("/account/block/instance"),
1847
- (0, runtime_1.Tags)("Account"),
1903
+ (0, runtime_1.Post)("/account/block/instance/communities"),
1904
+ (0, runtime_1.Tags)("Account", "Community"),
1905
+ __param(0, (0, runtime_1.Body)()),
1906
+ __param(1, (0, runtime_1.Inject)())
1907
+ ], LemmyHttp.prototype, "userBlockInstanceCommunities", null);
1908
+ __decorate([
1909
+ (0, runtime_1.Security)("bearerAuth"),
1910
+ (0, runtime_1.Post)("/account/block/instance/persons"),
1911
+ (0, runtime_1.Tags)("Account", "Person"),
1848
1912
  __param(0, (0, runtime_1.Body)()),
1849
1913
  __param(1, (0, runtime_1.Inject)())
1850
- ], LemmyHttp.prototype, "userBlockInstance", null);
1914
+ ], LemmyHttp.prototype, "userBlockInstancePersons", null);
1851
1915
  __decorate([
1852
1916
  (0, runtime_1.Security)("bearerAuth"),
1853
1917
  (0, runtime_1.Post)("/admin/instance/block"),
@@ -1958,8 +2022,8 @@ __decorate([
1958
2022
  ], LemmyHttp.prototype, "imageHealth", null);
1959
2023
  __decorate([
1960
2024
  (0, runtime_1.Security)("bearerAuth"),
1961
- (0, runtime_1.Post)("/user/donation_dialog_shown"),
1962
- (0, runtime_1.Tags)("Miscellaneous"),
2025
+ (0, runtime_1.Post)("/account/donation_dialog_shown"),
2026
+ (0, runtime_1.Tags)("Account"),
1963
2027
  __param(0, (0, runtime_1.Inject)())
1964
2028
  ], LemmyHttp.prototype, "donationDialogShown", null);
1965
2029
  __decorate([
@@ -2008,6 +2072,20 @@ __decorate([
2008
2072
  __param(0, (0, runtime_1.Body)()),
2009
2073
  __param(1, (0, runtime_1.Inject)())
2010
2074
  ], LemmyHttp.prototype, "followMultiCommunity", null);
2075
+ __decorate([
2076
+ (0, runtime_1.Security)("bearerAuth"),
2077
+ (0, runtime_1.Put)("/community/notifications"),
2078
+ (0, runtime_1.Tags)("Community"),
2079
+ __param(0, (0, runtime_1.Body)()),
2080
+ __param(1, (0, runtime_1.Inject)())
2081
+ ], LemmyHttp.prototype, "updateCommunityNotifications", null);
2082
+ __decorate([
2083
+ (0, runtime_1.Security)("bearerAuth"),
2084
+ (0, runtime_1.Put)("/post/notifications"),
2085
+ (0, runtime_1.Tags)("Post"),
2086
+ __param(0, (0, runtime_1.Body)()),
2087
+ __param(1, (0, runtime_1.Inject)())
2088
+ ], LemmyHttp.prototype, "updatePostNotifications", null);
2011
2089
  exports.LemmyHttp = LemmyHttp = __decorate([
2012
2090
  (0, runtime_1.Route)("api/v4")
2013
2091
  ], LemmyHttp);
@@ -2035,9 +2113,10 @@ function createFormData(image) {
2035
2113
  * The msg is either an empty string, or extra non-translatable info.
2036
2114
  */
2037
2115
  class LemmyError extends Error {
2038
- constructor(name, msg) {
2116
+ constructor(name, status, msg) {
2039
2117
  super(msg ?? "");
2040
2118
  this.name = name;
2119
+ this.status = status;
2041
2120
  // Set the prototype explicitly.
2042
2121
  Object.setPrototypeOf(this, LemmyError.prototype);
2043
2122
  }