lemmy-js-client 1.0.0-block-nsfw.1 → 1.0.0-local-image-user.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 (151) hide show
  1. package/dist/http.d.ts +63 -16
  2. package/dist/http.js +978 -889
  3. package/dist/index.d.ts +23 -17
  4. package/dist/other_types.d.ts +9 -0
  5. package/dist/types/BannedPersonsResponse.d.ts +6 -0
  6. package/dist/types/Comment.d.ts +14 -0
  7. package/dist/types/CommentActions.d.ts +18 -0
  8. package/dist/types/CommentReplyView.d.ts +15 -14
  9. package/dist/types/CommentReportView.d.ts +8 -13
  10. package/dist/types/CommentSlimView.d.ts +11 -13
  11. package/dist/types/CommentView.d.ts +14 -13
  12. package/dist/types/Community.d.ts +23 -4
  13. package/dist/types/CommunityActions.d.ts +35 -0
  14. package/dist/types/CommunityReportResponse.d.ts +7 -0
  15. package/dist/types/CommunityReportView.d.ts +0 -4
  16. package/dist/types/CommunityView.d.ts +6 -6
  17. package/dist/types/CommunityVisibility.d.ts +1 -1
  18. package/dist/types/CreateCommunityReport.d.ts +8 -0
  19. package/dist/types/CreateCommunityTag.d.ts +8 -0
  20. package/dist/types/CreateSite.d.ts +2 -1
  21. package/dist/types/DeleteCommunityTag.d.ts +7 -0
  22. package/dist/types/EditPost.d.ts +1 -1
  23. package/dist/types/EditSite.d.ts +4 -5
  24. package/dist/types/GetComments.d.ts +3 -1
  25. package/dist/types/GetCommentsResponse.d.ts +3 -0
  26. package/dist/types/GetCommentsSlimResponse.d.ts +3 -0
  27. package/dist/types/GetModlog.d.ts +3 -2
  28. package/dist/types/GetModlogResponse.d.ts +6 -0
  29. package/dist/types/GetPosts.d.ts +1 -7
  30. package/dist/types/GetPostsResponse.d.ts +1 -0
  31. package/dist/types/GetSiteResponse.d.ts +4 -2
  32. package/dist/types/Instance.d.ts +9 -0
  33. package/dist/types/InstanceActions.d.ts +18 -0
  34. package/dist/types/InstanceWithFederationState.d.ts +9 -0
  35. package/dist/types/LemmyErrorType.d.ts +97 -26
  36. package/dist/types/ListBannedPersons.d.ts +9 -0
  37. package/dist/types/ListCommentLikes.d.ts +3 -1
  38. package/dist/types/ListCommentLikesResponse.d.ts +6 -0
  39. package/dist/types/ListCommunities.d.ts +3 -1
  40. package/dist/types/ListCommunitiesResponse.d.ts +6 -0
  41. package/dist/types/ListCommunityPendingFollows.d.ts +3 -1
  42. package/dist/types/ListCommunityPendingFollows.js +0 -1
  43. package/dist/types/ListCommunityPendingFollowsResponse.d.ts +6 -0
  44. package/dist/types/ListCustomEmojis.d.ts +0 -3
  45. package/dist/types/ListInbox.d.ts +3 -2
  46. package/dist/types/ListInboxResponse.d.ts +6 -0
  47. package/dist/types/ListMedia.d.ts +3 -1
  48. package/dist/types/ListMedia.js +0 -1
  49. package/dist/types/ListMediaResponse.d.ts +6 -0
  50. package/dist/types/ListPersonContent.d.ts +3 -2
  51. package/dist/types/ListPersonContentResponse.d.ts +6 -0
  52. package/dist/types/ListPersonHidden.d.ts +9 -0
  53. package/dist/types/ListPersonHidden.js +2 -0
  54. package/dist/types/ListPersonHiddenResponse.d.ts +13 -0
  55. package/dist/types/ListPersonHiddenResponse.js +2 -0
  56. package/dist/types/ListPersonRead.d.ts +9 -0
  57. package/dist/types/ListPersonRead.js +2 -0
  58. package/dist/types/ListPersonReadResponse.d.ts +13 -0
  59. package/dist/types/ListPersonReadResponse.js +2 -0
  60. package/dist/types/ListPersonSaved.d.ts +3 -2
  61. package/dist/types/ListPersonSavedResponse.d.ts +8 -2
  62. package/dist/types/ListPostLikes.d.ts +3 -1
  63. package/dist/types/ListPostLikesResponse.d.ts +6 -0
  64. package/dist/types/ListRegistrationApplications.d.ts +3 -1
  65. package/dist/types/ListRegistrationApplications.js +0 -1
  66. package/dist/types/ListRegistrationApplicationsResponse.d.ts +6 -0
  67. package/dist/types/ListReports.d.ts +3 -2
  68. package/dist/types/ListReportsResponse.d.ts +6 -0
  69. package/dist/types/ListTaglines.d.ts +3 -1
  70. package/dist/types/ListTaglines.js +0 -1
  71. package/dist/types/ListTaglinesResponse.d.ts +6 -0
  72. package/dist/types/LocalImage.d.ts +2 -2
  73. package/dist/types/LocalSite.d.ts +24 -5
  74. package/dist/types/LocalUser.d.ts +5 -0
  75. package/dist/types/LocalUserView.d.ts +2 -4
  76. package/dist/types/Login.d.ts +3 -0
  77. package/dist/types/ModBan.d.ts +2 -0
  78. package/dist/types/ModChangeCommunityVisibility.d.ts +12 -0
  79. package/dist/types/ModChangeCommunityVisibility.js +2 -0
  80. package/dist/types/ModChangeCommunityVisibilityId.d.ts +1 -0
  81. package/dist/types/ModChangeCommunityVisibilityView.d.ts +11 -0
  82. package/dist/types/ModChangeCommunityVisibilityView.js +2 -0
  83. package/dist/types/ModlogActionType.d.ts +1 -1
  84. package/dist/types/ModlogCombinedView.d.ts +3 -3
  85. package/dist/types/MyUserInfo.d.ts +1 -0
  86. package/dist/types/PaginationCursor.d.ts +1 -4
  87. package/dist/types/PendingFollow.d.ts +2 -2
  88. package/dist/types/Person.d.ts +2 -8
  89. package/dist/types/PersonActions.d.ts +9 -0
  90. package/dist/types/PersonActions.js +2 -0
  91. package/dist/types/PersonCommentMentionView.d.ts +13 -14
  92. package/dist/types/PersonPostMentionView.d.ts +15 -19
  93. package/dist/types/PersonSavedCombinedView.d.ts +7 -0
  94. package/dist/types/PersonSavedCombinedView.js +2 -0
  95. package/dist/types/PersonView.d.ts +4 -2
  96. package/dist/types/PluginMetadata.d.ts +5 -0
  97. package/dist/types/Post.d.ts +15 -0
  98. package/dist/types/PostActions.d.ts +35 -0
  99. package/dist/types/PostActions.js +2 -0
  100. package/dist/types/PostReportView.d.ts +8 -16
  101. package/dist/types/PostView.d.ts +14 -18
  102. package/dist/types/PrivateMessageReportView.d.ts +1 -1
  103. package/dist/types/ResolveCommunityReport.d.ts +8 -0
  104. package/dist/types/ResolveCommunityReport.js +2 -0
  105. package/dist/types/SaveUserSettings.d.ts +3 -1
  106. package/dist/types/Search.d.ts +3 -2
  107. package/dist/types/SearchResponse.d.ts +6 -0
  108. package/dist/types/SiteView.d.ts +2 -2
  109. package/dist/types/Tag.d.ts +8 -6
  110. package/dist/types/Tagline.d.ts +2 -1
  111. package/dist/types/Tagline.js +0 -1
  112. package/dist/types/{PostTags.d.ts → TagsView.d.ts} +1 -3
  113. package/dist/types/TagsView.js +2 -0
  114. package/dist/types/UpdateCommunityTag.d.ts +8 -0
  115. package/dist/types/UpdateCommunityTag.js +2 -0
  116. package/dist/types/VoteShow.d.ts +4 -0
  117. package/dist/types/VoteView.d.ts +1 -0
  118. package/package.json +6 -3
  119. package/dist/types/CommentAggregates.d.ts +0 -17
  120. package/dist/types/CommunityAggregates.d.ts +0 -30
  121. package/dist/types/InboxCombinedPaginationCursor.d.ts +0 -4
  122. package/dist/types/LocalUserVoteDisplayMode.d.ts +0 -9
  123. package/dist/types/ModHideCommunity.d.ts +0 -14
  124. package/dist/types/ModHideCommunityId.d.ts +0 -1
  125. package/dist/types/ModHideCommunityView.d.ts +0 -11
  126. package/dist/types/ModlogCombinedPaginationCursor.d.ts +0 -4
  127. package/dist/types/ModlogCombinedPaginationCursor.js +0 -3
  128. package/dist/types/PersonAggregates.d.ts +0 -10
  129. package/dist/types/PersonContentCombinedPaginationCursor.d.ts +0 -4
  130. package/dist/types/PersonContentCombinedPaginationCursor.js +0 -3
  131. package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +0 -4
  132. package/dist/types/PersonSavedCombinedPaginationCursor.js +0 -3
  133. package/dist/types/PostAggregates.d.ts +0 -18
  134. package/dist/types/ReportCombinedPaginationCursor.d.ts +0 -4
  135. package/dist/types/ReportCombinedPaginationCursor.js +0 -3
  136. package/dist/types/SearchCombinedPaginationCursor.d.ts +0 -4
  137. package/dist/types/SearchCombinedPaginationCursor.js +0 -3
  138. package/dist/types/SiteAggregates.d.ts +0 -27
  139. package/dist/types/SubscribedType.d.ts +0 -4
  140. package/dist/types/SubscribedType.js +0 -3
  141. /package/dist/types/{CommentAggregates.js → CommentActions.js} +0 -0
  142. /package/dist/types/{CommunityAggregates.js → CommunityActions.js} +0 -0
  143. /package/dist/types/{ModHideCommunity.js → CommunityReportResponse.js} +0 -0
  144. /package/dist/types/{ModHideCommunityView.js → CreateCommunityReport.js} +0 -0
  145. /package/dist/types/{PersonAggregates.js → CreateCommunityTag.js} +0 -0
  146. /package/dist/types/{PostAggregates.js → DeleteCommunityTag.js} +0 -0
  147. /package/dist/types/{PostTags.js → InstanceActions.js} +0 -0
  148. /package/dist/types/{SiteAggregates.js → ListBannedPersons.js} +0 -0
  149. /package/dist/types/{InboxCombinedPaginationCursor.js → ModChangeCommunityVisibilityId.js} +0 -0
  150. /package/dist/types/{LocalUserVoteDisplayMode.js → PluginMetadata.js} +0 -0
  151. /package/dist/types/{ModHideCommunityId.js → VoteShow.js} +0 -0
