lemmy-js-client 1.0.0-block-nsfw.1 → 1.0.0-comment-lock.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 (285) hide show
  1. package/README.md +6 -0
  2. package/dist/http.d.ts +125 -43
  3. package/dist/http.js +1135 -916
  4. package/dist/index.d.ts +65 -36
  5. package/dist/other_types.d.ts +23 -2
  6. package/dist/types/AdminAllowInstance.d.ts +1 -1
  7. package/dist/types/AdminBlockInstance.d.ts +2 -2
  8. package/dist/types/AdminBlockInstanceParams.d.ts +1 -1
  9. package/dist/types/AdminListUsers.d.ts +7 -0
  10. package/dist/types/AdminListUsersResponse.d.ts +10 -0
  11. package/dist/types/AdminPurgeComment.d.ts +1 -1
  12. package/dist/types/AdminPurgeCommunity.d.ts +1 -1
  13. package/dist/types/AdminPurgePerson.d.ts +1 -1
  14. package/dist/types/AdminPurgePost.d.ts +1 -1
  15. package/dist/types/BanFromCommunity.d.ts +1 -1
  16. package/dist/types/BanPerson.d.ts +1 -1
  17. package/dist/types/Comment.d.ts +20 -2
  18. package/dist/types/CommentActions.d.ts +14 -0
  19. package/dist/types/CommentReport.d.ts +2 -2
  20. package/dist/types/CommentReportView.d.ts +10 -13
  21. package/dist/types/CommentResponse.d.ts +0 -2
  22. package/dist/types/CommentSlimView.d.ts +7 -13
  23. package/dist/types/CommentView.d.ts +11 -13
  24. package/dist/types/Community.d.ts +25 -6
  25. package/dist/types/CommunityActions.d.ts +29 -0
  26. package/dist/types/CommunityIdQuery.d.ts +8 -0
  27. package/dist/types/CommunityNotificationsMode.d.ts +4 -0
  28. package/dist/types/CommunityReport.d.ts +2 -2
  29. package/dist/types/CommunityReportResponse.d.ts +7 -0
  30. package/dist/types/CommunityReportView.d.ts +4 -4
  31. package/dist/types/CommunityView.d.ts +4 -6
  32. package/dist/types/CommunityVisibility.d.ts +1 -1
  33. package/dist/types/CreateCommunityReport.d.ts +8 -0
  34. package/dist/types/CreateCommunityTag.d.ts +10 -0
  35. package/dist/types/CreateMultiCommunity.d.ts +5 -0
  36. package/dist/types/CreateOrDeleteMultiCommunityEntry.d.ts +6 -0
  37. package/dist/types/CreatePost.d.ts +1 -1
  38. package/dist/types/CreateSite.d.ts +18 -14
  39. package/dist/types/CustomEmoji.d.ts +2 -2
  40. package/dist/types/DeleteCommunityTag.d.ts +7 -0
  41. package/dist/types/EditPost.d.ts +2 -2
  42. package/dist/types/EditSite.d.ts +26 -21
  43. package/dist/types/ExportDataResponse.d.ts +13 -0
  44. package/dist/types/FederationBlockList.d.ts +3 -3
  45. package/dist/types/FederationError.d.ts +3 -1
  46. package/dist/types/FollowMultiCommunity.d.ts +5 -0
  47. package/dist/types/GetComments.d.ts +3 -3
  48. package/dist/types/GetCommentsResponse.d.ts +3 -0
  49. package/dist/types/GetCommentsSlimResponse.d.ts +3 -0
  50. package/dist/types/GetModlog.d.ts +3 -2
  51. package/dist/types/GetModlogResponse.d.ts +6 -0
  52. package/dist/types/GetMultiCommunity.d.ts +4 -0
  53. package/dist/types/GetMultiCommunityResponse.d.ts +6 -0
  54. package/dist/types/GetPosts.d.ts +3 -9
  55. package/dist/types/GetPostsResponse.d.ts +1 -0
  56. package/dist/types/GetSiteResponse.d.ts +4 -2
  57. package/dist/types/Instance.d.ts +13 -3
  58. package/dist/types/InstanceActions.d.ts +18 -0
  59. package/dist/types/InstanceWithFederationState.d.ts +11 -2
  60. package/dist/types/LemmyErrorType.d.ts +94 -29
  61. package/dist/types/LikeType.d.ts +4 -0
  62. package/dist/types/ListCommentLikes.d.ts +3 -1
  63. package/dist/types/ListCommentLikesResponse.d.ts +6 -0
  64. package/dist/types/ListCommunities.d.ts +3 -1
  65. package/dist/types/ListCommunitiesResponse.d.ts +6 -0
  66. package/dist/types/ListCommunityPendingFollows.d.ts +3 -1
  67. package/dist/types/ListCommunityPendingFollows.js +0 -1
  68. package/dist/types/ListCommunityPendingFollowsResponse.d.ts +6 -0
  69. package/dist/types/ListCustomEmojis.d.ts +0 -3
  70. package/dist/types/ListMedia.d.ts +3 -1
  71. package/dist/types/ListMedia.js +0 -1
  72. package/dist/types/ListMediaResponse.d.ts +6 -0
  73. package/dist/types/ListMultiCommunities.d.ts +5 -0
  74. package/dist/types/ListMultiCommunitiesResponse.d.ts +4 -0
  75. package/dist/types/ListNotifications.d.ts +12 -0
  76. package/dist/types/ListNotificationsResponse.d.ts +13 -0
  77. package/dist/types/ListPersonContent.d.ts +3 -2
  78. package/dist/types/ListPersonContentResponse.d.ts +6 -0
  79. package/dist/types/ListPersonHidden.d.ts +9 -0
  80. package/dist/types/ListPersonHiddenResponse.d.ts +13 -0
  81. package/dist/types/ListPersonLiked.d.ts +13 -0
  82. package/dist/types/ListPersonLikedResponse.d.ts +13 -0
  83. package/dist/types/ListPersonRead.d.ts +9 -0
  84. package/dist/types/ListPersonReadResponse.d.ts +13 -0
  85. package/dist/types/ListPersonSaved.d.ts +3 -2
  86. package/dist/types/ListPersonSavedResponse.d.ts +8 -2
  87. package/dist/types/ListPostLikes.d.ts +3 -1
  88. package/dist/types/ListPostLikesResponse.d.ts +6 -0
  89. package/dist/types/ListRegistrationApplications.d.ts +3 -1
  90. package/dist/types/ListRegistrationApplications.js +0 -1
  91. package/dist/types/ListRegistrationApplicationsResponse.d.ts +6 -0
  92. package/dist/types/ListReports.d.ts +3 -2
  93. package/dist/types/ListReportsResponse.d.ts +6 -0
  94. package/dist/types/ListTaglines.d.ts +3 -1
  95. package/dist/types/ListTaglines.js +0 -1
  96. package/dist/types/ListTaglinesResponse.d.ts +6 -0
  97. package/dist/types/ListingType.d.ts +1 -1
  98. package/dist/types/LocalImage.d.ts +8 -3
  99. package/dist/types/LocalImageView.d.ts +2 -0
  100. package/dist/types/LocalSite.d.ts +30 -11
  101. package/dist/types/LocalSiteRateLimit.d.ts +16 -16
  102. package/dist/types/LocalSiteUrlBlocklist.d.ts +2 -2
  103. package/dist/types/LocalUser.d.ts +7 -1
  104. package/dist/types/LocalUserView.d.ts +1 -4
  105. package/dist/types/LockComment.d.ts +6 -0
  106. package/dist/types/LockComment.js +2 -0
  107. package/dist/types/LockPost.d.ts +1 -0
  108. package/dist/types/Login.d.ts +3 -0
  109. package/dist/types/LoginToken.d.ts +1 -1
  110. package/dist/types/MarkNotificationAsRead.d.ts +8 -0
  111. package/dist/types/MarkNotificationAsRead.js +2 -0
  112. package/dist/types/ModAdd.d.ts +1 -1
  113. package/dist/types/ModAddCommunity.d.ts +1 -1
  114. package/dist/types/ModBan.d.ts +4 -2
  115. package/dist/types/ModBanFromCommunity.d.ts +2 -2
  116. package/dist/types/ModChangeCommunityVisibility.d.ts +11 -0
  117. package/dist/types/ModChangeCommunityVisibility.js +2 -0
  118. package/dist/types/ModChangeCommunityVisibilityId.d.ts +1 -0
  119. package/dist/types/ModChangeCommunityVisibilityView.d.ts +11 -0
  120. package/dist/types/ModChangeCommunityVisibilityView.js +2 -0
  121. package/dist/types/ModEditPost.d.ts +10 -0
  122. package/dist/types/ModEditPost.js +2 -0
  123. package/dist/types/ModFeaturePost.d.ts +1 -1
  124. package/dist/types/ModLockComment.d.ts +14 -0
  125. package/dist/types/ModLockComment.js +2 -0
  126. package/dist/types/ModLockCommentId.d.ts +1 -0
  127. package/dist/types/ModLockCommentView.d.ts +14 -0
  128. package/dist/types/ModLockCommentView.js +2 -0
  129. package/dist/types/ModLockPost.d.ts +2 -1
  130. package/dist/types/ModRemoveComment.d.ts +1 -1
  131. package/dist/types/ModRemoveCommunity.d.ts +1 -1
  132. package/dist/types/ModRemovePost.d.ts +1 -1
  133. package/dist/types/ModTransferCommunity.d.ts +1 -1
  134. package/dist/types/ModlogActionType.d.ts +1 -1
  135. package/dist/types/ModlogCombinedView.d.ts +7 -4
  136. package/dist/types/MultiCommunity.d.ts +17 -0
  137. package/dist/types/MultiCommunity.js +2 -0
  138. package/dist/types/MultiCommunityFollow.d.ts +8 -0
  139. package/dist/types/MultiCommunityFollow.js +2 -0
  140. package/dist/types/MultiCommunityId.d.ts +1 -0
  141. package/dist/types/MultiCommunityView.d.ts +6 -0
  142. package/dist/types/MultiCommunityView.js +2 -0
  143. package/dist/types/MyUserInfo.d.ts +3 -1
  144. package/dist/types/NotePerson.d.ts +10 -0
  145. package/dist/types/NotePerson.js +2 -0
  146. package/dist/types/Notification.d.ts +16 -0
  147. package/dist/types/Notification.js +2 -0
  148. package/dist/types/NotificationData.d.ts +10 -0
  149. package/dist/types/NotificationData.js +2 -0
  150. package/dist/types/NotificationDataType.d.ts +4 -0
  151. package/dist/types/NotificationId.d.ts +1 -0
  152. package/dist/types/NotificationTypes.d.ts +4 -0
  153. package/dist/types/NotificationView.d.ts +6 -0
  154. package/dist/types/NotificationView.js +2 -0
  155. package/dist/types/OAuthAccount.d.ts +2 -2
  156. package/dist/types/OAuthProvider.d.ts +2 -2
  157. package/dist/types/PaginationCursor.d.ts +1 -4
  158. package/dist/types/PendingFollow.d.ts +2 -2
  159. package/dist/types/Person.d.ts +4 -10
  160. package/dist/types/PersonActions.d.ts +26 -0
  161. package/dist/types/PersonLikedCombinedView.d.ts +7 -0
  162. package/dist/types/PersonLikedCombinedView.js +2 -0
  163. package/dist/types/PersonSavedCombinedView.d.ts +7 -0
  164. package/dist/types/PersonSavedCombinedView.js +2 -0
  165. package/dist/types/PersonView.d.ts +3 -2
  166. package/dist/types/PluginMetadata.d.ts +5 -0
  167. package/dist/types/Post.d.ts +18 -3
  168. package/dist/types/PostActions.d.ts +33 -0
  169. package/dist/types/PostActions.js +2 -0
  170. package/dist/types/PostNotificationsMode.d.ts +4 -0
  171. package/dist/types/PostNotificationsMode.js +3 -0
  172. package/dist/types/PostOrCommentOrPrivateMessage.d.ts +10 -0
  173. package/dist/types/PostOrCommentOrPrivateMessage.js +2 -0
  174. package/dist/types/PostReport.d.ts +2 -2
  175. package/dist/types/PostReportView.d.ts +10 -16
  176. package/dist/types/PostView.d.ts +11 -18
  177. package/dist/types/PrivateMessage.d.ts +2 -3
  178. package/dist/types/PrivateMessageReport.d.ts +2 -2
  179. package/dist/types/PrivateMessageReportView.d.ts +3 -1
  180. package/dist/types/ReadableFederationState.d.ts +2 -2
  181. package/dist/types/RegistrationApplication.d.ts +1 -1
  182. package/dist/types/ResolveCommunityReport.d.ts +8 -0
  183. package/dist/types/ResolveCommunityReport.js +2 -0
  184. package/dist/types/SaveUserSettings.d.ts +7 -1
  185. package/dist/types/Search.d.ts +8 -3
  186. package/dist/types/SearchCombinedView.d.ts +4 -1
  187. package/dist/types/SearchResponse.d.ts +6 -0
  188. package/dist/types/SearchType.d.ts +1 -1
  189. package/dist/types/Site.d.ts +4 -3
  190. package/dist/types/SiteResponse.d.ts +0 -4
  191. package/dist/types/SiteView.d.ts +2 -2
  192. package/dist/types/Tag.d.ts +7 -13
  193. package/dist/types/Tagline.d.ts +4 -3
  194. package/dist/types/Tagline.js +0 -1
  195. package/dist/types/TagsView.d.ts +5 -0
  196. package/dist/types/TagsView.js +2 -0
  197. package/dist/types/UpdateCommunityNotifications.d.ts +9 -0
  198. package/dist/types/UpdateCommunityNotifications.js +2 -0
  199. package/dist/types/UpdateCommunityTag.d.ts +9 -0
  200. package/dist/types/UpdateCommunityTag.js +2 -0
  201. package/dist/types/UpdateMultiCommunity.d.ts +7 -0
  202. package/dist/types/UpdateMultiCommunity.js +2 -0
  203. package/dist/types/UpdatePostNotifications.d.ts +9 -0
  204. package/dist/types/UpdatePostNotifications.js +2 -0
  205. package/dist/types/UserBlockInstanceCommunitiesParams.d.ts +8 -0
  206. package/dist/types/UserBlockInstanceCommunitiesParams.js +2 -0
  207. package/dist/types/{UserBlockInstanceParams.d.ts → UserBlockInstancePersonsParams.d.ts} +2 -2
  208. package/dist/types/UserBlockInstancePersonsParams.js +2 -0
  209. package/dist/types/UserSettingsBackup.d.ts +31 -0
  210. package/dist/types/UserSettingsBackup.js +2 -0
  211. package/dist/types/VoteShow.d.ts +4 -0
  212. package/dist/types/VoteShow.js +3 -0
  213. package/dist/types/VoteView.d.ts +1 -0
  214. package/package.json +10 -6
  215. package/dist/types/BannedPersonsResponse.d.ts +0 -7
  216. package/dist/types/CommentAggregates.d.ts +0 -17
  217. package/dist/types/CommentReply.d.ts +0 -13
  218. package/dist/types/CommentReplyId.d.ts +0 -4
  219. package/dist/types/CommentReplyView.d.ts +0 -31
  220. package/dist/types/CommunityAggregates.d.ts +0 -30
  221. package/dist/types/InboxCombinedPaginationCursor.d.ts +0 -4
  222. package/dist/types/InboxCombinedView.d.ts +0 -13
  223. package/dist/types/InboxDataType.d.ts +0 -4
  224. package/dist/types/ListInbox.d.ts +0 -11
  225. package/dist/types/ListInboxResponse.d.ts +0 -7
  226. package/dist/types/LocalUserVoteDisplayMode.d.ts +0 -9
  227. package/dist/types/MarkCommentReplyAsRead.d.ts +0 -8
  228. package/dist/types/MarkPersonCommentMentionAsRead.d.ts +0 -8
  229. package/dist/types/MarkPersonPostMentionAsRead.d.ts +0 -8
  230. package/dist/types/ModHideCommunity.d.ts +0 -14
  231. package/dist/types/ModHideCommunityId.d.ts +0 -1
  232. package/dist/types/ModHideCommunityView.d.ts +0 -11
  233. package/dist/types/ModlogCombinedPaginationCursor.d.ts +0 -4
  234. package/dist/types/PersonAggregates.d.ts +0 -10
  235. package/dist/types/PersonCommentMention.d.ts +0 -13
  236. package/dist/types/PersonCommentMentionId.d.ts +0 -4
  237. package/dist/types/PersonCommentMentionView.d.ts +0 -31
  238. package/dist/types/PersonContentCombinedPaginationCursor.d.ts +0 -4
  239. package/dist/types/PersonPostMention.d.ts +0 -13
  240. package/dist/types/PersonPostMentionId.d.ts +0 -4
  241. package/dist/types/PersonPostMentionView.d.ts +0 -36
  242. package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +0 -4
  243. package/dist/types/PostAggregates.d.ts +0 -18
  244. package/dist/types/PostTags.d.ts +0 -7
  245. package/dist/types/ReportCombinedPaginationCursor.d.ts +0 -4
  246. package/dist/types/ResolveObjectResponse.d.ts +0 -13
  247. package/dist/types/SearchCombinedPaginationCursor.d.ts +0 -4
  248. package/dist/types/SiteAggregates.d.ts +0 -27
  249. package/dist/types/SubscribedType.d.ts +0 -4
  250. /package/dist/types/{BannedPersonsResponse.js → AdminListUsers.js} +0 -0
  251. /package/dist/types/{CommentAggregates.js → AdminListUsersResponse.js} +0 -0
  252. /package/dist/types/{CommentReplyId.js → CommentActions.js} +0 -0
  253. /package/dist/types/{CommentReply.js → CommunityActions.js} +0 -0
  254. /package/dist/types/{CommentReplyView.js → CommunityIdQuery.js} +0 -0
  255. /package/dist/types/{InboxCombinedPaginationCursor.js → CommunityNotificationsMode.js} +0 -0
  256. /package/dist/types/{CommunityAggregates.js → CommunityReportResponse.js} +0 -0
  257. /package/dist/types/{InboxCombinedView.js → CreateCommunityReport.js} +0 -0
  258. /package/dist/types/{ListInbox.js → CreateCommunityTag.js} +0 -0
  259. /package/dist/types/{InboxDataType.js → CreateMultiCommunity.js} +0 -0
  260. /package/dist/types/{ListInboxResponse.js → CreateOrDeleteMultiCommunityEntry.js} +0 -0
  261. /package/dist/types/{MarkCommentReplyAsRead.js → DeleteCommunityTag.js} +0 -0
  262. /package/dist/types/{MarkPersonCommentMentionAsRead.js → ExportDataResponse.js} +0 -0
  263. /package/dist/types/{MarkPersonPostMentionAsRead.js → FollowMultiCommunity.js} +0 -0
  264. /package/dist/types/{ModHideCommunity.js → GetMultiCommunity.js} +0 -0
  265. /package/dist/types/{ModHideCommunityView.js → GetMultiCommunityResponse.js} +0 -0
  266. /package/dist/types/{LocalUserVoteDisplayMode.js → InstanceActions.js} +0 -0
  267. /package/dist/types/{ModHideCommunityId.js → LikeType.js} +0 -0
  268. /package/dist/types/{PersonAggregates.js → ListMultiCommunities.js} +0 -0
  269. /package/dist/types/{PersonCommentMention.js → ListMultiCommunitiesResponse.js} +0 -0
  270. /package/dist/types/{PersonCommentMentionView.js → ListNotifications.js} +0 -0
  271. /package/dist/types/{PersonPostMention.js → ListNotificationsResponse.js} +0 -0
  272. /package/dist/types/{PersonPostMentionView.js → ListPersonHidden.js} +0 -0
  273. /package/dist/types/{PostAggregates.js → ListPersonHiddenResponse.js} +0 -0
  274. /package/dist/types/{PostTags.js → ListPersonLiked.js} +0 -0
  275. /package/dist/types/{ResolveObjectResponse.js → ListPersonLikedResponse.js} +0 -0
  276. /package/dist/types/{SiteAggregates.js → ListPersonRead.js} +0 -0
  277. /package/dist/types/{UserBlockInstanceParams.js → ListPersonReadResponse.js} +0 -0
  278. /package/dist/types/{ModlogCombinedPaginationCursor.js → ModChangeCommunityVisibilityId.js} +0 -0
  279. /package/dist/types/{PersonCommentMentionId.js → ModLockCommentId.js} +0 -0
  280. /package/dist/types/{PersonContentCombinedPaginationCursor.js → MultiCommunityId.js} +0 -0
  281. /package/dist/types/{PersonPostMentionId.js → NotificationDataType.js} +0 -0
  282. /package/dist/types/{PersonSavedCombinedPaginationCursor.js → NotificationId.js} +0 -0
  283. /package/dist/types/{ReportCombinedPaginationCursor.js → NotificationTypes.js} +0 -0
  284. /package/dist/types/{SearchCombinedPaginationCursor.js → PersonActions.js} +0 -0
  285. /package/dist/types/{SubscribedType.js → PluginMetadata.js} +0 -0
