lemmy-js-client 1.0.0-comment-lock.0 → 1.0.0-comment-lock.1

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 (50) hide show
  1. package/dist/http.d.ts +10 -5
  2. package/dist/http.js +29 -16
  3. package/dist/index.d.ts +15 -16
  4. package/dist/types/{ModAdd.d.ts → AdminAdd.d.ts} +4 -4
  5. package/dist/types/AdminAddId.d.ts +1 -0
  6. package/dist/types/{ModAddView.d.ts → AdminAddView.d.ts} +3 -3
  7. package/dist/types/{ModBan.d.ts → AdminBan.d.ts} +3 -3
  8. package/dist/types/AdminBanId.d.ts +1 -0
  9. package/dist/types/{ModBanView.d.ts → AdminBanView.d.ts} +3 -3
  10. package/dist/types/{ModRemoveCommunity.d.ts → AdminRemoveCommunity.d.ts} +3 -3
  11. package/dist/types/AdminRemoveCommunityId.d.ts +1 -0
  12. package/dist/types/AdminRemoveCommunityView.d.ts +11 -0
  13. package/dist/types/CommentView.d.ts +2 -0
  14. package/dist/types/EditSite.d.ts +4 -0
  15. package/dist/types/FederationError.d.ts +1 -1
  16. package/dist/types/LemmyErrorType.d.ts +10 -122
  17. package/dist/types/LinkMetadata.d.ts +4 -0
  18. package/dist/types/LocalSite.d.ts +1 -0
  19. package/dist/types/LocalUser.d.ts +1 -0
  20. package/dist/types/LocalUserView.d.ts +1 -0
  21. package/dist/types/{ModAddCommunity.d.ts → ModAddToCommunity.d.ts} +3 -3
  22. package/dist/types/ModAddToCommunityId.d.ts +1 -0
  23. package/dist/types/{ModAddCommunityView.d.ts → ModAddToCommunityView.d.ts} +3 -3
  24. package/dist/types/ModlogActionType.d.ts +1 -1
  25. package/dist/types/ModlogCombinedView.d.ts +12 -12
  26. package/dist/types/OpenGraphData.d.ts +4 -0
  27. package/dist/types/PersonView.d.ts +2 -1
  28. package/dist/types/PostView.d.ts +2 -0
  29. package/dist/types/SaveUserSettings.d.ts +4 -0
  30. package/dist/types/UserSettingsBackup.d.ts +0 -4
  31. package/package.json +4 -4
  32. package/dist/types/MarkPrivateMessageAsRead.d.ts +0 -8
  33. package/dist/types/ModAddCommunityId.d.ts +0 -1
  34. package/dist/types/ModAddId.d.ts +0 -1
  35. package/dist/types/ModBanId.d.ts +0 -1
  36. package/dist/types/ModRemoveCommunityId.d.ts +0 -1
  37. package/dist/types/ModRemoveCommunityView.d.ts +0 -11
  38. package/dist/types/ModRemoveCommunityView.js +0 -2
  39. /package/dist/types/{MarkPrivateMessageAsRead.js → AdminAdd.js} +0 -0
  40. /package/dist/types/{ModAddCommunityId.js → AdminAddId.js} +0 -0
  41. /package/dist/types/{ModAdd.js → AdminAddView.js} +0 -0
  42. /package/dist/types/{ModAddCommunity.js → AdminBan.js} +0 -0
  43. /package/dist/types/{ModAddId.js → AdminBanId.js} +0 -0
  44. /package/dist/types/{ModAddCommunityView.js → AdminBanView.js} +0 -0
  45. /package/dist/types/{ModAddView.js → AdminRemoveCommunity.js} +0 -0
  46. /package/dist/types/{ModBanId.js → AdminRemoveCommunityId.js} +0 -0
  47. /package/dist/types/{ModBan.js → AdminRemoveCommunityView.js} +0 -0
  48. /package/dist/types/{ModBanView.js → ModAddToCommunity.js} +0 -0
  49. /package/dist/types/{ModRemoveCommunityId.js → ModAddToCommunityId.js} +0 -0
  50. /package/dist/types/{ModRemoveCommunity.js → ModAddToCommunityView.js} +0 -0
package/dist/http.d.ts CHANGED
@@ -74,7 +74,6 @@ import { LockComment } from "./types/LockComment";
74
74
  import { Login } from "./types/Login";
75
75
  import { LoginResponse } from "./types/LoginResponse";
76
76
  import { MarkPostAsRead } from "./types/MarkPostAsRead";
77
- import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
78
77
  import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
79
78
  import { PasswordReset } from "./types/PasswordReset";
80
79
  import { PostReportResponse } from "./types/PostReportResponse";
@@ -148,6 +147,8 @@ import { UserBlockInstancePersonsParams } from "./types/UserBlockInstancePersons
148
147
  import { MarkNotificationAsRead } from "./types/MarkNotificationAsRead";
149
148
  import { ListNotificationsResponse } from "./types/ListNotificationsResponse";
150
149
  import { ModEditPost } from "./types/ModEditPost";
