lemmy-js-client 0.20.0-reports-combined.3 → 0.20.0-show-mod-reports.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. package/README.md +1 -1
  2. package/dist/http.d.ts +229 -411
  3. package/dist/http.js +1208 -390
  4. package/dist/index.d.ts +57 -16
  5. package/dist/other_types.d.ts +80 -16
  6. package/dist/types/AdminAllowInstance.d.ts +3 -2
  7. package/dist/types/AdminAllowInstanceId.d.ts +1 -0
  8. package/dist/types/AdminAllowInstanceView.d.ts +1 -1
  9. package/dist/types/AdminBlockInstance.d.ts +3 -2
  10. package/dist/types/AdminBlockInstanceId.d.ts +1 -0
  11. package/dist/types/AdminPurgeComment.d.ts +3 -2
  12. package/dist/types/AdminPurgeCommentId.d.ts +1 -0
  13. package/dist/types/AdminPurgeCommentId.js +3 -0
  14. package/dist/types/AdminPurgeCommunity.d.ts +3 -2
  15. package/dist/types/AdminPurgeCommunityId.d.ts +1 -0
  16. package/dist/types/AdminPurgeCommunityId.js +3 -0
  17. package/dist/types/AdminPurgePerson.d.ts +3 -2
  18. package/dist/types/AdminPurgePersonId.d.ts +1 -0
  19. package/dist/types/AdminPurgePersonId.js +3 -0
  20. package/dist/types/AdminPurgePost.d.ts +3 -2
  21. package/dist/types/AdminPurgePostId.d.ts +1 -0
  22. package/dist/types/AdminPurgePostId.js +3 -0
  23. package/dist/types/CommentSlimView.d.ts +20 -0
  24. package/dist/types/Community.d.ts +2 -2
  25. package/dist/types/CommunityAggregates.d.ts +2 -0
  26. package/dist/types/CommunityReport.d.ts +22 -0
  27. package/dist/types/CommunityReportId.d.ts +4 -0
  28. package/dist/types/CommunityReportId.js +3 -0
  29. package/dist/types/CommunityReportView.d.ts +16 -0
  30. package/dist/types/CreatePost.d.ts +2 -0
  31. package/dist/types/CreateSite.d.ts +1 -4
  32. package/dist/types/DeleteImageParams.d.ts +3 -0
  33. package/dist/types/DeleteImageParams.js +3 -0
  34. package/dist/types/EditCommunity.d.ts +0 -8
  35. package/dist/types/EditPost.d.ts +2 -0
  36. package/dist/types/EditSite.d.ts +5 -16
  37. package/dist/types/FederationError.d.ts +1 -1
  38. package/dist/types/GetComments.d.ts +0 -1
  39. package/dist/types/GetCommentsSlimResponse.d.ts +7 -0
  40. package/dist/types/GetModlog.d.ts +3 -2
  41. package/dist/types/GetModlogResponse.d.ts +2 -34
  42. package/dist/types/GetPersonDetails.d.ts +0 -7
  43. package/dist/types/GetPersonDetailsResponse.d.ts +0 -4
  44. package/dist/types/GetPosts.d.ts +5 -0
  45. package/dist/types/GetRandomCommunity.d.ts +1 -0
  46. package/dist/types/GetSiteResponse.d.ts +1 -8
  47. package/dist/types/GetUnreadCountResponse.d.ts +2 -4
  48. package/dist/types/ImageGetParams.d.ts +4 -0
  49. package/dist/types/ImageGetParams.js +3 -0
  50. package/dist/types/ImageProxyParams.d.ts +5 -0
  51. package/dist/types/ImageProxyParams.js +3 -0
  52. package/dist/types/InboxCombinedPaginationCursor.d.ts +4 -0
  53. package/dist/types/InboxCombinedPaginationCursor.js +3 -0
  54. package/dist/types/InboxCombinedView.d.ts +13 -0
  55. package/dist/types/InboxDataType.d.ts +4 -0
  56. package/dist/types/InboxDataType.js +3 -0
  57. package/dist/types/LemmyErrorType.d.ts +5 -3
  58. package/dist/types/ListInbox.d.ts +11 -0
  59. package/dist/types/ListInboxResponse.d.ts +7 -0
  60. package/dist/types/ListPersonContent.d.ts +18 -0
  61. package/dist/types/ListPersonContentResponse.d.ts +7 -0
  62. package/dist/types/ListPersonSaved.d.ts +10 -0
  63. package/dist/types/ListPersonSavedResponse.d.ts +7 -0
  64. package/dist/types/ListReports.d.ts +14 -0
  65. package/dist/types/LocalImage.d.ts +0 -1
  66. package/dist/types/LocalSite.d.ts +5 -0
  67. package/dist/types/LocalUser.d.ts +9 -0
  68. package/dist/types/MarkPersonCommentMentionAsRead.d.ts +8 -0
  69. package/dist/types/MarkPersonPostMentionAsRead.d.ts +8 -0
  70. package/dist/types/ModAdd.d.ts +3 -2
  71. package/dist/types/ModAddCommunity.d.ts +3 -2
  72. package/dist/types/ModAddCommunityId.d.ts +1 -0
  73. package/dist/types/ModAddCommunityId.js +3 -0
  74. package/dist/types/ModAddCommunityView.d.ts +1 -1
  75. package/dist/types/ModAddId.d.ts +1 -0
  76. package/dist/types/ModAddId.js +3 -0
  77. package/dist/types/ModAddView.d.ts +1 -1
  78. package/dist/types/ModBan.d.ts +3 -2
  79. package/dist/types/ModBanFromCommunity.d.ts +3 -2
  80. package/dist/types/ModBanFromCommunityId.d.ts +1 -0
  81. package/dist/types/ModBanFromCommunityId.js +3 -0
  82. package/dist/types/ModBanFromCommunityView.d.ts +1 -1
  83. package/dist/types/ModBanId.d.ts +1 -0
  84. package/dist/types/ModBanId.js +3 -0
  85. package/dist/types/ModBanView.d.ts +1 -1
  86. package/dist/types/ModFeaturePost.d.ts +3 -2
  87. package/dist/types/ModFeaturePostId.d.ts +1 -0
  88. package/dist/types/ModFeaturePostId.js +3 -0
  89. package/dist/types/ModFeaturePostView.d.ts +1 -0
  90. package/dist/types/ModHideCommunity.d.ts +3 -2
  91. package/dist/types/ModHideCommunityId.d.ts +1 -0
  92. package/dist/types/ModHideCommunityId.js +3 -0
  93. package/dist/types/ModLockPost.d.ts +3 -2
  94. package/dist/types/ModLockPostId.d.ts +1 -0
  95. package/dist/types/ModLockPostId.js +3 -0
  96. package/dist/types/ModLockPostView.d.ts +1 -0
  97. package/dist/types/ModRemoveComment.d.ts +3 -2
  98. package/dist/types/ModRemoveCommentId.d.ts +1 -0
  99. package/dist/types/ModRemoveCommentId.js +3 -0
  100. package/dist/types/ModRemoveCommentView.d.ts +1 -1
  101. package/dist/types/ModRemoveCommunity.d.ts +3 -2
  102. package/dist/types/ModRemoveCommunityId.d.ts +1 -0
  103. package/dist/types/ModRemoveCommunityId.js +3 -0
  104. package/dist/types/ModRemovePost.d.ts +3 -2
  105. package/dist/types/ModRemovePostId.d.ts +1 -0
  106. package/dist/types/ModRemovePostId.js +3 -0
  107. package/dist/types/ModRemovePostView.d.ts +1 -0
  108. package/dist/types/ModTransferCommunity.d.ts +3 -2
  109. package/dist/types/ModTransferCommunityId.d.ts +1 -0
  110. package/dist/types/ModTransferCommunityId.js +3 -0
  111. package/dist/types/ModTransferCommunityView.d.ts +1 -1
  112. package/dist/types/ModlogCombinedPaginationCursor.d.ts +4 -0
  113. package/dist/types/ModlogCombinedPaginationCursor.js +3 -0
  114. package/dist/types/ModlogCombinedView.d.ts +52 -0
  115. package/dist/types/ModlogCombinedView.js +2 -0
  116. package/dist/types/Person.d.ts +2 -2
  117. package/dist/types/{PersonMention.d.ts → PersonCommentMention.d.ts} +3 -3
  118. package/dist/types/PersonCommentMention.js +2 -0
  119. package/dist/types/PersonCommentMentionId.d.ts +4 -0
  120. package/dist/types/PersonCommentMentionId.js +3 -0
  121. package/dist/types/{PersonMentionView.d.ts → PersonCommentMentionView.d.ts} +4 -4
  122. package/dist/types/PersonCommentMentionView.js +2 -0
  123. package/dist/types/PersonContentCombinedPaginationCursor.d.ts +4 -0
  124. package/dist/types/PersonContentCombinedPaginationCursor.js +3 -0
  125. package/dist/types/PersonContentCombinedView.d.ts +7 -0
  126. package/dist/types/PersonContentCombinedView.js +2 -0
  127. package/dist/types/PersonContentType.d.ts +4 -0
  128. package/dist/types/PersonContentType.js +3 -0
  129. package/dist/types/PersonPostMention.d.ts +13 -0
  130. package/dist/types/PersonPostMention.js +2 -0
  131. package/dist/types/PersonPostMentionId.d.ts +4 -0
  132. package/dist/types/PersonPostMentionId.js +3 -0
  133. package/dist/types/PersonPostMentionView.d.ts +32 -0
  134. package/dist/types/PersonPostMentionView.js +2 -0
  135. package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +4 -0
  136. package/dist/types/PersonSavedCombinedPaginationCursor.js +3 -0
  137. package/dist/types/PostTags.d.ts +7 -0
  138. package/dist/types/PostTags.js +2 -0
  139. package/dist/types/PostView.d.ts +2 -0
  140. package/dist/types/ReportCombinedView.d.ts +4 -1
  141. package/dist/types/ReportType.d.ts +4 -0
  142. package/dist/types/ReportType.js +3 -0
  143. package/dist/types/SaveUserSettings.d.ts +4 -8
  144. package/dist/types/Search.d.ts +7 -7
  145. package/dist/types/SearchCombinedPaginationCursor.d.ts +4 -0
  146. package/dist/types/SearchCombinedPaginationCursor.js +3 -0
  147. package/dist/types/SearchCombinedView.d.ts +13 -0
  148. package/dist/types/SearchCombinedView.js +2 -0
  149. package/dist/types/SearchResponse.d.ts +2 -10
  150. package/dist/types/SearchSortType.d.ts +4 -0
  151. package/dist/types/SearchSortType.js +3 -0
  152. package/dist/types/Site.d.ts +2 -2
  153. package/dist/types/SiteResponse.d.ts +1 -1
  154. package/dist/types/SuccessResponse.d.ts +1 -1
  155. package/dist/types/Tag.d.ts +27 -0
  156. package/dist/types/Tag.js +2 -0
  157. package/dist/types/TagId.d.ts +4 -0
  158. package/dist/types/TagId.js +3 -0
  159. package/dist/types/UploadImageResponse.d.ts +4 -0
  160. package/dist/types/UploadImageResponse.js +3 -0
  161. package/package.json +8 -4
  162. package/dist/types/CommentReplyResponse.d.ts +0 -7
  163. package/dist/types/GetPersonMentions.d.ts +0 -10
  164. package/dist/types/GetPersonMentionsResponse.d.ts +0 -7
  165. package/dist/types/GetPrivateMessages.d.ts +0 -10
  166. package/dist/types/GetReplies.d.ts +0 -10
  167. package/dist/types/GetRepliesResponse.d.ts +0 -7
  168. package/dist/types/MarkPersonMentionAsRead.d.ts +0 -8
  169. package/dist/types/ModlogListParams.d.ts +0 -17
  170. package/dist/types/PersonMentionId.d.ts +0 -4
  171. package/dist/types/PersonMentionResponse.d.ts +0 -7
  172. package/dist/types/PrivateMessagesResponse.d.ts +0 -7
  173. package/dist/types/ReportCombined.d.ts +0 -14
  174. package/dist/types/ReportCombinedId.d.ts +0 -4
  175. /package/dist/types/{PersonMentionId.js → AdminAllowInstanceId.js} +0 -0
  176. /package/dist/types/{ReportCombinedId.js → AdminBlockInstanceId.js} +0 -0
  177. /package/dist/types/{CommentReplyResponse.js → CommentSlimView.js} +0 -0
  178. /package/dist/types/{GetPersonMentions.js → CommunityReport.js} +0 -0
  179. /package/dist/types/{GetPersonMentionsResponse.js → CommunityReportView.js} +0 -0
  180. /package/dist/types/{GetPrivateMessages.js → GetCommentsSlimResponse.js} +0 -0
  181. /package/dist/types/{GetReplies.js → InboxCombinedView.js} +0 -0
  182. /package/dist/types/{GetRepliesResponse.js → ListInbox.js} +0 -0
  183. /package/dist/types/{MarkPersonMentionAsRead.js → ListInboxResponse.js} +0 -0
  184. /package/dist/types/{ModlogListParams.js → ListPersonContent.js} +0 -0
  185. /package/dist/types/{PersonMention.js → ListPersonContentResponse.js} +0 -0
  186. /package/dist/types/{PersonMentionResponse.js → ListPersonSaved.js} +0 -0
  187. /package/dist/types/{PersonMentionView.js → ListPersonSavedResponse.js} +0 -0
  188. /package/dist/types/{PrivateMessagesResponse.js → MarkPersonCommentMentionAsRead.js} +0 -0
  189. /package/dist/types/{ReportCombined.js → MarkPersonPostMentionAsRead.js} +0 -0
