Adding combined inbox and routes.

This commit is contained in:
Dessalines 2025-01-14 18:00:28 -05:00
parent 53a9e949e6
commit 82be99929f
25 changed files with 175 additions and 170 deletions

View file

@ -14,7 +14,6 @@ import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
import { BlockPerson } from "./types/BlockPerson"; import { BlockPerson } from "./types/BlockPerson";
import { BlockPersonResponse } from "./types/BlockPersonResponse"; import { BlockPersonResponse } from "./types/BlockPersonResponse";
import { ChangePassword } from "./types/ChangePassword"; import { ChangePassword } from "./types/ChangePassword";
import { CommentReplyResponse } from "./types/CommentReplyResponse";
import { CommentReportResponse } from "./types/CommentReportResponse"; import { CommentReportResponse } from "./types/CommentReportResponse";
import { CommentResponse } from "./types/CommentResponse"; import { CommentResponse } from "./types/CommentResponse";
import { CommunityResponse } from "./types/CommunityResponse"; import { CommunityResponse } from "./types/CommunityResponse";
@ -60,15 +59,10 @@ import { GetModlog } from "./types/GetModlog";
import { GetModlogResponse } from "./types/GetModlogResponse"; import { GetModlogResponse } from "./types/GetModlogResponse";
import { GetPersonDetails } from "./types/GetPersonDetails"; import { GetPersonDetails } from "./types/GetPersonDetails";
import { GetPersonDetailsResponse } from "./types/GetPersonDetailsResponse"; import { GetPersonDetailsResponse } from "./types/GetPersonDetailsResponse";
import { GetPersonMentions } from "./types/GetPersonMentions";
import { GetPersonMentionsResponse } from "./types/GetPersonMentionsResponse";
import { GetPost } from "./types/GetPost"; import { GetPost } from "./types/GetPost";
import { GetPostResponse } from "./types/GetPostResponse"; import { GetPostResponse } from "./types/GetPostResponse";
import { GetPosts } from "./types/GetPosts"; import { GetPosts } from "./types/GetPosts";
import { GetPostsResponse } from "./types/GetPostsResponse"; import { GetPostsResponse } from "./types/GetPostsResponse";
import { GetPrivateMessages } from "./types/GetPrivateMessages";
import { GetReplies } from "./types/GetReplies";
import { GetRepliesResponse } from "./types/GetRepliesResponse";
import { GetReportCount } from "./types/GetReportCount"; import { GetReportCount } from "./types/GetReportCount";
import { GetReportCountResponse } from "./types/GetReportCountResponse"; import { GetReportCountResponse } from "./types/GetReportCountResponse";
import { GetSiteMetadata } from "./types/GetSiteMetadata"; import { GetSiteMetadata } from "./types/GetSiteMetadata";
@ -84,17 +78,14 @@ import { LockPost } from "./types/LockPost";
import { Login } from "./types/Login"; import { Login } from "./types/Login";
import { LoginResponse } from "./types/LoginResponse"; import { LoginResponse } from "./types/LoginResponse";
import { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead"; import { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
import { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
import { MarkPostAsRead } from "./types/MarkPostAsRead"; import { MarkPostAsRead } from "./types/MarkPostAsRead";
import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead"; import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset"; import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
import { PasswordReset } from "./types/PasswordReset"; import { PasswordReset } from "./types/PasswordReset";
import { PersonMentionResponse } from "./types/PersonMentionResponse";
import { PostReportResponse } from "./types/PostReportResponse"; import { PostReportResponse } from "./types/PostReportResponse";
import { PostResponse } from "./types/PostResponse"; import { PostResponse } from "./types/PostResponse";
import { PrivateMessageReportResponse } from "./types/PrivateMessageReportResponse"; import { PrivateMessageReportResponse } from "./types/PrivateMessageReportResponse";
import { PrivateMessageResponse } from "./types/PrivateMessageResponse"; import { PrivateMessageResponse } from "./types/PrivateMessageResponse";
import { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
import { PurgeComment } from "./types/PurgeComment"; import { PurgeComment } from "./types/PurgeComment";
import { PurgeCommunity } from "./types/PurgeCommunity"; import { PurgeCommunity } from "./types/PurgeCommunity";
import { PurgePerson } from "./types/PurgePerson"; import { PurgePerson } from "./types/PurgePerson";
@ -160,6 +151,10 @@ import { ListPersonSaved } from "./types/ListPersonSaved";
import { ListPersonSavedResponse } from "./types/ListPersonSavedResponse"; import { ListPersonSavedResponse } from "./types/ListPersonSavedResponse";
import { DeleteImageParams } from "./types/DeleteImageParams"; import { DeleteImageParams } from "./types/DeleteImageParams";
import { UploadImageResponse } from "./types/UploadImageResponse"; import { UploadImageResponse } from "./types/UploadImageResponse";
import { ListInboxResponse } from "./types/ListInboxResponse";
import { ListInbox } from "./types/ListInbox";
import { MarkPersonCommentMentionAsRead } from "./types/MarkPersonCommentMentionAsRead";
import { MarkPersonPostMentionAsRead } from "./types/MarkPersonPostMentionAsRead";
enum HttpType { enum HttpType {
Get = "GET", Get = "GET",
@ -949,7 +944,7 @@ export class LemmyHttp {
form: MarkCommentReplyAsRead, form: MarkCommentReplyAsRead,
options?: RequestOptions, options?: RequestOptions,
) { ) {
return this.#wrapper<MarkCommentReplyAsRead, CommentReplyResponse>( return this.#wrapper<MarkCommentReplyAsRead, SuccessResponse>(
HttpType.Post, HttpType.Post,
"/comment/mark_as_read", "/comment/mark_as_read",
form, form,
@ -1069,20 +1064,6 @@ export class LemmyHttp {
); );
} }
/**
* Get / fetch private messages.
*
* `HTTP.GET /private_message/list`
*/
getPrivateMessages(form: GetPrivateMessages, options?: RequestOptions) {
return this.#wrapper<GetPrivateMessages, PrivateMessagesResponse>(
HttpType.Get,
"/private_message/list",
form,
options,
);
}
/** /**
* Create a private message. * Create a private message.
* *
@ -1242,60 +1223,35 @@ export class LemmyHttp {
); );
} }
/**
* Get mentions for your user.
*
* `HTTP.GET /account/mention`
*/
getPersonMentions(form: GetPersonMentions, options?: RequestOptions) {
return this.#wrapper<GetPersonMentions, GetPersonMentionsResponse>(
HttpType.Get,
"/account/mention",
form,
options,
);
}
/** /**
* Mark a person mention as read. * Mark a person mention as read.
* *
* `HTTP.POST /account/mention/mark_as_read` * `HTTP.POST /account/mention/comment/mark_as_read`
*/ */
markPersonMentionAsRead( markCommentMentionAsRead(
form: MarkPersonMentionAsRead, form: MarkPersonCommentMentionAsRead,
options?: RequestOptions, options?: RequestOptions,
) { ) {
return this.#wrapper<MarkPersonMentionAsRead, PersonMentionResponse>( return this.#wrapper<MarkPersonCommentMentionAsRead, SuccessResponse>(
HttpType.Post, HttpType.Post,
"/account/mention/mark_as_read", "/account/mention/comment/mark_as_read",
form, form,
options, options,
); );
} }
/** /**
* Mark a person mention as read. * Mark a person post body mention as read.
* *
* `HTTP.POST /account/mention/mark_as_read` * `HTTP.POST /account/mention/post/mark_as_read`
*/ */
markPersonAllMentionAsRead(options?: RequestOptions) { markPostMentionAsRead(
return this.#wrapper<object, PersonMentionResponse>( form: MarkPersonPostMentionAsRead,
options?: RequestOptions,
) {
return this.#wrapper<MarkPersonPostMentionAsRead, SuccessResponse>(
HttpType.Post, HttpType.Post,
"/account/mention/mark_as_read", "/account/mention/post/mark_as_read",
{},
options,
);
}
/**
* Get comment replies.
*
* `HTTP.GET /account/replies`
*/
getReplies(form: GetReplies, options?: RequestOptions) {
return this.#wrapper<GetReplies, GetRepliesResponse>(
HttpType.Get,
"/account/replies",
form, form,
options, options,
); );
@ -1405,12 +1361,12 @@ export class LemmyHttp {
/** /**
* Mark all replies as read. * Mark all replies as read.
* *
* `HTTP.POST /account/mention/mark_as_read/all` * `HTTP.POST /account/mark_as_read/all`
*/ */
markAllAsRead(options?: RequestOptions) { markAllNotificationsAsRead(options?: RequestOptions) {
return this.#wrapper<object, GetRepliesResponse>( return this.#wrapper<object, SuccessResponse>(
HttpType.Post, HttpType.Post,
"/account/mention/mark_as_read/all", "/account/mark_as_read/all",
{}, {},
options, options,
); );
@ -1472,6 +1428,20 @@ export class LemmyHttp {
); );
} }
/**
* Get your inbox (replies, comment mentions, post mentions, and messages)
*
* `HTTP.GET /account/inbox`
*/
listInbox(form: ListInbox, options?: RequestOptions) {
return this.#wrapper<ListInbox, ListInboxResponse>(
HttpType.Get,
"/account/inbox",
form,
options,
);
}
/** /**
* Verify your email * Verify your email
* *

View file

@ -44,7 +44,6 @@ export { CommentAggregates } from "./types/CommentAggregates";
export { CommentId } from "./types/CommentId"; export { CommentId } from "./types/CommentId";
export { CommentReply } from "./types/CommentReply"; export { CommentReply } from "./types/CommentReply";
export { CommentReplyId } from "./types/CommentReplyId"; export { CommentReplyId } from "./types/CommentReplyId";
export { CommentReplyResponse } from "./types/CommentReplyResponse";
export { CommentReplyView } from "./types/CommentReplyView"; export { CommentReplyView } from "./types/CommentReplyView";
export { CommentReport } from "./types/CommentReport"; export { CommentReport } from "./types/CommentReport";
export { CommentReportId } from "./types/CommentReportId"; export { CommentReportId } from "./types/CommentReportId";
@ -122,17 +121,12 @@ export { GetModlog } from "./types/GetModlog";
export { GetModlogResponse } from "./types/GetModlogResponse"; export { GetModlogResponse } from "./types/GetModlogResponse";
export { GetPersonDetails } from "./types/GetPersonDetails"; export { GetPersonDetails } from "./types/GetPersonDetails";
export { GetPersonDetailsResponse } from "./types/GetPersonDetailsResponse"; export { GetPersonDetailsResponse } from "./types/GetPersonDetailsResponse";
export { GetPersonMentions } from "./types/GetPersonMentions";
export { GetPersonMentionsResponse } from "./types/GetPersonMentionsResponse";
export { GetPost } from "./types/GetPost"; export { GetPost } from "./types/GetPost";
export { GetPostResponse } from "./types/GetPostResponse"; export { GetPostResponse } from "./types/GetPostResponse";
export { GetPosts } from "./types/GetPosts"; export { GetPosts } from "./types/GetPosts";
export { GetPostsResponse } from "./types/GetPostsResponse"; export { GetPostsResponse } from "./types/GetPostsResponse";
export { GetPrivateMessages } from "./types/GetPrivateMessages";
export { GetRandomCommunity } from "./types/GetRandomCommunity"; export { GetRandomCommunity } from "./types/GetRandomCommunity";
export { GetRegistrationApplication } from "./types/GetRegistrationApplication"; export { GetRegistrationApplication } from "./types/GetRegistrationApplication";
export { GetReplies } from "./types/GetReplies";
export { GetRepliesResponse } from "./types/GetRepliesResponse";
export { GetReportCount } from "./types/GetReportCount"; export { GetReportCount } from "./types/GetReportCount";
export { GetReportCountResponse } from "./types/GetReportCountResponse"; export { GetReportCountResponse } from "./types/GetReportCountResponse";
export { GetSiteMetadata } from "./types/GetSiteMetadata"; export { GetSiteMetadata } from "./types/GetSiteMetadata";
@ -145,6 +139,9 @@ export { HidePost } from "./types/HidePost";
export { ImageDetails } from "./types/ImageDetails"; export { ImageDetails } from "./types/ImageDetails";
export { ImageGetParams } from "./types/ImageGetParams"; export { ImageGetParams } from "./types/ImageGetParams";
export { ImageProxyParams } from "./types/ImageProxyParams"; export { ImageProxyParams } from "./types/ImageProxyParams";
export { InboxCombinedPaginationCursor } from "./types/InboxCombinedPaginationCursor";
export { InboxCombinedView } from "./types/InboxCombinedView";
export { InboxDataType } from "./types/InboxDataType";
export { Instance } from "./types/Instance"; export { Instance } from "./types/Instance";
export { InstanceId } from "./types/InstanceId"; export { InstanceId } from "./types/InstanceId";
export { InstanceWithFederationState } from "./types/InstanceWithFederationState"; export { InstanceWithFederationState } from "./types/InstanceWithFederationState";
@ -160,6 +157,8 @@ export { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows
export { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse"; export { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
export { ListCustomEmojis } from "./types/ListCustomEmojis"; export { ListCustomEmojis } from "./types/ListCustomEmojis";
export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse"; export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
export { ListInbox } from "./types/ListInbox";
export { ListInboxResponse } from "./types/ListInboxResponse";
export { ListLoginsResponse } from "./types/ListLoginsResponse"; export { ListLoginsResponse } from "./types/ListLoginsResponse";
export { ListMedia } from "./types/ListMedia"; export { ListMedia } from "./types/ListMedia";
export { ListMediaResponse } from "./types/ListMediaResponse"; export { ListMediaResponse } from "./types/ListMediaResponse";
@ -192,7 +191,8 @@ export { LoginResponse } from "./types/LoginResponse";
export { LoginToken } from "./types/LoginToken"; export { LoginToken } from "./types/LoginToken";
export { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead"; export { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
export { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead"; export { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead";
export { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead"; export { MarkPersonCommentMentionAsRead } from "./types/MarkPersonCommentMentionAsRead";
export { MarkPersonPostMentionAsRead } from "./types/MarkPersonPostMentionAsRead";
export { MarkPostAsRead } from "./types/MarkPostAsRead"; export { MarkPostAsRead } from "./types/MarkPostAsRead";
export { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead"; export { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
export { ModAdd } from "./types/ModAdd"; export { ModAdd } from "./types/ModAdd";
@ -242,14 +242,16 @@ export { PasswordReset } from "./types/PasswordReset";
export { PendingFollow } from "./types/PendingFollow"; export { PendingFollow } from "./types/PendingFollow";
export { Person } from "./types/Person"; export { Person } from "./types/Person";
export { PersonAggregates } from "./types/PersonAggregates"; export { PersonAggregates } from "./types/PersonAggregates";
export { PersonCommentMention } from "./types/PersonCommentMention";
export { PersonCommentMentionId } from "./types/PersonCommentMentionId";
export { PersonCommentMentionView } from "./types/PersonCommentMentionView";
export { PersonContentCombinedPaginationCursor } from "./types/PersonContentCombinedPaginationCursor"; export { PersonContentCombinedPaginationCursor } from "./types/PersonContentCombinedPaginationCursor";
export { PersonContentCombinedView } from "./types/PersonContentCombinedView"; export { PersonContentCombinedView } from "./types/PersonContentCombinedView";
export { PersonContentType } from "./types/PersonContentType"; export { PersonContentType } from "./types/PersonContentType";
export { PersonId } from "./types/PersonId"; export { PersonId } from "./types/PersonId";
export { PersonMention } from "./types/PersonMention"; export { PersonPostMention } from "./types/PersonPostMention";
export { PersonMentionId } from "./types/PersonMentionId"; export { PersonPostMentionId } from "./types/PersonPostMentionId";
export { PersonMentionResponse } from "./types/PersonMentionResponse"; export { PersonPostMentionView } from "./types/PersonPostMentionView";
export { PersonMentionView } from "./types/PersonMentionView";
export { PersonSavedCombinedPaginationCursor } from "./types/PersonSavedCombinedPaginationCursor"; export { PersonSavedCombinedPaginationCursor } from "./types/PersonSavedCombinedPaginationCursor";
export { PersonView } from "./types/PersonView"; export { PersonView } from "./types/PersonView";
export { Post } from "./types/Post"; export { Post } from "./types/Post";
@ -273,7 +275,6 @@ export { PrivateMessageReportResponse } from "./types/PrivateMessageReportRespon
export { PrivateMessageReportView } from "./types/PrivateMessageReportView"; export { PrivateMessageReportView } from "./types/PrivateMessageReportView";
export { PrivateMessageResponse } from "./types/PrivateMessageResponse"; export { PrivateMessageResponse } from "./types/PrivateMessageResponse";
export { PrivateMessageView } from "./types/PrivateMessageView"; export { PrivateMessageView } from "./types/PrivateMessageView";
export { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
export { PublicOAuthProvider } from "./types/PublicOAuthProvider"; export { PublicOAuthProvider } from "./types/PublicOAuthProvider";
export { PurgeComment } from "./types/PurgeComment"; export { PurgeComment } from "./types/PurgeComment";
export { PurgeCommunity } from "./types/PurgeCommunity"; export { PurgeCommunity } from "./types/PurgeCommunity";

View file

@ -1,7 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentReplyView } from "./CommentReplyView";
/**
* The response for a comment reply action.
*/
export type CommentReplyResponse = { comment_reply_view: CommentReplyView };

