lemmy-js-client 0.19.0-rc.14 → 0.19.0-rc.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/dist/http.d.ts +16 -20
  2. package/dist/http.js +12 -23
  3. package/dist/index.d.ts +4 -9
  4. package/dist/{types/others.d.ts → other_types.d.ts} +0 -8
  5. package/dist/types/ActivityId.d.ts +1 -0
  6. package/dist/types/CommentAggregates.d.ts +0 -1
  7. package/dist/types/CommentReplyView.d.ts +2 -0
  8. package/dist/types/CommentView.d.ts +2 -0
  9. package/dist/types/CommunityAggregates.d.ts +0 -1
  10. package/dist/types/CustomEmojiKeyword.d.ts +0 -1
  11. package/dist/types/FederatedInstances.d.ts +4 -4
  12. package/dist/types/ImageUpload.d.ts +0 -2
  13. package/dist/types/InstanceWithFederationState.d.ts +11 -0
  14. package/dist/types/LemmyErrorType.d.ts +6 -0
  15. package/dist/types/LocalSite.d.ts +1 -0
  16. package/dist/types/LocalSiteRateLimit.d.ts +0 -1
  17. package/dist/types/LocalUser.d.ts +1 -0
  18. package/dist/types/LoginToken.d.ts +0 -1
  19. package/dist/types/PersonAggregates.d.ts +0 -3
  20. package/dist/types/PersonMentionView.d.ts +2 -0
  21. package/dist/types/PersonView.d.ts +1 -0
  22. package/dist/types/PostAggregates.d.ts +0 -1
  23. package/dist/types/PostView.d.ts +2 -0
  24. package/dist/types/ReadableFederationState.d.ts +10 -0
  25. package/dist/types/ReadableFederationState.js +2 -0
  26. package/dist/types/SaveUserSettings.d.ts +1 -1
  27. package/dist/types/SiteAggregates.d.ts +0 -1
  28. package/package.json +1 -1
  29. package/dist/types/CommunityBlockId.d.ts +0 -1
  30. package/dist/types/DeleteAccountResponse.d.ts +0 -1
  31. package/dist/types/DeleteAccountResponse.js +0 -3
  32. package/dist/types/DeleteCustomEmojiResponse.d.ts +0 -5
  33. package/dist/types/ImageUploadId.d.ts +0 -1
  34. package/dist/types/ImageUploadId.js +0 -3
  35. package/dist/types/PasswordResetResponse.d.ts +0 -1
  36. package/dist/types/PasswordResetResponse.js +0 -3
  37. package/dist/types/PersonSortType.d.ts +0 -1
  38. package/dist/types/PersonSortType.js +0 -3
  39. package/dist/types/PurgeItemResponse.d.ts +0 -3
  40. package/dist/types/PurgeItemResponse.js +0 -3
  41. package/dist/types/VerifyEmailResponse.d.ts +0 -1
  42. package/dist/types/VerifyEmailResponse.js +0 -3
  43. package/dist/utils.d.ts +0 -0
  44. package/dist/utils.js +0 -0
  45. /package/dist/{types/others.js → other_types.js} +0 -0
  46. /package/dist/types/{CommunityBlockId.js → ActivityId.js} +0 -0
  47. /package/dist/types/{DeleteCustomEmojiResponse.js → InstanceWithFederationState.js} +0 -0
package/dist/http.d.ts CHANGED
@@ -31,11 +31,9 @@ import { CreatePrivateMessageReport } from "./types/CreatePrivateMessageReport";
31
31
  import { CreateSite } from "./types/CreateSite";
32
32
  import { CustomEmojiResponse } from "./types/CustomEmojiResponse";
33
33
  import { DeleteAccount } from "./types/DeleteAccount";
34
- import { DeleteAccountResponse } from "./types/DeleteAccountResponse";
35
34
  import { DeleteComment } from "./types/DeleteComment";
36
35
  import { DeleteCommunity } from "./types/DeleteCommunity";
37
36
  import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
38
- import { DeleteCustomEmojiResponse } from "./types/DeleteCustomEmojiResponse";
39
37
  import { DeletePost } from "./types/DeletePost";
40
38
  import { DeletePrivateMessage } from "./types/DeletePrivateMessage";
41
39
  import { DistinguishComment } from "./types/DistinguishComment";
@@ -93,7 +91,6 @@ import { MarkPostAsRead } from "./types/MarkPostAsRead";
93
91
  import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
