lemmy-js-client 1.0.0-block-nsfw.1 → 1.0.0-community-reports.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 (140) hide show
  1. package/dist/http.d.ts +53 -16
  2. package/dist/http.js +952 -889
  3. package/dist/index.d.ts +18 -17
  4. package/dist/other_types.d.ts +3 -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/ListPersonSaved.d.ts +3 -2
  53. package/dist/types/ListPersonSavedResponse.d.ts +8 -2
  54. package/dist/types/ListPostLikes.d.ts +3 -1
  55. package/dist/types/ListPostLikesResponse.d.ts +6 -0
  56. package/dist/types/ListRegistrationApplications.d.ts +3 -1
  57. package/dist/types/ListRegistrationApplications.js +0 -1
  58. package/dist/types/ListRegistrationApplicationsResponse.d.ts +6 -0
  59. package/dist/types/ListReports.d.ts +3 -2
  60. package/dist/types/ListReportsResponse.d.ts +6 -0
  61. package/dist/types/ListTaglines.d.ts +3 -1
  62. package/dist/types/ListTaglines.js +0 -1
  63. package/dist/types/ListTaglinesResponse.d.ts +6 -0
  64. package/dist/types/LocalSite.d.ts +24 -5
  65. package/dist/types/LocalUser.d.ts +4 -0
  66. package/dist/types/LocalUserView.d.ts +2 -4
  67. package/dist/types/ModBan.d.ts +2 -0
  68. package/dist/types/ModChangeCommunityVisibility.d.ts +12 -0
  69. package/dist/types/ModChangeCommunityVisibility.js +2 -0
  70. package/dist/types/ModChangeCommunityVisibilityId.d.ts +1 -0
  71. package/dist/types/ModChangeCommunityVisibilityView.d.ts +11 -0
  72. package/dist/types/ModChangeCommunityVisibilityView.js +2 -0
  73. package/dist/types/ModlogActionType.d.ts +1 -1
  74. package/dist/types/ModlogCombinedView.d.ts +3 -3
  75. package/dist/types/MyUserInfo.d.ts +1 -0
  76. package/dist/types/PaginationCursor.d.ts +1 -4
  77. package/dist/types/PendingFollow.d.ts +2 -2
  78. package/dist/types/Person.d.ts +2 -8
  79. package/dist/types/PersonActions.d.ts +9 -0
  80. package/dist/types/PersonActions.js +2 -0
  81. package/dist/types/PersonCommentMentionView.d.ts +13 -14
  82. package/dist/types/PersonPostMentionView.d.ts +15 -19
  83. package/dist/types/PersonSavedCombinedView.d.ts +7 -0
  84. package/dist/types/PersonSavedCombinedView.js +2 -0
  85. package/dist/types/PersonView.d.ts +4 -2
  86. package/dist/types/PluginMetadata.d.ts +5 -0
  87. package/dist/types/Post.d.ts +15 -0
  88. package/dist/types/PostActions.d.ts +35 -0
  89. package/dist/types/PostActions.js +2 -0
  90. package/dist/types/PostReportView.d.ts +8 -16
  91. package/dist/types/PostView.d.ts +14 -18
  92. package/dist/types/PrivateMessageReportView.d.ts +1 -1
  93. package/dist/types/ResolveCommunityReport.d.ts +8 -0
  94. package/dist/types/ResolveCommunityReport.js +2 -0
  95. package/dist/types/SaveUserSettings.d.ts +1 -0
  96. package/dist/types/Search.d.ts +3 -2
  97. package/dist/types/SearchResponse.d.ts +6 -0
  98. package/dist/types/SiteView.d.ts +2 -2
  99. package/dist/types/Tag.d.ts +8 -6
  100. package/dist/types/Tagline.d.ts +2 -1
  101. package/dist/types/Tagline.js +0 -1
  102. package/dist/types/{PostTags.d.ts → TagsView.d.ts} +1 -3
  103. package/dist/types/TagsView.js +2 -0
  104. package/dist/types/UpdateCommunityTag.d.ts +8 -0
  105. package/dist/types/UpdateCommunityTag.js +2 -0
  106. package/dist/types/VoteView.d.ts +1 -0
  107. package/package.json +6 -3
  108. package/dist/types/CommentAggregates.d.ts +0 -17
  109. package/dist/types/CommunityAggregates.d.ts +0 -30
  110. package/dist/types/InboxCombinedPaginationCursor.d.ts +0 -4
  111. package/dist/types/LocalUserVoteDisplayMode.d.ts +0 -9
  112. package/dist/types/ModHideCommunity.d.ts +0 -14
  113. package/dist/types/ModHideCommunityId.d.ts +0 -1
  114. package/dist/types/ModHideCommunityId.js +0 -3
  115. package/dist/types/ModHideCommunityView.d.ts +0 -11
  116. package/dist/types/ModlogCombinedPaginationCursor.d.ts +0 -4
  117. package/dist/types/ModlogCombinedPaginationCursor.js +0 -3
  118. package/dist/types/PersonAggregates.d.ts +0 -10
  119. package/dist/types/PersonContentCombinedPaginationCursor.d.ts +0 -4
  120. package/dist/types/PersonContentCombinedPaginationCursor.js +0 -3
  121. package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +0 -4
  122. package/dist/types/PersonSavedCombinedPaginationCursor.js +0 -3
  123. package/dist/types/PostAggregates.d.ts +0 -18
  124. package/dist/types/ReportCombinedPaginationCursor.d.ts +0 -4
  125. package/dist/types/ReportCombinedPaginationCursor.js +0 -3
  126. package/dist/types/SearchCombinedPaginationCursor.d.ts +0 -4
  127. package/dist/types/SearchCombinedPaginationCursor.js +0 -3
  128. package/dist/types/SiteAggregates.d.ts +0 -27
  129. package/dist/types/SubscribedType.d.ts +0 -4
  130. package/dist/types/SubscribedType.js +0 -3
  131. /package/dist/types/{CommentAggregates.js → CommentActions.js} +0 -0
  132. /package/dist/types/{CommunityAggregates.js → CommunityActions.js} +0 -0
  133. /package/dist/types/{ModHideCommunity.js → CommunityReportResponse.js} +0 -0
  134. /package/dist/types/{ModHideCommunityView.js → CreateCommunityReport.js} +0 -0
  135. /package/dist/types/{PersonAggregates.js → CreateCommunityTag.js} +0 -0
  136. /package/dist/types/{PostAggregates.js → DeleteCommunityTag.js} +0 -0
  137. /package/dist/types/{PostTags.js → InstanceActions.js} +0 -0
  138. /package/dist/types/{SiteAggregates.js → ListBannedPersons.js} +0 -0
  139. /package/dist/types/{InboxCombinedPaginationCursor.js → ModChangeCommunityVisibilityId.js} +0 -0
  140. /package/dist/types/{LocalUserVoteDisplayMode.js → PluginMetadata.js} +0 -0
