lemmy-js-client 0.19.0-rc.1 → 0.19.0-rc.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. package/dist/http.d.ts +27 -19
  2. package/dist/http.js +37 -31
  3. package/dist/index.d.ts +7 -17
  4. package/dist/types/AddAdmin.d.ts +0 -1
  5. package/dist/types/AddModToCommunity.d.ts +0 -1
  6. package/dist/types/ApproveRegistrationApplication.d.ts +0 -1
  7. package/dist/types/BanFromCommunity.d.ts +0 -1
  8. package/dist/types/BanPerson.d.ts +0 -1
  9. package/dist/types/BlockCommunity.d.ts +0 -1
  10. package/dist/types/BlockInstance.d.ts +6 -0
  11. package/dist/types/BlockInstanceResponse.d.ts +3 -0
  12. package/dist/types/BlockPerson.d.ts +0 -1
  13. package/dist/types/ChangePassword.d.ts +0 -1
  14. package/dist/types/CommentResponse.d.ts +0 -1
  15. package/dist/types/Community.d.ts +0 -2
  16. package/dist/types/CreateComment.d.ts +0 -2
  17. package/dist/types/CreateCommentLike.d.ts +0 -1
  18. package/dist/types/CreateCommentReport.d.ts +0 -1
  19. package/dist/types/CreateCommunity.d.ts +0 -1
  20. package/dist/types/CreateCustomEmoji.d.ts +0 -1
  21. package/dist/types/CreatePost.d.ts +0 -1
  22. package/dist/types/CreatePostLike.d.ts +0 -1
  23. package/dist/types/CreatePostReport.d.ts +0 -1
  24. package/dist/types/CreatePrivateMessage.d.ts +0 -1
  25. package/dist/types/CreatePrivateMessageReport.d.ts +0 -1
  26. package/dist/types/CreateSite.d.ts +0 -1
  27. package/dist/types/DeleteAccount.d.ts +1 -1
  28. package/dist/types/DeleteAccountResponse.d.ts +1 -1
  29. package/dist/types/DeleteComment.d.ts +0 -1
  30. package/dist/types/DeleteCommunity.d.ts +0 -1
  31. package/dist/types/DeleteCustomEmoji.d.ts +0 -1
  32. package/dist/types/DeletePost.d.ts +0 -1
  33. package/dist/types/DeletePrivateMessage.d.ts +0 -1
  34. package/dist/types/DistinguishComment.d.ts +0 -1
  35. package/dist/types/EditComment.d.ts +0 -2
  36. package/dist/types/EditCommunity.d.ts +0 -1
  37. package/dist/types/EditCustomEmoji.d.ts +0 -1
  38. package/dist/types/EditPost.d.ts +0 -1
  39. package/dist/types/EditPrivateMessage.d.ts +0 -1
  40. package/dist/types/EditSite.d.ts +0 -1
  41. package/dist/types/FeaturePost.d.ts +0 -1
  42. package/dist/types/FollowCommunity.d.ts +0 -1
  43. package/dist/types/GetComment.d.ts +0 -1
  44. package/dist/types/GetComments.d.ts +2 -1
  45. package/dist/types/GetCommunity.d.ts +0 -1
  46. package/dist/types/GetModlog.d.ts +0 -1
  47. package/dist/types/GetPersonDetails.d.ts +0 -1
  48. package/dist/types/GetPersonMentions.d.ts +0 -1
  49. package/dist/types/GetPost.d.ts +0 -1
  50. package/dist/types/GetPosts.d.ts +4 -2
  51. package/dist/types/GetPostsResponse.d.ts +2 -0
  52. package/dist/types/GetPrivateMessages.d.ts +2 -1
  53. package/dist/types/GetPrivateMessages.js +0 -1
  54. package/dist/types/GetReplies.d.ts +0 -1
  55. package/dist/types/GetReportCount.d.ts +0 -1
  56. package/dist/types/HideCommunity.d.ts +0 -1
  57. package/dist/types/ImageUpload.d.ts +9 -0
  58. package/dist/types/ImageUploadId.d.ts +1 -0
  59. package/dist/types/InstanceBlockView.d.ts +8 -0
  60. package/dist/types/ListCommentReports.d.ts +0 -1
  61. package/dist/types/ListCommunities.d.ts +0 -1
  62. package/dist/types/ListPostReports.d.ts +0 -1
  63. package/dist/types/ListPrivateMessageReports.d.ts +0 -1
  64. package/dist/types/ListRegistrationApplications.d.ts +0 -1
  65. package/dist/types/ListingType.d.ts +1 -1
  66. package/dist/types/LocalUser.d.ts +3 -0
  67. package/dist/types/LockPost.d.ts +0 -1
  68. package/dist/types/MarkCommentReplyAsRead.d.ts +0 -1
  69. package/dist/types/MarkPersonMentionAsRead.d.ts +0 -1
  70. package/dist/types/MarkPostAsRead.d.ts +0 -1
  71. package/dist/types/MarkPrivateMessageAsRead.d.ts +0 -1
  72. package/dist/types/MyUserInfo.d.ts +2 -0
  73. package/dist/types/PaginationCursor.d.ts +1 -0
  74. package/dist/types/PasswordResetResponse.d.ts +1 -1
  75. package/dist/types/Person.d.ts +0 -2
  76. package/dist/types/PostAggregates.d.ts +3 -0
  77. package/dist/types/PostListingMode.d.ts +1 -0
  78. package/dist/types/PurgeComment.d.ts +0 -1
  79. package/dist/types/PurgeCommunity.d.ts +0 -1
  80. package/dist/types/PurgePerson.d.ts +0 -1
  81. package/dist/types/PurgePost.d.ts +0 -1
  82. package/dist/types/RemoveComment.d.ts +0 -1
  83. package/dist/types/RemoveCommunity.d.ts +0 -1
  84. package/dist/types/RemovePost.d.ts +0 -1
  85. package/dist/types/ResolveCommentReport.d.ts +0 -1
  86. package/dist/types/ResolveObject.d.ts +0 -1
  87. package/dist/types/ResolvePostReport.d.ts +0 -1
  88. package/dist/types/ResolvePrivateMessageReport.d.ts +0 -1
  89. package/dist/types/SaveComment.d.ts +0 -1
  90. package/dist/types/SavePost.d.ts +0 -1
  91. package/dist/types/SaveUserSettings.d.ts +0 -1
  92. package/dist/types/Search.d.ts +0 -1
  93. package/dist/types/SortType.d.ts +1 -1
  94. package/dist/types/TransferCommunity.d.ts +0 -1
  95. package/dist/types/VerifyEmailResponse.d.ts +1 -1
  96. package/package.json +1 -1
  97. package/dist/types/CommunityJoin.d.ts +0 -4
  98. package/dist/types/CommunityJoinResponse.d.ts +0 -3
  99. package/dist/types/GetBannedPersons.d.ts +0 -3
  100. package/dist/types/GetCaptcha.d.ts +0 -3
  101. package/dist/types/GetFederatedInstances.d.ts +0 -3
  102. package/dist/types/GetSite.d.ts +0 -3
  103. package/dist/types/GetSite.js +0 -3
  104. package/dist/types/GetUnreadCount.d.ts +0 -3
  105. package/dist/types/GetUnreadCount.js +0 -3
  106. package/dist/types/GetUnreadRegistrationApplicationCount.d.ts +0 -3
  107. package/dist/types/GetUnreadRegistrationApplicationCount.js +0 -3
  108. package/dist/types/LeaveAdmin.d.ts +0 -3
  109. package/dist/types/LeaveAdmin.js +0 -3
  110. package/dist/types/MarkAllAsRead.d.ts +0 -3
  111. package/dist/types/MarkAllAsRead.js +0 -3
  112. package/dist/types/ModJoin.d.ts +0 -4
  113. package/dist/types/ModJoinResponse.d.ts +0 -3
  114. package/dist/types/ModJoinResponse.js +0 -3
  115. package/dist/types/PostJoin.d.ts +0 -4
  116. package/dist/types/PostJoinResponse.d.ts +0 -3
  117. package/dist/types/PostJoinResponse.js +0 -3
  118. package/dist/types/PostOrCommentId.d.ts +0 -7
  119. package/dist/types/PostOrCommentId.js +0 -2
  120. package/dist/types/UserJoin.d.ts +0 -3
  121. package/dist/types/UserJoin.js +0 -3
  122. package/dist/types/UserJoinResponse.d.ts +0 -3
  123. package/dist/types/UserJoinResponse.js +0 -3
  124. /package/dist/types/{CommunityJoin.js → BlockInstance.js} +0 -0
  125. /package/dist/types/{CommunityJoinResponse.js → BlockInstanceResponse.js} +0 -0
  126. /package/dist/types/{ModJoin.js → ImageUpload.js} +0 -0
  127. /package/dist/types/{GetBannedPersons.js → ImageUploadId.js} +0 -0
  128. /package/dist/types/{PostJoin.js → InstanceBlockView.js} +0 -0
  129. /package/dist/types/{GetCaptcha.js → PaginationCursor.js} +0 -0
  130. /package/dist/types/{GetFederatedInstances.js → PostListingMode.js} +0 -0
