lemmy-js-client 1.0.0-block-nsfw.1 → 1.0.0-media-fixes.1

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 (114) hide show
  1. package/dist/http.d.ts +42 -16
  2. package/dist/http.js +926 -889
  3. package/dist/index.d.ts +19 -17
  4. package/dist/other_types.d.ts +3 -0
  5. package/dist/types/BannedPersonsResponse.d.ts +5 -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 +1 -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 +0 -5
  24. package/dist/types/GetModlog.d.ts +2 -2
  25. package/dist/types/GetModlogResponse.d.ts +5 -0
  26. package/dist/types/GetPosts.d.ts +2 -2
  27. package/dist/types/GetPostsResponse.d.ts +2 -2
  28. package/dist/types/GetSiteResponse.d.ts +4 -2
  29. package/dist/types/Instance.d.ts +9 -0
  30. package/dist/types/InstanceActions.d.ts +18 -0
  31. package/dist/types/InstanceWithFederationState.d.ts +9 -0
  32. package/dist/types/LemmyErrorType.d.ts +13 -6
  33. package/dist/types/ListBannedPersons.d.ts +9 -0
  34. package/dist/types/ListInbox.d.ts +2 -2
  35. package/dist/types/ListInboxResponse.d.ts +5 -0
  36. package/dist/types/ListPersonContent.d.ts +2 -2
  37. package/dist/types/ListPersonContentResponse.d.ts +5 -0
  38. package/dist/types/ListPersonSaved.d.ts +2 -2
  39. package/dist/types/ListPersonSavedResponse.d.ts +7 -2
  40. package/dist/types/ListReports.d.ts +2 -2
  41. package/dist/types/ListReportsResponse.d.ts +5 -0
  42. package/dist/types/LocalSite.d.ts +20 -5
  43. package/dist/types/LocalUser.d.ts +4 -0
  44. package/dist/types/LocalUserView.d.ts +2 -4
  45. package/dist/types/ModBan.d.ts +2 -0
  46. package/dist/types/ModChangeCommunityVisibility.d.ts +12 -0
  47. package/dist/types/ModChangeCommunityVisibility.js +2 -0
  48. package/dist/types/ModChangeCommunityVisibilityId.d.ts +1 -0
  49. package/dist/types/ModChangeCommunityVisibilityView.d.ts +11 -0
  50. package/dist/types/ModChangeCommunityVisibilityView.js +2 -0
  51. package/dist/types/ModlogActionType.d.ts +1 -1
  52. package/dist/types/ModlogCombinedView.d.ts +3 -3
  53. package/dist/types/PaginationCursor.d.ts +1 -4
  54. package/dist/types/PendingFollow.d.ts +2 -2
  55. package/dist/types/Person.d.ts +2 -8
  56. package/dist/types/PersonActions.d.ts +9 -0
  57. package/dist/types/PersonActions.js +2 -0
  58. package/dist/types/PersonCommentMentionView.d.ts +13 -14
  59. package/dist/types/PersonPostMentionView.d.ts +15 -19
  60. package/dist/types/PersonSavedCombinedView.d.ts +7 -0
  61. package/dist/types/PersonSavedCombinedView.js +2 -0
  62. package/dist/types/PersonView.d.ts +4 -2
  63. package/dist/types/PluginMetadata.d.ts +5 -0
  64. package/dist/types/Post.d.ts +15 -0
  65. package/dist/types/PostActions.d.ts +35 -0
  66. package/dist/types/PostActions.js +2 -0
  67. package/dist/types/PostPaginationCursor.d.ts +7 -0
  68. package/dist/types/PostReportView.d.ts +8 -16
  69. package/dist/types/PostView.d.ts +14 -18
  70. package/dist/types/PrivateMessageReportView.d.ts +1 -1
  71. package/dist/types/ResolveCommunityReport.d.ts +8 -0
  72. package/dist/types/ResolveCommunityReport.js +2 -0
  73. package/dist/types/Search.d.ts +2 -2
  74. package/dist/types/SearchResponse.d.ts +5 -0
  75. package/dist/types/SiteView.d.ts +2 -2
  76. package/dist/types/Tag.d.ts +8 -6
  77. package/dist/types/{PostTags.d.ts → TagsView.d.ts} +1 -3
  78. package/dist/types/TagsView.js +2 -0
  79. package/dist/types/UpdateCommunityTag.d.ts +8 -0
  80. package/dist/types/UpdateCommunityTag.js +2 -0
  81. package/package.json +6 -3
  82. package/dist/types/CommentAggregates.d.ts +0 -17
  83. package/dist/types/CommunityAggregates.d.ts +0 -30
  84. package/dist/types/InboxCombinedPaginationCursor.d.ts +0 -4
  85. package/dist/types/LocalUserVoteDisplayMode.d.ts +0 -9
  86. package/dist/types/ModHideCommunity.d.ts +0 -14
  87. package/dist/types/ModHideCommunityId.d.ts +0 -1
  88. package/dist/types/ModHideCommunityView.d.ts +0 -11
  89. package/dist/types/ModlogCombinedPaginationCursor.d.ts +0 -4
  90. package/dist/types/ModlogCombinedPaginationCursor.js +0 -3
  91. package/dist/types/PersonAggregates.d.ts +0 -10
  92. package/dist/types/PersonContentCombinedPaginationCursor.d.ts +0 -4
  93. package/dist/types/PersonContentCombinedPaginationCursor.js +0 -3
  94. package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +0 -4
  95. package/dist/types/PersonSavedCombinedPaginationCursor.js +0 -3
  96. package/dist/types/PostAggregates.d.ts +0 -18
  97. package/dist/types/ReportCombinedPaginationCursor.d.ts +0 -4
  98. package/dist/types/ReportCombinedPaginationCursor.js +0 -3
  99. package/dist/types/SearchCombinedPaginationCursor.d.ts +0 -4
  100. package/dist/types/SearchCombinedPaginationCursor.js +0 -3
  101. package/dist/types/SiteAggregates.d.ts +0 -27
  102. package/dist/types/SubscribedType.d.ts +0 -4
  103. package/dist/types/SubscribedType.js +0 -3
  104. /package/dist/types/{CommentAggregates.js → CommentActions.js} +0 -0
  105. /package/dist/types/{CommunityAggregates.js → CommunityActions.js} +0 -0
  106. /package/dist/types/{ModHideCommunity.js → CommunityReportResponse.js} +0 -0
  107. /package/dist/types/{ModHideCommunityView.js → CreateCommunityReport.js} +0 -0
  108. /package/dist/types/{PersonAggregates.js → CreateCommunityTag.js} +0 -0
  109. /package/dist/types/{PostAggregates.js → DeleteCommunityTag.js} +0 -0
  110. /package/dist/types/{PostTags.js → InstanceActions.js} +0 -0
  111. /package/dist/types/{SiteAggregates.js → ListBannedPersons.js} +0 -0
  112. /package/dist/types/{InboxCombinedPaginationCursor.js → ModChangeCommunityVisibilityId.js} +0 -0
  113. /package/dist/types/{LocalUserVoteDisplayMode.js → PluginMetadata.js} +0 -0
  114. /package/dist/types/{ModHideCommunityId.js → PostPaginationCursor.js} +0 -0