@@ -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
  };
@@ -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
  };
@@ -97,4 +97,8 @@ export type LocalUser = {
97
97
  * A default time range limit to apply to post sorts, in seconds.
98
98
  */
99
99
  default_post_time_range_seconds?: number;
100
+ show_score: boolean;
101
+ show_upvotes: boolean;
102
+ show_downvotes: boolean;
103
+ show_upvote_percentage: boolean;
100
104
  };
@@ -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,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
  };
@@ -1,10 +1,12 @@
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 { Post } from "./Post";
5
- import type { PostAggregates } from "./PostAggregates";
6
- import type { PostTags } from "./PostTags";
7
- import type { SubscribedType } from "./SubscribedType";
8
+ import type { PostActions } from "./PostActions";
9
+ import type { TagsView } from "./TagsView";
8
10
  /**
9
11
  * A post view.
10
12
  */
@@ -13,21 +15,15 @@ export type PostView = {
13
15
  creator: Person;
14
16
  community: Community;
15
17
  image_details?: ImageDetails;
16
- creator_banned_from_community: boolean;
17
- banned_from_community: boolean;
18
- creator_is_moderator: boolean;
18
+ community_actions?: CommunityActions;
19
+ person_actions?: PersonActions;
20
+ post_actions?: PostActions;
21
+ instance_actions?: InstanceActions;
22
+ creator_home_instance_actions?: InstanceActions;
23
+ creator_local_instance_actions?: InstanceActions;
24
+ creator_community_actions?: CommunityActions;
19
25
  creator_is_admin: boolean;
20
- counts: PostAggregates;
21
- subscribed: SubscribedType;
22
- /**
23
- * The time when the post was saved.
24
- */
25
- saved?: string;
26
- read: boolean;
27
- hidden: boolean;
28
- creator_blocked: boolean;
29
- my_vote?: number;
30
- unread_comments: number;
31
- tags: PostTags;
26
+ tags: TagsView;
32
27
  can_mod: boolean;
28
+ creator_banned: boolean;
33
29
  };
