mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2025-02-05 16:34:43 +00:00
Adding combined inbox and routes.
This commit is contained in:
parent
53a9e949e6
commit
82be99929f
25 changed files with 175 additions and 170 deletions
102
src/http.ts
102
src/http.ts
|
@ -14,7 +14,6 @@ import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
|
|||
import { BlockPerson } from "./types/BlockPerson";
|
||||
import { BlockPersonResponse } from "./types/BlockPersonResponse";
|
||||
import { ChangePassword } from "./types/ChangePassword";
|
||||
import { CommentReplyResponse } from "./types/CommentReplyResponse";
|
||||
import { CommentReportResponse } from "./types/CommentReportResponse";
|
||||
import { CommentResponse } from "./types/CommentResponse";
|
||||
import { CommunityResponse } from "./types/CommunityResponse";
|
||||
|
@ -60,15 +59,10 @@ import { GetModlog } from "./types/GetModlog";
|
|||
import { GetModlogResponse } from "./types/GetModlogResponse";
|
||||
import { GetPersonDetails } from "./types/GetPersonDetails";
|
||||
import { GetPersonDetailsResponse } from "./types/GetPersonDetailsResponse";
|
||||
import { GetPersonMentions } from "./types/GetPersonMentions";
|
||||
import { GetPersonMentionsResponse } from "./types/GetPersonMentionsResponse";
|
||||
import { GetPost } from "./types/GetPost";
|
||||
import { GetPostResponse } from "./types/GetPostResponse";
|
||||
import { GetPosts } from "./types/GetPosts";
|
||||
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 { GetReportCountResponse } from "./types/GetReportCountResponse";
|
||||
import { GetSiteMetadata } from "./types/GetSiteMetadata";
|
||||
|
@ -84,17 +78,14 @@ import { LockPost } from "./types/LockPost";
|
|||
import { Login } from "./types/Login";
|
||||
import { LoginResponse } from "./types/LoginResponse";
|
||||
import { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
|
||||
import { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
|
||||
import { MarkPostAsRead } from "./types/MarkPostAsRead";
|
||||
import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
|
||||
import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
|
||||
import { PasswordReset } from "./types/PasswordReset";
|
||||
import { PersonMentionResponse } from "./types/PersonMentionResponse";
|
||||
import { PostReportResponse } from "./types/PostReportResponse";
|
||||
import { PostResponse } from "./types/PostResponse";
|
||||
import { PrivateMessageReportResponse } from "./types/PrivateMessageReportResponse";
|
||||
import { PrivateMessageResponse } from "./types/PrivateMessageResponse";
|
||||
import { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
|
||||
import { PurgeComment } from "./types/PurgeComment";
|
||||
import { PurgeCommunity } from "./types/PurgeCommunity";
|
||||
import { PurgePerson } from "./types/PurgePerson";
|
||||
|
@ -160,6 +151,10 @@ import { ListPersonSaved } from "./types/ListPersonSaved";
|
|||
import { ListPersonSavedResponse } from "./types/ListPersonSavedResponse";
|
||||
import { DeleteImageParams } from "./types/DeleteImageParams";
|
||||
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 {
|
||||
Get = "GET",
|
||||
|
@ -949,7 +944,7 @@ export class LemmyHttp {
|
|||
form: MarkCommentReplyAsRead,
|
||||
options?: RequestOptions,
|
||||
) {
|
||||
return this.#wrapper<MarkCommentReplyAsRead, CommentReplyResponse>(
|
||||
return this.#wrapper<MarkCommentReplyAsRead, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/comment/mark_as_read",
|
||||
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.
|
||||
*
|
||||
|
@ -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.
|
||||
*
|
||||
* `HTTP.POST /account/mention/mark_as_read`
|
||||
* `HTTP.POST /account/mention/comment/mark_as_read`
|
||||
*/
|
||||
markPersonMentionAsRead(
|
||||
form: MarkPersonMentionAsRead,
|
||||
markCommentMentionAsRead(
|
||||
form: MarkPersonCommentMentionAsRead,
|
||||
options?: RequestOptions,
|
||||
) {
|
||||
return this.#wrapper<MarkPersonMentionAsRead, PersonMentionResponse>(
|
||||
return this.#wrapper<MarkPersonCommentMentionAsRead, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/account/mention/mark_as_read",
|
||||
"/account/mention/comment/mark_as_read",
|
||||
form,
|
||||
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) {
|
||||
return this.#wrapper<object, PersonMentionResponse>(
|
||||
markPostMentionAsRead(
|
||||
form: MarkPersonPostMentionAsRead,
|
||||
options?: RequestOptions,
|
||||
) {
|
||||
return this.#wrapper<MarkPersonPostMentionAsRead, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/account/mention/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",
|
||||
"/account/mention/post/mark_as_read",
|
||||
form,
|
||||
options,
|
||||
);
|
||||
|
@ -1405,12 +1361,12 @@ export class LemmyHttp {
|
|||
/**
|
||||
* Mark all replies as read.
|
||||
*
|
||||
* `HTTP.POST /account/mention/mark_as_read/all`
|
||||
* `HTTP.POST /account/mark_as_read/all`
|
||||
*/
|
||||
markAllAsRead(options?: RequestOptions) {
|
||||
return this.#wrapper<object, GetRepliesResponse>(
|
||||
markAllNotificationsAsRead(options?: RequestOptions) {
|
||||
return this.#wrapper<object, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/account/mention/mark_as_read/all",
|
||||
"/account/mark_as_read/all",
|
||||
{},
|
||||
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
|
||||
*
|
||||
|
|
25
src/index.ts
25
src/index.ts
|
@ -44,7 +44,6 @@ export { CommentAggregates } from "./types/CommentAggregates";
|
|||
export { CommentId } from "./types/CommentId";
|
||||
export { CommentReply } from "./types/CommentReply";
|
||||
export { CommentReplyId } from "./types/CommentReplyId";
|
||||
export { CommentReplyResponse } from "./types/CommentReplyResponse";
|
||||
export { CommentReplyView } from "./types/CommentReplyView";
|
||||
export { CommentReport } from "./types/CommentReport";
|
||||
export { CommentReportId } from "./types/CommentReportId";
|
||||
|
@ -122,17 +121,12 @@ export { GetModlog } from "./types/GetModlog";
|
|||
export { GetModlogResponse } from "./types/GetModlogResponse";
|
||||
export { GetPersonDetails } from "./types/GetPersonDetails";
|
||||
export { GetPersonDetailsResponse } from "./types/GetPersonDetailsResponse";
|
||||
export { GetPersonMentions } from "./types/GetPersonMentions";
|
||||
export { GetPersonMentionsResponse } from "./types/GetPersonMentionsResponse";
|
||||
export { GetPost } from "./types/GetPost";
|
||||
export { GetPostResponse } from "./types/GetPostResponse";
|
||||
export { GetPosts } from "./types/GetPosts";
|
||||
export { GetPostsResponse } from "./types/GetPostsResponse";
|
||||
export { GetPrivateMessages } from "./types/GetPrivateMessages";
|
||||
export { GetRandomCommunity } from "./types/GetRandomCommunity";
|
||||
export { GetRegistrationApplication } from "./types/GetRegistrationApplication";
|
||||
export { GetReplies } from "./types/GetReplies";
|
||||
export { GetRepliesResponse } from "./types/GetRepliesResponse";
|
||||
export { GetReportCount } from "./types/GetReportCount";
|
||||
export { GetReportCountResponse } from "./types/GetReportCountResponse";
|
||||
export { GetSiteMetadata } from "./types/GetSiteMetadata";
|
||||
|
@ -145,6 +139,9 @@ export { HidePost } from "./types/HidePost";
|
|||
export { ImageDetails } from "./types/ImageDetails";
|
||||
export { ImageGetParams } from "./types/ImageGetParams";
|
||||
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 { InstanceId } from "./types/InstanceId";
|
||||
export { InstanceWithFederationState } from "./types/InstanceWithFederationState";
|
||||
|
@ -160,6 +157,8 @@ export { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows
|
|||
export { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
|
||||
export { ListCustomEmojis } from "./types/ListCustomEmojis";
|
||||
export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
|
||||
export { ListInbox } from "./types/ListInbox";
|
||||
export { ListInboxResponse } from "./types/ListInboxResponse";
|
||||
export { ListLoginsResponse } from "./types/ListLoginsResponse";
|
||||
export { ListMedia } from "./types/ListMedia";
|
||||
export { ListMediaResponse } from "./types/ListMediaResponse";
|
||||
|
@ -192,7 +191,8 @@ export { LoginResponse } from "./types/LoginResponse";
|
|||
export { LoginToken } from "./types/LoginToken";
|
||||
export { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
|
||||
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 { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
|
||||
export { ModAdd } from "./types/ModAdd";
|
||||
|
@ -242,14 +242,16 @@ export { PasswordReset } from "./types/PasswordReset";
|
|||
export { PendingFollow } from "./types/PendingFollow";
|
||||
export { Person } from "./types/Person";
|
||||
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 { PersonContentCombinedView } from "./types/PersonContentCombinedView";
|
||||
export { PersonContentType } from "./types/PersonContentType";
|
||||
export { PersonId } from "./types/PersonId";
|
||||
export { PersonMention } from "./types/PersonMention";
|
||||
export { PersonMentionId } from "./types/PersonMentionId";
|
||||
export { PersonMentionResponse } from "./types/PersonMentionResponse";
|
||||
export { PersonMentionView } from "./types/PersonMentionView";
|
||||
export { PersonPostMention } from "./types/PersonPostMention";
|
||||
export { PersonPostMentionId } from "./types/PersonPostMentionId";
|
||||
export { PersonPostMentionView } from "./types/PersonPostMentionView";
|
||||
export { PersonSavedCombinedPaginationCursor } from "./types/PersonSavedCombinedPaginationCursor";
|
||||
export { PersonView } from "./types/PersonView";
|
||||
export { Post } from "./types/Post";
|
||||
|
@ -273,7 +275,6 @@ export { PrivateMessageReportResponse } from "./types/PrivateMessageReportRespon
|
|||
export { PrivateMessageReportView } from "./types/PrivateMessageReportView";
|
||||
export { PrivateMessageResponse } from "./types/PrivateMessageResponse";
|
||||
export { PrivateMessageView } from "./types/PrivateMessageView";
|
||||
export { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
|
||||
export { PublicOAuthProvider } from "./types/PublicOAuthProvider";
|
||||
export { PurgeComment } from "./types/PurgeComment";
|
||||
export { PurgeCommunity } from "./types/PurgeCommunity";
|
||||
|
|
|
@ -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 };
|
|
@ -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;
|
||||
};
|
|
@ -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> };
|
|
@ -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;
|
||||
};
|
|
@ -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;
|
||||
};
|
|
@ -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> };
|
|
@ -1,10 +1,6 @@
|
|||
// 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 = {
|
||||
replies: number;
|
||||
mentions: number;
|
||||
private_messages: number;
|
||||
};
|
||||
export type GetUnreadCountResponse = { count: number };
|
||||
|
|
6
src/types/InboxCombinedPaginationCursor.ts
Normal file
6
src/types/InboxCombinedPaginationCursor.ts
Normal 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;
|
11
src/types/InboxCombinedView.ts
Normal file
11
src/types/InboxCombinedView.ts
Normal 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);
|
11
src/types/InboxDataType.ts
Normal file
11
src/types/InboxDataType.ts
Normal 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";
|
|
@ -98,7 +98,7 @@ export type LemmyErrorType =
|
|||
| { error: "couldnt_hide_post" }
|
||||
| { error: "couldnt_update_community" }
|
||||
| { error: "couldnt_update_replies" }
|
||||
| { error: "couldnt_update_person_mentions" }
|
||||
| { error: "couldnt_update_person_comment_mentions" }
|
||||
| { error: "couldnt_create_post" }
|
||||
| { error: "couldnt_create_private_message" }
|
||||
| { error: "couldnt_update_private" }
|
||||
|
|
13
src/types/ListInbox.ts
Normal file
13
src/types/ListInbox.ts
Normal 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;
|
||||
};
|
7
src/types/ListInboxResponse.ts
Normal file
7
src/types/ListInboxResponse.ts
Normal 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> };
|
10
src/types/MarkPersonCommentMentionAsRead.ts
Normal file
10
src/types/MarkPersonCommentMentionAsRead.ts
Normal 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;
|
||||
};
|
|
@ -1,10 +1,10 @@
|
|||
// 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.
|
||||
*/
|
||||
export type MarkPersonMentionAsRead = {
|
||||
person_mention_id: PersonMentionId;
|
||||
export type MarkPersonPostMentionAsRead = {
|
||||
person_post_mention_id: PersonPostMentionId;
|
||||
read: boolean;
|
||||
};
|
|
@ -1,13 +1,13 @@
|
|||
// 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 { PersonCommentMentionId } from "./PersonCommentMentionId";
|
||||
import type { PersonId } from "./PersonId";
|
||||
import type { PersonMentionId } from "./PersonMentionId";
|
||||
|
||||
/**
|
||||
* A person mention.
|
||||
*/
|
||||
export type PersonMention = {
|
||||
id: PersonMentionId;
|
||||
export type PersonCommentMention = {
|
||||
id: PersonCommentMentionId;
|
||||
recipient_id: PersonId;
|
||||
comment_id: CommentId;
|
||||
read: boolean;
|
6
src/types/PersonCommentMentionId.ts
Normal file
6
src/types/PersonCommentMentionId.ts
Normal 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;
|
|
@ -3,15 +3,15 @@ import type { Comment } from "./Comment";
|
|||
import type { CommentAggregates } from "./CommentAggregates";
|
||||
import type { Community } from "./Community";
|
||||
import type { Person } from "./Person";
|
||||
import type { PersonMention } from "./PersonMention";
|
||||
import type { PersonCommentMention } from "./PersonCommentMention";
|
||||
import type { Post } from "./Post";
|
||||
import type { SubscribedType } from "./SubscribedType";
|
||||
|
||||
/**
|
||||
* A person mention view.
|
||||
* A person comment mention view.
|
||||
*/
|
||||
export type PersonMentionView = {
|
||||
person_mention: PersonMention;
|
||||
export type PersonCommentMentionView = {
|
||||
person_comment_mention: PersonCommentMention;
|
||||
comment: Comment;
|
||||
creator: Person;
|
||||
post: Post;
|
|
@ -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 };
|
15
src/types/PersonPostMention.ts
Normal file
15
src/types/PersonPostMention.ts
Normal 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;
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
// 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;
|
32
src/types/PersonPostMentionView.ts
Normal file
32
src/types/PersonPostMentionView.ts
Normal 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;
|
||||
};
|
|
@ -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>;
|
||||
};
|
Loading…
Reference in a new issue