@@ -3,6 +3,7 @@ import type { LanguageId } from "./LanguageId";
3
3
  import type { LocalSiteUrlBlocklist } from "./LocalSiteUrlBlocklist";
4
4
  import type { OAuthProvider } from "./OAuthProvider";
5
5
  import type { PersonView } from "./PersonView";
6
+ import type { PluginMetadata } from "./PluginMetadata";
6
7
  import type { PublicOAuthProvider } from "./PublicOAuthProvider";
7
8
  import type { SiteView } from "./SiteView";
8
9
  import type { Tagline } from "./Tagline";
@@ -22,8 +23,9 @@ export type GetSiteResponse = {
22
23
  /**
23
24
  * A list of external auth methods your site supports.
24
25
  */
25
- oauth_providers?: Array<PublicOAuthProvider>;
26
- admin_oauth_providers?: Array<OAuthProvider>;
26
+ oauth_providers: Array<PublicOAuthProvider>;
27
+ admin_oauth_providers: Array<OAuthProvider>;
27
28
  blocked_urls: Array<LocalSiteUrlBlocklist>;
28
29
  image_upload_disabled: boolean;
30
+ active_plugins: Array<PluginMetadata>;
29
31
  };
@@ -6,7 +6,16 @@ export type Instance = {
6
6
  id: InstanceId;
7
7
  domain: string;
8
8
  published: string;
9
+ /**
10
+ * When the instance was updated.
11
+ */
9
12
  updated?: string;
13
+ /**
14
+ * The software of the instance.
15
+ */
10
16
  software?: string;
17
+ /**
18
+ * The version of the instance's software.
19
+ */
11
20
  version?: string;
12
21
  };