@@ -1,7 +1,13 @@
1
- import type { PersonContentCombinedView } from "./PersonContentCombinedView";
1
+ import type { PaginationCursor } from "./PaginationCursor";
2
+ import type { PersonSavedCombinedView } from "./PersonSavedCombinedView";
2
3
  /**
3
4
  * A person's saved content response.
4
5
  */
5
6
  export type ListPersonSavedResponse = {
6
- saved: Array<PersonContentCombinedView>;
7
+ saved: Array<PersonSavedCombinedView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
7
13
  };
@@ -1,9 +1,11 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { PostId } from "./PostId";
2
3
  /**
3
4
  * List post likes. Admins-only.
4
5
  */
5
6
  export type ListPostLikes = {
6
7
  post_id: PostId;
7
- page?: number;
8
+ page_cursor?: PaginationCursor;
9
+ page_back?: boolean;
8
10
  limit?: number;
9
11
  };
@@ -1,7 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { VoteView } from "./VoteView";
2
3
  /**
3
4
  * The post likes response
4
5
  */
5
6
  export type ListPostLikesResponse = {
6
7
  post_likes: Array<VoteView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
7
13
  };
@@ -1,3 +1,4 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  /**
2
3
  * Fetches a list of registration applications.
3
4
  */
@@ -6,6 +7,7 @@ export type ListRegistrationApplications = {
6
7
  * Only shows the unread applications (IE those without an admin actor)
7
8
  */
8
9
  unread_only?: boolean;
9
- page?: number;
10
+ page_cursor?: PaginationCursor;
11
+ page_back?: boolean;
10
12
  limit?: number;
11
13
  };