@@ -7,7 +7,7 @@ import type { PrivateMessageReport } from "./PrivateMessageReport";
7
7
  export type PrivateMessageReportView = {
8
8
  private_message_report: PrivateMessageReport;
9
9
  private_message: PrivateMessage;
10
- private_message_creator: Person;
11
10
  creator: Person;
11
+ private_message_creator: Person;
12
12
  resolver?: Person;
13
13
  };
@@ -0,0 +1,8 @@
1
+ import type { CommunityReportId } from "./CommunityReportId";
2
+ /**
3
+ * Resolve a community report.
4
+ */
5
+ export type ResolveCommunityReport = {
6
+ report_id: CommunityReportId;
7
+ resolved: boolean;
8
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -84,6 +84,7 @@ export type SaveUserSettings = {
84
84
  * A list of languages you are able to see discussion in.
85
85
  */
86
86
  discussion_languages?: Array<LanguageId>;
87
+ blocking_keywords?: Array<string>;
87
88
  /**
88
89
  * Open links in a new tab
89
90
  */
@@ -1,7 +1,7 @@
1
1
  import type { CommunityId } from "./CommunityId";
2
2
  import type { ListingType } from "./ListingType";
3
+ import type { PaginationCursor } from "./PaginationCursor";
3
4
  import type { PersonId } from "./PersonId";
4
- import type { SearchCombinedPaginationCursor } from "./SearchCombinedPaginationCursor";
5
5
  import type { SearchSortType } from "./SearchSortType";
6
6
  import type { SearchType } from "./SearchType";
7
7
  /**
@@ -24,6 +24,7 @@ export type Search = {
24
24
  post_url_only?: boolean;
25
25
  liked_only?: boolean;
26
26
  disliked_only?: boolean;
27
- page_cursor?: SearchCombinedPaginationCursor;
27
+ page_cursor?: PaginationCursor;
28
28
  page_back?: boolean;
29
+ limit?: number;
29
30
  };
@@ -1,7 +1,13 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { SearchCombinedView } from "./SearchCombinedView";
2
3
  /**
3
4
  * The search response, containing lists of the return type possibilities
4
5
  */
5
6
  export type SearchResponse = {
6
7
  results: Array<SearchCombinedView>;
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,7 @@
1
+ import type { Instance } from "./Instance";
1
2
  import type { LocalSite } from "./LocalSite";
2
3
  import type { LocalSiteRateLimit } from "./LocalSiteRateLimit";
3
4
  import type { Site } from "./Site";
4
- import type { SiteAggregates } from "./SiteAggregates";
5
5
  /**
6
6
  * A site view.
7
7
  */
@@ -9,5 +9,5 @@ export type SiteView = {
9
9
  site: Site;
10
10
  local_site: LocalSite;
11
11
  local_site_rate_limit: LocalSiteRateLimit;
12
- counts: SiteAggregates;
12
+ instance: Instance;
13
13
  };
@@ -7,16 +7,18 @@ import type { TagId } from "./TagId";
7
7
  * The assignment happens by the post creator and can be updated by the community moderators.
8
8
  *
9
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.
10
+ * displayed and filtered on. Currently, we only have community post tags, which is a tag that is
11
+ * created by the mods of a community, then assigned to posts by post authors as well as mods of a
12
+ * community, to categorize a post.
13
+ *
14
+ * In the future we may add more tag types, depending on the requirements, this will lead to either
15
+ * expansion of this table (community_id optional, addition of tag_type enum) or split of this
16
+ * table / creation of new tables.
15
17
  */
16
18
  export type Tag = {
17
19
  id: TagId;
18
20
  ap_id: DbUrl;
19
- name: string;
21
+ display_name: string;
20
22
  /**
21
23
  * the community that owns this tag
22
24
  */