@@ -0,0 +1,18 @@
1
+ import type { InstanceId } from "./InstanceId";
2
+ import type { PersonId } from "./PersonId";
3
+ export type InstanceActions = {
4
+ person_id: PersonId;
5
+ instance_id: InstanceId;
6
+ /**
7
+ * When the instance was blocked.
8
+ */
9
+ blocked?: string;
10
+ /**
11
+ * When this user received a site ban.
12
+ */
13
+ received_ban?: string;
14
+ /**
15
+ * When their ban expires.
16
+ */
17
+ ban_expires?: string;
18
+ };
@@ -9,7 +9,16 @@ export type InstanceWithFederationState = {
9
9
  id: InstanceId;
10
10
  domain: string;
11
11
  published: string;
12
+ /**
13
+ * When the instance was updated.
14
+ */
12
15
  updated?: string;
16
+ /**
17
+ * The software of the instance.
18
+ */
13
19
  software?: string;
20
+ /**
21
+ * The version of the instance's software.
22
+ */
14
23
  version?: string;
15
24
  };
@@ -75,8 +75,6 @@ export type LemmyErrorType = {
75
75
  error: "honeypot_failed";
76
76
  } | {
77
77
  error: "registration_application_is_pending";
78
- } | {
79
- error: "cant_enable_private_instance_and_federation_together";
80
78
  } | {
81
79
  error: "locked";
82
80
  } | {
@@ -95,6 +93,8 @@ export type LemmyErrorType = {
95
93
  error: "couldnt_update_post";
96
94
  } | {
97
95
  error: "no_post_edit_allowed";
96
+ } | {
97
+ error: "nsfw_not_allowed";
98
98
  } | {
99
99
  error: "edit_private_message_not_allowed";
100
100
  } | {
@@ -125,8 +125,6 @@ export type LemmyErrorType = {
125
125
  error: "no_email_setup";
126
126
  } | {
127
127
  error: "local_site_not_setup";
128
- } | {
129
- error: "email_smtp_server_needs_a_port";
130
128
  } | {
131
129
  error: "invalid_email_address";
132
130
  message: string;
@@ -176,8 +174,6 @@ export type LemmyErrorType = {
176
174
  error: "community_block_already_exists";
177
175
  } | {
178
176
  error: "community_follower_already_exists";
179
- } | {
180
- error: "couldnt_update_community_hidden_status";
181
177
  } | {
182
178
  error: "person_block_already_exists";
183
179
  } | {
@@ -188,6 +184,8 @@ export type LemmyErrorType = {
188
184
  error: "couldnt_save_post";
189
185
  } | {
190
186
  error: "couldnt_mark_post_as_read";
187
+ } | {
188
+ error: "couldnt_update_read_comments";
191
189
  } | {
192
190
  error: "couldnt_hide_post";
193
191
  } | {
@@ -255,6 +253,10 @@ export type LemmyErrorType = {
255
253
  error: "invalid_unix_time";
256
254
  } | {
257
255
  error: "invalid_bot_action";
256
+ } | {
257
+ error: "invalid_tag_name";
258
+ } | {
259
+ error: "tag_not_in_community";
258
260
  } | {
259
261
  error: "cant_block_local_instance";
260
262
  } | {
@@ -285,4 +287,9 @@ export type LemmyErrorType = {
285
287
  message: {
286
288
  error?: FederationError;
287
289
  };
290
+ } | {
291
+ error: "couldnt_parse_pagination_token";
292
+ } | {
293
+ error: "plugin_error";
294
+ message: string;
288
295
  };
@@ -0,0 +1,9 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
2
+ /**
3
+ * List the banned persons.
4
+ */
5
+ export type ListBannedPersons = {
6
+ page_cursor?: PaginationCursor;
7
+ page_back?: boolean;
8
+ limit?: number;
9
+ };
@@ -1,11 +1,11 @@
1
- import type { InboxCombinedPaginationCursor } from "./InboxCombinedPaginationCursor";
2
1
  import type { InboxDataType } from "./InboxDataType";
2
+ import type { PaginationCursor } from "./PaginationCursor";
3
3
  /**
4
4
  * Get your inbox (replies, comment mentions, post mentions, and messages)
5
5
  */
6
6
  export type ListInbox = {
7
7
  type_?: InboxDataType;
8
8
  unread_only?: boolean;
9
- page_cursor?: InboxCombinedPaginationCursor;
9
+ page_cursor?: PaginationCursor;
10
10
  page_back?: boolean;
11
11
  };
@@ -1,7 +1,12 @@
1
1
  import type { InboxCombinedView } from "./InboxCombinedView";
2
+ import type { PaginationCursor } from "./PaginationCursor";
2
3
  /**
3
4
  * Get your inbox (replies, comment mentions, post mentions, and messages)
4
5
  */
5
6
  export type ListInboxResponse = {
6
7
  inbox: Array<InboxCombinedView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
7
12
  };
@@ -1,4 +1,4 @@
1
- import type { PersonContentCombinedPaginationCursor } from "./PersonContentCombinedPaginationCursor";
1
+ import type { PaginationCursor } from "./PaginationCursor";
2
2
  import type { PersonContentType } from "./PersonContentType";
3
3
  import type { PersonId } from "./PersonId";
4
4
  /**
@@ -13,6 +13,6 @@ export type ListPersonContent = {
13
13
  * Example: dessalines , or dessalines@xyz.tld
14
14
  */
15
15
  username?: string;
16
- page_cursor?: PersonContentCombinedPaginationCursor;
16
+ page_cursor?: PaginationCursor;
17
17
  page_back?: boolean;
18
18
  };
@@ -1,7 +1,12 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { PersonContentCombinedView } from "./PersonContentCombinedView";
2
3
  /**
3
4
  * A person's content response.
4
5
  */
5
6
  export type ListPersonContentResponse = {
6
7
  content: Array<PersonContentCombinedView>;
8
+ /**
9
+ * the pagination cursor to use to fetch the next page
10
+ */
11
+ next_page?: PaginationCursor;
7
12
  };
@@ -1,10 +1,10 @@
1
+ import type { PaginationCursor } from "./PaginationCursor";
1
2
  import type { PersonContentType } from "./PersonContentType";
2
- import type { PersonSavedCombinedPaginationCursor } from "./PersonSavedCombinedPaginationCursor";
3
3
  /**
4
4
  * Gets your saved posts and comments
5
5
  */
6
6
  export type ListPersonSaved = {
7
7
  type_?: PersonContentType;
8
- page_cursor?: PersonSavedCombinedPaginationCursor;
8
+ page_cursor?: PaginationCursor;
9
9
  page_back?: boolean;
10
10
  };
@@ -1,7 +1,12 @@
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;
7
12
  };
@@ -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,7 +22,7 @@ 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
27
  /**
28
28
  * Only for admins: also show reports with `violates_instance_rules=false`
@@ -1,7 +1,12 @@
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;
7
12
  };
@@ -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,24 @@ 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;
129
144
  };
@@ -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";
@@ -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
  };