@@ -1,3 +1,2 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { RegistrationApplicationView } from "./RegistrationApplicationView";
2
3
  /**
3
4
  * The list of registration applications.
4
5
  */
5
6
  export type ListRegistrationApplicationsResponse = {
6
7
  registration_applications: Array<RegistrationApplicationView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
7
13
  };
@@ -1,6 +1,6 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
+ import type { PaginationCursor } from "./PaginationCursor";
2
3
  import type { PostId } from "./PostId";
3
- import type { ReportCombinedPaginationCursor } from "./ReportCombinedPaginationCursor";
4
4
  import type { ReportType } from "./ReportType";
5
5
  /**
6
6
  * List reports.
@@ -22,8 +22,9 @@ export type ListReports = {
22
22
  * if no community is given, it returns reports for all communities moderated by the auth user
23
23
  */
24
24
  community_id?: CommunityId;
25
- page_cursor?: ReportCombinedPaginationCursor;
25
+ page_cursor?: PaginationCursor;
26
26
  page_back?: boolean;
27
+ limit?: number;
27
28
  /**
28
29
  * Only for admins: also show reports with `violates_instance_rules=false`
29
30
  */
@@ -1,7 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { ReportCombinedView } from "./ReportCombinedView";
2
3
  /**
3
4
  * The post reports response.
4
5
  */