View file

@ -1,12 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentSortType } from "./CommentSortType";
/**
* Get mentions for your user.
*/
export type GetPersonMentions = {
sort?: CommentSortType;
page?: number;
limit?: number;
unread_only?: boolean;
};

View file

@ -1,7 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonMentionView } from "./PersonMentionView";
/**
* The response of mentions for your user.
*/
export type GetPersonMentionsResponse = { mentions: Array<PersonMentionView> };

View file

@ -1,12 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId";
/**
* Get your private messages.
*/
export type GetPrivateMessages = {
unread_only?: boolean;
page?: number;
limit?: number;
creator_id?: PersonId;
};

View file

@ -1,12 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentSortType } from "./CommentSortType";
/**
* Get comment replies.
*/
export type GetReplies = {
sort?: CommentSortType;
page?: number;
limit?: number;
unread_only?: boolean;
};

View file

@ -1,7 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentReplyView } from "./CommentReplyView";
/**
* Fetches your replies.
*/
export type GetRepliesResponse = { replies: Array<CommentReplyView> };

View file

@ -1,10 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/** /**
* A response containing counts for your notifications. * A response containing a count of unread notifications.
*/ */
export type GetUnreadCountResponse = { export type GetUnreadCountResponse = { count: number };
replies: number;
mentions: number;
private_messages: number;
};

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* like PaginationCursor but for the report_combined table
*/
export type InboxCombinedPaginationCursor = string;

