lemmy-js-client 1.0.0-bool-vote.1 → 1.0.0-change-api-routes.0

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 (181) hide show
  1. package/dist/http.d.ts +5 -6
  2. package/dist/http.js +32 -32
  3. package/dist/index.d.ts +11 -59
  4. package/dist/other_types.d.ts +3 -3
  5. package/dist/types/AuthenticateWithOauth.d.ts +4 -0
  6. package/dist/types/ChangePassword.d.ts +4 -0
  7. package/dist/types/CommentSortType.d.ts +1 -1
  8. package/dist/types/CommunityActions.d.ts +4 -4
  9. package/dist/types/CommunityFollowerState.d.ts +1 -1
  10. package/dist/types/CommunityNotificationsMode.d.ts +1 -1
  11. package/dist/types/CommunitySortType.d.ts +1 -1
  12. package/dist/types/CommunityVisibility.d.ts +1 -1
  13. package/dist/types/CreateCommentLike.d.ts +3 -0
  14. package/dist/types/CreatePostLike.d.ts +3 -0
  15. package/dist/types/FederatedInstanceView.d.ts +12 -0
  16. package/dist/types/FederationAllowList.d.ts +4 -0
  17. package/dist/types/FederationBlockList.d.ts +0 -2
  18. package/dist/types/FederationBlockList.js +1 -0
  19. package/dist/types/FederationMode.d.ts +1 -1
  20. package/dist/types/FederationQueueState.d.ts +18 -0
  21. package/dist/types/GetFederatedInstances.d.ts +9 -0
  22. package/dist/types/GetFederatedInstancesKind.d.ts +1 -0
  23. package/dist/types/GetFederatedInstancesResponse.d.ts +5 -5
  24. package/dist/types/GetModlog.d.ts +2 -2
  25. package/dist/types/GetModlogResponse.d.ts +2 -2
  26. package/dist/types/GetPosts.d.ts +1 -0
  27. package/dist/types/LikeType.d.ts +1 -1
  28. package/dist/types/ListCommunityPendingFollows.d.ts +1 -1
  29. package/dist/types/ListCommunityPendingFollowsResponse.d.ts +2 -2
  30. package/dist/types/ListingType.d.ts +1 -1
  31. package/dist/types/Login.d.ts +4 -0
  32. package/dist/types/MarkManyPostsAsRead.d.ts +1 -0
  33. package/dist/types/Modlog.d.ts +10 -0
  34. package/dist/types/ModlogId.d.ts +1 -0
  35. package/dist/types/ModlogKind.d.ts +4 -0
  36. package/dist/types/ModlogView.d.ts +15 -0
  37. package/dist/types/MultiCommunityEntry.d.ts +6 -0
  38. package/dist/types/Notification.d.ts +2 -20
  39. package/dist/types/NotificationData.d.ts +6 -33
  40. package/dist/types/NotificationDataType.d.ts +1 -1
  41. package/dist/types/NotificationType.d.ts +1 -1
  42. package/dist/types/PendingFollowerView.d.ts +9 -0
  43. package/dist/types/PersonContentCombinedView.d.ts +2 -2
  44. package/dist/types/PersonContentType.d.ts +1 -1
  45. package/dist/types/PersonLikedCombinedView.d.ts +2 -2
  46. package/dist/types/PersonSavedCombinedView.d.ts +2 -2
  47. package/dist/types/PostFeatureType.d.ts +1 -1
  48. package/dist/types/PostListingMode.d.ts +1 -1
  49. package/dist/types/PostNotificationsMode.d.ts +1 -1
  50. package/dist/types/PostOrCommentOrPrivateMessage.d.ts +3 -3
  51. package/dist/types/PostSortType.d.ts +1 -1
  52. package/dist/types/Register.d.ts +4 -0
  53. package/dist/types/RegistrationMode.d.ts +1 -1
  54. package/dist/types/ReportCombinedView.d.ts +4 -4
  55. package/dist/types/ReportType.d.ts +1 -1
  56. package/dist/types/SearchCombinedView.d.ts +5 -5
  57. package/dist/types/SearchSortType.d.ts +1 -1
  58. package/dist/types/SearchType.d.ts +1 -1
  59. package/dist/types/UntranslatedError.d.ts +3 -1
  60. package/dist/types/UserSettingsBackup.d.ts +2 -0
  61. package/dist/types/VoteShow.d.ts +1 -1
  62. package/dist/types/VoteView.d.ts +3 -0
  63. package/package.json +4 -4
  64. package/dist/types/AdminAdd.d.ts +0 -12
  65. package/dist/types/AdminAddId.d.ts +0 -1
  66. package/dist/types/AdminAddView.d.ts +0 -10
  67. package/dist/types/AdminAllowInstance.d.ts +0 -11
  68. package/dist/types/AdminAllowInstanceId.d.ts +0 -1
  69. package/dist/types/AdminAllowInstanceView.d.ts +0 -11
  70. package/dist/types/AdminBan.d.ts +0 -16
  71. package/dist/types/AdminBanId.d.ts +0 -1
  72. package/dist/types/AdminBanView.d.ts +0 -10
  73. package/dist/types/AdminBlockInstance.d.ts +0 -12
  74. package/dist/types/AdminBlockInstanceId.d.ts +0 -1
  75. package/dist/types/AdminBlockInstanceView.d.ts +0 -11
  76. package/dist/types/AdminBlockInstanceView.js +0 -2
  77. package/dist/types/AdminPurgeComment.d.ts +0 -13
  78. package/dist/types/AdminPurgeComment.js +0 -2
  79. package/dist/types/AdminPurgeCommentId.d.ts +0 -1
  80. package/dist/types/AdminPurgeCommentId.js +0 -3
  81. package/dist/types/AdminPurgeCommentView.d.ts +0 -11
  82. package/dist/types/AdminPurgeCommentView.js +0 -2
  83. package/dist/types/AdminPurgeCommunity.d.ts +0 -11
  84. package/dist/types/AdminPurgeCommunity.js +0 -2
  85. package/dist/types/AdminPurgeCommunityId.d.ts +0 -1
  86. package/dist/types/AdminPurgeCommunityId.js +0 -3
  87. package/dist/types/AdminPurgeCommunityView.d.ts +0 -9
  88. package/dist/types/AdminPurgeCommunityView.js +0 -2
  89. package/dist/types/AdminPurgePerson.d.ts +0 -11
  90. package/dist/types/AdminPurgePerson.js +0 -2
  91. package/dist/types/AdminPurgePersonId.d.ts +0 -1
  92. package/dist/types/AdminPurgePersonId.js +0 -3
  93. package/dist/types/AdminPurgePersonView.d.ts +0 -9
  94. package/dist/types/AdminPurgePersonView.js +0 -2
  95. package/dist/types/AdminPurgePost.d.ts +0 -13
  96. package/dist/types/AdminPurgePost.js +0 -2
  97. package/dist/types/AdminPurgePostId.d.ts +0 -1
  98. package/dist/types/AdminPurgePostId.js +0 -3
  99. package/dist/types/AdminPurgePostView.d.ts +0 -11
  100. package/dist/types/AdminPurgePostView.js +0 -2
  101. package/dist/types/AdminRemoveCommunity.d.ts +0 -14
  102. package/dist/types/AdminRemoveCommunity.js +0 -2
  103. package/dist/types/AdminRemoveCommunityId.d.ts +0 -1
  104. package/dist/types/AdminRemoveCommunityId.js +0 -3
  105. package/dist/types/AdminRemoveCommunityView.d.ts +0 -11
  106. package/dist/types/AdminRemoveCommunityView.js +0 -2
  107. package/dist/types/BanFromCommunityResponse.d.ts +0 -8
  108. package/dist/types/BanFromCommunityResponse.js +0 -2
  109. package/dist/types/FederatedInstances.d.ts +0 -9
  110. package/dist/types/FederatedInstances.js +0 -2
  111. package/dist/types/GetCommunityPendingFollowsCount.d.ts +0 -4
  112. package/dist/types/GetCommunityPendingFollowsCount.js +0 -2
  113. package/dist/types/ModAddToCommunity.d.ts +0 -14
  114. package/dist/types/ModAddToCommunity.js +0 -2
  115. package/dist/types/ModAddToCommunityId.d.ts +0 -1
  116. package/dist/types/ModAddToCommunityId.js +0 -3
  117. package/dist/types/ModAddToCommunityView.d.ts +0 -12
  118. package/dist/types/ModAddToCommunityView.js +0 -2
  119. package/dist/types/ModBanFromCommunity.d.ts +0 -16
  120. package/dist/types/ModBanFromCommunity.js +0 -2
  121. package/dist/types/ModBanFromCommunityId.d.ts +0 -1
  122. package/dist/types/ModBanFromCommunityId.js +0 -3
  123. package/dist/types/ModBanFromCommunityView.d.ts +0 -12
  124. package/dist/types/ModBanFromCommunityView.js +0 -2
  125. package/dist/types/ModChangeCommunityVisibility.d.ts +0 -11
  126. package/dist/types/ModChangeCommunityVisibility.js +0 -2
  127. package/dist/types/ModChangeCommunityVisibilityId.d.ts +0 -1
  128. package/dist/types/ModChangeCommunityVisibilityId.js +0 -3
  129. package/dist/types/ModChangeCommunityVisibilityView.d.ts +0 -11
  130. package/dist/types/ModChangeCommunityVisibilityView.js +0 -2
  131. package/dist/types/ModFeaturePost.d.ts +0 -14
  132. package/dist/types/ModFeaturePost.js +0 -2
  133. package/dist/types/ModFeaturePostId.d.ts +0 -1
  134. package/dist/types/ModFeaturePostId.js +0 -3
  135. package/dist/types/ModFeaturePostView.d.ts +0 -14
  136. package/dist/types/ModFeaturePostView.js +0 -2
  137. package/dist/types/ModLockComment.d.ts +0 -14
  138. package/dist/types/ModLockComment.js +0 -2
  139. package/dist/types/ModLockCommentId.d.ts +0 -1
  140. package/dist/types/ModLockCommentId.js +0 -3
  141. package/dist/types/ModLockCommentView.d.ts +0 -16
  142. package/dist/types/ModLockCommentView.js +0 -2
  143. package/dist/types/ModLockPost.d.ts +0 -14
  144. package/dist/types/ModLockPost.js +0 -2
  145. package/dist/types/ModLockPostId.d.ts +0 -1
  146. package/dist/types/ModLockPostId.js +0 -3
  147. package/dist/types/ModLockPostView.d.ts +0 -14
  148. package/dist/types/ModLockPostView.js +0 -2
  149. package/dist/types/ModRemoveComment.d.ts +0 -14
  150. package/dist/types/ModRemoveComment.js +0 -2
  151. package/dist/types/ModRemoveCommentId.d.ts +0 -1
  152. package/dist/types/ModRemoveCommentId.js +0 -3
  153. package/dist/types/ModRemoveCommentView.d.ts +0 -16
  154. package/dist/types/ModRemoveCommentView.js +0 -2
  155. package/dist/types/ModRemovePost.d.ts +0 -14
  156. package/dist/types/ModRemovePost.js +0 -2
  157. package/dist/types/ModRemovePostId.d.ts +0 -1
  158. package/dist/types/ModRemovePostId.js +0 -3
  159. package/dist/types/ModRemovePostView.d.ts +0 -14
  160. package/dist/types/ModRemovePostView.js +0 -2
  161. package/dist/types/ModTransferCommunity.d.ts +0 -13
  162. package/dist/types/ModTransferCommunity.js +0 -2
  163. package/dist/types/ModTransferCommunityId.d.ts +0 -1
  164. package/dist/types/ModTransferCommunityId.js +0 -3
  165. package/dist/types/ModTransferCommunityView.d.ts +0 -12
  166. package/dist/types/ModTransferCommunityView.js +0 -2
  167. package/dist/types/ModlogActionType.d.ts +0 -4
  168. package/dist/types/ModlogActionType.js +0 -3
  169. package/dist/types/ModlogCombinedView.d.ts +0 -55
  170. package/dist/types/ModlogCombinedView.js +0 -2
  171. /package/dist/types/{AdminAdd.js → FederatedInstanceView.js} +0 -0
  172. /package/dist/types/{AdminAddId.js → FederationAllowList.js} +0 -0
  173. /package/dist/types/{AdminAddView.js → FederationQueueState.js} +0 -0
  174. /package/dist/types/{AdminAllowInstance.js → GetFederatedInstances.js} +0 -0
  175. /package/dist/types/{AdminAllowInstanceId.js → GetFederatedInstancesKind.js} +0 -0
  176. /package/dist/types/{AdminAllowInstanceView.js → Modlog.js} +0 -0
  177. /package/dist/types/{AdminBanId.js → ModlogId.js} +0 -0
  178. /package/dist/types/{AdminBlockInstanceId.js → ModlogKind.js} +0 -0
  179. /package/dist/types/{AdminBan.js → ModlogView.js} +0 -0
  180. /package/dist/types/{AdminBanView.js → MultiCommunityEntry.js} +0 -0
  181. /package/dist/types/{AdminBlockInstance.js → PendingFollowerView.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import type { CommentId } from "./CommentId";
2
2
  import type { CommunityId } from "./CommunityId";
3
3
  import type { ListingType } from "./ListingType";
4
- import type { ModlogActionType } from "./ModlogActionType";
4
+ import type { ModlogKind } from "./ModlogKind";
5
5
  import type { PaginationCursor } from "./PaginationCursor";
6
6
  import type { PersonId } from "./PersonId";
7
7
  import type { PostId } from "./PostId";
@@ -20,7 +20,7 @@ export type GetModlog = {
20
20
  /**
21
21
  * Filter by the modlog action type.
22
22
  */
23
- type_?: ModlogActionType;
23
+ type_?: ModlogKind;
24
24
  /**
25
25
  * Filter by listing type. When not using All, it will remove the non-community modlog entries,
26
26
  * such as site bans, instance blocks, adding an admin, etc.
@@ -1,10 +1,10 @@
1
- import type { ModlogCombinedView } from "./ModlogCombinedView";
1
+ import type { ModlogView } from "./ModlogView";
2
2
  import type { PaginationCursor } from "./PaginationCursor";
3
3
  /**
4
4
  * The modlog fetch response.
5
5
  */
6
6
  export type GetModlogResponse = {
7
- modlog: Array<ModlogCombinedView>;
7
+ modlog: Array<ModlogView>;
8
8
  /**
9
9
  * the pagination cursor to use to fetch the next page
10
10
  */
@@ -18,6 +18,7 @@ export type GetPosts = {
18
18
  community_id?: CommunityId;
19
19
  community_name?: string;
20
20
  multi_community_id?: MultiCommunityId;
21
+ multi_community_name?: string;
21
22
  show_hidden?: boolean;
22
23
  /**
23
24
  * If true, then show the read posts (even if your user setting is to hide them)
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The like_type for a persons liked content.
3
3
  */
4
- export type LikeType = "All" | "LikedOnly" | "DislikedOnly";
4
+ export type LikeType = "all" | "liked_only" | "disliked_only";
@@ -3,7 +3,7 @@ export type ListCommunityPendingFollows = {
3
3
  /**
4
4
  * Only shows the unapproved applications
5
5
  */
6
- pending_only?: boolean;
6
+ unread_only?: boolean;
7
7
  all_communities?: boolean;
8
8
  page_cursor?: PaginationCursor;
9
9
  page_back?: boolean;
@@ -1,7 +1,7 @@
1
1
  import type { PaginationCursor } from "./PaginationCursor";
2
- import type { PendingFollow } from "./PendingFollow";
2
+ import type { PendingFollowerView } from "./PendingFollowerView";
3
3
  export type ListCommunityPendingFollowsResponse = {
4
- items: Array<PendingFollow>;
4
+ items: Array<PendingFollowerView>;
5
5
  /**
6
6
  * the pagination cursor to use to fetch the next page
7
7
  */
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * A listing type for post and comment list fetches.
3
3
  */
4
- export type ListingType = "All" | "Local" | "Subscribed" | "ModeratorView" | "Suggested";
4
+ export type ListingType = "all" | "local" | "subscribed" | "moderator_view" | "suggested";
@@ -12,4 +12,8 @@ export type Login = {
12
12
  * May be required, if totp is enabled for their account.
13
13
  */
14
14
  totp_2fa_token?: string;
15
+ /**
16
+ * If this is true the login is valid forever, otherwise it expires after one week.
17
+ */
18
+ stay_logged_in?: boolean;
15
19
  };
@@ -4,4 +4,5 @@ import type { PostId } from "./PostId";
4
4
  */
5
5
  export type MarkManyPostsAsRead = {
6
6
  post_ids: Array<PostId>;
7
+ read: boolean;
7
8
  };
@@ -0,0 +1,10 @@
1
+ import type { ModlogId } from "./ModlogId";
2
+ import type { ModlogKind } from "./ModlogKind";
3
+ export type Modlog = {
4
+ id: ModlogId;
5
+ kind: ModlogKind;
6
+ is_revert: boolean;
7
+ reason?: string;
8
+ expires_at?: string;
9
+ published_at: string;
10
+ };
@@ -0,0 +1 @@
1
+ export type ModlogId = number;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * A list of possible types for the various modlog actions.
3
+ */
4
+ export type ModlogKind = "admin_add" | "admin_ban" | "admin_allow_instance" | "admin_block_instance" | "admin_purge_comment" | "admin_purge_community" | "admin_purge_person" | "admin_purge_post" | "mod_add_to_community" | "mod_ban_from_community" | "admin_feature_post_site" | "mod_feature_post_community" | "mod_change_community_visibility" | "mod_lock_post" | "mod_remove_comment" | "admin_remove_community" | "mod_remove_post" | "mod_transfer_community" | "mod_lock_comment";
@@ -0,0 +1,15 @@
1
+ import type { Comment } from "./Comment";
2
+ import type { Community } from "./Community";
3
+ import type { Instance } from "./Instance";
4
+ import type { Modlog } from "./Modlog";
5
+ import type { Person } from "./Person";
6
+ import type { Post } from "./Post";
7
+ export type ModlogView = {
8
+ modlog: Modlog;
9
+ moderator?: Person;
10
+ target_person?: Person;
11
+ target_instance?: Instance;
12
+ target_community?: Community;
13
+ target_post?: Post;
14
+ target_comment?: Comment;
15
+ };
@@ -0,0 +1,6 @@
1
+ import type { CommunityId } from "./CommunityId";
2
+ import type { MultiCommunityId } from "./MultiCommunityId";
3
+ export type MultiCommunityEntry = {
4
+ multi_community_id: MultiCommunityId;
5
+ community_id: CommunityId;
6
+ };
@@ -1,14 +1,5 @@
1
- import type { AdminAddId } from "./AdminAddId";
2
- import type { AdminBanId } from "./AdminBanId";
3
- import type { AdminRemoveCommunityId } from "./AdminRemoveCommunityId";
4
1
  import type { CommentId } from "./CommentId";
5
- import type { ModAddToCommunityId } from "./ModAddToCommunityId";
6
- import type { ModBanFromCommunityId } from "./ModBanFromCommunityId";
7
- import type { ModLockCommentId } from "./ModLockCommentId";
8
- import type { ModLockPostId } from "./ModLockPostId";
9
- import type { ModRemoveCommentId } from "./ModRemoveCommentId";
10
- import type { ModRemovePostId } from "./ModRemovePostId";
11
- import type { ModTransferCommunityId } from "./ModTransferCommunityId";
2
+ import type { ModlogId } from "./ModlogId";
12
3
  import type { NotificationId } from "./NotificationId";
13
4
  import type { NotificationType } from "./NotificationType";
14
5
  import type { PersonId } from "./PersonId";
@@ -23,14 +14,5 @@ export type Notification = {
23
14
  kind: NotificationType;
24
15
  post_id?: PostId;
25
16
  private_message_id?: PrivateMessageId;
26
- admin_add_id?: AdminAddId;
27
- mod_add_to_community_id?: ModAddToCommunityId;
28
- admin_ban_id?: AdminBanId;
29
- mod_ban_from_community_id?: ModBanFromCommunityId;
30
- mod_lock_post_id?: ModLockPostId;
31
- mod_remove_comment_id?: ModRemoveCommentId;
32
- admin_remove_community_id?: AdminRemoveCommunityId;
33
- mod_remove_post_id?: ModRemovePostId;
34
- mod_lock_comment_id?: ModLockCommentId;
35
- mod_transfer_community_id?: ModTransferCommunityId;
17
+ modlog_id?: ModlogId;
36
18
  };
@@ -1,40 +1,13 @@
1
- import type { AdminAdd } from "./AdminAdd";
2
- import type { AdminBan } from "./AdminBan";
3
- import type { AdminRemoveCommunity } from "./AdminRemoveCommunity";
4
1
  import type { CommentView } from "./CommentView";
5
- import type { ModAddToCommunity } from "./ModAddToCommunity";
6
- import type { ModBanFromCommunity } from "./ModBanFromCommunity";
7
- import type { ModLockComment } from "./ModLockComment";
8
- import type { ModLockPost } from "./ModLockPost";
9
- import type { ModRemoveComment } from "./ModRemoveComment";
10
- import type { ModRemovePost } from "./ModRemovePost";
11
- import type { ModTransferCommunity } from "./ModTransferCommunity";
2
+ import type { ModlogView } from "./ModlogView";
12
3
  import type { PostView } from "./PostView";
13
4
  import type { PrivateMessageView } from "./PrivateMessageView";
14
5
  export type NotificationData = ({
15
- type_: "Comment";
6
+ type_: "comment";
16
7
  } & CommentView) | ({
17
- type_: "Post";
8
+ type_: "post";
18
9
  } & PostView) | ({
19
- type_: "PrivateMessage";
10
+ type_: "private_message";
20
11
  } & PrivateMessageView) | ({
21
- type_: "AdminAdd";
22
- } & AdminAdd) | ({
23
- type_: "ModAddToCommunity";
24
- } & ModAddToCommunity) | ({
25
- type_: "AdminBan";
26
- } & AdminBan) | ({
27
- type_: "ModBanFromCommunity";
28
- } & ModBanFromCommunity) | ({
29
- type_: "ModLockPost";
30
- } & ModLockPost) | ({
31
- type_: "ModLockComment";
32
- } & ModLockComment) | ({
33
- type_: "ModRemovePost";
34
- } & ModRemovePost) | ({
35
- type_: "ModRemoveComment";
36
- } & ModRemoveComment) | ({
37
- type_: "AdminRemoveCommunity";
38
- } & AdminRemoveCommunity) | ({
39
- type_: "ModTransferCommunity";
40
- } & ModTransferCommunity);
12
+ type_: "mod_action";
13
+ } & ModlogView);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * A list of possible types for the inbox.
3
3
  */
4
- export type NotificationDataType = "All" | "Reply" | "Mention" | "PrivateMessage" | "Subscribed";
4
+ export type NotificationDataType = "all" | "reply" | "mention" | "private_message" | "subscribed";
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Types of notifications which can be received in inbox
3
3
  */
4
- export type NotificationType = "Mention" | "Reply" | "Subscribed" | "PrivateMessage" | "ModAction";
4
+ export type NotificationType = "mention" | "reply" | "subscribed" | "private_message" | "mod_action";
@@ -0,0 +1,9 @@
1
+ import type { Community } from "./Community";
2
+ import type { CommunityFollowerState } from "./CommunityFollowerState";
3
+ import type { Person } from "./Person";
4
+ export type PendingFollowerView = {
5
+ person: Person;
6
+ community: Community;
7
+ is_new_instance: boolean;
8
+ follow_state?: CommunityFollowerState;
9
+ };
@@ -1,7 +1,7 @@
1
1
  import type { CommentView } from "./CommentView";
2
2
  import type { PostView } from "./PostView";
3
3
  export type PersonContentCombinedView = ({
4
- type_: "Post";
4
+ type_: "post";
5
5
  } & PostView) | ({
6
- type_: "Comment";
6
+ type_: "comment";
7
7
  } & CommentView);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * A list of possible types for a person's content.
3
3
  */
4
- export type PersonContentType = "All" | "Comments" | "Posts";
4
+ export type PersonContentType = "all" | "comments" | "posts";
@@ -1,7 +1,7 @@
1
1
  import type { CommentView } from "./CommentView";
2
2
  import type { PostView } from "./PostView";
3
3
  export type PersonLikedCombinedView = ({
4
- type_: "Post";
4
+ type_: "post";
5
5
  } & PostView) | ({
6
- type_: "Comment";
6
+ type_: "comment";
7
7
  } & CommentView);
@@ -1,7 +1,7 @@
1
1
  import type { CommentView } from "./CommentView";
2
2
  import type { PostView } from "./PostView";
3
3
  export type PersonSavedCombinedView = ({
4
- type_: "Post";
4
+ type_: "post";
5
5
  } & PostView) | ({
6
- type_: "Comment";
6
+ type_: "comment";
7
7
  } & CommentView);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The feature type for a post.
3
3
  */
4
- export type PostFeatureType = "Local" | "Community";
4
+ export type PostFeatureType = "local" | "community";
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * A post-view mode that changes how multiple post listings look.
3
3
  */
4
- export type PostListingMode = "List" | "Card" | "SmallCard";
4
+ export type PostListingMode = "list" | "card" | "small_card";
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Available settings for post notifications
3
3
  */
4
- export type PostNotificationsMode = "AllComments" | "RepliesAndMentions" | "Mute";
4
+ export type PostNotificationsMode = "all_comments" | "replies_and_mentions" | "mute";
@@ -2,9 +2,9 @@ import type { Comment } from "./Comment";
2
2
  import type { Post } from "./Post";
3
3
  import type { PrivateMessage } from "./PrivateMessage";
4
4
  export type PostOrCommentOrPrivateMessage = ({
5
- type_: "Post";
5
+ type_: "post";
6
6
  } & Post) | ({
7
- type_: "Comment";
7
+ type_: "comment";
8
8
  } & Comment) | ({
9
- type_: "PrivateMessage";
9
+ type_: "private_message";
10
10
  } & PrivateMessage);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The post sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
3
3
  */
4
- export type PostSortType = "Active" | "Hot" | "New" | "Old" | "Top" | "MostComments" | "NewComments" | "Controversial" | "Scaled";
4
+ export type PostSortType = "active" | "hot" | "new" | "old" | "top" | "most_comments" | "new_comments" | "controversial" | "scaled";
@@ -27,4 +27,8 @@ export type Register = {
27
27
  * An answer is mandatory if require application is enabled on the server
28
28
  */
29
29
  answer?: string;
30
+ /**
31
+ * If this is true the login is valid forever, otherwise it expires after one week.
32
+ */
33
+ stay_logged_in?: boolean;
30
34
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The registration mode for your site. Determines what happens after a user signs up.
3
3
  */
4
- export type RegistrationMode = "Closed" | "RequireApplication" | "Open";
4
+ export type RegistrationMode = "closed" | "require_application" | "open";
@@ -3,11 +3,11 @@ import type { CommunityReportView } from "./CommunityReportView";
3
3
  import type { PostReportView } from "./PostReportView";
4
4
  import type { PrivateMessageReportView } from "./PrivateMessageReportView";
5
5
  export type ReportCombinedView = ({
6
- type_: "Post";
6
+ type_: "post";
7
7
  } & PostReportView) | ({
8
- type_: "Comment";
8
+ type_: "comment";
9
9
  } & CommentReportView) | ({
10
- type_: "PrivateMessage";
10
+ type_: "private_message";
11
11
  } & PrivateMessageReportView) | ({
12
- type_: "Community";
12
+ type_: "community";
13
13
  } & CommunityReportView);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * A list of possible types for reports.
3
3
  */
4
- export type ReportType = "All" | "Posts" | "Comments" | "PrivateMessages" | "Communities";
4
+ export type ReportType = "all" | "posts" | "comments" | "private_messages" | "communities";
@@ -4,13 +4,13 @@ import type { MultiCommunityView } from "./MultiCommunityView";
4
4
  import type { PersonView } from "./PersonView";
5
5
  import type { PostView } from "./PostView";
6
6
  export type SearchCombinedView = ({
7
- type_: "Post";
7
+ type_: "post";
8
8
  } & PostView) | ({
9
- type_: "Comment";
9
+ type_: "comment";
10
10
  } & CommentView) | ({
11
- type_: "Community";
11
+ type_: "community";
12
12
  } & CommunityView) | ({
13
- type_: "Person";
13
+ type_: "person";
14
14
  } & PersonView) | ({
15
- type_: "MultiCommunity";
15
+ type_: "multi_community";
16
16
  } & MultiCommunityView);
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The search sort types.
3
3
  */
4
- export type SearchSortType = "New" | "Top" | "Old";
4
+ export type SearchSortType = "new" | "top" | "old";
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The type of content returned from a search.
3
3
  */
4
- export type SearchType = "All" | "Comments" | "Posts" | "Communities" | "Users" | "MultiCommunities";
4
+ export type SearchType = "all" | "comments" | "posts" | "communities" | "users" | "multi_communities";
@@ -9,4 +9,6 @@ export type UntranslatedError = "InvalidCommunity" | "CannotCreatePostOrCommentI
9
9
  DomainNotInAllowList: string;
10
10
  } | "FederationDisabledByStrictAllowList" | "ContradictingFilters" | "UrlWithoutDomain" | "InboxTimeout" | "CantDeleteSite" | "ObjectIsNotPublic" | "ObjectIsNotPrivate" | {
11
11
  InvalidFollow: string;
12
- } | "PurgeInvalidImageUrl" | "Unreachable" | "CouldntSendWebmention" | "CommunityHasNoFollowers";
12
+ } | "PurgeInvalidImageUrl" | "Unreachable" | "CouldntSendWebmention" | {
13
+ CommunityHasNoFollowers: string;
14
+ };
@@ -24,4 +24,6 @@ export type UserSettingsBackup = {
24
24
  blocked_users: Array<string>;
25
25
  blocked_instances_communities: Array<string>;
26
26
  blocked_instances_persons: Array<string>;
27
+ blocking_keywords: Array<string>;
28
+ discussion_languages: Array<string>;
27
29
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Lets you show votes for others only, show all votes, or hide all votes.
3
3
  */
4
- export type VoteShow = "Show" | "ShowForOthers" | "Hide";
4
+ export type VoteShow = "show" | "show_for_others" | "hide";
@@ -6,5 +6,8 @@ export type VoteView = {
6
6
  creator: Person;
7
7
  creator_banned: boolean;
8
8
  creator_banned_from_community: boolean;
9
+ /**
10
+ * True means Upvote, False means Downvote.
11
+ */
9
12
  is_upvote: boolean;
10
13
  };
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-bool-vote.1",
4
+ "version": "1.0.0-change-api-routes.0",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "devDependencies": {
26
26
  "@eslint/js": "^9.20.0",
27
27
  "@redocly/cli": "^2.0.0",
28
- "@types/node": "^22.7.4",
28
+ "@types/node": "^24.0.0",
29
29
  "@typescript-eslint/eslint-plugin": "^8.7.0",
30
30
  "@typescript-eslint/parser": "^8.7.0",
31
31
  "ajv": "^8.17.1",
@@ -38,13 +38,13 @@
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": "^3.0.0",
41
+ "sortpack": "^4.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.18.2",
47
+ "packageManager": "pnpm@10.20.0",
48
48
  "types": "./dist/index.d.ts",
49
49
  "lint-staged": {
50
50
  "*.{ts,tsx,js}": [
@@ -1,12 +0,0 @@
1
- import type { AdminAddId } from "./AdminAddId";
2
- import type { PersonId } from "./PersonId";
3
- /**
4
- * When someone is added as a site admin.
5
- */
6
- export type AdminAdd = {
7
- id: AdminAddId;
8
- mod_person_id: PersonId;
9
- other_person_id: PersonId;
10
- removed: boolean;
11
- published_at: string;
12
- };
@@ -1 +0,0 @@
1
- export type AdminAddId = number;
@@ -1,10 +0,0 @@
1
- import type { AdminAdd } from "./AdminAdd";
2
- import type { Person } from "./Person";
3
- /**
4
- * When someone is added as a site moderator.
5
- */
6
- export type AdminAddView = {
7
- admin_add: AdminAdd;
8
- moderator?: Person;
9
- other_person: Person;
10
- };
@@ -1,11 +0,0 @@
1
- import type { AdminAllowInstanceId } from "./AdminAllowInstanceId";
2
- import type { InstanceId } from "./InstanceId";
3
- import type { PersonId } from "./PersonId";
4
- export type AdminAllowInstance = {
5
- id: AdminAllowInstanceId;
6
- instance_id: InstanceId;
7
- admin_person_id: PersonId;
8
- allowed: boolean;
9
- reason: string;
10
- published_at: string;
11
- };
@@ -1 +0,0 @@
1
- export type AdminAllowInstanceId = number;
@@ -1,11 +0,0 @@
1
- import type { AdminAllowInstance } from "./AdminAllowInstance";
2
- import type { Instance } from "./Instance";
3
- import type { Person } from "./Person";
4
- /**
5
- * When an admin purges a post.
6
- */
7
- export type AdminAllowInstanceView = {
8
- admin_allow_instance: AdminAllowInstance;
9
- instance: Instance;
10
- admin?: Person;
11
- };
@@ -1,16 +0,0 @@
1
- import type { AdminBanId } from "./AdminBanId";
2
- import type { InstanceId } from "./InstanceId";
3
- import type { PersonId } from "./PersonId";
4
- /**
5
- * When someone is banned from the site.
6
- */
7
- export type AdminBan = {
8
- id: AdminBanId;
9
- mod_person_id: PersonId;
10
- other_person_id: PersonId;
11
- reason: string;
12
- banned: boolean;
13
- expires_at?: string;
14
- published_at: string;
15
- instance_id: InstanceId;
16
- };
@@ -1 +0,0 @@
1
- export type AdminBanId = number;
@@ -1,10 +0,0 @@
1
- import type { AdminBan } from "./AdminBan";
2
- import type { Person } from "./Person";
3
- /**
4
- * When someone is banned from the site.
5
- */
6
- export type AdminBanView = {
7
- admin_ban: AdminBan;
8
- moderator?: Person;
9
- other_person: Person;
10
- };
@@ -1,12 +0,0 @@
1
- import type { AdminBlockInstanceId } from "./AdminBlockInstanceId";
2
- import type { InstanceId } from "./InstanceId";
3
- import type { PersonId } from "./PersonId";
4
- export type AdminBlockInstance = {
5
- id: AdminBlockInstanceId;
6
- instance_id: InstanceId;
7
- admin_person_id: PersonId;
8
- blocked: boolean;
9
- reason: string;
10
- expires_at?: string;
11
- published_at: string;
12
- };
@@ -1 +0,0 @@
1
- export type AdminBlockInstanceId = number;
@@ -1,11 +0,0 @@
1
- import type { AdminBlockInstance } from "./AdminBlockInstance";
2
- import type { Instance } from "./Instance";
3
- import type { Person } from "./Person";
4
- /**
5
- * When an admin purges a post.
6
- */
7
- export type AdminBlockInstanceView = {
8
- admin_block_instance: AdminBlockInstance;
9
- instance: Instance;
10
- admin?: Person;
11
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,13 +0,0 @@
1
- import type { AdminPurgeCommentId } from "./AdminPurgeCommentId";
2
- import type { PersonId } from "./PersonId";
3
- import type { PostId } from "./PostId";
4
- /**
5
- * When an admin purges a comment.
6
- */
7
- export type AdminPurgeComment = {
8
- id: AdminPurgeCommentId;
9
- admin_person_id: PersonId;
10
- post_id: PostId;
11
- reason: string;
12
- published_at: string;
13
- };
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export type AdminPurgeCommentId = 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 });