lemmy-js-client 1.0.0-block-nsfw.1 → 1.0.0-site-person-ban.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.
- package/dist/http.d.ts +2 -2
- package/dist/http.js +5 -4
- package/dist/index.d.ts +14 -17
- package/dist/other_types.d.ts +3 -0
- package/dist/types/BannedPersonsResponse.d.ts +5 -0
- package/dist/types/Comment.d.ts +9 -0
- package/dist/types/CommentActions.d.ts +18 -0
- package/dist/types/CommentReplyView.d.ts +10 -14
- package/dist/types/CommentReportView.d.ts +8 -13
- package/dist/types/CommentSlimView.d.ts +8 -13
- package/dist/types/CommentView.d.ts +9 -13
- package/dist/types/Community.d.ts +23 -4
- package/dist/types/CommunityActions.d.ts +35 -0
- package/dist/types/CommunityReportResponse.d.ts +7 -0
- package/dist/types/CommunityReportView.d.ts +0 -4
- package/dist/types/CommunityView.d.ts +4 -6
- package/dist/types/CommunityVisibility.d.ts +1 -1
- package/dist/types/CreateCommunityReport.d.ts +8 -0
- package/dist/types/CreateSite.d.ts +1 -0
- package/dist/types/GetModlog.d.ts +2 -2
- package/dist/types/GetModlogResponse.d.ts +5 -0
- package/dist/types/GetPosts.d.ts +2 -2
- package/dist/types/GetPostsResponse.d.ts +2 -2
- package/dist/types/GetSiteResponse.d.ts +2 -2
- package/dist/types/Instance.d.ts +9 -0
- package/dist/types/InstanceActions.d.ts +18 -0
- package/dist/types/InstanceWithFederationState.d.ts +9 -0
- package/dist/types/LemmyErrorType.d.ts +6 -4
- package/dist/types/ListBannedPersons.d.ts +9 -0
- package/dist/types/ListInbox.d.ts +2 -2
- package/dist/types/ListInboxResponse.d.ts +5 -0
- package/dist/types/ListPersonContent.d.ts +2 -2
- package/dist/types/ListPersonContentResponse.d.ts +5 -0
- package/dist/types/ListPersonSaved.d.ts +2 -2
- package/dist/types/ListPersonSavedResponse.d.ts +7 -2
- package/dist/types/ListReports.d.ts +2 -2
- package/dist/types/ListReportsResponse.d.ts +5 -0
- package/dist/types/LocalSite.d.ts +20 -0
- package/dist/types/LocalUser.d.ts +4 -0
- package/dist/types/LocalUserView.d.ts +2 -4
- package/dist/types/ModBan.d.ts +2 -0
- package/dist/types/ModChangeCommunityVisibility.d.ts +12 -0
- package/dist/types/ModChangeCommunityVisibilityId.d.ts +1 -0
- package/dist/types/ModChangeCommunityVisibilityView.d.ts +11 -0
- package/dist/types/ModlogActionType.d.ts +1 -1
- package/dist/types/ModlogCombinedView.d.ts +3 -3
- package/dist/types/PaginationCursor.d.ts +1 -4
- package/dist/types/PendingFollow.d.ts +2 -2
- package/dist/types/Person.d.ts +2 -8
- package/dist/types/PersonActions.d.ts +9 -0
- package/dist/types/PersonActions.js +2 -0
- package/dist/types/PersonCommentMentionView.d.ts +10 -14
- package/dist/types/PersonPostMentionView.d.ts +10 -19
- package/dist/types/PersonSavedCombinedView.d.ts +7 -0
- package/dist/types/PersonSavedCombinedView.js +2 -0
- package/dist/types/PersonView.d.ts +2 -2
- package/dist/types/Post.d.ts +10 -0
- package/dist/types/PostActions.d.ts +35 -0
- package/dist/types/PostActions.js +2 -0
- package/dist/types/PostPaginationCursor.d.ts +7 -0
- package/dist/types/PostReportView.d.ts +8 -16
- package/dist/types/PostView.d.ts +9 -18
- package/dist/types/PrivateMessageReportView.d.ts +1 -1
- package/dist/types/ResolveCommunityReport.d.ts +8 -0
- package/dist/types/ResolveCommunityReport.js +2 -0
- package/dist/types/Search.d.ts +2 -2
- package/dist/types/SearchResponse.d.ts +5 -0
- package/dist/types/SiteView.d.ts +0 -2
- package/package.json +3 -3
- package/dist/types/CommentAggregates.d.ts +0 -17
- package/dist/types/CommunityAggregates.d.ts +0 -30
- package/dist/types/InboxCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/LocalUserVoteDisplayMode.d.ts +0 -9
- package/dist/types/ModHideCommunity.d.ts +0 -14
- package/dist/types/ModHideCommunityId.d.ts +0 -1
- package/dist/types/ModHideCommunityId.js +0 -3
- package/dist/types/ModHideCommunityView.d.ts +0 -11
- package/dist/types/ModlogCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/ModlogCombinedPaginationCursor.js +0 -3
- package/dist/types/PersonAggregates.d.ts +0 -10
- package/dist/types/PersonContentCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/PersonContentCombinedPaginationCursor.js +0 -3
- package/dist/types/PersonSavedCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/PersonSavedCombinedPaginationCursor.js +0 -3
- package/dist/types/PostAggregates.d.ts +0 -18
- package/dist/types/PostTags.d.ts +0 -7
- package/dist/types/ReportCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/ReportCombinedPaginationCursor.js +0 -3
- package/dist/types/SearchCombinedPaginationCursor.d.ts +0 -4
- package/dist/types/SearchCombinedPaginationCursor.js +0 -3
- package/dist/types/SiteAggregates.d.ts +0 -27
- package/dist/types/SubscribedType.d.ts +0 -4
- package/dist/types/SubscribedType.js +0 -3
- /package/dist/types/{CommentAggregates.js → CommentActions.js} +0 -0
- /package/dist/types/{CommunityAggregates.js → CommunityActions.js} +0 -0
- /package/dist/types/{ModHideCommunity.js → CommunityReportResponse.js} +0 -0
- /package/dist/types/{ModHideCommunityView.js → CreateCommunityReport.js} +0 -0
- /package/dist/types/{PersonAggregates.js → InstanceActions.js} +0 -0
- /package/dist/types/{PostAggregates.js → ListBannedPersons.js} +0 -0
- /package/dist/types/{PostTags.js → ModChangeCommunityVisibility.js} +0 -0
- /package/dist/types/{InboxCombinedPaginationCursor.js → ModChangeCommunityVisibilityId.js} +0 -0
- /package/dist/types/{SiteAggregates.js → ModChangeCommunityVisibilityView.js} +0 -0
- /package/dist/types/{LocalUserVoteDisplayMode.js → PostPaginationCursor.js} +0 -0
@@ -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
|
};
|
@@ -95,6 +95,8 @@ export type LemmyErrorType = {
|
|
95
95
|
error: "couldnt_update_post";
|
96
96
|
} | {
|
97
97
|
error: "no_post_edit_allowed";
|
98
|
+
} | {
|
99
|
+
error: "nsfw_not_allowed";
|
98
100
|
} | {
|
99
101
|
error: "edit_private_message_not_allowed";
|
100
102
|
} | {
|
@@ -125,8 +127,6 @@ export type LemmyErrorType = {
|
|
125
127
|
error: "no_email_setup";
|
126
128
|
} | {
|
127
129
|
error: "local_site_not_setup";
|
128
|
-
} | {
|
129
|
-
error: "email_smtp_server_needs_a_port";
|
130
130
|
} | {
|
131
131
|
error: "invalid_email_address";
|
132
132
|
message: string;
|
@@ -176,8 +176,6 @@ export type LemmyErrorType = {
|
|
176
176
|
error: "community_block_already_exists";
|
177
177
|
} | {
|
178
178
|
error: "community_follower_already_exists";
|
179
|
-
} | {
|
180
|
-
error: "couldnt_update_community_hidden_status";
|
181
179
|
} | {
|
182
180
|
error: "person_block_already_exists";
|
183
181
|
} | {
|
@@ -188,6 +186,8 @@ export type LemmyErrorType = {
|
|
188
186
|
error: "couldnt_save_post";
|
189
187
|
} | {
|
190
188
|
error: "couldnt_mark_post_as_read";
|
189
|
+
} | {
|
190
|
+
error: "couldnt_update_read_comments";
|
191
191
|
} | {
|
192
192
|
error: "couldnt_hide_post";
|
193
193
|
} | {
|
@@ -285,4 +285,6 @@ export type LemmyErrorType = {
|
|
285
285
|
message: {
|
286
286
|
error?: FederationError;
|
287
287
|
};
|
288
|
+
} | {
|
289
|
+
error: "couldnt_parse_pagination_token";
|
288
290
|
};
|
@@ -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?:
|
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 {
|
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?:
|
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?:
|
8
|
+
page_cursor?: PaginationCursor;
|
9
9
|
page_back?: boolean;
|
10
10
|
};
|
@@ -1,7 +1,12 @@
|
|
1
|
-
import type {
|
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<
|
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?:
|
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
|
};
|
@@ -126,4 +126,24 @@ export type LocalSite = {
|
|
126
126
|
* Block NSFW content being created
|
127
127
|
*/
|
128
128
|
disallow_nsfw_content: boolean;
|
129
|
+
users: number;
|
130
|
+
posts: number;
|
131
|
+
comments: number;
|
132
|
+
communities: number;
|
133
|
+
/**
|
134
|
+
* The number of users with any activity in the last day.
|
135
|
+
*/
|
136
|
+
users_active_day: number;
|
137
|
+
/**
|
138
|
+
* The number of users with any activity in the last week.
|
139
|
+
*/
|
140
|
+
users_active_week: number;
|
141
|
+
/**
|
142
|
+
* The number of users with any activity in the last month.
|
143
|
+
*/
|
144
|
+
users_active_month: number;
|
145
|
+
/**
|
146
|
+
* The number of users with any activity in the last half year.
|
147
|
+
*/
|
148
|
+
users_active_half_year: number;
|
129
149
|
};
|
@@ -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
|
-
|
10
|
+
instance_actions?: InstanceActions;
|
13
11
|
};
|
package/dist/types/ModBan.d.ts
CHANGED
@@ -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 @@
|
|
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
|
+
};
|
@@ -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" | "
|
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_: "
|
42
|
-
} &
|
41
|
+
type_: "ModChangeCommunityVisibility";
|
42
|
+
} & ModChangeCommunityVisibilityView) | ({
|
43
43
|
type_: "ModLockPost";
|
44
44
|
} & ModLockPostView) | ({
|
45
45
|
type_: "ModRemoveComment";
|
@@ -1,7 +1,4 @@
|
|
1
1
|
/**
|
2
|
-
*
|
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
|
-
|
8
|
+
follow_state?: CommunityFollowerState;
|
9
9
|
};
|
package/dist/types/Person.d.ts
CHANGED
@@ -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
|
};
|
@@ -1,31 +1,27 @@
|
|
1
1
|
import type { Comment } from "./Comment";
|
2
|
-
import type {
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
community_actions?: CommunityActions;
|
21
|
+
comment_actions?: CommentActions;
|
22
|
+
person_actions?: PersonActions;
|
23
|
+
instance_actions?: InstanceActions;
|
24
|
+
creator_community_actions?: CommunityActions;
|
22
25
|
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
26
|
can_mod: boolean;
|
31
27
|
};
|
@@ -1,36 +1,27 @@
|
|
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 {
|
7
|
-
import type { PostTags } from "./PostTags";
|
8
|
-
import type { SubscribedType } from "./SubscribedType";
|
9
|
+
import type { PostActions } from "./PostActions";
|
9
10
|
/**
|
10
11
|
* A person post mention view.
|
11
12
|
*/
|
12
13
|
export type PersonPostMentionView = {
|
13
14
|
person_post_mention: PersonPostMention;
|
15
|
+
recipient: Person;
|
14
16
|
post: Post;
|
15
17
|
creator: Person;
|
16
18
|
community: Community;
|
17
19
|
image_details?: ImageDetails;
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
community_actions?: CommunityActions;
|
21
|
+
person_actions?: PersonActions;
|
22
|
+
post_actions?: PostActions;
|
23
|
+
instance_actions?: InstanceActions;
|
24
|
+
creator_community_actions?: CommunityActions;
|
23
25
|
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
26
|
can_mod: boolean;
|
36
27
|
};
|
@@ -1,10 +1,10 @@
|
|
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
|
+
instance_actions?: InstanceActions;
|
10
10
|
};
|
package/dist/types/Post.d.ts
CHANGED
@@ -79,4 +79,14 @@ 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;
|
82
92
|
};
|
@@ -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,7 @@
|
|
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
|
6
|
+
*/
|
7
|
+
export type PostPaginationCursor = string;
|
@@ -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 {
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
};
|
package/dist/types/PostView.d.ts
CHANGED
@@ -1,10 +1,11 @@
|
|
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 {
|
6
|
-
import type { PostTags } from "./PostTags";
|
7
|
-
import type { SubscribedType } from "./SubscribedType";
|
8
|
+
import type { PostActions } from "./PostActions";
|
8
9
|
/**
|
9
10
|
* A post view.
|
10
11
|
*/
|
@@ -13,21 +14,11 @@ export type PostView = {
|
|
13
14
|
creator: Person;
|
14
15
|
community: Community;
|
15
16
|
image_details?: ImageDetails;
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
community_actions?: CommunityActions;
|
18
|
+
person_actions?: PersonActions;
|
19
|
+
post_actions?: PostActions;
|
20
|
+
instance_actions?: InstanceActions;
|
21
|
+
creator_community_actions?: CommunityActions;
|
19
22
|
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;
|
32
23
|
can_mod: boolean;
|
33
24
|
};
|