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