lemmy-js-client 0.19.0-alpha.11 → 0.19.0-alpha.12

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 (32) hide show
  1. package/dist/http.d.ts +17 -29
  2. package/dist/index.d.ts +0 -14
  3. package/dist/types/LemmyErrorType.d.ts +165 -138
  4. package/package.json +1 -1
  5. package/dist/types/AddAdminResponse.d.ts +0 -4
  6. package/dist/types/AddAdminResponse.js +0 -2
  7. package/dist/types/AddModToCommunityResponse.d.ts +0 -4
  8. package/dist/types/AddModToCommunityResponse.js +0 -2
  9. package/dist/types/BanFromCommunityResponse.d.ts +0 -5
  10. package/dist/types/BanFromCommunityResponse.js +0 -2
  11. package/dist/types/BanPersonResponse.d.ts +0 -5
  12. package/dist/types/BanPersonResponse.js +0 -2
  13. package/dist/types/BlockCommunityResponse.d.ts +0 -5
  14. package/dist/types/BlockCommunityResponse.js +0 -2
  15. package/dist/types/BlockInstanceResponse.d.ts +0 -3
  16. package/dist/types/BlockInstanceResponse.js +0 -3
  17. package/dist/types/BlockPersonResponse.d.ts +0 -5
  18. package/dist/types/BlockPersonResponse.js +0 -2
  19. package/dist/types/CommentReplyResponse.d.ts +0 -4
  20. package/dist/types/CommentReplyResponse.js +0 -2
  21. package/dist/types/DeleteAccountResponse.d.ts +0 -1
  22. package/dist/types/DeleteAccountResponse.js +0 -3
  23. package/dist/types/DeleteCustomEmojiResponse.d.ts +0 -5
  24. package/dist/types/DeleteCustomEmojiResponse.js +0 -2
  25. package/dist/types/PasswordResetResponse.d.ts +0 -1
  26. package/dist/types/PasswordResetResponse.js +0 -3
  27. package/dist/types/PersonSortType.d.ts +0 -1
  28. package/dist/types/PersonSortType.js +0 -3
  29. package/dist/types/PurgeItemResponse.d.ts +0 -3
  30. package/dist/types/PurgeItemResponse.js +0 -3
  31. package/dist/types/VerifyEmailResponse.d.ts +0 -1
  32. package/dist/types/VerifyEmailResponse.js +0 -3
package/dist/http.d.ts CHANGED
@@ -1,20 +1,13 @@
1
1
  import fetch from "cross-fetch";
2
2
  import { AddAdmin } from "./types/AddAdmin";
3
- import { AddAdminResponse } from "./types/AddAdminResponse";
4
3
  import { AddModToCommunity } from "./types/AddModToCommunity";