94
92
  import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
95
93
  import { PasswordReset } from "./types/PasswordReset";
96
- import { PasswordResetResponse } from "./types/PasswordResetResponse";
97
94
  import { PersonMentionResponse } from "./types/PersonMentionResponse";
98
95
  import { PostReportResponse } from "./types/PostReportResponse";
99
96
  import { PostResponse } from "./types/PostResponse";
@@ -102,7 +99,6 @@ import { PrivateMessageResponse } from "./types/PrivateMessageResponse";
102
99
  import { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
103
100
  import { PurgeComment } from "./types/PurgeComment";
104
101
  import { PurgeCommunity } from "./types/PurgeCommunity";
105
- import { PurgeItemResponse } from "./types/PurgeItemResponse";
106
102
  import { PurgePerson } from "./types/PurgePerson";
107
103
  import { PurgePost } from "./types/PurgePost";
108
104
  import { Register } from "./types/Register";
@@ -123,8 +119,7 @@ import { SearchResponse } from "./types/SearchResponse";
123
119
  import { SiteResponse } from "./types/SiteResponse";
124
120
  import { TransferCommunity } from "./types/TransferCommunity";
125
121
  import { VerifyEmail } from "./types/VerifyEmail";
126
- import { VerifyEmailResponse } from "./types/VerifyEmailResponse";
127
- import { DeleteImage, UploadImage, UploadImageResponse } from "./types/others";
122
+ import { DeleteImage, UploadImage, UploadImageResponse } from "./other_types";
128
123
  import { HideCommunity } from "./types/HideCommunity";
129
124
  import { BlockInstance } from "./types/BlockInstance";
130
125
  import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
@@ -281,7 +276,7 @@ export declare class LemmyHttp {
281
276
  *
282
277
  * `HTTP.PUT /community/hide`
283
278
  */
284
- hideCommunity(form: HideCommunity): Promise<CommunityResponse>;
279
+ hideCommunity(form: HideCommunity): Promise<SuccessResponse>;
285
280
  /**
286
281
  * A moderator remove for a community.
287
282
  *
@@ -341,7 +336,7 @@ export declare class LemmyHttp {
341
336
  *
342
337
  * `HTTP.POST /post/mark_as_read`
343
338
  */
344
- markPostAsRead(form: MarkPostAsRead): Promise<PostResponse>;
339
+ markPostAsRead(form: MarkPostAsRead): Promise<SuccessResponse>;
345
340
  /**
346
341
  * A moderator can lock a post ( IE disable new comments ).
347
342
  *
@@ -534,6 +529,7 @@ export declare class LemmyHttp {
534
529
  * `HTTP.POST /user/login`
535
530
  */
536
531
  login(form: Login): Promise<LoginResponse>;
532
+ logout(): Promise<SuccessResponse>;
537
533
  /**
538
534
  * Get the details for a person.
539
535
  *
@@ -587,19 +583,19 @@ export declare class LemmyHttp {
587
583
  *
588
584
  * `HTTP.POST /user/delete_account`
589
585
  */
590
- deleteAccount(form: DeleteAccount): Promise<DeleteAccountResponse>;
586
+ deleteAccount(form: DeleteAccount): Promise<SuccessResponse>;
591
587
  /**
592
588
  * Reset your password.
593
589
  *
594
590
  * `HTTP.POST /user/password_reset`
595
591
  */
596
- passwordReset(form: PasswordReset): Promise<PasswordResetResponse>;
592
+ passwordReset(form: PasswordReset): Promise<SuccessResponse>;
597
593
  /**
598
594
  * Change your password from an email / token based reset.
599
595
  *
600
596
  * `HTTP.POST /user/password_change`
601
597
  */
602
- passwordChangeAfterReset(form: PasswordChangeAfterReset): Promise<LoginResponse>;
598
+ passwordChangeAfterReset(form: PasswordChangeAfterReset): Promise<SuccessResponse>;
603
599
  /**
604
600
  * Mark all replies as read.
605
601
  *
@@ -611,7 +607,7 @@ export declare class LemmyHttp {
611
607
  *
612
608
  * `HTTP.PUT /user/save_user_settings`
613
609
  */
614
- saveUserSettings(form: SaveUserSettings): Promise<LoginResponse>;
610
+ saveUserSettings(form: SaveUserSettings): Promise<SuccessResponse>;
615
611
  /**
616
612
  * Change your user password.
617
613
  *
@@ -635,7 +631,7 @@ export declare class LemmyHttp {
635
631
  *
636
632
  * `HTTP.POST /user/verify_email`
637
633
  */
638
- verifyEmail(form: VerifyEmail): Promise<VerifyEmailResponse>;
634
+ verifyEmail(form: VerifyEmail): Promise<SuccessResponse>;
639
635
  /**
640
636
  * Add an admin to your site.
641
637
  *
@@ -665,25 +661,25 @@ export declare class LemmyHttp {
665
661
  *
666
662
  * `HTTP.POST /admin/purge/person`
667
663
  */
668
- purgePerson(form: PurgePerson): Promise<PurgeItemResponse>;
664
+ purgePerson(form: PurgePerson): Promise<SuccessResponse>;
669
665
  /**
670
666
  * Purge / Delete a community from the database.
671
667
  *
672
668
  * `HTTP.POST /admin/purge/community`
673
669
  */
674
- purgeCommunity(form: PurgeCommunity): Promise<PurgeItemResponse>;
670
+ purgeCommunity(form: PurgeCommunity): Promise<SuccessResponse>;
675
671
  /**
676
672
  * Purge / Delete a post from the database.
677
673
  *
678
674
  * `HTTP.POST /admin/purge/post`
679
675
  */
680
- purgePost(form: PurgePost): Promise<PurgeItemResponse>;
676
+ purgePost(form: PurgePost): Promise<SuccessResponse>;
681
677
  /**
682
678
  * Purge / Delete a comment from the database.
683
679
  *
684
680
  * `HTTP.POST /admin/purge/comment`
685
681
  */
686
- purgeComment(form: PurgeComment): Promise<PurgeItemResponse>;
682
+ purgeComment(form: PurgeComment): Promise<SuccessResponse>;
687
683
  /**
688
684
  * Create a new custom emoji
689
685
  *
@@ -701,7 +697,7 @@ export declare class LemmyHttp {
701
697
  *
702
698
  * `HTTP.Post /custom_emoji/delete`
703
699
  */
704
- deleteCustomEmoji(form: DeleteCustomEmoji): Promise<DeleteCustomEmojiResponse>;
700
+ deleteCustomEmoji(form: DeleteCustomEmoji): Promise<SuccessResponse>;
705
701
  /**
706
702
  * Fetch federated instances.
707
703
  *
@@ -717,11 +713,11 @@ export declare class LemmyHttp {
717
713
  /**
718
714
  * Upload an image to the server.
719
715
  */
720
- uploadImage({ image, auth, }: UploadImage): Promise<UploadImageResponse>;
716
+ uploadImage({ image }: UploadImage): Promise<UploadImageResponse>;
721
717
  /**
722
718
  * Delete a pictrs image
723
719
  */
724
- deleteImage({ token, filename, auth }: DeleteImage): Promise<any>;
720
+ deleteImage({ token, filename }: DeleteImage): Promise<boolean>;
725
721
  /**
726
722
  * Set the headers (can be used to set the auth header)
727
723
  */
package/dist/http.js CHANGED
@@ -27,7 +27,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.LemmyHttp = void 0;
28
28
  const cross_fetch_1 = __importDefault(require("cross-fetch"));
29
29
  const form_data_1 = __importDefault(require("form-data"));
30
- const others_1 = require("./types/others");
30
+ const other_types_1 = require("./other_types");
31
31
  var HttpType;
32
32
  (function (HttpType) {
33
33
  HttpType["Get"] = "GET";
@@ -49,7 +49,7 @@ class LemmyHttp {
49
49
  _LemmyHttp_headers.set(this, {});
50
50
  _LemmyHttp_pictrsUrl.set(this, void 0);
51
51
  _LemmyHttp_fetchFunction.set(this, cross_fetch_1.default);
52
- __classPrivateFieldSet(this, _LemmyHttp_apiUrl, `${baseUrl.replace(/\/+$/, "")}/api/${others_1.VERSION}`, "f");
52
+ __classPrivateFieldSet(this, _LemmyHttp_apiUrl, `${baseUrl.replace(/\/+$/, "")}/api/${other_types_1.VERSION}`, "f");
53
53
  __classPrivateFieldSet(this, _LemmyHttp_pictrsUrl, `${baseUrl}/pictrs/image`, "f");
54
54
  if (options === null || options === void 0 ? void 0 : options.headers) {
55
55
  __classPrivateFieldSet(this, _LemmyHttp_headers, options.headers, "f");
@@ -569,6 +569,9 @@ class LemmyHttp {
569
569
  login(form) {
570
570
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/login", form);
571
571
  }
572
+ logout() {
573
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/logout", {});
574
+ }
572
575
  /**
573
576
  * Get the details for a person.
574
577
  *
@@ -812,22 +815,15 @@ class LemmyHttp {
812
815
  /**
813
816
  * Upload an image to the server.
814
817
  */
815
- uploadImage({ image, auth, }) {
816
- var _a, _b, _c, _d;
818
+ uploadImage({ image }) {
817
819
  return __awaiter(this, void 0, void 0, function* () {
818
820
  const formData = createFormData(image);
819
- // If auth cookie not already set by browser, set it with passed in auth
820
- const headers = {};
821
- if (!((_b = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.cookie) === null || _b === void 0 ? void 0 : _b.includes("auth=")) &&
822
- !((_d = (_c = __classPrivateFieldGet(this, _LemmyHttp_headers, "f")) === null || _c === void 0 ? void 0 : _c.Cookie) === null || _d === void 0 ? void 0 : _d.includes("auth="))) {
823
- headers.Cookie = `auth=${auth}`;
824
- }
825
821
  let url = undefined;
826
822
  let delete_url = undefined;
827
823
  const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, __classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f"), {
828
824
  method: HttpType.Post,
829
825
  body: formData,
830
- headers: Object.assign(Object.assign({}, __classPrivateFieldGet(this, _LemmyHttp_headers, "f")), headers),
826
+ headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
831
827
  });
832
828
  if (response.status === 413) {
833
829
  return { msg: "too_large" };
@@ -845,21 +841,14 @@ class LemmyHttp {
845
841
  /**
846
842
  * Delete a pictrs image
847
843
  */
848
- deleteImage({ token, filename, auth }) {
849
- var _a, _b, _c, _d;
844
+ deleteImage({ token, filename }) {
850
845
  return __awaiter(this, void 0, void 0, function* () {
851
- // If auth cookie not already set by browser, set it with passed in auth
852
- const headers = {};
853
- if (!((_b = (_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.cookie) === null || _b === void 0 ? void 0 : _b.includes("auth=")) &&
854
- !((_d = (_c = __classPrivateFieldGet(this, _LemmyHttp_headers, "f")) === null || _c === void 0 ? void 0 : _c.Cookie) === null || _d === void 0 ? void 0 : _d.includes("auth="))) {
855
- headers.Cookie = `auth=${auth}`;
856
- }
857
846
  const deleteUrl = `${__classPrivateFieldGet(this, _LemmyHttp_pictrsUrl, "f")}/delete/${token}/${filename}`;
858
847
  const response = yield __classPrivateFieldGet(this, _LemmyHttp_fetchFunction, "f").call(this, deleteUrl, {
859
848
  method: HttpType.Get,
860
- headers: Object.assign(Object.assign({}, __classPrivateFieldGet(this, _LemmyHttp_headers, "f")), headers),
849
+ headers: __classPrivateFieldGet(this, _LemmyHttp_headers, "f"),
861
850
  });
862
- return yield response.json();
851
+ return (yield response.status) == 204;
863
852
  });
864
853
  }
865
854
  /**
@@ -895,10 +884,10 @@ _LemmyHttp_apiUrl = new WeakMap(), _LemmyHttp_headers = new WeakMap(), _LemmyHtt
895
884
  json = yield response.json();
896
885
  }
897
886
  catch (error) {
898
- throw response.statusText;
887
+ throw new Error(response.statusText);
899
888
  }
900
889
  if (!response.ok) {
901
- throw (_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText;
890
+ throw new Error((_a = json["error"]) !== null && _a !== void 0 ? _a : response.statusText);
902
891
  }
903
892
  else {
904
893
  return json;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./http";
2
+ export { ActivityId } from "./types/ActivityId";
2
3
  export { AddAdmin } from "./types/AddAdmin";
3
4
  export { AddAdminResponse } from "./types/AddAdminResponse";
4
5
  export { AddModToCommunity } from "./types/AddModToCommunity";
@@ -41,7 +42,6 @@ export { CommentSortType } from "./types/CommentSortType";
41
42
  export { CommentView } from "./types/CommentView";
42
43
  export { Community } from "./types/Community";
43
44
  export { CommunityAggregates } from "./types/CommunityAggregates";
44
- export { CommunityBlockId } from "./types/CommunityBlockId";
45
45
  export { CommunityBlockView } from "./types/CommunityBlockView";
46
46
  export { CommunityFollowerView } from "./types/CommunityFollowerView";
47
47
  export { CommunityId } from "./types/CommunityId";
@@ -65,11 +65,9 @@ export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword";
65
65
  export { CustomEmojiResponse } from "./types/CustomEmojiResponse";
66
66
  export { CustomEmojiView } from "./types/CustomEmojiView";
67
67
  export { DeleteAccount } from "./types/DeleteAccount";
68
- export { DeleteAccountResponse } from "./types/DeleteAccountResponse";
69
68
  export { DeleteComment } from "./types/DeleteComment";
70
69
  export { DeleteCommunity } from "./types/DeleteCommunity";
71
70
  export { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
72
- export { DeleteCustomEmojiResponse } from "./types/DeleteCustomEmojiResponse";
73
71
  export { DeletePost } from "./types/DeletePost";
74
72
  export { DeletePrivateMessage } from "./types/DeletePrivateMessage";
75
73
  export { DistinguishComment } from "./types/DistinguishComment";
@@ -112,10 +110,10 @@ export { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
112
110
  export { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
113
111
  export { HideCommunity } from "./types/HideCommunity";
114
112
  export { ImageUpload } from "./types/ImageUpload";
115
- export { ImageUploadId } from "./types/ImageUploadId";
116
113
  export { Instance } from "./types/Instance";
117
114
  export { InstanceBlockView } from "./types/InstanceBlockView";
118
115
  export { InstanceId } from "./types/InstanceId";
116
+ export { InstanceWithFederationState } from "./types/InstanceWithFederationState";
119
117
  export { Language } from "./types/Language";
120
118
  export { LanguageId } from "./types/LanguageId";
121
119
  export { LemmyErrorType } from "./types/LemmyErrorType";
@@ -172,7 +170,6 @@ export { MyUserInfo } from "./types/MyUserInfo";
172
170
  export { PaginationCursor } from "./types/PaginationCursor";
173
171
  export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
174
172
  export { PasswordReset } from "./types/PasswordReset";
175
- export { PasswordResetResponse } from "./types/PasswordResetResponse";
176
173
  export { Person } from "./types/Person";
177
174
  export { PersonAggregates } from "./types/PersonAggregates";
178
175
  export { PersonBlockId } from "./types/PersonBlockId";
@@ -182,7 +179,6 @@ export { PersonMention } from "./types/PersonMention";
182
179
  export { PersonMentionId } from "./types/PersonMentionId";
183
180
  export { PersonMentionResponse } from "./types/PersonMentionResponse";
184
181
  export { PersonMentionView } from "./types/PersonMentionView";
185
- export { PersonSortType } from "./types/PersonSortType";
186
182
  export { PersonView } from "./types/PersonView";
187
183
  export { Post } from "./types/Post";
188
184
  export { PostAggregates } from "./types/PostAggregates";
@@ -206,9 +202,9 @@ export { PrivateMessageView } from "./types/PrivateMessageView";
206
202
  export { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
207
203
  export { PurgeComment } from "./types/PurgeComment";
208
204
  export { PurgeCommunity } from "./types/PurgeCommunity";
209
- export { PurgeItemResponse } from "./types/PurgeItemResponse";
210
205
  export { PurgePerson } from "./types/PurgePerson";
211
206
  export { PurgePost } from "./types/PurgePost";
207
+ export { ReadableFederationState } from "./types/ReadableFederationState";
212
208
  export { Register } from "./types/Register";
213
209
  export { RegistrationApplication } from "./types/RegistrationApplication";
214
210
  export { RegistrationApplicationResponse } from "./types/RegistrationApplicationResponse";
@@ -242,5 +238,4 @@ export { TransferCommunity } from "./types/TransferCommunity";
242
238
  export { UpdateTotp } from "./types/UpdateTotp";
243
239
  export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
244
240
  export { VerifyEmail } from "./types/VerifyEmail";
245
- export { VerifyEmailResponse } from "./types/VerifyEmailResponse";
246
- export { UploadImage, UploadImageResponse, ImageFile, DeleteImage, } from "./types/others";
241
+ export { UploadImage, UploadImageResponse, ImageFile, DeleteImage, } from "./other_types";
@@ -2,10 +2,6 @@
2
2
  export declare const VERSION = "v3";
3
3
  export interface UploadImage {
4
4
  image: File | Buffer;
5
- /**
6
- * Optional if cookie with jwt set is already present. Otherwise, auth is required.
7
- */
8
- auth?: string;
9
5
  }
10
6
  export interface UploadImageResponse {
11
7
  /**
@@ -23,8 +19,4 @@ export interface ImageFile {
23
19
  export interface DeleteImage {
24
20
  token: string;
25
21
  filename: string;
26
- /**
27
- * Optional if cookie with jwt set is already present. Otherwise, auth is required.
28
- */
29
- auth?: string;
30
22
  }
@@ -0,0 +1 @@
1
+ export type ActivityId = number;
@@ -1,6 +1,5 @@
1
1
  import type { CommentId } from "./CommentId";
2
2
  export interface CommentAggregates {
3
- id: number;
4
3
  comment_id: CommentId;
5
4
  score: number;
6
5
  upvotes: number;
@@ -14,6 +14,8 @@ export interface CommentReplyView {
14
14
  recipient: Person;
15
15
  counts: CommentAggregates;
16
16
  creator_banned_from_community: boolean;
17
+ creator_is_moderator: boolean;
18
+ creator_is_admin: boolean;
17
19
  subscribed: SubscribedType;
18
20
  saved: boolean;
19
21
  creator_blocked: boolean;
@@ -11,6 +11,8 @@ export interface CommentView {
11
11
  community: Community;
12
12
  counts: CommentAggregates;
13
13
  creator_banned_from_community: boolean;
14
+ creator_is_moderator: boolean;
15
+ creator_is_admin: boolean;
14
16
  subscribed: SubscribedType;
15
17
  saved: boolean;
16
18
  creator_blocked: boolean;
@@ -1,6 +1,5 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
2
  export interface CommunityAggregates {
3
- id: number;
4
3
  community_id: CommunityId;
5
4
  subscribers: number;
6
5
  posts: number;
@@ -1,6 +1,5 @@
1
1
  import type { CustomEmojiId } from "./CustomEmojiId";
2
2
  export interface CustomEmojiKeyword {
3
- id: number;
4
3
  custom_emoji_id: CustomEmojiId;
5
4
  keyword: string;
6
5
  }
@@ -1,6 +1,6 @@
1
- import type { Instance } from "./Instance";
1
+ import type { InstanceWithFederationState } from "./InstanceWithFederationState";
2
2
  export interface FederatedInstances {
3
- linked: Array<Instance>;
4
- allowed: Array<Instance>;
5
- blocked: Array<Instance>;
3
+ linked: Array<InstanceWithFederationState>;
4
+ allowed: Array<InstanceWithFederationState>;
5
+ blocked: Array<InstanceWithFederationState>;
6
6
  }
@@ -1,7 +1,5 @@
1
- import type { ImageUploadId } from "./ImageUploadId";
2
1
  import type { LocalUserId } from "./LocalUserId";
3
2
  export interface ImageUpload {
4
- id: ImageUploadId;
5
3
  local_user_id: LocalUserId;
6
4
  pictrs_alias: string;
7
5
  pictrs_delete_token: string;
@@ -0,0 +1,11 @@
1
+ import type { InstanceId } from "./InstanceId";
2
+ import type { ReadableFederationState } from "./ReadableFederationState";
3
+ export interface InstanceWithFederationState {
4
+ id: InstanceId;
5
+ domain: string;
6
+ published: string;
7
+ updated?: string;
8
+ software?: string;
9
+ version?: string;
10
+ federation_state?: ReadableFederationState;
11
+ }
@@ -68,6 +68,10 @@ export type LemmyErrorType = {
68
68
  error: "couldnt_find_person";
69
69
  } | {
70
70
  error: "person_is_blocked";
71
+ } | {
72
+ error: "community_is_blocked";
73
+ } | {
74
+ error: "instance_is_blocked";
71
75
  } | {
72
76
  error: "downvotes_are_disabled";
73
77
  } | {
@@ -298,6 +302,8 @@ export type LemmyErrorType = {
298
302
  error: "ban_expiration_in_past";
299
303
  } | {
300
304
  error: "invalid_unix_time";
305
+ } | {
306
+ error: "invalid_bot_action";
301
307
  } | {
302
308
  error: "unknown";
303
309
  message: string;
@@ -26,4 +26,5 @@ export interface LocalSite {
26
26
  updated?: string;
27
27
  registration_mode: RegistrationMode;
28
28
  reports_email_admins: boolean;
29
+ federation_signed_fetch: boolean;
29
30
  }
@@ -1,6 +1,5 @@
1
1
  import type { LocalSiteId } from "./LocalSiteId";
2
2
  export interface LocalSiteRateLimit {
3
- id: number;
4
3
  local_site_id: LocalSiteId;
5
4
  message: number;
6
5
  message_per_second: number;
@@ -28,4 +28,5 @@ export interface LocalUser {
28
28
  totp_2fa_enabled: boolean;
29
29
  enable_keyboard_navigation: boolean;
30
30
  enable_animated_images: boolean;
31
+ collapse_bot_comments: boolean;
31
32
  }
@@ -1,6 +1,5 @@
1
1
  import type { LocalUserId } from "./LocalUserId";
2
2
  export interface LoginToken {
3
- id: number;
4
3
  user_id: LocalUserId;
5
4
  published: string;
6
5
  ip?: string;
@@ -1,9 +1,6 @@
1
1
  import type { PersonId } from "./PersonId";
2
2
  export interface PersonAggregates {
3
- id: number;
4
3
  person_id: PersonId;
5
4
  post_count: number;
6
- post_score: number;
7
5
  comment_count: number;
8
- comment_score: number;
9
6
  }
@@ -14,6 +14,8 @@ export interface PersonMentionView {
14
14
  recipient: Person;
15
15
  counts: CommentAggregates;
16
16
  creator_banned_from_community: boolean;
17
+ creator_is_moderator: boolean;
18
+ creator_is_admin: boolean;
17
19
  subscribed: SubscribedType;
18
20
  saved: boolean;
19
21
  creator_blocked: boolean;
@@ -3,4 +3,5 @@ import type { PersonAggregates } from "./PersonAggregates";
3
3
  export interface PersonView {
4
4
  person: Person;
5
5
  counts: PersonAggregates;
6
+ is_admin: boolean;
6
7
  }
@@ -1,6 +1,5 @@
1
1
  import type { PostId } from "./PostId";
2
2
  export interface PostAggregates {
3
- id: number;
4
3
  post_id: PostId;
5
4
  comments: number;
6
5
  score: number;
@@ -8,6 +8,8 @@ export interface PostView {
8
8
  creator: Person;
9
9
  community: Community;
10
10
  creator_banned_from_community: boolean;
11
+ creator_is_moderator: boolean;
12
+ creator_is_admin: boolean;
11
13
  counts: PostAggregates;
12
14
  subscribed: SubscribedType;
13
15
  saved: boolean;
@@ -0,0 +1,10 @@
1
+ import type { ActivityId } from "./ActivityId";
2
+ import type { InstanceId } from "./InstanceId";
3
+ export interface ReadableFederationState {
4
+ instance_id: InstanceId;
5
+ last_successful_id?: ActivityId;
6
+ last_successful_published_time?: string;
7
+ fail_count: number;
8
+ last_retry?: string;
9
+ next_retry?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -22,11 +22,11 @@ export interface SaveUserSettings {
22
22
  bot_account?: boolean;
23
23
  show_bot_accounts?: boolean;
24
24
  show_read_posts?: boolean;
25
- show_new_post_notifs?: boolean;
26
25
  discussion_languages?: Array<LanguageId>;
27
26
  open_links_in_new_tab?: boolean;
28
27
  infinite_scroll_enabled?: boolean;
29
28
  post_listing_mode?: PostListingMode;
30
29
  enable_keyboard_navigation?: boolean;
31
30
  enable_animated_images?: boolean;
31
+ collapse_bot_comments?: boolean;
32
32
  }
@@ -1,6 +1,5 @@
1
1
  import type { SiteId } from "./SiteId";
2
2
  export interface SiteAggregates {
3
- id: number;
4
3
  site_id: SiteId;
5
4
  users: number;
6
5
  posts: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
- "version": "0.19.0-rc.14",
3
+ "version": "0.19.0-rc.15",
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 +0,0 @@
1
- export type CommunityBlockId = number;
@@ -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 +0,0 @@
1
- export type ImageUploadId = number;
@@ -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 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 });
package/dist/utils.d.ts DELETED
File without changes
package/dist/utils.js DELETED
File without changes
File without changes