package/dist/http.d.ts CHANGED
@@ -31,6 +31,7 @@ import { CreatePrivateMessageReport } from "./types/CreatePrivateMessageReport";
31
31
  import { CreateSite } from "./types/CreateSite";
32
32
  import { CustomEmojiResponse } from "./types/CustomEmojiResponse";
33
33
  import { DeleteAccount } from "./types/DeleteAccount";
34
+ import { DeleteAccountResponse } from "./types/DeleteAccountResponse";
34
35
  import { DeleteComment } from "./types/DeleteComment";
35
36
  import { DeleteCommunity } from "./types/DeleteCommunity";
36
37
  import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
@@ -46,15 +47,12 @@ import { EditPrivateMessage } from "./types/EditPrivateMessage";
46
47
  import { EditSite } from "./types/EditSite";
47
48
  import { FeaturePost } from "./types/FeaturePost";
48
49
  import { FollowCommunity } from "./types/FollowCommunity";
49
- import { GetBannedPersons } from "./types/GetBannedPersons";
50
- import { GetCaptcha } from "./types/GetCaptcha";
51
50
  import { GetCaptchaResponse } from "./types/GetCaptchaResponse";
52
51
  import { GetComment } from "./types/GetComment";
53
52
  import { GetComments } from "./types/GetComments";
