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

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