@@ -1,15 +1,7 @@
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
- import type { SearchType } from "./SearchType";
1
+ import type { SearchCombinedView } from "./SearchCombinedView";
6
2
  /**
7
3
  * The search response, containing lists of the return type possibilities
8
4
  */
9
5
  export type SearchResponse = {
10
- type_: SearchType;
11
- comments: Array<CommentView>;
12
- posts: Array<PostView>;
13
- communities: Array<CommunityView>;
14
- users: Array<PersonView>;
6
+ results: Array<SearchCombinedView>;
15
7
  };
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The search sort types.
3
+ */
4
+ export type SearchSortType = "New" | "Top" | "Old";
@@ -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 });
@@ -26,9 +26,9 @@ export type Site = {
26
26
  */
27
27
  description?: string;
28
28
  /**
29
- * The federated actor_id.
29
+ * The federated ap_id.
30
30
  */
31
- actor_id: DbUrl;
31
+ ap_id: DbUrl;
32
32
  /**
33
33
  * The time the site was last refreshed.
34
34
  */
@@ -5,7 +5,7 @@ import type { SiteView } from "./SiteView";
5
5
  export type SiteResponse = {
6
6
  site_view: SiteView;
7
7
  /**
8
- * deprecated, use field `tagline` or /api/v3/tagline/list
8
+ * deprecated, use field `tagline` or /api/v4/tagline/list
9
9
  */
10
10
  taglines: Array<null>;
11
11
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Saves settings for your user.
2
+ * A response that completes successfully.
3
3
  */
4
4
  export type SuccessResponse = {
5
5
  success: boolean;
@@ -0,0 +1,27 @@
1
+ import type { CommunityId } from "./CommunityId";
2
+ import type { DbUrl } from "./DbUrl";
3
+ import type { TagId } from "./TagId";
4
+ /**
5
+ * A tag that can be assigned to a post within a community.
6
+ * The tag object is created by the community moderators.
7
+ * The assignment happens by the post creator and can be updated by the community moderators.
8
+ *
9
+ * A tag is a federatable object that gives additional context to another object, which can be
10
+ * displayed and filtered on currently, we only have community post tags, which is a tag that is
11
+ * created by post authors as well as mods of a community, to categorize a post. in the future we
12
+ * may add more tag types, depending on the requirements, this will lead to either expansion of
13
+ * this table (community_id optional, addition of tag_type enum) or split of this table / creation
14
+ * of new tables.
15
+ */
16
+ export type Tag = {
17
+ id: TagId;
18
+ ap_id: DbUrl;
19
+ name: string;
20
+ /**
21
+ * the community that owns this tag
22
+ */
23
+ community_id: CommunityId;
24
+ published: string;
25
+ updated?: string;
26
+ deleted: boolean;
27
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The internal tag id.
3
+ */
4
+ export type TagId = number;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export type UploadImageResponse = {
2
+ image_url: string;
3
+ filename: string;
4
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "lemmy-js-client",
3
3
  "description": "A javascript / typescript client for Lemmy",
4
- "version": "0.20.0-reports-combined.3",
5
- "author": "Dessalines <tyhou13@gmx.com>",
4
+ "version": "0.20.0-show-mod-reports.0",
5
+ "author": "Dessalines",
6
6
  "license": "AGPL-3.0",
7
7
  "main": "./dist/index.js",
8
8
  "files": [
@@ -12,13 +12,16 @@
12
12
  "build": "tsc",
13
13
  "docs": "typedoc src/index.ts",
14
14
  "lint": "tsc --noEmit && eslint --report-unused-disable-directives && prettier --check src",
15
- "prepare": "pnpm run build && husky"
15
+ "prepare": "pnpm run build && husky",
16
+ "tsoa": "tsoa spec-and-routes && tsc && redocly build-docs tsoa_build/swagger.json"
16
17
  },
17
18
  "repository": {
18
19
  "type": "git",
19
20
  "url": "git+https://github.com/LemmyNet/lemmy-js-client.git"
20
21
  },
21
22
  "devDependencies": {
23
+ "@redocly/cli": "^1.27.2",
24
+ "@types/joi": "^17.2.3",
22
25
  "@types/node": "^22.7.4",
23
26
  "@typescript-eslint/eslint-plugin": "^8.7.0",
24
27
  "@typescript-eslint/parser": "^8.7.0",
@@ -31,11 +34,12 @@
31
34
  "prettier-plugin-organize-imports": "^4.0.0",
32
35
  "prettier-plugin-packagejson": "^2.5.1",
33
36
  "sortpack": "^2.4.0",
37
+ "tsoa": "^6.6.0",
34
38
  "typedoc": "^0.27.0",
35
39
  "typescript": "^5.5.4",
36
40
  "typescript-eslint": "^8.7.0"
37
41
  },
38
- "packageManager": "pnpm@9.15.0",
42
+ "packageManager": "pnpm@9.15.5",
39
43
  "types": "./dist/index.d.ts",
40
44
  "lint-staged": {
41
45
  "*.{ts,tsx,js}": [
@@ -1,7 +0,0 @@
1
- import type { CommentReplyView } from "./CommentReplyView";
2
- /**
3
- * The response for a comment reply action.
4
- */
5
- export type CommentReplyResponse = {
6
- comment_reply_view: CommentReplyView;
7
- };
@@ -1,10 +0,0 @@
1
- import type { CommentSortType } from "./CommentSortType";
2
- /**
3
- * Get mentions for your user.
4
- */
5
- export type GetPersonMentions = {
6
- sort?: CommentSortType;
7
- page?: number;
8
- limit?: number;
9
- unread_only?: boolean;
10
- };
@@ -1,7 +0,0 @@
1
- import type { PersonMentionView } from "./PersonMentionView";
2
- /**
3
- * The response of mentions for your user.
4
- */
5
- export type GetPersonMentionsResponse = {
6
- mentions: Array<PersonMentionView>;
7
- };
@@ -1,10 +0,0 @@
1
- import type { PersonId } from "./PersonId";
2
- /**
3
- * Get your private messages.
4
- */
5
- export type GetPrivateMessages = {
6
- unread_only?: boolean;
7
- page?: number;
8
- limit?: number;
9
- creator_id?: PersonId;
10
- };
@@ -1,10 +0,0 @@
1
- import type { CommentSortType } from "./CommentSortType";
2
- /**
3
- * Get comment replies.
4
- */
5
- export type GetReplies = {
6
- sort?: CommentSortType;
7
- page?: number;
8
- limit?: number;
9
- unread_only?: boolean;
10
- };
@@ -1,7 +0,0 @@
1
- import type { CommentReplyView } from "./CommentReplyView";
2
- /**
3
- * Fetches your replies.
4
- */
5
- export type GetRepliesResponse = {
6
- replies: Array<CommentReplyView>;
7
- };
@@ -1,8 +0,0 @@
1
- import type { PersonMentionId } from "./PersonMentionId";
2
- /**
3
- * Mark a person mention as read.
4
- */
5
- export type MarkPersonMentionAsRead = {
6
- person_mention_id: PersonMentionId;
7
- read: boolean;
8
- };
@@ -1,17 +0,0 @@
1
- import type { CommentId } from "./CommentId";
2
- import type { CommunityId } from "./CommunityId";
3
- import type { PersonId } from "./PersonId";
4
- import type { PostId } from "./PostId";
5
- /**
6
- * Querying / filtering the modlog.
7
- */
8
- export type ModlogListParams = {
9
- community_id?: CommunityId;
10
- mod_person_id?: PersonId;
11
- other_person_id?: PersonId;
12
- post_id?: PostId;
13
- comment_id?: CommentId;
14
- page?: number;
15
- limit?: number;
16
- hide_modlog_names: boolean;
17
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * The person mention id.
3
- */
4
- export type PersonMentionId = number;
@@ -1,7 +0,0 @@
1
- import type { PersonMentionView } from "./PersonMentionView";
2
- /**
3
- * The response for a person mention action.
4
- */
5
- export type PersonMentionResponse = {
6
- person_mention_view: PersonMentionView;
7
- };
@@ -1,7 +0,0 @@
1
- import type { PrivateMessageView } from "./PrivateMessageView";
2
- /**
3
- * The private messages response.
4
- */
5
- export type PrivateMessagesResponse = {
6
- private_messages: Array<PrivateMessageView>;
7
- };
@@ -1,14 +0,0 @@
1
- import type { CommentReportId } from "./CommentReportId";
2
- import type { PostReportId } from "./PostReportId";
3
- import type { PrivateMessageReportId } from "./PrivateMessageReportId";
4
- import type { ReportCombinedId } from "./ReportCombinedId";
5
- /**
6
- * A combined reports table.
7
- */
8
- export type ReportCombined = {
9
- id: ReportCombinedId;
10
- published: string;
11
- post_report_id?: PostReportId;
12
- comment_report_id?: CommentReportId;
13
- private_message_report_id?: PrivateMessageReportId;
14
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * The report combined id
3
- */
4
- export type ReportCombinedId = number;