54
53
  import { GetCommentsResponse } from "./types/GetCommentsResponse";
55
54
  import { GetCommunity } from "./types/GetCommunity";
56
55
  import { GetCommunityResponse } from "./types/GetCommunityResponse";
57
- import { GetFederatedInstances } from "./types/GetFederatedInstances";
58
56
  import { GetFederatedInstancesResponse } from "./types/GetFederatedInstancesResponse";
59
57
  import { GetModlog } from "./types/GetModlog";
60
58
  import { GetModlogResponse } from "./types/GetModlogResponse";
@@ -71,15 +69,11 @@ import { GetReplies } from "./types/GetReplies";
71
69
  import { GetRepliesResponse } from "./types/GetRepliesResponse";
72
70
  import { GetReportCount } from "./types/GetReportCount";
73
71
  import { GetReportCountResponse } from "./types/GetReportCountResponse";
74
- import { GetSite } from "./types/GetSite";
75
72
  import { GetSiteMetadata } from "./types/GetSiteMetadata";
76
73
  import { GetSiteMetadataResponse } from "./types/GetSiteMetadataResponse";
77
74
  import { GetSiteResponse } from "./types/GetSiteResponse";
78
- import { GetUnreadCount } from "./types/GetUnreadCount";
79
75
  import { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
80
- import { GetUnreadRegistrationApplicationCount } from "./types/GetUnreadRegistrationApplicationCount";
81
76
  import { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
82
- import { LeaveAdmin } from "./types/LeaveAdmin";
83
77
  import { ListCommentReports } from "./types/ListCommentReports";
84
78
  import { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
85
79
  import { ListCommunities } from "./types/ListCommunities";
@@ -93,13 +87,13 @@ import { ListRegistrationApplicationsResponse } from "./types/ListRegistrationAp
93
87
  import { LockPost } from "./types/LockPost";
94
88
  import { Login } from "./types/Login";
95
89
  import { LoginResponse } from "./types/LoginResponse";
96
- import { MarkAllAsRead } from "./types/MarkAllAsRead";
97
90
  import { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
98
91
  import { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
99
92
  import { MarkPostAsRead } from "./types/MarkPostAsRead";
100
93
  import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
101
94
  import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
102
95
  import { PasswordReset } from "./types/PasswordReset";
96
+ import { PasswordResetResponse } from "./types/PasswordResetResponse";
103
97
  import { PersonMentionResponse } from "./types/PersonMentionResponse";
104
98
  import { PostReportResponse } from "./types/PostReportResponse";
105
99
  import { PostResponse } from "./types/PostResponse";
@@ -129,7 +123,9 @@ import { SearchResponse } from "./types/SearchResponse";
129
123
  import { SiteResponse } from "./types/SiteResponse";
130
124
  import { TransferCommunity } from "./types/TransferCommunity";
131
125
  import { VerifyEmail } from "./types/VerifyEmail";
126
+ import { VerifyEmailResponse } from "./types/VerifyEmailResponse";
132
127
  import { UploadImage, UploadImageResponse } from "./types/others";
128
+ import { HideCommunity } from "./types/HideCommunity";
133
129
  /**
134
130
  * Helps build lemmy HTTP requests.
135
131
  */
@@ -151,7 +147,7 @@ export declare class LemmyHttp {
151
147
  *
152
148
  * `HTTP.GET /site`
153
149
  */
154
- getSite(form?: GetSite): Promise<GetSiteResponse>;
150
+ getSite(): Promise<GetSiteResponse>;
155
151
  /**
156
152
  * Create your site.
157
153
  *
@@ -169,7 +165,7 @@ export declare class LemmyHttp {
169
165
  *
170
166
  * `HTTP.POST /user/leave_admin`
171
167
  */
172
- leaveAdmin(form: LeaveAdmin): Promise<GetSiteResponse>;
168
+ leaveAdmin(): Promise<GetSiteResponse>;
173
169
  /**
174
170
  * Get the modlog.
175
171
  *
@@ -230,6 +226,12 @@ export declare class LemmyHttp {
230
226
  * `HTTP.POST /community/delete`
231
227
  */
232
228
  deleteCommunity(form: DeleteCommunity): Promise<CommunityResponse>;
229
+ /**
230
+ * Hide a community from public view.
231
+ *
232
+ * `HTTP.PUT /community/hide`
233
+ */
234
+ hideCommunity(form: HideCommunity): Promise<CommunityResponse>;
233
235
  /**
234
236
  * A moderator remove for a community.
235
237
  *
@@ -517,7 +519,7 @@ export declare class LemmyHttp {
517
519
  *
518
520
  * `HTTP.GET /user/banned`
519
521
  */
520
- getBannedPersons(form: GetBannedPersons): Promise<BannedPersonsResponse>;
522
+ getBannedPersons(): Promise<BannedPersonsResponse>;
521
523
  /**
522
524
  * Block a person.
523
525
  *
@@ -529,19 +531,19 @@ export declare class LemmyHttp {
529
531
  *
530
532
  * `HTTP.GET /user/get_captcha`
531
533
  */
532
- getCaptcha(form?: GetCaptcha): Promise<GetCaptchaResponse>;
534
+ getCaptcha(): Promise<GetCaptchaResponse>;
533
535
  /**
534
536
  * Delete your account.
535
537
  *
536
538
  * `HTTP.POST /user/delete_account`
537
539
  */
538
- deleteAccount(form: DeleteAccount): Promise<null>;
540
+ deleteAccount(form: DeleteAccount): Promise<DeleteAccountResponse>;
539
541
  /**
540
542
  * Reset your password.
541
543
  *
542
544
  * `HTTP.POST /user/password_reset`
543
545
  */
544
- passwordReset(form: PasswordReset): Promise<null>;
546
+ passwordReset(form: PasswordReset): Promise<PasswordResetResponse>;
545
547
  /**
546
548
  * Change your password from an email / token based reset.
547
549
  *
@@ -553,7 +555,7 @@ export declare class LemmyHttp {
553
555
  *
554
556
  * `HTTP.POST /user/mark_all_as_read`
555
557
  */
556
- markAllAsRead(form: MarkAllAsRead): Promise<GetRepliesResponse>;
558
+ markAllAsRead(): Promise<GetRepliesResponse>;
557
559
  /**
558
560
  * Save your user settings.
559
561
  *
@@ -577,13 +579,13 @@ export declare class LemmyHttp {
577
579
  *
578
580
  * `HTTP.GET /user/unread_count`
579
581
  */
580
- getUnreadCount(form: GetUnreadCount): Promise<GetUnreadCountResponse>;
582
+ getUnreadCount(): Promise<GetUnreadCountResponse>;
581
583
  /**
582
584
  * Verify your email
583
585
  *
584
586
  * `HTTP.POST /user/verify_email`
585
587
  */
586
- verifyEmail(form: VerifyEmail): Promise<null>;
588
+ verifyEmail(form: VerifyEmail): Promise<VerifyEmailResponse>;
587
589
  /**
588
590
  * Add an admin to your site.
589
591
  *
@@ -595,7 +597,7 @@ export declare class LemmyHttp {
595
597
  *
596
598
  * `HTTP.GET /admin/registration_application/count`
597
599
  */
598
- getUnreadRegistrationApplicationCount(form: GetUnreadRegistrationApplicationCount): Promise<GetUnreadRegistrationApplicationCountResponse>;
600
+ getUnreadRegistrationApplicationCount(): Promise<GetUnreadRegistrationApplicationCountResponse>;
599
601
  /**
600
602
  * List the registration applications.
601
603
  *
@@ -655,9 +657,15 @@ export declare class LemmyHttp {
655
657
  *
656
658
  * `HTTP.Get /federated_instances`
657
659
  */
658
- getFederatedInstances(form?: GetFederatedInstances): Promise<GetFederatedInstancesResponse>;
660
+ getFederatedInstances(): Promise<GetFederatedInstancesResponse>;
659
661
  /**
660
662
  * Upload an image to the server.
661
663
  */
662
664
  uploadImage({ image, auth, }: UploadImage): Promise<UploadImageResponse>;
665
+ /**
666
+ * Set the headers (can be used to set the auth header)
667
+ */
668
+ setHeaders(headers: {
669
+ [key: string]: string;
670
+ }): void;
663
671
  }
package/dist/http.js CHANGED
@@ -63,8 +63,8 @@ class LemmyHttp {
63
63
  *
64
64
  * `HTTP.GET /site`
65
65
  */
66
- getSite(form = {}) {
67
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/site", form);
66
+ getSite() {
67
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/site", {});
68
68
  }
69
69
  /**
70
70
  * Create your site.
@@ -87,8 +87,8 @@ class LemmyHttp {
87
87
  *
88
88
  * `HTTP.POST /user/leave_admin`
89
89
  */
90
- leaveAdmin(form) {
91
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/leave_admin", form);
90
+ leaveAdmin() {
91
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/leave_admin", {});
92
92
  }
93
93
  /**
94
94
  * Get the modlog.
@@ -170,6 +170,14 @@ class LemmyHttp {
170
170
  deleteCommunity(form) {
171
171
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/delete", form);
172
172
  }
173
+ /**
174
+ * Hide a community from public view.
175
+ *
176
+ * `HTTP.PUT /community/hide`
177
+ */
178
+ hideCommunity(form) {
179
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/community/hide", form);
180
+ }
173
181
  /**
174
182
  * A moderator remove for a community.
175
183
  *
@@ -551,8 +559,8 @@ class LemmyHttp {
551
559
  *
552
560
  * `HTTP.GET /user/banned`
553
561
  */
554
- getBannedPersons(form) {
555
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/banned", form);
562
+ getBannedPersons() {
563
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/banned", {});
556
564
  }
557
565
  /**
558
566
  * Block a person.
@@ -567,8 +575,8 @@ class LemmyHttp {
567
575
  *
568
576
  * `HTTP.GET /user/get_captcha`
569
577
  */
570
- getCaptcha(form = {}) {
571
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/get_captcha", form);
578
+ getCaptcha() {
579
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/get_captcha", {});
572
580
  }
573
581
  /**
574
582
  * Delete your account.
@@ -599,8 +607,8 @@ class LemmyHttp {
599
607
  *
600
608
  * `HTTP.POST /user/mark_all_as_read`
601
609
  */
602
- markAllAsRead(form) {
603
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/mark_all_as_read", form);
610
+ markAllAsRead() {
611
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/mark_all_as_read", {});
604
612
  }
605
613
  /**
606
614
  * Save your user settings.
@@ -631,8 +639,8 @@ class LemmyHttp {
631
639
  *
632
640
  * `HTTP.GET /user/unread_count`
633
641
  */
634
- getUnreadCount(form) {
635
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/unread_count", form);
642
+ getUnreadCount() {
643
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/user/unread_count", {});
636
644
  }
637
645
  /**
638
646
  * Verify your email
@@ -655,8 +663,8 @@ class LemmyHttp {
655
663
  *
656
664
  * `HTTP.GET /admin/registration_application/count`
657
665
  */
658
- getUnreadRegistrationApplicationCount(form) {
659
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application/count", form);
666
+ getUnreadRegistrationApplicationCount() {
667
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/admin/registration_application/count", {});
660
668
  }
661
669
  /**
662
670
  * List the registration applications.
@@ -712,9 +720,7 @@ class LemmyHttp {
712
720
  * `HTTP.POST /custom_emoji`
713
721
  */
714
722
  createCustomEmoji(form) {
715
- return __awaiter(this, void 0, void 0, function* () {
716
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji", form);
717
- });
723
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji", form);
718
724
  }
719
725
  /**
720
726
  * Edit an existing custom emoji
@@ -722,9 +728,7 @@ class LemmyHttp {
722
728
  * `HTTP.PUT /custom_emoji`
723
729
  */
724
730
  editCustomEmoji(form) {
725
- return __awaiter(this, void 0, void 0, function* () {
726
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/custom_emoji", form);
727
- });
731
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Put, "/custom_emoji", form);
728
732
  }
729
733
  /**
730
734
  * Delete a custom emoji
@@ -732,19 +736,15 @@ class LemmyHttp {
732
736
  * `HTTP.Post /custom_emoji/delete`
733
737
  */
734
738
  deleteCustomEmoji(form) {
735
- return __awaiter(this, void 0, void 0, function* () {
736
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji/delete", form);
737
- });
739
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/custom_emoji/delete", form);
738
740
  }
739
741
  /**
740
742
  * Fetch federated instances.
741
743
  *
742
744
  * `HTTP.Get /federated_instances`
743
745
  */
744
- getFederatedInstances(form = {}) {
745
- return __awaiter(this, void 0, void 0, function* () {
746
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", form);
747
- });
746
+ getFederatedInstances() {
747
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Get, "/federated_instances", {});
748
748
  }
749
749
  /**
750
750
  * Upload an image to the server.
@@ -753,11 +753,11 @@ class LemmyHttp {
753
753
  var _a, _b, _c, _d;
754
754
  return __awaiter(this, void 0, void 0, function* () {
755
755
  const formData = createFormData(image);
756
- // If jwt cookie not already set by browser, set it with passed in auth
756
+ // If auth cookie not already set by browser, set it with passed in auth
757
757
  const headers = {};
758
- if (!((_b = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.cookie) === null || _b === void 0 ? void 0 : _b.includes("jwt=")) &&
759
- !((_d = (_c = __classPrivateFieldGet(this, _LemmyHttp_headers, "f")) === null || _c === void 0 ? void 0 : _c.Cookie) === null || _d === void 0 ? void 0 : _d.includes("jwt="))) {
760
- headers.Cookie = `jwt=${auth}`;
758
+ if (!((_b = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.cookie) === null || _b === void 0 ? void 0 : _b.includes("auth=")) &&
759
+ !((_d = (_c = __classPrivateFieldGet(this, _LemmyHttp_headers, "f")) === null || _c === void 0 ? void 0 : _c.Cookie) === null || _d === void 0 ? void 0 : _d.includes("auth="))) {
760
+ headers.Cookie = `auth=${auth}`;
761
761
  }
762
762
  let url = undefined;
763
763
  let delete_url = undefined;
@@ -779,6 +779,12 @@ class LemmyHttp {
779
779
  delete_url });
780
780
  });
781
781
  }
782
+ /**
783
+ * Set the headers (can be used to set the auth header)
784
+ */
785
+ setHeaders(headers) {
786
+ __classPrivateFieldSet(this, _LemmyHttp_headers, headers, "f");
787
+ }
782
788
  }
783
789
  exports.LemmyHttp = LemmyHttp;
784
790
  _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) {
package/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ export { BanPersonResponse } from "./types/BanPersonResponse";
19
19
  export { BannedPersonsResponse } from "./types/BannedPersonsResponse";
20
20
  export { BlockCommunity } from "./types/BlockCommunity";
21
21
  export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
22
+ export { BlockInstance } from "./types/BlockInstance";
23
+ export { BlockInstanceResponse } from "./types/BlockInstanceResponse";
22
24
  export { BlockPerson } from "./types/BlockPerson";
23
25
  export { BlockPersonResponse } from "./types/BlockPersonResponse";
24
26
  export { CaptchaResponse } from "./types/CaptchaResponse";
@@ -43,8 +45,6 @@ export { CommunityBlockId } from "./types/CommunityBlockId";
43
45
  export { CommunityBlockView } from "./types/CommunityBlockView";
44
46
  export { CommunityFollowerView } from "./types/CommunityFollowerView";
45
47
  export { CommunityId } from "./types/CommunityId";
46
- export { CommunityJoin } from "./types/CommunityJoin";
47
- export { CommunityJoinResponse } from "./types/CommunityJoinResponse";
48
48
  export { CommunityModeratorView } from "./types/CommunityModeratorView";
49
49
  export { CommunityResponse } from "./types/CommunityResponse";
50
50
  export { CommunityView } from "./types/CommunityView";
@@ -82,15 +82,12 @@ export { EditSite } from "./types/EditSite";
82
82
  export { FeaturePost } from "./types/FeaturePost";
83
83
  export { FederatedInstances } from "./types/FederatedInstances";
84
84
  export { FollowCommunity } from "./types/FollowCommunity";
85
- export { GetBannedPersons } from "./types/GetBannedPersons";
86
- export { GetCaptcha } from "./types/GetCaptcha";
87
85
  export { GetCaptchaResponse } from "./types/GetCaptchaResponse";
88
86
  export { GetComment } from "./types/GetComment";
89
87
  export { GetComments } from "./types/GetComments";
90
88
  export { GetCommentsResponse } from "./types/GetCommentsResponse";
91
89
  export { GetCommunity } from "./types/GetCommunity";
92
90
  export { GetCommunityResponse } from "./types/GetCommunityResponse";
93
- export { GetFederatedInstances } from "./types/GetFederatedInstances";
94
91
  export { GetFederatedInstancesResponse } from "./types/GetFederatedInstancesResponse";
95
92
  export { GetModlog } from "./types/GetModlog";
96
93
  export { GetModlogResponse } from "./types/GetModlogResponse";
@@ -107,20 +104,19 @@ export { GetReplies } from "./types/GetReplies";
107
104
  export { GetRepliesResponse } from "./types/GetRepliesResponse";
108
105
  export { GetReportCount } from "./types/GetReportCount";
109
106
  export { GetReportCountResponse } from "./types/GetReportCountResponse";
110
- export { GetSite } from "./types/GetSite";
111
107
  export { GetSiteMetadata } from "./types/GetSiteMetadata";
112
108
  export { GetSiteMetadataResponse } from "./types/GetSiteMetadataResponse";
113
109
  export { GetSiteResponse } from "./types/GetSiteResponse";
114
- export { GetUnreadCount } from "./types/GetUnreadCount";
115
110
  export { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
116
- export { GetUnreadRegistrationApplicationCount } from "./types/GetUnreadRegistrationApplicationCount";
117
111
  export { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
118
112
  export { HideCommunity } from "./types/HideCommunity";
113
+ export { ImageUpload } from "./types/ImageUpload";
114
+ export { ImageUploadId } from "./types/ImageUploadId";
119
115
  export { Instance } from "./types/Instance";
116
+ export { InstanceBlockView } from "./types/InstanceBlockView";
120
117
  export { InstanceId } from "./types/InstanceId";
121
118
  export { Language } from "./types/Language";
122
119
  export { LanguageId } from "./types/LanguageId";
123
- export { LeaveAdmin } from "./types/LeaveAdmin";
124
120
  export { LemmyErrorType } from "./types/LemmyErrorType";
125
121
  export { ListCommentReports } from "./types/ListCommentReports";
126
122
  export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
@@ -142,7 +138,6 @@ export { LocalUserView } from "./types/LocalUserView";
142
138
  export { LockPost } from "./types/LockPost";
143
139
  export { Login } from "./types/Login";
144
140
  export { LoginResponse } from "./types/LoginResponse";
145
- export { MarkAllAsRead } from "./types/MarkAllAsRead";
146
141
  export { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
147
142
  export { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
148
143
  export { MarkPostAsRead } from "./types/MarkPostAsRead";
@@ -159,8 +154,6 @@ export { ModFeaturePost } from "./types/ModFeaturePost";
159
154
  export { ModFeaturePostView } from "./types/ModFeaturePostView";
160
155
  export { ModHideCommunity } from "./types/ModHideCommunity";
161
156
  export { ModHideCommunityView } from "./types/ModHideCommunityView";
162
- export { ModJoin } from "./types/ModJoin";
163
- export { ModJoinResponse } from "./types/ModJoinResponse";
164
157
  export { ModLockPost } from "./types/ModLockPost";
165
158
  export { ModLockPostView } from "./types/ModLockPostView";
166
159
  export { ModRemoveComment } from "./types/ModRemoveComment";
@@ -174,6 +167,7 @@ export { ModTransferCommunityView } from "./types/ModTransferCommunityView";
174
167
  export { ModlogActionType } from "./types/ModlogActionType";
175
168
  export { ModlogListParams } from "./types/ModlogListParams";
176
169
  export { MyUserInfo } from "./types/MyUserInfo";
170
+ export { PaginationCursor } from "./types/PaginationCursor";
177
171
  export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
178
172
  export { PasswordReset } from "./types/PasswordReset";
179
173
  export { PasswordResetResponse } from "./types/PasswordResetResponse";
@@ -192,9 +186,7 @@ export { Post } from "./types/Post";
192
186
  export { PostAggregates } from "./types/PostAggregates";
193
187
  export { PostFeatureType } from "./types/PostFeatureType";
194
188
  export { PostId } from "./types/PostId";
195
- export { PostJoin } from "./types/PostJoin";
196
- export { PostJoinResponse } from "./types/PostJoinResponse";
197
- export { PostOrCommentId } from "./types/PostOrCommentId";
189
+ export { PostListingMode } from "./types/PostListingMode";
198
190
  export { PostReport } from "./types/PostReport";
199
191
  export { PostReportId } from "./types/PostReportId";
200
192
  export { PostReportResponse } from "./types/PostReportResponse";
@@ -244,8 +236,6 @@ export { SortType } from "./types/SortType";
244
236
  export { SubscribedType } from "./types/SubscribedType";
245
237
  export { Tagline } from "./types/Tagline";
246
238
  export { TransferCommunity } from "./types/TransferCommunity";
247
- export { UserJoin } from "./types/UserJoin";
248
- export { UserJoinResponse } from "./types/UserJoinResponse";
249
239
  export { VerifyEmail } from "./types/VerifyEmail";
250
240
  export { VerifyEmailResponse } from "./types/VerifyEmailResponse";
251
241
  export { UploadImage, UploadImageResponse, ImageFile } from "./types/others";
@@ -2,5 +2,4 @@ import type { PersonId } from "./PersonId";
2
2
  export interface AddAdmin {
3
3
  person_id: PersonId;
4
4
  added: boolean;
5
- auth: string;
6
5
  }
@@ -4,5 +4,4 @@ export interface AddModToCommunity {
4
4
  community_id: CommunityId;
5
5
  person_id: PersonId;
6
6
  added: boolean;
7
- auth: string;
8
7
  }
@@ -2,5 +2,4 @@ export interface ApproveRegistrationApplication {
2
2
  id: number;
3
3
  approve: boolean;
4
4
  deny_reason?: string;
5
- auth: string;
6
5
  }
@@ -7,5 +7,4 @@ export interface BanFromCommunity {
7
7
  remove_data?: boolean;
8
8
  reason?: string;
9
9
  expires?: number;
10
- auth: string;
11
10
  }
@@ -5,5 +5,4 @@ export interface BanPerson {
5
5
  remove_data?: boolean;
6
6
  reason?: string;
7
7
  expires?: number;
8
- auth: string;
9
8
  }
@@ -2,5 +2,4 @@ import type { CommunityId } from "./CommunityId";
2
2
  export interface BlockCommunity {
3
3
  community_id: CommunityId;
4
4
  block: boolean;
5
- auth: string;
6
5
  }
@@ -0,0 +1,6 @@
1
+ import type { InstanceId } from "./InstanceId";
2
+ export interface BlockInstance {
3
+ instance_id: InstanceId;
4
+ block: boolean;
5
+ auth: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ export interface BlockInstanceResponse {
2
+ blocked: boolean;
3
+ }
@@ -2,5 +2,4 @@ import type { PersonId } from "./PersonId";
2
2
  export interface BlockPerson {
3
3
  person_id: PersonId;
4
4
  block: boolean;
5
- auth: string;
6
5
  }
@@ -2,5 +2,4 @@ export interface ChangePassword {
2
2
  new_password: string;
3
3
  new_password_verify: string;
4
4
  old_password: string;
5
- auth: string;
6
5
  }
@@ -3,5 +3,4 @@ import type { LocalUserId } from "./LocalUserId";
3
3
  export interface CommentResponse {
4
4
  comment_view: CommentView;
5
5
  recipient_ids: Array<LocalUserId>;
6
- form_id?: string;
7
6
  }
@@ -14,8 +14,6 @@ export interface Community {
14
14
  local: boolean;
15
15
  icon?: string;
16
16
  banner?: string;
17
- followers_url: string;
18
- inbox_url: string;
19
17
  hidden: boolean;
20
18
  posting_restricted_to_mods: boolean;
21
19
  instance_id: InstanceId;
@@ -6,6 +6,4 @@ export interface CreateComment {
6
6
  post_id: PostId;
7
7
  parent_id?: CommentId;
8
8
  language_id?: LanguageId;
9
- form_id?: string;
10
- auth: string;
11
9
  }
@@ -2,5 +2,4 @@ import type { CommentId } from "./CommentId";
2
2
  export interface CreateCommentLike {
3
3
  comment_id: CommentId;
4
4
  score: number;
5
- auth: string;
6
5
  }
@@ -2,5 +2,4 @@ import type { CommentId } from "./CommentId";
2
2
  export interface CreateCommentReport {
3
3
  comment_id: CommentId;
4
4
  reason: string;
5
- auth: string;
6
5
  }
@@ -8,5 +8,4 @@ export interface CreateCommunity {
8
8
  nsfw?: boolean;
9
9
  posting_restricted_to_mods?: boolean;
10
10
  discussion_languages?: Array<LanguageId>;
11
- auth: string;
12
11
  }
@@ -4,5 +4,4 @@ export interface CreateCustomEmoji {
4
4
  image_url: string;
5
5
  alt_text: string;
6
6
  keywords: Array<string>;
7
- auth: string;
8
7
  }
@@ -8,5 +8,4 @@ export interface CreatePost {
8
8
  honeypot?: string;
9
9
  nsfw?: boolean;
10
10
  language_id?: LanguageId;
11
- auth: string;
12
11
  }
@@ -2,5 +2,4 @@ import type { PostId } from "./PostId";
2
2
  export interface CreatePostLike {
3
3
  post_id: PostId;
4
4
  score: number;
5
- auth: string;
6
5
  }
@@ -2,5 +2,4 @@ import type { PostId } from "./PostId";
2
2
  export interface CreatePostReport {
3
3
  post_id: PostId;
4
4
  reason: string;
5
- auth: string;
6
5
  }
@@ -2,5 +2,4 @@ import type { PersonId } from "./PersonId";
2
2
  export interface CreatePrivateMessage {
3
3
  content: string;
4
4
  recipient_id: PersonId;
5
- auth: string;
6
5
  }
@@ -2,5 +2,4 @@ import type { PrivateMessageId } from "./PrivateMessageId";
2
2
  export interface CreatePrivateMessageReport {
3
3
  private_message_id: PrivateMessageId;
4
4
  reason: string;
5
- auth: string;
6
5
  }
@@ -41,5 +41,4 @@ export interface CreateSite {
41
41
  blocked_instances?: Array<string>;
42
42
  taglines?: Array<string>;
43
43
  registration_mode?: RegistrationMode;
44
- auth: string;
45
44
  }
@@ -1,4 +1,4 @@
1
1
  export interface DeleteAccount {
2
2
  password: string;
3
- auth: string;
3
+ delete_content: boolean;
4
4
  }
@@ -1 +1 @@
1
- export type DeleteAccountResponse = null;
1
+ export type DeleteAccountResponse = Record<string, never>;
@@ -2,5 +2,4 @@ import type { CommentId } from "./CommentId";
2
2
  export interface DeleteComment {
3
3
  comment_id: CommentId;
4
4
  deleted: boolean;
5
- auth: string;
6
5
  }
@@ -2,5 +2,4 @@ import type { CommunityId } from "./CommunityId";
2
2
  export interface DeleteCommunity {
3
3
  community_id: CommunityId;
4
4
  deleted: boolean;
5
- auth: string;
6
5
  }
@@ -1,5 +1,4 @@
1
1
  import type { CustomEmojiId } from "./CustomEmojiId";
2
2
  export interface DeleteCustomEmoji {
3
3
  id: CustomEmojiId;
4
- auth: string;
5
4
  }
@@ -2,5 +2,4 @@ import type { PostId } from "./PostId";
2
2
  export interface DeletePost {
3
3
  post_id: PostId;
4
4
  deleted: boolean;
5
- auth: string;
6
5
  }