View file

@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentReplyView } from "./CommentReplyView";
import type { PersonCommentMentionView } from "./PersonCommentMentionView";
import type { PersonPostMentionView } from "./PersonPostMentionView";
import type { PrivateMessageView } from "./PrivateMessageView";
export type InboxCombinedView =
| ({ type_: "CommentReply" } & CommentReplyView)
| ({ type_: "CommentMention" } & PersonCommentMentionView)
| ({ type_: "PostMention" } & PersonPostMentionView)
| ({ type_: "PrivateMessage" } & PrivateMessageView);

View file

@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* A list of possible types for the inbox.
*/
export type InboxDataType =
| "All"
| "CommentReply"
| "CommentMention"
| "PostMention"
| "PrivateMessage";

View file

@ -98,7 +98,7 @@ export type LemmyErrorType =
| { error: "couldnt_hide_post" } | { error: "couldnt_hide_post" }
| { error: "couldnt_update_community" } | { error: "couldnt_update_community" }
| { error: "couldnt_update_replies" } | { error: "couldnt_update_replies" }
| { error: "couldnt_update_person_mentions" } | { error: "couldnt_update_person_comment_mentions" }
| { error: "couldnt_create_post" } | { error: "couldnt_create_post" }
| { error: "couldnt_create_private_message" } | { error: "couldnt_create_private_message" }
| { error: "couldnt_update_private" } | { error: "couldnt_update_private" }