@@ -0,0 +1,9 @@
1
+ import type { TagId } from "./TagId";
2
+ /**
3
+ * Make changes to a community tag
4
+ */
5
+ export type UpdateCommunityTag = {
6
+ tag_id: TagId;
7
+ display_name?: string;
8
+ description?: string;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import type { MultiCommunityId } from "./MultiCommunityId";
2
+ export type UpdateMultiCommunity = {
3
+ id: MultiCommunityId;
4
+ title?: string;
5
+ description?: string;
6
+ deleted?: boolean;
7
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type { PostId } from "./PostId";
2
+ import type { PostNotificationsMode } from "./PostNotificationsMode";
3
+ /**
4
+ * Change notification settings for a post
5
+ */
6
+ export type UpdatePostNotifications = {
7
+ post_id: PostId;
8
+ mode: PostNotificationsMode;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ import type { InstanceId } from "./InstanceId";
2
+ /**
3
+ * Block an instance's communities.
4
+ */
5
+ export type UserBlockInstanceCommunitiesParams = {
6
+ instance_id: InstanceId;
7
+ block: boolean;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +1,8 @@
1
1
  import type { InstanceId } from "./InstanceId";
2
2
  /**
3
- * Block an instance as user
3
+ * Block an instance's persons.
4
4
  */
5
- export type UserBlockInstanceParams = {
5
+ export type UserBlockInstancePersonsParams = {
6
6
  instance_id: InstanceId;
7
7
  block: boolean;
8
8
  };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ import type { LocalUser } from "./LocalUser";
2
+ /**
3
+ * Backup of user data. This struct should never be changed so that the data can be used as a
4
+ * long-term backup in case the instance goes down unexpectedly. All fields are optional to allow
5
+ * importing partial backups.
6
+ *
7
+ * This data should not be parsed by apps/clients, but directly downloaded as a file.
8
+ *
9
+ * Be careful with any changes to this struct, to avoid breaking changes which could prevent
10
+ * importing older backups.
11
+ */
12
+ export type UserSettingsBackup = {
13
+ display_name?: string;
14
+ bio?: string;
15
+ avatar?: string;
16
+ banner?: string;
17
+ matrix_id?: string;
18
+ bot_account?: boolean;
19
+ settings?: LocalUser;
20
+ followed_communities: Array<string>;
21
+ saved_posts: Array<string>;
22
+ saved_comments: Array<string>;
23
+ blocked_communities: Array<string>;
24
+ blocked_users: Array<string>;
25
+ /**
26
+ * Only kept for v0.19 compatibility
27
+ */
28
+ blocked_instances: Array<string>;
29
+ blocked_instances_communities: Array<string>;
30
+ blocked_instances_persons: Array<string>;
31
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Lets you show votes for others only, show all votes, or hide all votes.
3
+ */
4
+ export type VoteShow = "Show" | "ShowForOthers" | "Hide";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,6 +4,7 @@ import type { Person } from "./Person";
4
4
  */
5
5
  export type VoteView = {
6
6
  creator: Person;
7
+ creator_banned: boolean;
7
8
  creator_banned_from_community: boolean;
8
9
  score: number;
9
10
  };
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-block-nsfw.1",
4
+ "version": "1.0.0-comment-lock.0",
5
5
  "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
@@ -19,28 +19,32 @@
19
19
  "type": "git",
20
20
  "url": "git+https://github.com/LemmyNet/lemmy-js-client.git"
21
21
  },
22
+ "dependencies": {
23
+ "@tsoa/runtime": "^6.6.0"
24
+ },
22
25
  "devDependencies": {
23
26
  "@eslint/js": "^9.20.0",
24
- "@redocly/cli": "^1.27.2",
25
- "@types/joi": "^17.2.3",
27
+ "@redocly/cli": "^2.0.0",
26
28
  "@types/node": "^22.7.4",
27
29
  "@typescript-eslint/eslint-plugin": "^8.7.0",
28
30
  "@typescript-eslint/parser": "^8.7.0",
31
+ "ajv": "^8.17.1",
29
32
  "eslint": "^9.11.1",
30
33
  "eslint-plugin-prettier": "^5.2.1",
31
34
  "husky": "^9.1.4",
32
- "lint-staged": "^15.2.7",
35
+ "joi": "^17.13.3",
36
+ "lint-staged": "^16.0.0",
33
37
  "prettier": "^3.3.3",
34
38
  "prettier-plugin-import-sort": "^0.0.7",
35
39
  "prettier-plugin-organize-imports": "^4.0.0",
36
40
  "prettier-plugin-packagejson": "^2.5.1",
37
41
  "sortpack": "^2.4.0",
38
42
  "tsoa": "^6.6.0",
39
- "typedoc": "^0.27.0",
43
+ "typedoc": "^0.28.0",
40
44
  "typescript": "^5.5.4",
41
45
  "typescript-eslint": "^8.7.0"
42
46
  },
43
- "packageManager": "pnpm@10.4.0",
47
+ "packageManager": "pnpm@10.14.0",
44
48
  "types": "./dist/index.d.ts",
45
49
  "lint-staged": {
46
50
  "*.{ts,tsx,js}": [
@@ -1,7 +0,0 @@
1
- import type { PersonView } from "./PersonView";
2
- /**
3
- * The list of banned persons.
4
- */
5
- export type BannedPersonsResponse = {
6
- banned: Array<PersonView>;
7
- };
@@ -1,17 +0,0 @@
1
- import type { CommentId } from "./CommentId";
2
- /**
3
- * Aggregate data for a comment.
4
- */
5
- export type CommentAggregates = {
6
- comment_id: CommentId;
7
- score: number;
8
- upvotes: number;
9
- downvotes: number;
10
- published: string;
11
- /**
12
- * The total number of children in this comment branch.
13
- */
14
- child_count: number;
15
- report_count: number;
16
- unresolved_report_count: number;
17
- };
@@ -1,13 +0,0 @@
1
- import type { CommentId } from "./CommentId";
2
- import type { CommentReplyId } from "./CommentReplyId";
3
- import type { PersonId } from "./PersonId";
4
- /**
5
- * A comment reply.
6
- */
7
- export type CommentReply = {
8
- id: CommentReplyId;
9
- recipient_id: PersonId;
10
- comment_id: CommentId;
11
- read: boolean;
12
- published: string;
13
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * The comment reply id.
3
- */
4
- export type CommentReplyId = number;
@@ -1,31 +0,0 @@
1
- import type { Comment } from "./Comment";
2
- import type { CommentAggregates } from "./CommentAggregates";
3
- import type { CommentReply } from "./CommentReply";
4
- import type { Community } from "./Community";
5
- import type { Person } from "./Person";
6
- import type { Post } from "./Post";
7
- import type { SubscribedType } from "./SubscribedType";
8
- /**
9
- * A comment reply view.
10
- */
11
- export type CommentReplyView = {
12
- comment_reply: CommentReply;
13
- comment: Comment;
14
- creator: Person;
15
- post: Post;
16
- community: Community;
17
- recipient: Person;
18
- counts: CommentAggregates;
19
- creator_banned_from_community: boolean;
20
- banned_from_community: boolean;
21
- creator_is_moderator: boolean;
22
- creator_is_admin: boolean;
23
- subscribed: SubscribedType;
24
- /**
25
- * The time when the comment was saved.
26
- */
27
- saved?: string;
28
- creator_blocked: boolean;
29
- my_vote?: number;
30
- can_mod: boolean;
31
- };
@@ -1,30 +0,0 @@
1
- import type { CommunityId } from "./CommunityId";
2
- /**
3
- * Aggregate data for a community.
4
- */
5
- export type CommunityAggregates = {
6
- community_id: CommunityId;
7
- subscribers: number;
8
- posts: number;
9
- comments: number;
10
- published: string;
11
- /**
12
- * The number of users with any activity in the last day.
13
- */
14
- users_active_day: number;
15
- /**
16
- * The number of users with any activity in the last week.
17
- */
18
- users_active_week: number;
19
- /**
20
- * The number of users with any activity in the last month.
21
- */
22
- users_active_month: number;
23
- /**
24
- * The number of users with any activity in the last year.
25
- */
26
- users_active_half_year: number;
27
- subscribers_local: number;
28
- report_count: number;
29
- unresolved_report_count: number;
30
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * like PaginationCursor but for the report_combined table
3
- */
4
- export type InboxCombinedPaginationCursor = string;
@@ -1,13 +0,0 @@
1
- import type { CommentReplyView } from "./CommentReplyView";
2
- import type { PersonCommentMentionView } from "./PersonCommentMentionView";
3
- import type { PersonPostMentionView } from "./PersonPostMentionView";
4
- import type { PrivateMessageView } from "./PrivateMessageView";
5
- export type InboxCombinedView = ({
6
- type_: "CommentReply";
7
- } & CommentReplyView) | ({
8
- type_: "CommentMention";
9
- } & PersonCommentMentionView) | ({
10
- type_: "PostMention";
11
- } & PersonPostMentionView) | ({
12
- type_: "PrivateMessage";
13
- } & PrivateMessageView);
@@ -1,4 +0,0 @@
1
- /**
2
- * A list of possible types for the inbox.
3
- */
4
- export type InboxDataType = "All" | "CommentReply" | "CommentMention" | "PostMention" | "PrivateMessage";
@@ -1,11 +0,0 @@
1
- import type { InboxCombinedPaginationCursor } from "./InboxCombinedPaginationCursor";
2
- import type { InboxDataType } from "./InboxDataType";
3
- /**
4
- * Get your inbox (replies, comment mentions, post mentions, and messages)
5
- */
6
- export type ListInbox = {
7
- type_?: InboxDataType;
8
- unread_only?: boolean;
9
- page_cursor?: InboxCombinedPaginationCursor;
10
- page_back?: boolean;
11
- };
@@ -1,7 +0,0 @@
1
- import type { InboxCombinedView } from "./InboxCombinedView";
2
- /**
3
- * Get your inbox (replies, comment mentions, post mentions, and messages)
4
- */
5
- export type ListInboxResponse = {
6
- inbox: Array<InboxCombinedView>;
7
- };
@@ -1,9 +0,0 @@
1
- /**
2
- * The vote display settings for your user.
3
- */
4
- export type LocalUserVoteDisplayMode = {
5
- score: boolean;
6
- upvotes: boolean;
7
- downvotes: boolean;
8
- upvote_percentage: boolean;
9
- };
@@ -1,8 +0,0 @@
1
- import type { CommentReplyId } from "./CommentReplyId";
2
- /**
3
- * Mark a comment reply as read.
4
- */
5
- export type MarkCommentReplyAsRead = {
6
- comment_reply_id: CommentReplyId;
7
- read: boolean;
8
- };
@@ -1,8 +0,0 @@
1
- import type { PersonCommentMentionId } from "./PersonCommentMentionId";
2
- /**
3
- * Mark a person mention as read.
4
- */
5
- export type MarkPersonCommentMentionAsRead = {
6
- person_comment_mention_id: PersonCommentMentionId;
7
- read: boolean;
8
- };
@@ -1,8 +0,0 @@
1
- import type { PersonPostMentionId } from "./PersonPostMentionId";
2
- /**
3
- * Mark a person mention as read.
4
- */
5
- export type MarkPersonPostMentionAsRead = {
6
- person_post_mention_id: PersonPostMentionId;
7
- read: boolean;
8
- };
@@ -1,14 +0,0 @@
1
- import type { CommunityId } from "./CommunityId";
2
- import type { ModHideCommunityId } from "./ModHideCommunityId";
3
- import type { PersonId } from "./PersonId";
4
- /**
5
- * When a community is hidden from public view.
6
- */
7
- export type ModHideCommunity = {
8
- id: ModHideCommunityId;
9
- community_id: CommunityId;
10
- mod_person_id: PersonId;
11
- published: string;
12
- reason?: string;
13
- hidden: boolean;
14
- };
@@ -1 +0,0 @@
1
- export type ModHideCommunityId = number;
@@ -1,11 +0,0 @@
1
- import type { Community } from "./Community";
2
- import type { ModHideCommunity } from "./ModHideCommunity";
3
- import type { Person } from "./Person";
4
- /**
5
- * When a community is hidden from public view.
6
- */
7
- export type ModHideCommunityView = {
8
- mod_hide_community: ModHideCommunity;
9
- admin?: Person;
10
- community: Community;
11
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * like PaginationCursor but for the modlog_combined
3
- */
4
- export type ModlogCombinedPaginationCursor = string;
@@ -1,10 +0,0 @@
1
- import type { PersonId } from "./PersonId";
2
- /**
3
- * Aggregate data for a person.
4
- */
5
- export type PersonAggregates = {
6
- person_id: PersonId;
7
- post_count: number;
8
- comment_count: number;
9
- published: string;
10
- };
@@ -1,13 +0,0 @@
1
- import type { CommentId } from "./CommentId";
2
- import type { PersonCommentMentionId } from "./PersonCommentMentionId";
3
- import type { PersonId } from "./PersonId";
4
- /**
5
- * A person mention.
6
- */
7
- export type PersonCommentMention = {
8
- id: PersonCommentMentionId;
9
- recipient_id: PersonId;
10
- comment_id: CommentId;
11
- read: boolean;
12
- published: string;
13
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * The person comment mention id.
3
- */
4
- export type PersonCommentMentionId = number;
@@ -1,31 +0,0 @@
1
- import type { Comment } from "./Comment";
2
- import type { CommentAggregates } from "./CommentAggregates";
3
- import type { Community } from "./Community";
4
- import type { Person } from "./Person";
5
- import type { PersonCommentMention } from "./PersonCommentMention";
6
- import type { Post } from "./Post";
7
- import type { SubscribedType } from "./SubscribedType";
8
- /**
9
- * A person comment mention view.
10
- */
11
- export type PersonCommentMentionView = {
12
- person_comment_mention: PersonCommentMention;
13
- comment: Comment;
14
- creator: Person;
15
- post: Post;
16
- community: Community;
17
- recipient: Person;
18
- counts: CommentAggregates;
19
- creator_banned_from_community: boolean;
20
- banned_from_community: boolean;
21
- creator_is_moderator: boolean;
22
- creator_is_admin: boolean;
23
- subscribed: SubscribedType;
24
- /**
25
- * The time when the comment was saved.
26
- */
27
- saved?: string;
28
- creator_blocked: boolean;
29
- my_vote?: number;
30
- can_mod: boolean;
31
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * like PaginationCursor but for the person_content_combined table
3
- */
4
- export type PersonContentCombinedPaginationCursor = string;
@@ -1,13 +0,0 @@
1
- import type { PersonId } from "./PersonId";
2
- import type { PersonPostMentionId } from "./PersonPostMentionId";
3
- import type { PostId } from "./PostId";
4
- /**
5
- * A person mention.
6
- */
7
- export type PersonPostMention = {
8
- id: PersonPostMentionId;
9
- recipient_id: PersonId;
10
- post_id: PostId;
11
- read: boolean;
12
- published: string;
13
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * The person post mention id.
3
- */
4
- export type PersonPostMentionId = number;
@@ -1,36 +0,0 @@
1
- import type { Community } from "./Community";
2
- import type { ImageDetails } from "./ImageDetails";
3
- import type { Person } from "./Person";
4
- import type { PersonPostMention } from "./PersonPostMention";
5
- import type { Post } from "./Post";
6
- import type { PostAggregates } from "./PostAggregates";
7
- import type { PostTags } from "./PostTags";
8
- import type { SubscribedType } from "./SubscribedType";
9
- /**
10
- * A person post mention view.
11
- */
12
- export type PersonPostMentionView = {
13
- person_post_mention: PersonPostMention;
14
- post: Post;
15
- creator: Person;
16
- community: Community;
17
- image_details?: ImageDetails;
18
- recipient: Person;
19
- counts: PostAggregates;
20
- creator_banned_from_community: boolean;
21
- banned_from_community: boolean;
22
- creator_is_moderator: boolean;
23
- creator_is_admin: boolean;
24
- subscribed: SubscribedType;
25
- /**
26
- * The time when the post was saved.
27
- */
28
- saved?: string;
29
- read: boolean;
30
- hidden: boolean;
31
- creator_blocked: boolean;
32
- my_vote?: number;
33
- unread_comments: number;
34
- post_tags: PostTags;
35
- can_mod: boolean;
36
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * like PaginationCursor but for the person_saved_combined table
3
- */
4
- export type PersonSavedCombinedPaginationCursor = string;
@@ -1,18 +0,0 @@
1
- import type { PostId } from "./PostId";
2
- /**
3
- * Aggregate data for a post.
4
- */
5
- export type PostAggregates = {
6
- post_id: PostId;
7
- comments: number;
8
- score: number;
9
- upvotes: number;
10
- downvotes: number;
11
- published: string;
12
- /**
13
- * The time of the newest comment in the post.
14
- */
15
- newest_comment_time: string;
16
- report_count: number;
17
- unresolved_report_count: number;
18
- };
@@ -1,7 +0,0 @@
1
- import type { Tag } from "./Tag";
2
- /**
3
- * we wrap this in a struct so we can implement FromSqlRow<Json> for it
4
- */
5
- export type PostTags = {
6
- tags: Array<Tag>;
7
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * like PaginationCursor but for the report_combined table
3
- */
4
- export type ReportCombinedPaginationCursor = string;
@@ -1,13 +0,0 @@
1
- import type { CommentView } from "./CommentView";
2
- import type { CommunityView } from "./CommunityView";
3
- import type { PersonView } from "./PersonView";
4
- import type { PostView } from "./PostView";
5
- /**
6
- * The response of an apub object fetch.
7
- */
8
- export type ResolveObjectResponse = {
9
- comment?: CommentView;
10
- post?: PostView;
11
- community?: CommunityView;
12
- person?: PersonView;
13
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * like PaginationCursor but for the modlog_combined
3
- */
4
- export type SearchCombinedPaginationCursor = string;
@@ -1,27 +0,0 @@
1
- import type { SiteId } from "./SiteId";
2
- /**
3
- * Aggregate data for a site.
4
- */
5
- export type SiteAggregates = {
6
- site_id: SiteId;
7
- users: number;
8
- posts: number;
9
- comments: number;
10
- communities: number;
11
- /**
12
- * The number of users with any activity in the last day.
13
- */
14
- users_active_day: number;
15
- /**
16
- * The number of users with any activity in the last week.
17
- */
18
- users_active_week: number;
19
- /**
20
- * The number of users with any activity in the last month.
21
- */
22
- users_active_month: number;
23
- /**
24
- * The number of users with any activity in the last half year.
25
- */
26
- users_active_half_year: number;
27
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * A type / status for a community subscribe.
3
- */
4
- export type SubscribedType = "Subscribed" | "NotSubscribed" | "Pending" | "ApprovalRequired";