5
- import { AddModToCommunityResponse } from "./types/AddModToCommunityResponse";
6
4
  import { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
7
5
  import { BanFromCommunity } from "./types/BanFromCommunity";
8
- import { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
9
6
  import { BanPerson } from "./types/BanPerson";
10
- import { BanPersonResponse } from "./types/BanPersonResponse";
11
7
  import { BannedPersonsResponse } from "./types/BannedPersonsResponse";
12
8
  import { BlockCommunity } from "./types/BlockCommunity";
13
- import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
14
9
  import { BlockPerson } from "./types/BlockPerson";
15
- import { BlockPersonResponse } from "./types/BlockPersonResponse";
16
10
  import { ChangePassword } from "./types/ChangePassword";
17
- import { CommentReplyResponse } from "./types/CommentReplyResponse";
18
11
  import { CommentReportResponse } from "./types/CommentReportResponse";
19
12
  import { CommentResponse } from "./types/CommentResponse";
20
13
  import { CommunityResponse } from "./types/CommunityResponse";
@@ -31,11 +24,9 @@ import { CreatePrivateMessageReport } from "./types/CreatePrivateMessageReport";
31
24
  import { CreateSite } from "./types/CreateSite";
32
25
  import { CustomEmojiResponse } from "./types/CustomEmojiResponse";
33
26
  import { DeleteAccount } from "./types/DeleteAccount";
34
- import { DeleteAccountResponse } from "./types/DeleteAccountResponse";
35
27
  import { DeleteComment } from "./types/DeleteComment";
36
28
  import { DeleteCommunity } from "./types/DeleteCommunity";
37
29
  import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
38
- import { DeleteCustomEmojiResponse } from "./types/DeleteCustomEmojiResponse";
39
30
  import { DeletePost } from "./types/DeletePost";
40
31
  import { DeletePrivateMessage } from "./types/DeletePrivateMessage";
41
32
  import { DistinguishComment } from "./types/DistinguishComment";
@@ -93,7 +84,6 @@ import { MarkPostAsRead } from "./types/MarkPostAsRead";
93
84
  import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
94
85
  import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
95
86
  import { PasswordReset } from "./types/PasswordReset";
96
- import { PasswordResetResponse } from "./types/PasswordResetResponse";
97
87
  import { PersonMentionResponse } from "./types/PersonMentionResponse";
98
88
  import { PostReportResponse } from "./types/PostReportResponse";
99
89
  import { PostResponse } from "./types/PostResponse";
@@ -102,7 +92,6 @@ import { PrivateMessageResponse } from "./types/PrivateMessageResponse";
102
92
  import { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
103
93
  import { PurgeComment } from "./types/PurgeComment";
104
94
  import { PurgeCommunity } from "./types/PurgeCommunity";
105
- import { PurgeItemResponse } from "./types/PurgeItemResponse";
106
95
  import { PurgePerson } from "./types/PurgePerson";
107
96
  import { PurgePost } from "./types/PurgePost";
108
97
  import { Register } from "./types/Register";
@@ -123,14 +112,13 @@ import { SearchResponse } from "./types/SearchResponse";
123
112
  import { SiteResponse } from "./types/SiteResponse";
124
113
  import { TransferCommunity } from "./types/TransferCommunity";
125
114
  import { VerifyEmail } from "./types/VerifyEmail";
126
- import { VerifyEmailResponse } from "./types/VerifyEmailResponse";
127
115
  import { DeleteImage, UploadImage, UploadImageResponse } from "./types/others";
128
116
  import { HideCommunity } from "./types/HideCommunity";
129
117
  import { BlockInstance } from "./types/BlockInstance";
130
- import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
131
118
  import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
132
119
  import { UpdateTotp } from "./types/UpdateTotp";
133
120
  import { UpdateTotpResponse } from "./types/UpdateTotpResponse";
121
+ import { SuccessResponse } from "./types/SuccessResponse";
134
122
  /**
135
123
  * Helps build lemmy HTTP requests.
136
124
  */
@@ -242,7 +230,7 @@ export declare class LemmyHttp {
242
230
  *
243
231
  * `HTTP.POST /community/block`
244
232
  */
245
- blockCommunity(form: BlockCommunity): Promise<BlockCommunityResponse>;
233
+ blockCommunity(form: BlockCommunity): Promise<SuccessResponse>;
246
234
  /**
247
235
  * Delete a community.
248
236
  *
@@ -272,13 +260,13 @@ export declare class LemmyHttp {
272
260
  *
273
261
  * `HTTP.POST /community/ban_user`
274
262
  */
275
- banFromCommunity(form: BanFromCommunity): Promise<BanFromCommunityResponse>;
263
+ banFromCommunity(form: BanFromCommunity): Promise<SuccessResponse>;
276
264
  /**
277
265
  * Add a moderator to your community.
278
266
  *
279
267
  * `HTTP.POST /community/mod`
280
268
  */
281
- addModToCommunity(form: AddModToCommunity): Promise<AddModToCommunityResponse>;
269
+ addModToCommunity(form: AddModToCommunity): Promise<SuccessResponse>;
282
270
  /**
283
271
  * Create a post.
284
272
  *
@@ -398,7 +386,7 @@ export declare class LemmyHttp {
398
386
  *
399
387
  * `HTTP.POST /comment/mark_as_read`
400
388
  */
401
- markCommentReplyAsRead(form: MarkCommentReplyAsRead): Promise<CommentReplyResponse>;
389
+ markCommentReplyAsRead(form: MarkCommentReplyAsRead): Promise<SuccessResponse>;
402
390
  /**
403
391
  * Like / vote on a comment.
404
392
  *
@@ -536,7 +524,7 @@ export declare class LemmyHttp {
536
524
  *
537
525
  * `HTTP.POST /user/ban`
538
526
  */
539
- banPerson(form: BanPerson): Promise<BanPersonResponse>;
527
+ banPerson(form: BanPerson): Promise<SuccessResponse>;
540
528
  /**
541
529
  * Get a list of banned users
542
530
  *
@@ -548,7 +536,7 @@ export declare class LemmyHttp {
548
536
  *
549
537
  * `HTTP.POST /user/block`
550
538
  */
551
- blockPerson(form: BlockPerson): Promise<BlockPersonResponse>;
539
+ blockPerson(form: BlockPerson): Promise<SuccessResponse>;
552
540
  /**
553
541
  * Fetch a Captcha.
554
542
  *
@@ -560,13 +548,13 @@ export declare class LemmyHttp {
560
548
  *
561
549
  * `HTTP.POST /user/delete_account`
562
550
  */
563
- deleteAccount(form: DeleteAccount): Promise<DeleteAccountResponse>;
551
+ deleteAccount(form: DeleteAccount): Promise<SuccessResponse>;
564
552
  /**
565
553
  * Reset your password.
566
554
  *
567
555
  * `HTTP.POST /user/password_reset`
568
556
  */
569
- passwordReset(form: PasswordReset): Promise<PasswordResetResponse>;
557
+ passwordReset(form: PasswordReset): Promise<SuccessResponse>;
570
558
  /**
571
559
  * Change your password from an email / token based reset.
572
560
  *
@@ -608,13 +596,13 @@ export declare class LemmyHttp {
608
596
  *
609
597
  * `HTTP.POST /user/verify_email`
610
598
  */
611
- verifyEmail(form: VerifyEmail): Promise<VerifyEmailResponse>;
599
+ verifyEmail(form: VerifyEmail): Promise<SuccessResponse>;
612
600
  /**
613
601
  * Add an admin to your site.
614
602
  *
615
603
  * `HTTP.POST /admin/add`
616
604
  */
617
- addAdmin(form: AddAdmin): Promise<AddAdminResponse>;
605
+ addAdmin(form: AddAdmin): Promise<SuccessResponse>;
618
606
  /**
619
607
  * Get the unread registration applications count.
620
608
  *
@@ -638,25 +626,25 @@ export declare class LemmyHttp {
638
626
  *
639
627
  * `HTTP.POST /admin/purge/person`
640
628
  */
641
- purgePerson(form: PurgePerson): Promise<PurgeItemResponse>;
629
+ purgePerson(form: PurgePerson): Promise<SuccessResponse>;
642
630
  /**
643
631
  * Purge / Delete a community from the database.
644
632
  *
645
633
  * `HTTP.POST /admin/purge/community`
646
634
  */
647
- purgeCommunity(form: PurgeCommunity): Promise<PurgeItemResponse>;
635
+ purgeCommunity(form: PurgeCommunity): Promise<SuccessResponse>;
648
636
  /**
649
637
  * Purge / Delete a post from the database.
650
638
  *
651
639
  * `HTTP.POST /admin/purge/post`
652
640
  */
653
- purgePost(form: PurgePost): Promise<PurgeItemResponse>;
641
+ purgePost(form: PurgePost): Promise<SuccessResponse>;
654
642
  /**
655
643
  * Purge / Delete a comment from the database.
656
644
  *
657
645
  * `HTTP.POST /admin/purge/comment`
658
646
  */
659
- purgeComment(form: PurgeComment): Promise<PurgeItemResponse>;
647
+ purgeComment(form: PurgeComment): Promise<SuccessResponse>;
660
648
  /**
661
649
  * Create a new custom emoji
662
650
  *
@@ -674,7 +662,7 @@ export declare class LemmyHttp {
674
662
  *
675
663
  * `HTTP.Post /custom_emoji/delete`
676
664
  */
677
- deleteCustomEmoji(form: DeleteCustomEmoji): Promise<DeleteCustomEmojiResponse>;
665
+ deleteCustomEmoji(form: DeleteCustomEmoji): Promise<SuccessResponse>;
678
666
  /**
679
667
  * Fetch federated instances.
680
668
  *
@@ -686,7 +674,7 @@ export declare class LemmyHttp {
686
674
  *
687
675
  * `HTTP.Post /site/block`
688
676
  */
689
- blockInstance(form: BlockInstance): Promise<BlockInstanceResponse>;
677
+ blockInstance(form: BlockInstance): Promise<SuccessResponse>;
690
678
  /**
691
679
  * Upload an image to the server.
692
680
  */
package/dist/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  export * from "./http";
2
2
  export { AddAdmin } from "./types/AddAdmin";
3
- export { AddAdminResponse } from "./types/AddAdminResponse";
4
3
  export { AddModToCommunity } from "./types/AddModToCommunity";
5
- export { AddModToCommunityResponse } from "./types/AddModToCommunityResponse";
6
4
  export { AdminPurgeComment } from "./types/AdminPurgeComment";
7
5
  export { AdminPurgeCommentView } from "./types/AdminPurgeCommentView";
8
6
  export { AdminPurgeCommunity } from "./types/AdminPurgeCommunity";
@@ -13,16 +11,11 @@ export { AdminPurgePost } from "./types/AdminPurgePost";
13
11
  export { AdminPurgePostView } from "./types/AdminPurgePostView";
14
12
  export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
15
13
  export { BanFromCommunity } from "./types/BanFromCommunity";
16
- export { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
17
14
  export { BanPerson } from "./types/BanPerson";
18
- export { BanPersonResponse } from "./types/BanPersonResponse";
19
15
  export { BannedPersonsResponse } from "./types/BannedPersonsResponse";
20
16
  export { BlockCommunity } from "./types/BlockCommunity";
21
- export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
22
17
  export { BlockInstance } from "./types/BlockInstance";
23
- export { BlockInstanceResponse } from "./types/BlockInstanceResponse";
24
18
  export { BlockPerson } from "./types/BlockPerson";
25
- export { BlockPersonResponse } from "./types/BlockPersonResponse";
26
19
  export { CaptchaResponse } from "./types/CaptchaResponse";
27
20
  export { ChangePassword } from "./types/ChangePassword";
28
21
  export { Comment } from "./types/Comment";
@@ -30,7 +23,6 @@ export { CommentAggregates } from "./types/CommentAggregates";
30
23
  export { CommentId } from "./types/CommentId";
31
24
  export { CommentReply } from "./types/CommentReply";
32
25
  export { CommentReplyId } from "./types/CommentReplyId";
33
- export { CommentReplyResponse } from "./types/CommentReplyResponse";
34
26
  export { CommentReplyView } from "./types/CommentReplyView";
35
27
  export { CommentReport } from "./types/CommentReport";
36
28
  export { CommentReportId } from "./types/CommentReportId";
@@ -65,11 +57,9 @@ export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword";
65
57
  export { CustomEmojiResponse } from "./types/CustomEmojiResponse";
66
58
  export { CustomEmojiView } from "./types/CustomEmojiView";
67
59
  export { DeleteAccount } from "./types/DeleteAccount";
68
- export { DeleteAccountResponse } from "./types/DeleteAccountResponse";
69
60
  export { DeleteComment } from "./types/DeleteComment";
70
61
  export { DeleteCommunity } from "./types/DeleteCommunity";
71
62
  export { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
72
- export { DeleteCustomEmojiResponse } from "./types/DeleteCustomEmojiResponse";
73
63
  export { DeletePost } from "./types/DeletePost";
74
64
  export { DeletePrivateMessage } from "./types/DeletePrivateMessage";
75
65
  export { DistinguishComment } from "./types/DistinguishComment";
@@ -171,7 +161,6 @@ export { MyUserInfo } from "./types/MyUserInfo";
171
161
  export { PaginationCursor } from "./types/PaginationCursor";
172
162
  export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
173
163
  export { PasswordReset } from "./types/PasswordReset";
174
- export { PasswordResetResponse } from "./types/PasswordResetResponse";
175
164
  export { Person } from "./types/Person";
176
165
  export { PersonAggregates } from "./types/PersonAggregates";
177
166
  export { PersonBlockId } from "./types/PersonBlockId";
@@ -181,7 +170,6 @@ export { PersonMention } from "./types/PersonMention";
181
170
  export { PersonMentionId } from "./types/PersonMentionId";
182
171
  export { PersonMentionResponse } from "./types/PersonMentionResponse";
183
172
  export { PersonMentionView } from "./types/PersonMentionView";
184
- export { PersonSortType } from "./types/PersonSortType";
185
173
  export { PersonView } from "./types/PersonView";
186
174
  export { Post } from "./types/Post";
187
175
  export { PostAggregates } from "./types/PostAggregates";
@@ -205,7 +193,6 @@ export { PrivateMessageView } from "./types/PrivateMessageView";
205
193
  export { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
206
194
  export { PurgeComment } from "./types/PurgeComment";
207
195
  export { PurgeCommunity } from "./types/PurgeCommunity";
208
- export { PurgeItemResponse } from "./types/PurgeItemResponse";
209
196
  export { PurgePerson } from "./types/PurgePerson";
210
197
  export { PurgePost } from "./types/PurgePost";
211
198
  export { Register } from "./types/Register";
@@ -241,5 +228,4 @@ export { TransferCommunity } from "./types/TransferCommunity";
241
228
  export { UpdateTotp } from "./types/UpdateTotp";
242
229
  export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
243
230
  export { VerifyEmail } from "./types/VerifyEmail";
244
- export { VerifyEmailResponse } from "./types/VerifyEmailResponse";
245
231
  export { UploadImage, UploadImageResponse, ImageFile, DeleteImage, } from "./types/others";
@@ -1,277 +1,304 @@
1
1
  export type LemmyErrorType = {
2
- error_type: "ReportReasonRequired";
2
+ error: "report_reason_required";
3
3
  } | {
4
- error_type: "ReportTooLong";
4
+ error: "report_too_long";
5
5
  } | {
6
- error_type: "NotAModerator";
6
+ error: "not_a_moderator";
7
7
  } | {
8
- error_type: "NotAnAdmin";
8
+ error: "not_an_admin";
9
9
  } | {
10
- error_type: "CannotBlockYourself";
10
+ error: "cant_block_yourself";
11
11
  } | {
12
- error_type: "CannotBlockAdmin";
12
+ error: "cant_block_admin";
13
13
  } | {
14
- error_type: "CouldNotUpdateUser";
14
+ error: "couldnt_update_user";
15
15
  } | {
16
- error_type: "PasswordsDoNotMatch";
16
+ error: "passwords_do_not_match";
17
17
  } | {
18
- error_type: "PasswordIncorrect";
18
+ error: "email_not_verified";
19
19
  } | {
20
- error_type: "EmailNotVerified";
20
+ error: "email_required";
21
21
  } | {
22
- error_type: "EmailRequired";
22
+ error: "couldnt_update_comment";
23
23
  } | {
24
- error_type: "CouldNotUpdateComment";
24
+ error: "couldnt_update_private_message";
25
25
  } | {
26
- error_type: "CouldNotUpdatePrivateMessage";
26
+ error: "cannot_leave_admin";
27
27
  } | {
28
- error_type: "CannotLeaveAdmin";
28
+ error: "no_lines_in_html";
29
29
  } | {
30
- error_type: "NoLinesInHtml";
30
+ error: "site_metadata_page_is_not_doctype_html";
31
31
  } | {
32
- error_type: "SiteMetadataPageIsNotDoctypeHtml";
33
- } | {
34
- error_type: "PictrsResponseError";
32
+ error: "pictrs_response_error";
35
33
  message: string;
36
34
  } | {
37
- error_type: "PictrsPurgeResponseError";
35
+ error: "pictrs_purge_response_error";
38
36
  message: string;
39
37
  } | {
40
- error_type: "ImageUrlMissingPathSegments";
38
+ error: "pictrs_caching_disabled";
41
39
  } | {
42
- error_type: "ImageUrlMissingLastPathSegment";
40
+ error: "image_url_missing_path_segments";
43
41
  } | {
44
- error_type: "PictrsApiKeyNotProvided";
42
+ error: "image_url_missing_last_path_segment";
45
43
  } | {
46
- error_type: "NoContentTypeHeader";
44
+ error: "pictrs_api_key_not_provided";
47
45
  } | {
48
- error_type: "NotAnImageType";
46
+ error: "no_content_type_header";
49
47
  } | {
50
- error_type: "NotAModOrAdmin";
48
+ error: "not_an_image_type";
51
49
  } | {
52
- error_type: "NoAdmins";
50
+ error: "not_a_mod_or_admin";
53
51
  } | {
54
- error_type: "NotTopAdmin";
52
+ error: "no_admins";
55
53
  } | {
56
- error_type: "NotTopMod";
54
+ error: "not_top_admin";
57
55
  } | {
58
- error_type: "NotLoggedIn";
56
+ error: "not_top_mod";
59
57
  } | {
60
- error_type: "SiteBan";
58
+ error: "not_logged_in";
61
59
  } | {
62
- error_type: "Deleted";
60
+ error: "site_ban";
63
61
  } | {
64
- error_type: "BannedFromCommunity";
62
+ error: "deleted";
65
63
  } | {
66
- error_type: "CouldNotFindCommunity";
64
+ error: "banned_from_community";
67
65
  } | {
68
- error_type: "PersonIsBlocked";
66
+ error: "couldnt_find_community";
69
67
  } | {
70
- error_type: "DownvotesAreDisabled";
68
+ error: "couldnt_find_person";
71
69
  } | {
72
- error_type: "InstanceIsPrivate";
70
+ error: "person_is_blocked";
73
71
  } | {
74
- error_type: "InvalidPassword";
72
+ error: "downvotes_are_disabled";
75
73
  } | {
76
- error_type: "SiteDescriptionLengthOverflow";
74
+ error: "instance_is_private";
77
75
  } | {
78
- error_type: "HoneypotFailed";
76
+ error: "invalid_password";
79
77
  } | {
80
- error_type: "RegistrationApplicationIsPending";
78
+ error: "site_description_length_overflow";
81
79
  } | {
82
- error_type: "PrivateInstanceCannotHaveFederationEnabled";
80
+ error: "honeypot_failed";
83
81
  } | {
84
- error_type: "Locked";
82
+ error: "registration_application_is_pending";
85
83
  } | {
86
- error_type: "CouldNotCreateComment";
84
+ error: "cant_enable_private_instance_and_federation_together";
87
85
  } | {
88
- error_type: "MaxCommentDepthReached";
86
+ error: "locked";
89
87
  } | {
90
- error_type: "EditCommentNotAllowed";
88
+ error: "couldnt_create_comment";
91
89
  } | {
92
- error_type: "OnlyAdminsCanCreateCommunities";
90
+ error: "max_comment_depth_reached";
93
91
  } | {
94
- error_type: "CommunityAlreadyExists";
92
+ error: "no_comment_edit_allowed";
95
93
  } | {
96
- error_type: "LanguageNotAllowed";
94
+ error: "only_admins_can_create_communities";
97
95
  } | {
98
- error_type: "OnlyModsCanPostInCommunity";
96
+ error: "community_already_exists";
99
97
  } | {
100
- error_type: "CouldNotUpdatePost";
98
+ error: "language_not_allowed";
101
99
  } | {
102
- error_type: "EditPostNotAllowed";
100
+ error: "only_mods_can_post_in_community";
103
101
  } | {
104
- error_type: "CouldNotFindPost";
102
+ error: "couldnt_update_post";
105
103
  } | {
106
- error_type: "EditPrivateMessageNotAllowed";
104
+ error: "no_post_edit_allowed";
107
105
  } | {
108
- error_type: "SiteAlreadyExists";
106
+ error: "couldnt_find_post";
109
107
  } | {
110
- error_type: "ApplicationQuestionRequired";
108
+ error: "edit_private_message_not_allowed";
111
109
  } | {
112
- error_type: "InvalidDefaultPostListingType";
110
+ error: "site_already_exists";
113
111
  } | {
114
- error_type: "RegistrationClosed";
112
+ error: "application_question_required";
115
113
  } | {
116
- error_type: "RegistrationApplicationAnswerRequired";
114
+ error: "invalid_default_post_listing_type";
117
115
  } | {
118
- error_type: "EmailAlreadyExists";
116
+ error: "registration_closed";
119
117
  } | {
120
- error_type: "FederationError";
121
- message: string;
118
+ error: "registration_application_answer_required";
119
+ } | {
120
+ error: "email_already_exists";
121
+ } | {
122
+ error: "federation_forbidden_by_strict_allow_list";
123
+ } | {
124
+ error: "person_is_banned_from_community";
122
125
  } | {
123
- error_type: "FederationForbiddenByStrictAllowList";
126
+ error: "object_is_not_public";
124
127
  } | {
125
- error_type: "PersonIsBannedFromCommunity";
128
+ error: "invalid_community";
126
129
  } | {
127
- error_type: "ObjectIsNotPublic";
130
+ error: "cannot_create_post_or_comment_in_deleted_or_removed_community";
128
131
  } | {
129
- error_type: "InvalidCommunity";
132
+ error: "cannot_receive_page";
130
133
  } | {
131
- error_type: "CannotCreatePostOrCommentInDeletedOrRemovedCommunity";
134
+ error: "new_post_cannot_be_locked";
132
135
  } | {
133
- error_type: "CannotReceivePage";
136
+ error: "only_local_admin_can_remove_community";
134
137
  } | {
135
- error_type: "NewPostCannotBeLocked";
138
+ error: "only_local_admin_can_restore_community";
136
139
  } | {
137
- error_type: "OnlyLocalAdminCanRemoveCommunity";
140
+ error: "no_id_given";
138
141
  } | {
139
- error_type: "OnlyLocalAdminCanRestoreCommunity";
142
+ error: "incorrect_login";
140
143
  } | {
141
- error_type: "NoIdGiven";
144
+ error: "invalid_query";
145
+ } | {
146
+ error: "object_not_local";
147
+ } | {
148
+ error: "post_is_locked";
149
+ } | {
150
+ error: "person_is_banned_from_site";
151
+ message: string;
142
152
  } | {
143
- error_type: "CouldNotFindUsernameOrEmail";
153
+ error: "invalid_vote_value";
144
154
  } | {
145
- error_type: "InvalidQuery";
155
+ error: "page_does_not_specify_creator";
146
156
  } | {
147
- error_type: "ObjectNotLocal";
157
+ error: "page_does_not_specify_group";
148
158
  } | {
149
- error_type: "PostIsLocked";
159
+ error: "no_community_found_in_cc";
150
160
  } | {
151
- error_type: "PersonIsBannedFromSite";
161
+ error: "no_email_setup";
152
162
  } | {
153
- error_type: "InvalidVoteValue";
163
+ error: "email_smtp_server_needs_a_port";
154
164
  } | {
155
- error_type: "PageDoesNotSpecifyCreator";
165
+ error: "missing_an_email";
156
166
  } | {
157
- error_type: "PageDoesNotSpecifyGroup";
167
+ error: "rate_limit_error";
158
168
  } | {
159
- error_type: "NoCommunityFoundInCC";
169
+ error: "invalid_name";
160
170
  } | {
161
- error_type: "NoEmailSetup";
171
+ error: "invalid_display_name";
162
172
  } | {
163
- error_type: "EmailSmtpServerNeedsAPort";
173
+ error: "invalid_matrix_id";
164
174
  } | {
165
- error_type: "MissingAnEmail";
175
+ error: "invalid_post_title";
166
176
  } | {
167
- error_type: "RateLimitError";
177
+ error: "invalid_body_field";
168
178
  } | {
169
- error_type: "InvalidName";
179
+ error: "bio_length_overflow";
170
180
  } | {
171
- error_type: "InvalidDisplayName";
181
+ error: "missing_totp_token";
172
182
  } | {
173
- error_type: "InvalidMatrixId";
183
+ error: "missing_totp_secret";
174
184
  } | {
175
- error_type: "InvalidPostTitle";
185
+ error: "incorrect_totp_token";
176
186
  } | {
177
- error_type: "InvalidBodyField";
187
+ error: "couldnt_parse_totp_secret";
178
188
  } | {
179
- error_type: "BioLengthOverflow";
189
+ error: "couldnt_generate_totp";
180
190
  } | {
181
- error_type: "MissingTotpToken";
191
+ error: "totp_already_enabled";
182
192
  } | {
183
- error_type: "IncorrectTotpToken";
193
+ error: "couldnt_like_comment";
184
194
  } | {
185
- error_type: "CouldNotParseTotpSecret";
195
+ error: "couldnt_save_comment";
186
196
  } | {
187
- error_type: "CouldNotLikeComment";
197
+ error: "couldnt_create_report";
188
198
  } | {
189
- error_type: "CouldNotSaveComment";
199
+ error: "couldnt_resolve_report";
190
200
  } | {
191
- error_type: "CouldNotCreateReport";
201
+ error: "community_moderator_already_exists";
192
202
  } | {
193
- error_type: "CouldNotResolveReport";
203
+ error: "community_user_already_banned";
194
204
  } | {
195
- error_type: "CommunityModeratorAlreadyExists";
205
+ error: "community_block_already_exists";
196
206
  } | {
197
- error_type: "CommunityUserIsAlreadyBanned";
207
+ error: "community_follower_already_exists";
198
208
  } | {
199
- error_type: "CommunityBlockAlreadyExists";
209
+ error: "couldnt_update_community_hidden_status";
200
210
  } | {
201
- error_type: "CommunityFollowerAlreadyExists";
211
+ error: "person_block_already_exists";
202
212
  } | {
203
- error_type: "CouldNotUpdateCommunityHiddenStatus";
213
+ error: "user_already_exists";
204
214
  } | {
205
- error_type: "PersonBlockAlreadyExists";
215
+ error: "token_not_found";
206
216
  } | {
207
- error_type: "UserAlreadyExists";
217
+ error: "couldnt_like_post";
208
218
  } | {
209
- error_type: "TokenNotFound";
219
+ error: "couldnt_save_post";
210
220
  } | {
211
- error_type: "CouldNotLikePost";
221
+ error: "couldnt_mark_post_as_read";
212
222
  } | {
213
- error_type: "CouldNotSavePost";
223
+ error: "couldnt_update_community";
214
224
  } | {
215
- error_type: "CouldNotMarkPostAsRead";
225
+ error: "couldnt_update_replies";
216
226
  } | {
217
- error_type: "CouldNotUpdateCommunity";
227
+ error: "couldnt_update_person_mentions";
218
228
  } | {
219
- error_type: "CouldNotUpdateReplies";
229
+ error: "post_title_too_long";
220
230
  } | {
221
- error_type: "CouldNotUpdatePersonMentions";
231
+ error: "couldnt_create_post";
222
232
  } | {
223
- error_type: "PostTitleTooLong";
233
+ error: "couldnt_create_private_message";
224
234
  } | {
225
- error_type: "CouldNotCreatePost";
235
+ error: "couldnt_update_private";
226
236
  } | {
227
- error_type: "CouldNotCreatePrivateMessage";
237
+ error: "system_err_login";
228
238
  } | {
229
- error_type: "CouldNotUpdatePrivate";
239
+ error: "couldnt_set_all_registrations_accepted";
230
240
  } | {
231
- error_type: "SystemErrLogin";
241
+ error: "couldnt_set_all_email_verified";
232
242
  } | {
233
- error_type: "CouldNotSetAllRegistrationsAccepted";
243
+ error: "banned";
234
244
  } | {
235
- error_type: "CouldNotSetAllEmailVerified";
245
+ error: "couldnt_get_comments";
236
246
  } | {
237
- error_type: "Banned";
247
+ error: "couldnt_get_posts";
238
248
  } | {
239
- error_type: "CouldNotGetComments";
249
+ error: "invalid_url";
240
250
  } | {
241
- error_type: "CouldNotGetPosts";
251
+ error: "email_send_failed";
242
252
  } | {
243
- error_type: "InvalidUrl";
253
+ error: "slurs";
244
254
  } | {
245
- error_type: "EmailSendFailed";
255
+ error: "couldnt_find_object";
246
256
  } | {
247
- error_type: "Slurs";
257
+ error: "registration_denied";
258
+ message: string | null;
248
259
  } | {
249
- error_type: "CouldNotGenerateTotp";
260
+ error: "federation_disabled";
250
261
  } | {
251
- error_type: "CouldNotFindObject";
262
+ error: "domain_blocked";
263
+ message: string;
252
264
  } | {
253
- error_type: "RegistrationDenied";
265
+ error: "domain_not_in_allow_list";
254
266
  message: string;
255
267
  } | {
256
- error_type: "FederationDisabled";
268
+ error: "federation_disabled_by_strict_allow_list";
269
+ } | {
270
+ error: "site_name_required";
271
+ } | {
272
+ error: "site_name_length_overflow";
273
+ } | {
274
+ error: "permissive_regex";
275
+ } | {
276
+ error: "invalid_regex";
257
277
  } | {
258
- error_type: "DomainBlocked";
278
+ error: "captcha_incorrect";
259
279
  } | {
260
- error_type: "DomainNotInAllowList";
280
+ error: "password_reset_limit_reached";
261
281
  } | {
262
- error_type: "FederationDisabledByStrictAllowList";
282
+ error: "couldnt_create_audio_captcha";
263
283
  } | {
264
- error_type: "SiteNameRequired";
284
+ error: "invalid_url_scheme";
265
285
  } | {
266
- error_type: "SiteNameLengthOverflow";
286
+ error: "couldnt_send_webmention";
267
287
  } | {
268
- error_type: "PermissiveRegex";
288
+ error: "contradicting_filters";
269
289
  } | {
270
- error_type: "InvalidRegex";
290
+ error: "instance_block_already_exists";
271
291
  } | {
272
- error_type: "CaptchaIncorrect";
292
+ error: "auth_cookie_insecure";
273
293
  } | {
274
- error_type: "PasswordResetLimitReached";
294
+ error: "too_many_items";
275
295
  } | {
276
- error_type: "CouldNotCreateAudioCaptcha";
296
+ error: "community_has_no_followers";
297
+ } | {
298
+ error: "ban_expiration_in_past";
299
+ } | {
300
+ error: "invalid_unix_time";
301
+ } | {
302
+ error: "unknown";
303
+ message: string;
277
304
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
- "version": "0.19.0-alpha.11",
3
+ "version": "0.19.0-alpha.12",
4
4
  "description": "A javascript / typescript client for Lemmy",
5
5
  "repository": "https://github.com/LemmyNet/lemmy-js-client",
6
6
  "license": "AGPL-3.0",
@@ -1,4 +0,0 @@
1
- import type { PersonView } from "./PersonView";
2
- export interface AddAdminResponse {
3
- admins: Array<PersonView>;
4
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- import type { CommunityModeratorView } from "./CommunityModeratorView";
2
- export interface AddModToCommunityResponse {
3
- moderators: Array<CommunityModeratorView>;
4
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- import type { PersonView } from "./PersonView";
2
- export interface BanFromCommunityResponse {
3
- person_view: PersonView;
4
- banned: boolean;
5
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- import type { PersonView } from "./PersonView";
2
- export interface BanPersonResponse {
3
- person_view: PersonView;
4
- banned: boolean;
5
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- import type { CommunityView } from "./CommunityView";
2
- export interface BlockCommunityResponse {
3
- community_view: CommunityView;
4
- blocked: boolean;
5
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- export interface BlockInstanceResponse {
2
- blocked: boolean;
3
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- import type { PersonView } from "./PersonView";
2
- export interface BlockPersonResponse {
3
- person_view: PersonView;
4
- blocked: boolean;
5
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- import type { CommentReplyView } from "./CommentReplyView";
2
- export interface CommentReplyResponse {
3
- comment_reply_view: CommentReplyView;
4
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export type DeleteAccountResponse = Record<string, never>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- import type { CustomEmojiId } from "./CustomEmojiId";
2
- export interface DeleteCustomEmojiResponse {
3
- id: CustomEmojiId;
4
- success: boolean;
5
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export type PasswordResetResponse = Record<string, never>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export type PersonSortType = "New" | "Old" | "MostComments" | "CommentScore" | "PostScore" | "PostCount";
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +0,0 @@
1
- export interface PurgeItemResponse {
2
- success: boolean;
3
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export type VerifyEmailResponse = Record<string, never>;
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
- Object.defineProperty(exports, "__esModule", { value: true });