13
src/types/ListInbox.ts Normal file
View file

@ -0,0 +1,13 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { InboxCombinedPaginationCursor } from "./InboxCombinedPaginationCursor";
import type { InboxDataType } from "./InboxDataType";
/**
* Get your inbox (replies, comment mentions, post mentions, and messages)
*/
export type ListInbox = {
type_?: InboxDataType;
unread_only?: boolean;
page_cursor?: InboxCombinedPaginationCursor;
page_back?: boolean;
};

View file

@ -0,0 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { InboxCombinedView } from "./InboxCombinedView";
/**
* Get your inbox (replies, comment mentions, post mentions, and messages)
*/
export type ListInboxResponse = { inbox: Array<InboxCombinedView> };

View file

@ -0,0 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonCommentMentionId } from "./PersonCommentMentionId";
/**
* Mark a person mention as read.
*/
export type MarkPersonCommentMentionAsRead = {
person_comment_mention_id: PersonCommentMentionId;
read: boolean;
};

View file

@ -1,10 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonMentionId } from "./PersonMentionId"; import type { PersonPostMentionId } from "./PersonPostMentionId";
/** /**
* Mark a person mention as read. * Mark a person mention as read.
*/ */
export type MarkPersonMentionAsRead = { export type MarkPersonPostMentionAsRead = {
person_mention_id: PersonMentionId; person_post_mention_id: PersonPostMentionId;
read: boolean; read: boolean;
}; };