150
+ import { UpdateCommunityNotifications } from "./types/UpdateCommunityNotifications";
151
+ import { UpdatePostNotifications } from "./types/UpdatePostNotifications";
151
152
  type RequestOptions = Pick<RequestInit, "signal">;
152
153
  /**
153
154
  * Helps build lemmy HTTP requests.
@@ -459,10 +460,6 @@ export declare class LemmyHttp extends Controller {
459
460
  * @summary Delete a private message.
460
461
  */
461
462
  deletePrivateMessage(form: DeletePrivateMessage, options?: RequestOptions): Promise<PrivateMessageResponse>;
462
- /**
463
- * @summary Mark a private message as read.
464
- */
465
- markPrivateMessageAsRead(form: MarkPrivateMessageAsRead, options?: RequestOptions): Promise<SuccessResponse>;
466
463
  /**
467
464
  * @summary Create a report for a private message.
468
465
  */
@@ -762,6 +759,14 @@ export declare class LemmyHttp extends Controller {
762
759
  deleteMultiCommunityEntry(form: CreateOrDeleteMultiCommunityEntry, options?: RequestOptions): Promise<SuccessResponse>;
763
760
  listMultiCommunities(form: ListMultiCommunitiesI, options?: RequestOptions): Promise<ListMultiCommunitiesResponse>;
764
761
  followMultiCommunity(form: FollowMultiCommunity, options?: RequestOptions): Promise<SuccessResponse>;
762
+ /**
763
+ * @summary Change notification settings for a community
764
+ */
765
+ updateCommunityNotifications(form: UpdateCommunityNotifications, options?: RequestOptions): Promise<SuccessResponse>;
766
+ /**
767
+ * @summary Change notification settings for a post
768
+ */
769
+ updatePostNotifications(form: UpdatePostNotifications, options?: RequestOptions): Promise<SuccessResponse>;
765
770
  /**
766
771
  * Set the headers (can be used to set the auth header)
767
772
  */
package/dist/http.js CHANGED
@@ -490,12 +490,6 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
490
490
  async deletePrivateMessage(form, options) {
491
491
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/delete", form, options);
492
492
  }
493
- /**
494
- * @summary Mark a private message as read.
495
- */
496
- async markPrivateMessageAsRead(form, options) {
497
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/private_message/mark_as_read", form, options);
498
- }
499
493
  /**
500
494
  * @summary Create a report for a private message.
501
495
  */
@@ -932,7 +926,7 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
932
926
  * Mark donation dialog as shown, so it isn't displayed anymore.
933
927
  */
934
928
  donationDialogShown(options) {
935
- return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/user/donation_dialog_shown", {}, options);
929
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/account/donation_dialog_shown", {}, options);
936
930
  }
937
931
  createMultiCommunity(form, options) {
938
932
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community", form, options);
@@ -955,6 +949,18 @@ let LemmyHttp = class LemmyHttp extends runtime_1.Controller {
955
949
  followMultiCommunity(form, options) {
956
950
  return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/multi_community/follow", form, options);
957
951
  }
952
+ /**
953
+ * @summary Change notification settings for a community
954
+ */
955
+ updateCommunityNotifications(form, options) {
956
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/community/notifications", form, options);
957
+ }
958
+ /**
959
+ * @summary Change notification settings for a post
960
+ */
961
+ updatePostNotifications(form, options) {
962
+ return __classPrivateFieldGet(this, _LemmyHttp_instances, "m", _LemmyHttp_wrapper).call(this, HttpType.Post, "/post/notifications", form, options);
963
+ }
958
964
  /**
959
965
  * Set the headers (can be used to set the auth header)
960
966
  */
@@ -1522,13 +1528,6 @@ __decorate([
1522
1528
  __param(0, (0, runtime_1.Body)()),
1523
1529
  __param(1, (0, runtime_1.Inject)())
1524
1530
  ], LemmyHttp.prototype, "deletePrivateMessage", null);
1525
- __decorate([
1526
- (0, runtime_1.Security)("bearerAuth"),
1527
- (0, runtime_1.Post)("/private_message/mark_as_read"),
1528
- (0, runtime_1.Tags)("PrivateMessage"),
1529
- __param(0, (0, runtime_1.Body)()),
1530
- __param(1, (0, runtime_1.Inject)())
1531
- ], LemmyHttp.prototype, "markPrivateMessageAsRead", null);
1532
1531
  __decorate([
1533
1532
  (0, runtime_1.Security)("bearerAuth"),
1534
1533
  (0, runtime_1.Post)("/private_message/report"),
@@ -2023,8 +2022,8 @@ __decorate([
2023
2022
  ], LemmyHttp.prototype, "imageHealth", null);
2024
2023
  __decorate([
2025
2024
  (0, runtime_1.Security)("bearerAuth"),
2026
- (0, runtime_1.Post)("/user/donation_dialog_shown"),
2027
- (0, runtime_1.Tags)("Miscellaneous"),
2025
+ (0, runtime_1.Post)("/account/donation_dialog_shown"),
2026
+ (0, runtime_1.Tags)("Account"),
2028
2027
  __param(0, (0, runtime_1.Inject)())
2029
2028
  ], LemmyHttp.prototype, "donationDialogShown", null);
2030
2029
  __decorate([
@@ -2073,6 +2072,20 @@ __decorate([
2073
2072
  __param(0, (0, runtime_1.Body)()),
2074
2073
  __param(1, (0, runtime_1.Inject)())
2075
2074
  ], LemmyHttp.prototype, "followMultiCommunity", null);
2075
+ __decorate([
2076
+ (0, runtime_1.Security)("bearerAuth"),
2077
+ (0, runtime_1.Put)("/community/notifications"),
2078
+ (0, runtime_1.Tags)("Community"),
2079
+ __param(0, (0, runtime_1.Body)()),
2080
+ __param(1, (0, runtime_1.Inject)())
2081
+ ], LemmyHttp.prototype, "updateCommunityNotifications", null);
2082
+ __decorate([
2083
+ (0, runtime_1.Security)("bearerAuth"),
2084
+ (0, runtime_1.Put)("/post/notifications"),
2085
+ (0, runtime_1.Tags)("Post"),
2086
+ __param(0, (0, runtime_1.Body)()),
2087
+ __param(1, (0, runtime_1.Inject)())
2088
+ ], LemmyHttp.prototype, "updatePostNotifications", null);
2076
2089
  exports.LemmyHttp = LemmyHttp = __decorate([
2077
2090
  (0, runtime_1.Route)("api/v4")
2078
2091
  ], LemmyHttp);
package/dist/index.d.ts CHANGED
@@ -5,10 +5,16 @@ export { AddAdmin } from "./types/AddAdmin";
5
5
  export { AddAdminResponse } from "./types/AddAdminResponse";
6
6
  export { AddModToCommunity } from "./types/AddModToCommunity";
7
7
  export { AddModToCommunityResponse } from "./types/AddModToCommunityResponse";
8
+ export { AdminAdd } from "./types/AdminAdd";
9
+ export { AdminAddId } from "./types/AdminAddId";
10
+ export { AdminAddView } from "./types/AdminAddView";
8
11
  export { AdminAllowInstance } from "./types/AdminAllowInstance";
9
12
  export { AdminAllowInstanceId } from "./types/AdminAllowInstanceId";
10
13
  export { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
11
14
  export { AdminAllowInstanceView } from "./types/AdminAllowInstanceView";
15
+ export { AdminBan } from "./types/AdminBan";
16
+ export { AdminBanId } from "./types/AdminBanId";
17
+ export { AdminBanView } from "./types/AdminBanView";
12
18
  export { AdminBlockInstance } from "./types/AdminBlockInstance";
13
19
  export { AdminBlockInstanceId } from "./types/AdminBlockInstanceId";
14
20
  export { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
@@ -27,6 +33,9 @@ export { AdminPurgePersonView } from "./types/AdminPurgePersonView";
27
33
  export { AdminPurgePost } from "./types/AdminPurgePost";
28
34
  export { AdminPurgePostId } from "./types/AdminPurgePostId";
29
35
  export { AdminPurgePostView } from "./types/AdminPurgePostView";
36
+ export { AdminRemoveCommunity } from "./types/AdminRemoveCommunity";
37
+ export { AdminRemoveCommunityId } from "./types/AdminRemoveCommunityId";
38
+ export { AdminRemoveCommunityView } from "./types/AdminRemoveCommunityView";
30
39
  export { ApproveCommunityPendingFollower } from "./types/ApproveCommunityPendingFollower";
31
40
  export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
32
41
  export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";
@@ -211,19 +220,12 @@ export { LoginToken } from "./types/LoginToken";
211
220
  export { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead";
212
221
  export { MarkNotificationAsRead } from "./types/MarkNotificationAsRead";
213
222
  export { MarkPostAsRead } from "./types/MarkPostAsRead";
214
- export { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
215
- export { ModAdd } from "./types/ModAdd";
216
- export { ModAddCommunity } from "./types/ModAddCommunity";
217
- export { ModAddCommunityId } from "./types/ModAddCommunityId";
218
- export { ModAddCommunityView } from "./types/ModAddCommunityView";
219
- export { ModAddId } from "./types/ModAddId";
220
- export { ModAddView } from "./types/ModAddView";
221
- export { ModBan } from "./types/ModBan";
223
+ export { ModAddToCommunity } from "./types/ModAddToCommunity";
224
+ export { ModAddToCommunityId } from "./types/ModAddToCommunityId";
225
+ export { ModAddToCommunityView } from "./types/ModAddToCommunityView";
222
226
  export { ModBanFromCommunity } from "./types/ModBanFromCommunity";
223
227
  export { ModBanFromCommunityId } from "./types/ModBanFromCommunityId";
224
228
  export { ModBanFromCommunityView } from "./types/ModBanFromCommunityView";
225
- export { ModBanId } from "./types/ModBanId";
226
- export { ModBanView } from "./types/ModBanView";
227
229
  export { ModChangeCommunityVisibility } from "./types/ModChangeCommunityVisibility";
228
230
  export { ModChangeCommunityVisibilityId } from "./types/ModChangeCommunityVisibilityId";
229
231
  export { ModChangeCommunityVisibilityView } from "./types/ModChangeCommunityVisibilityView";
@@ -231,18 +233,15 @@ export { ModEditPost } from "./types/ModEditPost";
231
233
  export { ModFeaturePost } from "./types/ModFeaturePost";
232
234
  export { ModFeaturePostId } from "./types/ModFeaturePostId";
233
235
  export { ModFeaturePostView } from "./types/ModFeaturePostView";
236
+ export { ModLockComment } from "./types/ModLockComment";
237
+ export { ModLockCommentId } from "./types/ModLockCommentId";
238
+ export { ModLockCommentView } from "./types/ModLockCommentView";
234
239
  export { ModLockPost } from "./types/ModLockPost";
235
240
  export { ModLockPostId } from "./types/ModLockPostId";
236
241
  export { ModLockPostView } from "./types/ModLockPostView";
237
242
  export { ModRemoveComment } from "./types/ModRemoveComment";
238
243
  export { ModRemoveCommentId } from "./types/ModRemoveCommentId";
239
244
  export { ModRemoveCommentView } from "./types/ModRemoveCommentView";
240
- export { ModRemoveCommunity } from "./types/ModRemoveCommunity";
241
- export { ModRemoveCommunityId } from "./types/ModRemoveCommunityId";
242
- export { ModRemoveCommunityView } from "./types/ModRemoveCommunityView";
243
- export { ModLockComment } from "./types/ModLockComment";
244
- export { ModLockCommentId } from "./types/ModLockCommentId";
245
- export { ModLockCommentView } from "./types/ModLockCommentView";
246
245
  export { ModRemovePost } from "./types/ModRemovePost";
247
246
  export { ModRemovePostId } from "./types/ModRemovePostId";
248
247
  export { ModRemovePostView } from "./types/ModRemovePostView";
@@ -1,10 +1,10 @@
1
- import type { ModAddId } from "./ModAddId";
1
+ import type { AdminAddId } from "./AdminAddId";
2
2
  import type { PersonId } from "./PersonId";
3
3
  /**
4
- * When someone is added as a site moderator.
4
+ * When someone is added as a site admin.
5
5
  */
6
- export type ModAdd = {
7
- id: ModAddId;
6
+ export type AdminAdd = {
7
+ id: AdminAddId;
8
8
  mod_person_id: PersonId;
9
9
  other_person_id: PersonId;
10
10
  removed: boolean;
@@ -0,0 +1 @@
1
+ export type AdminAddId = number;
@@ -1,10 +1,10 @@
1
- import type { ModAdd } from "./ModAdd";
1
+ import type { AdminAdd } from "./AdminAdd";
2
2
  import type { Person } from "./Person";
3
3
  /**
4
4
  * When someone is added as a site moderator.
5
5
  */
6
- export type ModAddView = {
7
- mod_add: ModAdd;
6
+ export type AdminAddView = {
7
+ admin_add: AdminAdd;
8
8
  moderator?: Person;
9
9
  other_person: Person;
10
10
  };
@@ -1,11 +1,11 @@
1
+ import type { AdminBanId } from "./AdminBanId";
1
2
  import type { InstanceId } from "./InstanceId";
2
- import type { ModBanId } from "./ModBanId";
3
3
  import type { PersonId } from "./PersonId";
4
4
  /**
5
5
  * When someone is banned from the site.
6
6
  */
7
- export type ModBan = {
8
- id: ModBanId;
7
+ export type AdminBan = {
8
+ id: AdminBanId;
9
9
  mod_person_id: PersonId;
10
10
  other_person_id: PersonId;
11
11
  reason?: string;
@@ -0,0 +1 @@
1
+ export type AdminBanId = number;
@@ -1,10 +1,10 @@
1
- import type { ModBan } from "./ModBan";
1
+ import type { AdminBan } from "./AdminBan";
2
2
  import type { Person } from "./Person";
3
3
  /**
4
4
  * When someone is banned from the site.
5
5
  */
6
- export type ModBanView = {
7
- mod_ban: ModBan;
6
+ export type AdminBanView = {
7
+ admin_ban: AdminBan;
8
8
  moderator?: Person;
9
9
  other_person: Person;
10
10
  };
@@ -1,11 +1,11 @@
1
+ import type { AdminRemoveCommunityId } from "./AdminRemoveCommunityId";
1
2
  import type { CommunityId } from "./CommunityId";
2
- import type { ModRemoveCommunityId } from "./ModRemoveCommunityId";
3
3
  import type { PersonId } from "./PersonId";
4
4
  /**
5
5
  * When a moderator removes a community.
6
6
  */
7
- export type ModRemoveCommunity = {
8
- id: ModRemoveCommunityId;
7
+ export type AdminRemoveCommunity = {
8
+ id: AdminRemoveCommunityId;
9
9
  mod_person_id: PersonId;
10
10
  community_id: CommunityId;
11
11
  reason?: string;
@@ -0,0 +1 @@
1
+ export type AdminRemoveCommunityId = number;
@@ -0,0 +1,11 @@
1
+ import type { AdminRemoveCommunity } from "./AdminRemoveCommunity";
2
+ import type { Community } from "./Community";
3
+ import type { Person } from "./Person";
4
+ /**
5
+ * When an admin removes a community.
6
+ */
7
+ export type AdminRemoveCommunityView = {
8
+ admin_remove_community: AdminRemoveCommunity;
9
+ moderator?: Person;
10
+ community: Community;
11
+ };
@@ -21,6 +21,8 @@ export type CommentView = {
21
21
  post_tags: TagsView;
22
22
  can_mod: boolean;
23
23
  creator_banned: boolean;
24
+ creator_ban_expires_at?: string;
24
25
  creator_is_moderator: boolean;
25
26
  creator_banned_from_community: boolean;
27
+ creator_community_ban_expires_at?: string;
26
28
  };
@@ -55,6 +55,10 @@ export type EditSite = {
55
55
  * A default time range limit to apply to post sorts, in seconds. 0 means none.
56
56
  */
57
57
  default_post_time_range_seconds?: number;
58
+ /**
59
+ * A default fetch limit for number of items returned.
60
+ */
61
+ default_items_per_page?: number;
58
62
  /**
59
63
  * The default comment sort, usually "hot"
60
64
  */
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export type FederationError = "InvalidCommunity" | "CannotCreatePostOrCommentInDeletedOrRemovedCommunity" | "CannotReceivePage" | "OnlyLocalAdminCanRemoveCommunity" | "OnlyLocalAdminCanRestoreCommunity" | "PostIsLocked" | {
5
5
  PersonIsBannedFromSite: string;
6
- } | "InvalidVoteValue" | "PageDoesNotSpecifyCreator" | "CouldntGetComments" | "CouldntGetPosts" | "FederationDisabled" | {
6
+ } | "InvalidVoteValue" | "PageDoesNotSpecifyCreator" | "FederationDisabled" | {
7
7
  DomainBlocked: string;
8
8
  } | {
9
9
  DomainNotInAllowList: string;
@@ -4,7 +4,9 @@ export type LemmyErrorType = {
4
4
  } | {
5
5
  error: "block_keyword_too_long";
6
6
  } | {
7
- error: "couldnt_update_keywords";
7
+ error: "couldnt_update";
8
+ } | {
9
+ error: "couldnt_create";
8
10
  } | {
9
11
  error: "report_reason_required";
10
12
  } | {
@@ -19,16 +21,12 @@ export type LemmyErrorType = {
19
21
  error: "cant_note_yourself";
20
22
  } | {
21
23
  error: "cant_block_admin";
22
- } | {
23
- error: "couldnt_update_user";
24
24
  } | {
25
25
  error: "passwords_do_not_match";
26
26
  } | {
27
27
  error: "email_not_verified";
28
28
  } | {
29
29
  error: "email_required";
30
- } | {
31
- error: "couldnt_update_comment";
32
30
  } | {
33
31
  error: "cannot_leave_admin";
34
32
  } | {
@@ -83,8 +81,6 @@ export type LemmyErrorType = {
83
81
  error: "registration_application_is_pending";
84
82
  } | {
85
83
  error: "locked";
86
- } | {
87
- error: "couldnt_create_comment";
88
84
  } | {
89
85
  error: "max_comment_depth_reached";
90
86
  } | {
@@ -92,21 +88,15 @@ export type LemmyErrorType = {
92
88
  } | {
93
89
  error: "only_admins_can_create_communities";
94
90
  } | {
95
- error: "community_already_exists";
91
+ error: "already_exists";
96
92
  } | {
97
93
  error: "language_not_allowed";
98
- } | {
99
- error: "couldnt_update_languages";
100
- } | {
101
- error: "couldnt_update_post";
102
94
  } | {
103
95
  error: "no_post_edit_allowed";
104
96
  } | {
105
97
  error: "nsfw_not_allowed";
106
98
  } | {
107
99
  error: "edit_private_message_not_allowed";
108
- } | {
109
- error: "site_already_exists";
110
100
  } | {
111
101
  error: "application_question_required";
112
102
  } | {
@@ -118,9 +108,9 @@ export type LemmyErrorType = {
118
108
  } | {
119
109
  error: "registration_username_required";
120
110
  } | {
121
- error: "email_already_exists";
111
+ error: "email_already_taken";
122
112
  } | {
123
- error: "username_already_exists";
113
+ error: "username_already_taken";
124
114
  } | {
125
115
  error: "person_is_banned_from_community";
126
116
  } | {
@@ -150,58 +140,18 @@ export type LemmyErrorType = {
150
140
  error: "bio_length_overflow";
151
141
  } | {
152
142
  error: "alt_text_length_overflow";
153
- } | {
154
- error: "missing_totp_token";
155
- } | {
156
- error: "missing_totp_secret";
157
- } | {
158
- error: "incorrect_totp_token";
159
143
  } | {
160
144
  error: "couldnt_parse_totp_secret";
161
145
  } | {
162
146
  error: "couldnt_generate_totp";
163
147
  } | {
164
- error: "totp_already_enabled";
165
- } | {
166
- error: "couldnt_like_comment";
167
- } | {
168
- error: "couldnt_save_comment";
169
- } | {
170
- error: "couldnt_create_report";
171
- } | {
172
- error: "couldnt_resolve_report";
173
- } | {
174
- error: "community_moderator_already_exists";
175
- } | {
176
- error: "community_user_already_banned";
177
- } | {
178
- error: "community_block_already_exists";
179
- } | {
180
- error: "community_follower_already_exists";
181
- } | {
182
- error: "person_block_already_exists";
183
- } | {
184
- error: "couldnt_like_post";
185
- } | {
186
- error: "couldnt_save_post";
187
- } | {
188
- error: "couldnt_mark_post_as_read";
189
- } | {
190
- error: "couldnt_update_read_comments";
191
- } | {
192
- error: "couldnt_hide_post";
193
- } | {
194
- error: "couldnt_update_community";
195
- } | {
196
- error: "couldnt_create_notification";
197
- } | {
198
- error: "couldnt_update_notification";
148
+ error: "missing_totp_token";
199
149
  } | {
200
- error: "couldnt_create_post";
150
+ error: "missing_totp_secret";
201
151
  } | {
202
- error: "couldnt_create_private_message";
152
+ error: "incorrect_totp_token";
203
153
  } | {
204
- error: "couldnt_update_private_message";
154
+ error: "totp_already_enabled";
205
155
  } | {
206
156
  error: "blocked_url";
207
157
  } | {
@@ -235,10 +185,6 @@ export type LemmyErrorType = {
235
185
  error: "couldnt_send_webmention";
236
186
  } | {
237
187
  error: "contradicting_filters";
238
- } | {
239
- error: "instance_block_communities_already_exists";
240
- } | {
241
- error: "instance_block_persons_already_exists";
242
188
  } | {
243
189
  error: "too_many_items";
244
190
  } | {
@@ -262,10 +208,6 @@ export type LemmyErrorType = {
262
208
  error: "oauth_login_failed";
263
209
  } | {
264
210
  error: "oauth_registration_closed";
265
- } | {
266
- error: "couldnt_create_oauth_provider";
267
- } | {
268
- error: "couldnt_update_oauth_provider";
269
211
  } | {
270
212
  error: "not_found";
271
213
  } | {
@@ -288,60 +230,6 @@ export type LemmyErrorType = {
288
230
  message: string;
289
231
  } | {
290
232
  error: "invalid_fetch_limit";
291
- } | {
292
- error: "couldnt_create_emoji";
293
- } | {
294
- error: "couldnt_update_emoji";
295
- } | {
296
- error: "couldnt_create_person";
297
- } | {
298
- error: "couldnt_update_person";
299
- } | {
300
- error: "couldnt_create_modlog";
301
- } | {
302
- error: "couldnt_update_modlog";
303
- } | {
304
- error: "couldnt_create_site";
305
- } | {
306
- error: "couldnt_update_site";
307
- } | {
308
- error: "couldnt_create_registration_application";
309
- } | {
310
- error: "couldnt_update_registration_application";
311
- } | {
312
- error: "couldnt_create_tag";
313
- } | {
314
- error: "couldnt_update_tag";
315
- } | {
316
- error: "couldnt_create_post_tag";
317
- } | {
318
- error: "couldnt_create_tagline";
319
- } | {
320
- error: "couldnt_update_tagline";
321
- } | {
322
- error: "couldnt_create_image";
323
- } | {
324
- error: "couldnt_allow_instance";
325
- } | {
326
- error: "couldnt_block_instance";
327
- } | {
328
- error: "couldnt_insert_activity";
329
- } | {
330
- error: "couldnt_create_rate_limit";
331
- } | {
332
- error: "couldnt_create_captcha_answer";
333
- } | {
334
- error: "couldnt_update_federation_queue_state";
335
- } | {
336
- error: "couldnt_create_oauth_account";
337
- } | {
338
- error: "couldnt_create_password_reset_request";
339
- } | {
340
- error: "couldnt_create_login_token";
341
- } | {
342
- error: "couldnt_update_local_site_url_blocklist";
343
- } | {
344
- error: "couldnt_create_email_verification";
345
233
  } | {
346
234
  error: "email_notifications_disabled";
347
235
  } | {
@@ -7,5 +7,9 @@ export type LinkMetadata = {
7
7
  title?: string;
8
8
  description?: string;
9
9
  image?: DbUrl;
10
+ image_width?: number;
11
+ image_height?: number;
10
12
  embed_video_url?: DbUrl;
13
+ video_width?: number;
14
+ video_height?: number;
11
15
  };
@@ -145,4 +145,5 @@ export type LocalSite = {
145
145
  disable_email_notifications: boolean;
146
146
  suggested_communities?: MultiCommunityId;
147
147
  multi_comm_follower: PersonId;
148
+ default_items_per_page: number;
148
149
  };
@@ -103,4 +103,5 @@ export type LocalUser = {
103
103
  show_downvotes: VoteShow;
104
104
  show_upvote_percentage: boolean;
105
105
  show_person_votes: boolean;
106
+ default_items_per_page: number;
106
107
  };
@@ -7,4 +7,5 @@ export type LocalUserView = {
7
7
  local_user: LocalUser;
8
8
  person: Person;
9
9
  banned: boolean;
10
+ ban_expires_at?: string;
10
11
  };
@@ -1,11 +1,11 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
- import type { ModAddCommunityId } from "./ModAddCommunityId";
2
+ import type { ModAddToCommunityId } from "./ModAddToCommunityId";
3
3
  import type { PersonId } from "./PersonId";
4
4
  /**
5
5
  * When someone is added as a community moderator.
6
6
  */
7
- export type ModAddCommunity = {
8
- id: ModAddCommunityId;
7
+ export type ModAddToCommunity = {
8
+ id: ModAddToCommunityId;
9
9
  mod_person_id: PersonId;
10
10
  other_person_id: PersonId;
11
11
  community_id: CommunityId;
@@ -0,0 +1 @@
1
+ export type ModAddToCommunityId = number;
@@ -1,11 +1,11 @@
1
1
  import type { Community } from "./Community";
2
- import type { ModAddCommunity } from "./ModAddCommunity";
2
+ import type { ModAddToCommunity } from "./ModAddToCommunity";
3
3
  import type { Person } from "./Person";
4
4
  /**
5
5
  * When someone is added as a community moderator.
6
6
  */
7
- export type ModAddCommunityView = {
8
- mod_add_community: ModAddCommunity;
7
+ export type ModAddToCommunityView = {
8
+ mod_add_to_community: ModAddToCommunity;
9
9
  moderator?: Person;
10
10
  community: Community;
11
11
  other_person: Person;
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * A list of possible types for the various modlog actions.
3
3
  */
4
- export type ModlogActionType = "All" | "ModRemovePost" | "ModLockPost" | "ModFeaturePost" | "ModRemoveComment" | "ModRemoveCommunity" | "ModBanFromCommunity" | "ModAddCommunity" | "ModTransferCommunity" | "ModAdd" | "ModBan" | "ModChangeCommunityVisibility" | "AdminPurgePerson" | "AdminPurgeCommunity" | "AdminPurgePost" | "AdminPurgeComment" | "AdminBlockInstance" | "AdminAllowInstance";
4
+ export type ModlogActionType = "All" | "ModRemovePost" | "ModLockPost" | "ModFeaturePost" | "ModRemoveComment" | "ModLockComment" | "AdminRemoveCommunity" | "ModBanFromCommunity" | "ModAddToCommunity" | "ModTransferCommunity" | "AdminAdd" | "AdminBan" | "ModChangeCommunityVisibility" | "AdminPurgePerson" | "AdminPurgeCommunity" | "AdminPurgePost" | "AdminPurgeComment" | "AdminBlockInstance" | "AdminAllowInstance";
@@ -1,19 +1,19 @@
1
+ import type { AdminAddView } from "./AdminAddView";
1
2
  import type { AdminAllowInstanceView } from "./AdminAllowInstanceView";
3
+ import type { AdminBanView } from "./AdminBanView";
2
4
  import type { AdminBlockInstanceView } from "./AdminBlockInstanceView";
3
5
  import type { AdminPurgeCommentView } from "./AdminPurgeCommentView";
4
6
  import type { AdminPurgeCommunityView } from "./AdminPurgeCommunityView";
5
7
  import type { AdminPurgePersonView } from "./AdminPurgePersonView";
6
8
  import type { AdminPurgePostView } from "./AdminPurgePostView";
7
- import type { ModAddCommunityView } from "./ModAddCommunityView";
8
- import type { ModAddView } from "./ModAddView";
9
+ import type { AdminRemoveCommunityView } from "./AdminRemoveCommunityView";
10
+ import type { ModAddToCommunityView } from "./ModAddToCommunityView";
9
11
  import type { ModBanFromCommunityView } from "./ModBanFromCommunityView";
10
- import type { ModBanView } from "./ModBanView";
11
12
  import type { ModChangeCommunityVisibilityView } from "./ModChangeCommunityVisibilityView";
12
13
  import type { ModFeaturePostView } from "./ModFeaturePostView";
13
14
  import type { ModLockCommentView } from "./ModLockCommentView";
14
15
  import type { ModLockPostView } from "./ModLockPostView";
15
16
  import type { ModRemoveCommentView } from "./ModRemoveCommentView";
16
- import type { ModRemoveCommunityView } from "./ModRemoveCommunityView";
17
17
  import type { ModRemovePostView } from "./ModRemovePostView";
18
18
  import type { ModTransferCommunityView } from "./ModTransferCommunityView";
19
19
  export type ModlogCombinedView = ({
@@ -29,12 +29,12 @@ export type ModlogCombinedView = ({
29
29
  } & AdminPurgePersonView) | ({
30
30
  type_: "AdminPurgePost";
31
31
  } & AdminPurgePostView) | ({
32
- type_: "ModAdd";
33
- } & ModAddView) | ({
34
- type_: "ModAddCommunity";
35
- } & ModAddCommunityView) | ({
36
- type_: "ModBan";
37
- } & ModBanView) | ({
32
+ type_: "AdminAdd";
33
+ } & AdminAddView) | ({
34
+ type_: "ModAddToCommunity";
35
+ } & ModAddToCommunityView) | ({
36
+ type_: "AdminBan";
37
+ } & AdminBanView) | ({
38
38
  type_: "ModBanFromCommunity";
39
39
  } & ModBanFromCommunityView) | ({
40
40
  type_: "ModFeaturePost";
@@ -45,8 +45,8 @@ export type ModlogCombinedView = ({
45
45
  } & ModLockPostView) | ({
46
46
  type_: "ModRemoveComment";
47
47
  } & ModRemoveCommentView) | ({
48
- type_: "ModRemoveCommunity";
49
- } & ModRemoveCommunityView) | ({
48
+ type_: "AdminRemoveCommunity";
49
+ } & AdminRemoveCommunityView) | ({
50
50
  type_: "ModRemovePost";
51
51
  } & ModRemovePostView) | ({
52
52
  type_: "ModTransferCommunity";
@@ -6,5 +6,9 @@ export type OpenGraphData = {
6
6
  title?: string;
7
7
  description?: string;
8
8
  image?: DbUrl;
9
+ image_width?: number;
10
+ image_height?: number;
9
11
  embed_video_url?: DbUrl;
12
+ video_width?: number;
13
+ video_height?: number;
10
14
  };
@@ -7,5 +7,6 @@ export type PersonView = {
7
7
  person: Person;
8
8
  is_admin: boolean;
9
9
  person_actions?: PersonActions;
10
- creator_banned: boolean;
10
+ banned: boolean;
11
+ ban_expires_at?: string;
11
12
  };
@@ -21,6 +21,8 @@ export type PostView = {
21
21
  tags: TagsView;
22
22
  can_mod: boolean;
23
23
  creator_banned: boolean;
24
+ creator_ban_expires_at?: string;
24
25
  creator_is_moderator: boolean;
25
26
  creator_banned_from_community: boolean;
27
+ creator_community_ban_expires_at?: string;
26
28
  };
@@ -37,6 +37,10 @@ export type SaveUserSettings = {
37
37
  * A default time range limit to apply to post sorts, in seconds. 0 means none.
38
38
  */
39
39
  default_post_time_range_seconds?: number;
40
+ /**
41
+ * A default fetch limit for number of items returned.
42
+ */
43
+ default_items_per_page?: number;
40
44
  /**
41
45
  * The default comment sort, usually "hot"
42
46
  */
@@ -22,10 +22,6 @@ export type UserSettingsBackup = {
22
22
  saved_comments: Array<string>;
23
23
  blocked_communities: Array<string>;
24
24
  blocked_users: Array<string>;
25
- /**
26
- * Only kept for v0.19 compatibility
27
- */
28
- blocked_instances: Array<string>;
29
25
  blocked_instances_communities: Array<string>;
30
26
  blocked_instances_persons: Array<string>;
31
27
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
3
  "description": "A javascript / typescript client for Lemmy",
4
- "version": "1.0.0-comment-lock.0",
4
+ "version": "1.0.0-comment-lock.1",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -32,19 +32,19 @@
32
32
  "eslint": "^9.11.1",
33
33
  "eslint-plugin-prettier": "^5.2.1",
34
34
  "husky": "^9.1.4",
35
- "joi": "^17.13.3",
35
+ "joi": "^18.0.0",
36
36
  "lint-staged": "^16.0.0",
37
37
  "prettier": "^3.3.3",
38
38
  "prettier-plugin-import-sort": "^0.0.7",
39
39
  "prettier-plugin-organize-imports": "^4.0.0",
40
40
  "prettier-plugin-packagejson": "^2.5.1",
41
- "sortpack": "^2.4.0",
41
+ "sortpack": "^3.0.0",
42
42
  "tsoa": "^6.6.0",
43
43
  "typedoc": "^0.28.0",
44
44
  "typescript": "^5.5.4",
45
45
  "typescript-eslint": "^8.7.0"
46
46
  },
47
- "packageManager": "pnpm@10.14.0",
47
+ "packageManager": "pnpm@10.15.1",
48
48
  "types": "./dist/index.d.ts",
49
49
  "lint-staged": {
50
50
  "*.{ts,tsx,js}": [
@@ -1,8 +0,0 @@
1
- import type { PrivateMessageId } from "./PrivateMessageId";
2
- /**
3
- * Mark a private message as read.
4
- */
5
- export type MarkPrivateMessageAsRead = {
6
- private_message_id: PrivateMessageId;
7
- read: boolean;
8
- };
@@ -1 +0,0 @@
1
- export type ModAddCommunityId = number;
@@ -1 +0,0 @@
1
- export type ModAddId = number;
@@ -1 +0,0 @@
1
- export type ModBanId = number;
@@ -1 +0,0 @@
1
- export type ModRemoveCommunityId = number;
@@ -1,11 +0,0 @@
1
- import type { Community } from "./Community";
2
- import type { ModRemoveCommunity } from "./ModRemoveCommunity";
3
- import type { Person } from "./Person";
4
- /**
5
- * When a moderator removes a community.
6
- */
7
- export type ModRemoveCommunityView = {
8
- mod_remove_community: ModRemoveCommunity;
9
- moderator?: Person;
10
- community: Community;
11
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
File without changes
File without changes
File without changes