5
6
  export type ListReportsResponse = {
6
7
  reports: Array<ReportCombinedView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
7
13
  };
@@ -1,7 +1,9 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  /**
2
3
  * Fetches a list of taglines.
3
4
  */
4
5
  export type ListTaglines = {
5
- page?: number;
6
+ page_cursor?: PaginationCursor;
7
+ page_back?: boolean;
6
8
  limit?: number;
7
9
  };
@@ -1,3 +1,2 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { Tagline } from "./Tagline";
2
3
  /**
3
4
  * A response for taglines.
4
5
  */
5
6
  export type ListTaglinesResponse = {
6
7
  taglines: Array<Tagline>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
12
+ prev_page?: PaginationCursor;
7
13
  };
@@ -1,6 +1,6 @@
1
- import type { LocalUserId } from "./LocalUserId";
1
+ import type { PersonId } from "./PersonId";
2
2
  export type LocalImage = {
3
- local_user_id?: LocalUserId;
4
3
  pictrs_alias: string;
5
4
  published: string;
5
+ person_id: PersonId;
6
6
  };
@@ -113,11 +113,6 @@ export type LocalSite = {
113
113
  * What kind of comment downvotes your site allows.
114
114
  */
115
115
  comment_downvotes: FederationMode;
116
- /**
117
- * If this is true, users will never see the dialog asking to support Lemmy development with
118
- * donations.
119
- */
120
- disable_donation_dialog: boolean;
121
116
  /**
122
117
  * A default time range limit to apply to post sorts, in seconds.
123
118
  */
@@ -126,4 +121,28 @@ export type LocalSite = {
126
121
  * Block NSFW content being created
127
122
  */
128
123
  disallow_nsfw_content: boolean;
124
+ users: number;
125
+ posts: number;
126
+ comments: number;
127
+ communities: number;
128
+ /**
129
+ * The number of users with any activity in the last day.
130
+ */
131
+ users_active_day: number;
132
+ /**
133
+ * The number of users with any activity in the last week.
134
+ */
135
+ users_active_week: number;
136
+ /**
137
+ * The number of users with any activity in the last month.
138
+ */
139
+ users_active_month: number;
140
+ /**
141
+ * The number of users with any activity in the last half year.
142
+ */
143
+ users_active_half_year: number;
144
+ /**
145
+ * Dont send email notifications to users for new replies, mentions etc
146
+ */
147
+ disable_email_notifications: boolean;
129
148
  };
@@ -5,6 +5,7 @@ import type { PersonId } from "./PersonId";
5
5
  import type { PostListingMode } from "./PostListingMode";
6
6
  import type { PostSortType } from "./PostSortType";
7
7
  import type { SensitiveString } from "./SensitiveString";
8
+ import type { VoteShow } from "./VoteShow";
8
9
  /**
9
10
  * A local user.
10
11
  */
@@ -97,4 +98,8 @@ export type LocalUser = {
97
98
  * A default time range limit to apply to post sorts, in seconds.
98
99
  */
99
100
  default_post_time_range_seconds?: number;
101
+ show_score: boolean;
102
+ show_upvotes: boolean;
103
+ show_downvotes: VoteShow;
104
+ show_upvote_percentage: boolean;
100
105
  };
@@ -1,13 +1,11 @@
1
+ import type { InstanceActions } from "./InstanceActions";
1
2
  import type { LocalUser } from "./LocalUser";
2
- import type { LocalUserVoteDisplayMode } from "./LocalUserVoteDisplayMode";
3
3
  import type { Person } from "./Person";
4
- import type { PersonAggregates } from "./PersonAggregates";
5
4
  /**
6
5
  * A local user view.
7
6
  */
8
7
  export type LocalUserView = {
9
8
  local_user: LocalUser;
10
- local_user_vote_display_mode: LocalUserVoteDisplayMode;
11
9
  person: Person;
12
- counts: PersonAggregates;
10
+ instance_actions?: InstanceActions;
13
11
  };
@@ -1,6 +1,9 @@
1
1
  import type { SensitiveString } from "./SensitiveString";
2
2
  /**
3
3
  * Logging into lemmy.
4
+ *
5
+ * Note: Banned users can still log in, to be able to do certain things like delete
6
+ * their account.
4
7
  */
5
8
  export type Login = {
6
9
  username_or_email: SensitiveString;
@@ -1,3 +1,4 @@
1
+ import type { InstanceId } from "./InstanceId";
1
2
  import type { ModBanId } from "./ModBanId";
2
3
  import type { PersonId } from "./PersonId";
3
4
  /**
@@ -11,4 +12,5 @@ export type ModBan = {
11
12
  banned: boolean;
12
13
  expires?: string;
13
14
  published: string;
15
+ instance_id: InstanceId;
14
16
  };
@@ -0,0 +1,12 @@
1
+ import type { CommunityId } from "./CommunityId";
2
+ import type { CommunityVisibility } from "./CommunityVisibility";
3
+ import type { ModChangeCommunityVisibilityId } from "./ModChangeCommunityVisibilityId";
4
+ import type { PersonId } from "./PersonId";
5
+ export type ModChangeCommunityVisibility = {
6
+ id: ModChangeCommunityVisibilityId;
7
+ community_id: CommunityId;
8
+ mod_person_id: PersonId;
9
+ published: string;
10
+ reason?: string;
11
+ visibility: CommunityVisibility;
12
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type ModChangeCommunityVisibilityId = number;
@@ -0,0 +1,11 @@
1
+ import type { Community } from "./Community";
2
+ import type { ModChangeCommunityVisibility } from "./ModChangeCommunityVisibility";
3
+ import type { Person } from "./Person";
4
+ /**
5
+ * When the visibility of a community is changed
6
+ */
7
+ export type ModChangeCommunityVisibilityView = {
8
+ mod_change_community_visibility: ModChangeCommunityVisibility;
9
+ moderator?: Person;
10
+ community: Community;
11
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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" | "ModHideCommunity" | "AdminPurgePerson" | "AdminPurgeCommunity" | "AdminPurgePost" | "AdminPurgeComment" | "AdminBlockInstance" | "AdminAllowInstance";
4
+ export type ModlogActionType = "All" | "ModRemovePost" | "ModLockPost" | "ModFeaturePost" | "ModRemoveComment" | "ModRemoveCommunity" | "ModBanFromCommunity" | "ModAddCommunity" | "ModTransferCommunity" | "ModAdd" | "ModBan" | "ModChangeCommunityVisibility" | "AdminPurgePerson" | "AdminPurgeCommunity" | "AdminPurgePost" | "AdminPurgeComment" | "AdminBlockInstance" | "AdminAllowInstance";
@@ -8,8 +8,8 @@ import type { ModAddCommunityView } from "./ModAddCommunityView";
8
8
  import type { ModAddView } from "./ModAddView";
9
9
  import type { ModBanFromCommunityView } from "./ModBanFromCommunityView";
10
10
  import type { ModBanView } from "./ModBanView";
11
+ import type { ModChangeCommunityVisibilityView } from "./ModChangeCommunityVisibilityView";
11
12
  import type { ModFeaturePostView } from "./ModFeaturePostView";
12
- import type { ModHideCommunityView } from "./ModHideCommunityView";
13
13
  import type { ModLockPostView } from "./ModLockPostView";
14
14
  import type { ModRemoveCommentView } from "./ModRemoveCommentView";
15
15
  import type { ModRemoveCommunityView } from "./ModRemoveCommunityView";
@@ -38,8 +38,8 @@ export type ModlogCombinedView = ({
38
38
  } & ModBanFromCommunityView) | ({
39
39
  type_: "ModFeaturePost";
40
40
  } & ModFeaturePostView) | ({
41
- type_: "ModHideCommunity";
42
- } & ModHideCommunityView) | ({
41
+ type_: "ModChangeCommunityVisibility";
42
+ } & ModChangeCommunityVisibilityView) | ({
43
43
  type_: "ModLockPost";
44
44
  } & ModLockPostView) | ({
45
45
  type_: "ModRemoveComment";
@@ -15,5 +15,6 @@ export type MyUserInfo = {
15
15
  community_blocks: Array<Community>;
16
16
  instance_blocks: Array<Instance>;
17
17
  person_blocks: Array<Person>;
18
+ keyword_blocks: Array<string>;
18
19
  discussion_languages: Array<LanguageId>;
19
20
  };
@@ -1,7 +1,4 @@
1
1
  /**
2
- * currently this is just a wrapper around post id, but should be seen as opaque from the client's
3
- * perspective. stringified since we might want to use arbitrary info later, with a P prepended to
4
- * prevent ossification (api users love to make assumptions (e.g. parse stuff that looks like
5
- * numbers as numbers) about apis that aren't part of the spec
2
+ * A pagination cursor
6
3
  */
7
4
  export type PaginationCursor = string;
@@ -1,9 +1,9 @@
1
1
  import type { Community } from "./Community";
2
+ import type { CommunityFollowerState } from "./CommunityFollowerState";
2
3
  import type { Person } from "./Person";
3
- import type { SubscribedType } from "./SubscribedType";
4
4
  export type PendingFollow = {
5
5
  person: Person;
6
6
  community: Community;
7
7
  is_new_instance: boolean;
8
- subscribed: SubscribedType;
8
+ follow_state?: CommunityFollowerState;
9
9
  };
@@ -15,10 +15,6 @@ export type Person = {
15
15
  * A URL for an avatar.
16
16
  */
17
17
  avatar?: DbUrl;
18
- /**
19
- * Whether the person is banned.
20
- */
21
- banned: boolean;
22
18
  published: string;
23
19
  updated?: string;
24
20
  /**
@@ -49,9 +45,7 @@ export type Person = {
49
45
  * Whether the person is a bot account.
50
46
  */
51
47
  bot_account: boolean;
52
- /**
53
- * When their ban, if it exists, expires, if at all.
54
- */
55
- ban_expires?: string;
56
48
  instance_id: InstanceId;
49
+ post_count: number;
50
+ comment_count: number;
57
51
  };
@@ -0,0 +1,9 @@
1
+ import type { PersonId } from "./PersonId";
2
+ export type PersonActions = {
3
+ target_id: PersonId;
4
+ person_id: PersonId;
5
+ /**
6
+ * When the person was blocked.
7
+ */
8
+ blocked?: string;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,31 +1,30 @@
1
1
  import type { Comment } from "./Comment";
2
- import type { CommentAggregates } from "./CommentAggregates";
2
+ import type { CommentActions } from "./CommentActions";
3
3
  import type { Community } from "./Community";
4
+ import type { CommunityActions } from "./CommunityActions";
5
+ import type { InstanceActions } from "./InstanceActions";
4
6
  import type { Person } from "./Person";
7
+ import type { PersonActions } from "./PersonActions";
5
8
  import type { PersonCommentMention } from "./PersonCommentMention";
6
9
  import type { Post } from "./Post";
7
- import type { SubscribedType } from "./SubscribedType";
8
10
  /**
9
11
  * A person comment mention view.
10
12
  */
11
13
  export type PersonCommentMentionView = {
12
14
  person_comment_mention: PersonCommentMention;
15
+ recipient: Person;
13
16
  comment: Comment;
14
17
  creator: Person;
15
18
  post: Post;
16
19
  community: Community;
17
- recipient: Person;
18
- counts: CommentAggregates;
19
- creator_banned_from_community: boolean;
20
- banned_from_community: boolean;
21
- creator_is_moderator: boolean;
20
+ community_actions?: CommunityActions;
21
+ comment_actions?: CommentActions;
22
+ person_actions?: PersonActions;
23
+ instance_actions?: InstanceActions;
24
+ creator_home_instance_actions?: InstanceActions;
25
+ creator_local_instance_actions?: InstanceActions;
26
+ creator_community_actions?: CommunityActions;
22
27
  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
28
  can_mod: boolean;
29
+ creator_banned: boolean;
31
30
  };
@@ -1,36 +1,32 @@
1
1
  import type { Community } from "./Community";
2
+ import type { CommunityActions } from "./CommunityActions";
2
3
  import type { ImageDetails } from "./ImageDetails";
4
+ import type { InstanceActions } from "./InstanceActions";
3
5
  import type { Person } from "./Person";
6
+ import type { PersonActions } from "./PersonActions";
4
7
  import type { PersonPostMention } from "./PersonPostMention";
5
8
  import type { Post } from "./Post";
6
- import type { PostAggregates } from "./PostAggregates";
7
- import type { PostTags } from "./PostTags";
8
- import type { SubscribedType } from "./SubscribedType";
9
+ import type { PostActions } from "./PostActions";
10
+ import type { TagsView } from "./TagsView";
9
11
  /**
10
12
  * A person post mention view.
11
13
  */
12
14
  export type PersonPostMentionView = {
13
15
  person_post_mention: PersonPostMention;
16
+ recipient: Person;
14
17
  post: Post;
15
18
  creator: Person;
16
19
  community: Community;
17
20
  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;
21
+ community_actions?: CommunityActions;
22
+ person_actions?: PersonActions;
23
+ post_actions?: PostActions;
24
+ instance_actions?: InstanceActions;
25
+ creator_home_instance_actions?: InstanceActions;
26
+ creator_local_instance_actions?: InstanceActions;
27
+ creator_community_actions?: CommunityActions;
28
+ post_tags: TagsView;
23
29
  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
30
  can_mod: boolean;
31
+ creator_banned: boolean;
36
32
  };
@@ -0,0 +1,7 @@
1
+ import type { CommentView } from "./CommentView";
2
+ import type { PostView } from "./PostView";
3
+ export type PersonSavedCombinedView = ({
4
+ type_: "Post";
5
+ } & PostView) | ({
6
+ type_: "Comment";
7
+ } & CommentView);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +1,12 @@
1
+ import type { InstanceActions } from "./InstanceActions";
1
2
  import type { Person } from "./Person";
2
- import type { PersonAggregates } from "./PersonAggregates";
3
3
  /**
4
4
  * A person view.
5
5
  */
6
6
  export type PersonView = {
7
7
  person: Person;
8
- counts: PersonAggregates;
9
8
  is_admin: boolean;
9
+ home_instance_actions?: InstanceActions;
10
+ local_instance_actions?: InstanceActions;
11
+ creator_banned: boolean;
10
12
  };
@@ -0,0 +1,5 @@
1
+ export type PluginMetadata = {
2
+ name: string;
3
+ url: string;
4
+ description: string;
5
+ };
@@ -79,4 +79,19 @@ export type Post = {
79
79
  * Time at which the post will be published. None means publish immediately.
80
80
  */
81
81
  scheduled_publish_time?: string;
82
+ comments: number;
83
+ score: number;
84
+ upvotes: number;
85
+ downvotes: number;
86
+ /**
87
+ * The time of the newest comment in the post.
88
+ */
89
+ newest_comment_time: string;
90
+ report_count: number;
91
+ unresolved_report_count: number;
92
+ /**
93
+ * If a local user posts in a remote community, the comment is hidden until it is confirmed
94
+ * accepted by the community (by receiving it back via federation).
95
+ */
96
+ federation_pending: boolean;
82
97
  };
@@ -0,0 +1,35 @@
1
+ import type { PersonId } from "./PersonId";
2
+ import type { PostId } from "./PostId";
3
+ export type PostActions = {
4
+ post_id: PostId;
5
+ person_id: PersonId;
6
+ /**
7
+ * When the post was read.
8
+ */
9
+ read?: string;
10
+ /**
11
+ * When was the last time you read the comments.
12
+ */
13
+ read_comments?: string;
14
+ /**
15
+ * The number of comments you read last. Subtract this from total comments to get an unread
16
+ * count.
17
+ */
18
+ read_comments_amount?: number;
19
+ /**
20
+ * When the post was saved.
21
+ */
22
+ saved?: string;
23
+ /**
24
+ * When the post was liked.
25
+ */
26
+ liked?: string;
27
+ /**
28
+ * The like / score of the post.
29
+ */
30
+ like_score?: number;
31
+ /**
32
+ * When the post was hidden.
33
+ */
34
+ hidden?: string;
35
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,10 @@
1
1
  import type { Community } from "./Community";
2
+ import type { CommunityActions } from "./CommunityActions";
2
3
  import type { Person } from "./Person";
4
+ import type { PersonActions } from "./PersonActions";
3
5
  import type { Post } from "./Post";
4
- import type { PostAggregates } from "./PostAggregates";
6
+ import type { PostActions } from "./PostActions";
5
7
  import type { PostReport } from "./PostReport";
6
- import type { SubscribedType } from "./SubscribedType";
7
8
  /**
8
9
  * A post report view.
9
10
  */
@@ -13,19 +14,10 @@ export type PostReportView = {
13
14
  community: Community;
14
15
  creator: Person;
15
16
  post_creator: Person;
16
- creator_banned_from_community: boolean;
17
- creator_is_moderator: boolean;
18
- creator_is_admin: boolean;
19
- subscribed: SubscribedType;
20
- /**
21
- * The time when the post was saved.
22
- */
23
- saved?: string;
24
- read: boolean;
25
- hidden: boolean;
26
- creator_blocked: boolean;
27
- my_vote?: number;
28
- unread_comments: number;
29
- counts: PostAggregates;
17
+ creator_community_actions?: CommunityActions;
18
+ community_actions?: CommunityActions;
19
+ post_actions?: PostActions;
20
+ person_actions?: PersonActions;
30
21
  resolver?: Person;
22
+ creator_is_admin: boolean;
31
23
  };