View file

@ -1,13 +1,13 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId"; import type { CommentId } from "./CommentId";
import type { PersonCommentMentionId } from "./PersonCommentMentionId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PersonMentionId } from "./PersonMentionId";
/** /**
* A person mention. * A person mention.
*/ */
export type PersonMention = { export type PersonCommentMention = {
id: PersonMentionId; id: PersonCommentMentionId;
recipient_id: PersonId; recipient_id: PersonId;
comment_id: CommentId; comment_id: CommentId;
read: boolean; read: boolean;

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* The person comment mention id.
*/
export type PersonCommentMentionId = number;

View file

@ -3,15 +3,15 @@ import type { Comment } from "./Comment";
import type { CommentAggregates } from "./CommentAggregates"; import type { CommentAggregates } from "./CommentAggregates";
import type { Community } from "./Community"; import type { Community } from "./Community";
import type { Person } from "./Person"; import type { Person } from "./Person";
import type { PersonMention } from "./PersonMention"; import type { PersonCommentMention } from "./PersonCommentMention";
import type { Post } from "./Post"; import type { Post } from "./Post";
import type { SubscribedType } from "./SubscribedType"; import type { SubscribedType } from "./SubscribedType";
/** /**
* A person mention view. * A person comment mention view.
*/ */
export type PersonMentionView = { export type PersonCommentMentionView = {
person_mention: PersonMention; person_comment_mention: PersonCommentMention;
comment: Comment; comment: Comment;
creator: Person; creator: Person;
post: Post; post: Post;

View file

@ -1,7 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonMentionView } from "./PersonMentionView";
/**
* The response for a person mention action.
*/
export type PersonMentionResponse = { person_mention_view: PersonMentionView };

View file

@ -0,0 +1,15 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId";
import type { PersonPostMentionId } from "./PersonPostMentionId";
import type { PostId } from "./PostId";
/**
* A person mention.
*/
export type PersonPostMention = {
id: PersonPostMentionId;
recipient_id: PersonId;
post_id: PostId;
read: boolean;
published: string;
};

View file

@ -1,6 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/** /**
* The person mention id. * The person post mention id.
*/ */
export type PersonMentionId = number; export type PersonPostMentionId = number;

View file

@ -0,0 +1,32 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Community } from "./Community";
import type { ImageDetails } from "./ImageDetails";
import type { Person } from "./Person";
import type { PersonPostMention } from "./PersonPostMention";
import type { Post } from "./Post";
import type { PostAggregates } from "./PostAggregates";
import type { SubscribedType } from "./SubscribedType";
/**
* A person post mention view.
*/
export type PersonPostMentionView = {
person_post_mention: PersonPostMention;
post: Post;
creator: Person;
community: Community;
image_details?: ImageDetails;
recipient: Person;
counts: PostAggregates;
creator_banned_from_community: boolean;
banned_from_community: boolean;
creator_is_moderator: boolean;
creator_is_admin: boolean;
subscribed: SubscribedType;
saved: boolean;
read: boolean;
hidden: boolean;
creator_blocked: boolean;
my_vote?: number;
unread_comments: number;
};

View file

@ -1,9 +0,0 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PrivateMessageView } from "./PrivateMessageView";
/**
* The private messages response.
*/
export type PrivateMessagesResponse = {
private_messages: Array<PrivateMessageView>;
};