From 5bb5a6c189a0d96d96a782a4086a241b04cb902f Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 5 Jan 2025 17:58:59 -0500 Subject: [PATCH] Adding combined modlog --- src/http.ts | 32 ++++++++++++++++ src/index.ts | 33 ++++++++++++++-- src/types/AdminAllowInstance.ts | 3 +- src/types/AdminAllowInstanceId.ts | 3 ++ src/types/AdminAllowInstanceView.ts | 2 +- src/types/AdminBlockInstance.ts | 3 +- src/types/AdminBlockInstanceId.ts | 3 ++ src/types/AdminPurgeComment.ts | 3 +- src/types/AdminPurgeCommentId.ts | 3 ++ src/types/AdminPurgeCommunity.ts | 3 +- src/types/AdminPurgeCommunityId.ts | 3 ++ src/types/AdminPurgePerson.ts | 3 +- src/types/AdminPurgePersonId.ts | 3 ++ src/types/AdminPurgePost.ts | 3 +- src/types/AdminPurgePostId.ts | 3 ++ src/types/CreatePost.ts | 2 + src/types/EditPost.ts | 2 + src/types/GetComments.ts | 1 - src/types/GetModlog.ts | 7 ++-- src/types/GetModlogResponse.ts | 38 +------------------ src/types/GetPersonDetails.ts | 7 ---- src/types/GetPersonDetailsResponse.ts | 4 -- src/types/GetPosts.ts | 1 + src/types/GetSiteResponse.ts | 8 ---- src/types/LemmyErrorType.ts | 1 - src/types/ListPersonContent.ts | 20 ++++++++++ src/types/ListPersonContentResponse.ts | 9 +++++ src/types/ListPersonSaved.ts | 12 ++++++ src/types/ListPersonSavedResponse.ts | 9 +++++ src/types/ModAdd.ts | 3 +- src/types/ModAddCommunity.ts | 3 +- src/types/ModAddCommunityId.ts | 3 ++ src/types/ModAddId.ts | 3 ++ src/types/ModBan.ts | 3 +- src/types/ModBanFromCommunity.ts | 3 +- src/types/ModBanFromCommunityId.ts | 3 ++ src/types/ModBanFromCommunityView.ts | 2 +- src/types/ModBanId.ts | 3 ++ src/types/ModBanView.ts | 2 +- src/types/ModFeaturePost.ts | 3 +- src/types/ModFeaturePostId.ts | 3 ++ src/types/ModFeaturePostView.ts | 1 + src/types/ModHideCommunity.ts | 3 +- src/types/ModHideCommunityId.ts | 3 ++ src/types/ModLockPost.ts | 3 +- src/types/ModLockPostId.ts | 3 ++ src/types/ModLockPostView.ts | 1 + src/types/ModRemoveComment.ts | 3 +- src/types/ModRemoveCommentId.ts | 3 ++ src/types/ModRemoveCommentView.ts | 2 +- src/types/ModRemoveCommunity.ts | 3 +- src/types/ModRemoveCommunityId.ts | 3 ++ src/types/ModRemovePost.ts | 3 +- src/types/ModRemovePostId.ts | 3 ++ src/types/ModRemovePostView.ts | 1 + src/types/ModTransferCommunity.ts | 3 +- src/types/ModTransferCommunityId.ts | 3 ++ src/types/ModlogCombinedPaginationCursor.ts | 6 +++ src/types/ModlogCombinedView.ts | 37 ++++++++++++++++++ src/types/ModlogListParams.ts | 19 ---------- .../PersonContentCombinedPaginationCursor.ts | 6 +++ src/types/PersonContentCombinedView.ts | 7 ++++ src/types/PersonContentType.ts | 6 +++ .../PersonSavedCombinedPaginationCursor.ts | 6 +++ src/types/PostTags.ts | 7 ++++ src/types/PostView.ts | 2 + src/types/ReportCombined.ts | 16 -------- src/types/Search.ts | 1 - src/types/SiteResponse.ts | 2 +- src/types/Tag.ts | 29 ++++++++++++++ src/types/{ReportCombinedId.ts => TagId.ts} | 4 +- 71 files changed, 324 insertions(+), 123 deletions(-) create mode 100644 src/types/AdminAllowInstanceId.ts create mode 100644 src/types/AdminBlockInstanceId.ts create mode 100644 src/types/AdminPurgeCommentId.ts create mode 100644 src/types/AdminPurgeCommunityId.ts create mode 100644 src/types/AdminPurgePersonId.ts create mode 100644 src/types/AdminPurgePostId.ts create mode 100644 src/types/ListPersonContent.ts create mode 100644 src/types/ListPersonContentResponse.ts create mode 100644 src/types/ListPersonSaved.ts create mode 100644 src/types/ListPersonSavedResponse.ts create mode 100644 src/types/ModAddCommunityId.ts create mode 100644 src/types/ModAddId.ts create mode 100644 src/types/ModBanFromCommunityId.ts create mode 100644 src/types/ModBanId.ts create mode 100644 src/types/ModFeaturePostId.ts create mode 100644 src/types/ModHideCommunityId.ts create mode 100644 src/types/ModLockPostId.ts create mode 100644 src/types/ModRemoveCommentId.ts create mode 100644 src/types/ModRemoveCommunityId.ts create mode 100644 src/types/ModRemovePostId.ts create mode 100644 src/types/ModTransferCommunityId.ts create mode 100644 src/types/ModlogCombinedPaginationCursor.ts create mode 100644 src/types/ModlogCombinedView.ts delete mode 100644 src/types/ModlogListParams.ts create mode 100644 src/types/PersonContentCombinedPaginationCursor.ts create mode 100644 src/types/PersonContentCombinedView.ts create mode 100644 src/types/PersonContentType.ts create mode 100644 src/types/PersonSavedCombinedPaginationCursor.ts create mode 100644 src/types/PostTags.ts delete mode 100644 src/types/ReportCombined.ts create mode 100644 src/types/Tag.ts rename src/types/{ReportCombinedId.ts => TagId.ts} (64%) diff --git a/src/http.ts b/src/http.ts index c0b7294..ddeb49b 100644 --- a/src/http.ts +++ b/src/http.ts @@ -159,6 +159,10 @@ import { MyUserInfo } from "./types/MyUserInfo"; import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams"; import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams"; import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams"; +import { ListPersonContent } from "./types/ListPersonContent"; +import { ListPersonContentResponse } from "./types/ListPersonContentResponse"; +import { ListPersonSaved } from "./types/ListPersonSaved"; +import { ListPersonSavedResponse } from "./types/ListPersonSavedResponse"; enum HttpType { Get = "GET", @@ -1228,6 +1232,20 @@ export class LemmyHttp { ); } + /** + * List the content for a person. + * + * `HTTP.GET /person/content` + */ + listPersonContent(form: ListPersonContent = {}, options?: RequestOptions) { + return this.#wrapper( + HttpType.Get, + "/person/content", + form, + options, + ); + } + /** * Get mentions for your user. * @@ -1472,6 +1490,20 @@ export class LemmyHttp { ); } + /** + * List your saved content. + * + * `HTTP.GET /account/auth/saved` + */ + listPersonSaved(form: ListPersonSaved, options?: RequestOptions) { + return this.#wrapper( + HttpType.Post, + "/account/auth/saved", + form, + options, + ); + } + /** * Add an admin to your site. * diff --git a/src/index.ts b/src/index.ts index 72acbd5..d09d732 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,18 +11,24 @@ export { AddAdminResponse } from "./types/AddAdminResponse"; export { AddModToCommunity } from "./types/AddModToCommunity"; export { AddModToCommunityResponse } from "./types/AddModToCommunityResponse"; export { AdminAllowInstance } from "./types/AdminAllowInstance"; +export { AdminAllowInstanceId } from "./types/AdminAllowInstanceId"; export { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams"; export { AdminAllowInstanceView } from "./types/AdminAllowInstanceView"; export { AdminBlockInstance } from "./types/AdminBlockInstance"; +export { AdminBlockInstanceId } from "./types/AdminBlockInstanceId"; export { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams"; export { AdminBlockInstanceView } from "./types/AdminBlockInstanceView"; export { AdminPurgeComment } from "./types/AdminPurgeComment"; +export { AdminPurgeCommentId } from "./types/AdminPurgeCommentId"; export { AdminPurgeCommentView } from "./types/AdminPurgeCommentView"; export { AdminPurgeCommunity } from "./types/AdminPurgeCommunity"; +export { AdminPurgeCommunityId } from "./types/AdminPurgeCommunityId"; export { AdminPurgeCommunityView } from "./types/AdminPurgeCommunityView"; export { AdminPurgePerson } from "./types/AdminPurgePerson"; +export { AdminPurgePersonId } from "./types/AdminPurgePersonId"; export { AdminPurgePersonView } from "./types/AdminPurgePersonView"; export { AdminPurgePost } from "./types/AdminPurgePost"; +export { AdminPurgePostId } from "./types/AdminPurgePostId"; export { AdminPurgePostView } from "./types/AdminPurgePostView"; export { ApproveCommunityPendingFollower } from "./types/ApproveCommunityPendingFollower"; export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication"; @@ -156,6 +162,10 @@ export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse"; export { ListLoginsResponse } from "./types/ListLoginsResponse"; export { ListMedia } from "./types/ListMedia"; export { ListMediaResponse } from "./types/ListMediaResponse"; +export { ListPersonContent } from "./types/ListPersonContent"; +export { ListPersonContentResponse } from "./types/ListPersonContentResponse"; +export { ListPersonSaved } from "./types/ListPersonSaved"; +export { ListPersonSavedResponse } from "./types/ListPersonSavedResponse"; export { ListPostLikes } from "./types/ListPostLikes"; export { ListPostLikesResponse } from "./types/ListPostLikesResponse"; export { ListRegistrationApplications } from "./types/ListRegistrationApplications"; @@ -186,28 +196,40 @@ export { MarkPostAsRead } from "./types/MarkPostAsRead"; export { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead"; export { ModAdd } from "./types/ModAdd"; export { ModAddCommunity } from "./types/ModAddCommunity"; +export { ModAddCommunityId } from "./types/ModAddCommunityId"; export { ModAddCommunityView } from "./types/ModAddCommunityView"; +export { ModAddId } from "./types/ModAddId"; export { ModAddView } from "./types/ModAddView"; export { ModBan } from "./types/ModBan"; export { ModBanFromCommunity } from "./types/ModBanFromCommunity"; +export { ModBanFromCommunityId } from "./types/ModBanFromCommunityId"; export { ModBanFromCommunityView } from "./types/ModBanFromCommunityView"; +export { ModBanId } from "./types/ModBanId"; export { ModBanView } from "./types/ModBanView"; export { ModFeaturePost } from "./types/ModFeaturePost"; +export { ModFeaturePostId } from "./types/ModFeaturePostId"; export { ModFeaturePostView } from "./types/ModFeaturePostView"; export { ModHideCommunity } from "./types/ModHideCommunity"; +export { ModHideCommunityId } from "./types/ModHideCommunityId"; export { ModHideCommunityView } from "./types/ModHideCommunityView"; export { ModLockPost } from "./types/ModLockPost"; +export { ModLockPostId } from "./types/ModLockPostId"; export { ModLockPostView } from "./types/ModLockPostView"; export { ModRemoveComment } from "./types/ModRemoveComment"; +export { ModRemoveCommentId } from "./types/ModRemoveCommentId"; export { ModRemoveCommentView } from "./types/ModRemoveCommentView"; export { ModRemoveCommunity } from "./types/ModRemoveCommunity"; +export { ModRemoveCommunityId } from "./types/ModRemoveCommunityId"; export { ModRemoveCommunityView } from "./types/ModRemoveCommunityView"; export { ModRemovePost } from "./types/ModRemovePost"; +export { ModRemovePostId } from "./types/ModRemovePostId"; export { ModRemovePostView } from "./types/ModRemovePostView"; export { ModTransferCommunity } from "./types/ModTransferCommunity"; +export { ModTransferCommunityId } from "./types/ModTransferCommunityId"; export { ModTransferCommunityView } from "./types/ModTransferCommunityView"; export { ModlogActionType } from "./types/ModlogActionType"; -export { ModlogListParams } from "./types/ModlogListParams"; +export { ModlogCombinedPaginationCursor } from "./types/ModlogCombinedPaginationCursor"; +export { ModlogCombinedView } from "./types/ModlogCombinedView"; export { MyUserInfo } from "./types/MyUserInfo"; export { OAuthAccount } from "./types/OAuthAccount"; export { OAuthProvider } from "./types/OAuthProvider"; @@ -219,11 +241,15 @@ export { PasswordReset } from "./types/PasswordReset"; export { PendingFollow } from "./types/PendingFollow"; export { Person } from "./types/Person"; export { PersonAggregates } from "./types/PersonAggregates"; +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 { PersonSavedCombinedPaginationCursor } from "./types/PersonSavedCombinedPaginationCursor"; export { PersonView } from "./types/PersonView"; export { Post } from "./types/Post"; export { PostAggregates } from "./types/PostAggregates"; @@ -236,6 +262,7 @@ export { PostReportResponse } from "./types/PostReportResponse"; export { PostReportView } from "./types/PostReportView"; export { PostResponse } from "./types/PostResponse"; export { PostSortType } from "./types/PostSortType"; +export { PostTags } from "./types/PostTags"; export { PostView } from "./types/PostView"; export { PrivateMessage } from "./types/PrivateMessage"; export { PrivateMessageId } from "./types/PrivateMessageId"; @@ -261,8 +288,6 @@ export { RegistrationMode } from "./types/RegistrationMode"; export { RemoveComment } from "./types/RemoveComment"; export { RemoveCommunity } from "./types/RemoveCommunity"; export { RemovePost } from "./types/RemovePost"; -export { ReportCombined } from "./types/ReportCombined"; -export { ReportCombinedId } from "./types/ReportCombinedId"; export { ReportCombinedPaginationCursor } from "./types/ReportCombinedPaginationCursor"; export { ReportCombinedView } from "./types/ReportCombinedView"; export { ResolveCommentReport } from "./types/ResolveCommentReport"; @@ -284,6 +309,8 @@ export { SiteResponse } from "./types/SiteResponse"; export { SiteView } from "./types/SiteView"; export { SubscribedType } from "./types/SubscribedType"; export { SuccessResponse } from "./types/SuccessResponse"; +export { Tag } from "./types/Tag"; +export { TagId } from "./types/TagId"; export { Tagline } from "./types/Tagline"; export { TaglineId } from "./types/TaglineId"; export { TaglineResponse } from "./types/TaglineResponse"; diff --git a/src/types/AdminAllowInstance.ts b/src/types/AdminAllowInstance.ts index d4fdd74..9f1dc9f 100644 --- a/src/types/AdminAllowInstance.ts +++ b/src/types/AdminAllowInstance.ts @@ -1,9 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AdminAllowInstanceId } from "./AdminAllowInstanceId"; import type { InstanceId } from "./InstanceId"; import type { PersonId } from "./PersonId"; export type AdminAllowInstance = { - id: number; + id: AdminAllowInstanceId; instance_id: InstanceId; admin_person_id: PersonId; allowed: boolean; diff --git a/src/types/AdminAllowInstanceId.ts b/src/types/AdminAllowInstanceId.ts new file mode 100644 index 0000000..1d03eea --- /dev/null +++ b/src/types/AdminAllowInstanceId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AdminAllowInstanceId = number; diff --git a/src/types/AdminAllowInstanceView.ts b/src/types/AdminAllowInstanceView.ts index 53876ac..de8993d 100644 --- a/src/types/AdminAllowInstanceView.ts +++ b/src/types/AdminAllowInstanceView.ts @@ -7,7 +7,7 @@ import type { Person } from "./Person"; * When an admin purges a post. */ export type AdminAllowInstanceView = { - admin_block_instance: AdminAllowInstance; + admin_allow_instance: AdminAllowInstance; instance: Instance; admin?: Person; }; diff --git a/src/types/AdminBlockInstance.ts b/src/types/AdminBlockInstance.ts index e51008e..54b74a9 100644 --- a/src/types/AdminBlockInstance.ts +++ b/src/types/AdminBlockInstance.ts @@ -1,9 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AdminBlockInstanceId } from "./AdminBlockInstanceId"; import type { InstanceId } from "./InstanceId"; import type { PersonId } from "./PersonId"; export type AdminBlockInstance = { - id: number; + id: AdminBlockInstanceId; instance_id: InstanceId; admin_person_id: PersonId; blocked: boolean; diff --git a/src/types/AdminBlockInstanceId.ts b/src/types/AdminBlockInstanceId.ts new file mode 100644 index 0000000..b31a1cc --- /dev/null +++ b/src/types/AdminBlockInstanceId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AdminBlockInstanceId = number; diff --git a/src/types/AdminPurgeComment.ts b/src/types/AdminPurgeComment.ts index 8d5cd35..b85b6b1 100644 --- a/src/types/AdminPurgeComment.ts +++ b/src/types/AdminPurgeComment.ts @@ -1,4 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AdminPurgeCommentId } from "./AdminPurgeCommentId"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; @@ -6,7 +7,7 @@ import type { PostId } from "./PostId"; * When an admin purges a comment. */ export type AdminPurgeComment = { - id: number; + id: AdminPurgeCommentId; admin_person_id: PersonId; post_id: PostId; reason?: string; diff --git a/src/types/AdminPurgeCommentId.ts b/src/types/AdminPurgeCommentId.ts new file mode 100644 index 0000000..48be1bc --- /dev/null +++ b/src/types/AdminPurgeCommentId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AdminPurgeCommentId = number; diff --git a/src/types/AdminPurgeCommunity.ts b/src/types/AdminPurgeCommunity.ts index aa17a95..c202eb1 100644 --- a/src/types/AdminPurgeCommunity.ts +++ b/src/types/AdminPurgeCommunity.ts @@ -1,11 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AdminPurgeCommunityId } from "./AdminPurgeCommunityId"; import type { PersonId } from "./PersonId"; /** * When an admin purges a community. */ export type AdminPurgeCommunity = { - id: number; + id: AdminPurgeCommunityId; admin_person_id: PersonId; reason?: string; when_: string; diff --git a/src/types/AdminPurgeCommunityId.ts b/src/types/AdminPurgeCommunityId.ts new file mode 100644 index 0000000..d1f074a --- /dev/null +++ b/src/types/AdminPurgeCommunityId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AdminPurgeCommunityId = number; diff --git a/src/types/AdminPurgePerson.ts b/src/types/AdminPurgePerson.ts index 36d0358..1ef7341 100644 --- a/src/types/AdminPurgePerson.ts +++ b/src/types/AdminPurgePerson.ts @@ -1,11 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AdminPurgePersonId } from "./AdminPurgePersonId"; import type { PersonId } from "./PersonId"; /** * When an admin purges a person. */ export type AdminPurgePerson = { - id: number; + id: AdminPurgePersonId; admin_person_id: PersonId; reason?: string; when_: string; diff --git a/src/types/AdminPurgePersonId.ts b/src/types/AdminPurgePersonId.ts new file mode 100644 index 0000000..cb49257 --- /dev/null +++ b/src/types/AdminPurgePersonId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AdminPurgePersonId = number; diff --git a/src/types/AdminPurgePost.ts b/src/types/AdminPurgePost.ts index 79e3472..5cd11a0 100644 --- a/src/types/AdminPurgePost.ts +++ b/src/types/AdminPurgePost.ts @@ -1,4 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AdminPurgePostId } from "./AdminPurgePostId"; import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; @@ -6,7 +7,7 @@ import type { PersonId } from "./PersonId"; * When an admin purges a post. */ export type AdminPurgePost = { - id: number; + id: AdminPurgePostId; admin_person_id: PersonId; community_id: CommunityId; reason?: string; diff --git a/src/types/AdminPurgePostId.ts b/src/types/AdminPurgePostId.ts new file mode 100644 index 0000000..2f472f9 --- /dev/null +++ b/src/types/AdminPurgePostId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AdminPurgePostId = number; diff --git a/src/types/CreatePost.ts b/src/types/CreatePost.ts index e2cd6d5..8d9c355 100644 --- a/src/types/CreatePost.ts +++ b/src/types/CreatePost.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommunityId } from "./CommunityId"; import type { LanguageId } from "./LanguageId"; +import type { TagId } from "./TagId"; /** * Create a post. @@ -27,6 +28,7 @@ export type CreatePost = { * Instead of fetching a thumbnail, use a custom one. */ custom_thumbnail?: string; + tags?: Array; /** * Time when this post should be scheduled. Null means publish immediately. */ diff --git a/src/types/EditPost.ts b/src/types/EditPost.ts index 6b1f37d..a70e2b6 100644 --- a/src/types/EditPost.ts +++ b/src/types/EditPost.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LanguageId } from "./LanguageId"; import type { PostId } from "./PostId"; +import type { TagId } from "./TagId"; /** * Edit a post. @@ -23,6 +24,7 @@ export type EditPost = { * Instead of fetching a thumbnail, use a custom one. */ custom_thumbnail?: string; + tags?: Array; /** * Time when this post should be scheduled. Null means publish immediately. */ diff --git a/src/types/GetComments.ts b/src/types/GetComments.ts index e7bcb14..9bf6666 100644 --- a/src/types/GetComments.ts +++ b/src/types/GetComments.ts @@ -18,7 +18,6 @@ export type GetComments = { community_name?: string; post_id?: PostId; parent_id?: CommentId; - saved_only?: boolean; liked_only?: boolean; disliked_only?: boolean; }; diff --git a/src/types/GetModlog.ts b/src/types/GetModlog.ts index 8282fae..0542b6b 100644 --- a/src/types/GetModlog.ts +++ b/src/types/GetModlog.ts @@ -2,6 +2,7 @@ import type { CommentId } from "./CommentId"; import type { CommunityId } from "./CommunityId"; import type { ModlogActionType } from "./ModlogActionType"; +import type { ModlogCombinedPaginationCursor } from "./ModlogCombinedPaginationCursor"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; @@ -11,10 +12,10 @@ import type { PostId } from "./PostId"; export type GetModlog = { mod_person_id?: PersonId; community_id?: CommunityId; - page?: number; - limit?: number; type_?: ModlogActionType; - other_person_id?: PersonId; + modded_person_id?: PersonId; post_id?: PostId; comment_id?: CommentId; + page_cursor?: ModlogCombinedPaginationCursor; + page_back?: boolean; }; diff --git a/src/types/GetModlogResponse.ts b/src/types/GetModlogResponse.ts index 3f57f26..25574ff 100644 --- a/src/types/GetModlogResponse.ts +++ b/src/types/GetModlogResponse.ts @@ -1,41 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AdminAllowInstanceView } from "./AdminAllowInstanceView"; -import type { AdminBlockInstanceView } from "./AdminBlockInstanceView"; -import type { AdminPurgeCommentView } from "./AdminPurgeCommentView"; -import type { AdminPurgeCommunityView } from "./AdminPurgeCommunityView"; -import type { AdminPurgePersonView } from "./AdminPurgePersonView"; -import type { AdminPurgePostView } from "./AdminPurgePostView"; -import type { ModAddCommunityView } from "./ModAddCommunityView"; -import type { ModAddView } from "./ModAddView"; -import type { ModBanFromCommunityView } from "./ModBanFromCommunityView"; -import type { ModBanView } from "./ModBanView"; -import type { ModFeaturePostView } from "./ModFeaturePostView"; -import type { ModHideCommunityView } from "./ModHideCommunityView"; -import type { ModLockPostView } from "./ModLockPostView"; -import type { ModRemoveCommentView } from "./ModRemoveCommentView"; -import type { ModRemoveCommunityView } from "./ModRemoveCommunityView"; -import type { ModRemovePostView } from "./ModRemovePostView"; -import type { ModTransferCommunityView } from "./ModTransferCommunityView"; +import type { ModlogCombinedView } from "./ModlogCombinedView"; /** * The modlog fetch response. */ -export type GetModlogResponse = { - removed_posts: Array; - locked_posts: Array; - featured_posts: Array; - removed_comments: Array; - removed_communities: Array; - banned_from_community: Array; - banned: Array; - added_to_community: Array; - transferred_to_community: Array; - added: Array; - admin_purged_persons: Array; - admin_purged_communities: Array; - admin_purged_posts: Array; - admin_purged_comments: Array; - hidden_communities: Array; - admin_block_instance: Array; - admin_allow_instance: Array; -}; +export type GetModlogResponse = { modlog: Array }; diff --git a/src/types/GetPersonDetails.ts b/src/types/GetPersonDetails.ts index 257a208..e465c30 100644 --- a/src/types/GetPersonDetails.ts +++ b/src/types/GetPersonDetails.ts @@ -1,7 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -import type { PostSortType } from "./PostSortType"; /** * Gets a person's details. @@ -14,9 +12,4 @@ export type GetPersonDetails = { * Example: dessalines , or dessalines@xyz.tld */ username?: string; - sort?: PostSortType; - page?: number; - limit?: number; - community_id?: CommunityId; - saved_only?: boolean; }; diff --git a/src/types/GetPersonDetailsResponse.ts b/src/types/GetPersonDetailsResponse.ts index e17dcd0..d7adff9 100644 --- a/src/types/GetPersonDetailsResponse.ts +++ b/src/types/GetPersonDetailsResponse.ts @@ -1,8 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CommentView } from "./CommentView"; import type { CommunityModeratorView } from "./CommunityModeratorView"; import type { PersonView } from "./PersonView"; -import type { PostView } from "./PostView"; import type { Site } from "./Site"; /** @@ -11,7 +9,5 @@ import type { Site } from "./Site"; export type GetPersonDetailsResponse = { person_view: PersonView; site?: Site; - comments: Array; - posts: Array; moderates: Array; }; diff --git a/src/types/GetPosts.ts b/src/types/GetPosts.ts index 77b15dd..f5dbff7 100644 --- a/src/types/GetPosts.ts +++ b/src/types/GetPosts.ts @@ -18,6 +18,7 @@ export type GetPosts = { community_id?: CommunityId; community_name?: string; saved_only?: boolean; + read_only?: boolean; liked_only?: boolean; disliked_only?: boolean; show_hidden?: boolean; diff --git a/src/types/GetSiteResponse.ts b/src/types/GetSiteResponse.ts index 0119254..4d36090 100644 --- a/src/types/GetSiteResponse.ts +++ b/src/types/GetSiteResponse.ts @@ -17,14 +17,6 @@ export type GetSiteResponse = { version: string; all_languages: Array; discussion_languages: Array; - /** - * deprecated, use field `tagline` or /api/v3/tagline/list - */ - taglines: Array; - /** - * deprecated, use /api/v3/custom_emoji/list - */ - custom_emojis: Array; /** * If the site has any taglines, a random one is included here for displaying */ diff --git a/src/types/LemmyErrorType.ts b/src/types/LemmyErrorType.ts index 32b9c9e..a6a582b 100644 --- a/src/types/LemmyErrorType.ts +++ b/src/types/LemmyErrorType.ts @@ -103,7 +103,6 @@ export type LemmyErrorType = | { error: "system_err_login" } | { error: "couldnt_set_all_registrations_accepted" } | { error: "couldnt_set_all_email_verified" } - | { error: "banned" } | { error: "blocked_url" } | { error: "couldnt_get_comments" } | { error: "couldnt_get_posts" } diff --git a/src/types/ListPersonContent.ts b/src/types/ListPersonContent.ts new file mode 100644 index 0000000..f02fa6b --- /dev/null +++ b/src/types/ListPersonContent.ts @@ -0,0 +1,20 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PersonContentCombinedPaginationCursor } from "./PersonContentCombinedPaginationCursor"; +import type { PersonContentType } from "./PersonContentType"; +import type { PersonId } from "./PersonId"; + +/** + * Gets a person's content (posts and comments) + * + * Either person_id, or username are required. + */ +export type ListPersonContent = { + type_?: PersonContentType; + person_id?: PersonId; + /** + * Example: dessalines , or dessalines@xyz.tld + */ + username?: string; + page_cursor?: PersonContentCombinedPaginationCursor; + page_back?: boolean; +}; diff --git a/src/types/ListPersonContentResponse.ts b/src/types/ListPersonContentResponse.ts new file mode 100644 index 0000000..7cb26f0 --- /dev/null +++ b/src/types/ListPersonContentResponse.ts @@ -0,0 +1,9 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PersonContentCombinedView } from "./PersonContentCombinedView"; + +/** + * A person's content response. + */ +export type ListPersonContentResponse = { + content: Array; +}; diff --git a/src/types/ListPersonSaved.ts b/src/types/ListPersonSaved.ts new file mode 100644 index 0000000..d989d4e --- /dev/null +++ b/src/types/ListPersonSaved.ts @@ -0,0 +1,12 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PersonContentType } from "./PersonContentType"; +import type { PersonSavedCombinedPaginationCursor } from "./PersonSavedCombinedPaginationCursor"; + +/** + * Gets your saved posts and comments + */ +export type ListPersonSaved = { + type_?: PersonContentType; + page_cursor?: PersonSavedCombinedPaginationCursor; + page_back?: boolean; +}; diff --git a/src/types/ListPersonSavedResponse.ts b/src/types/ListPersonSavedResponse.ts new file mode 100644 index 0000000..1ff8570 --- /dev/null +++ b/src/types/ListPersonSavedResponse.ts @@ -0,0 +1,9 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PersonContentCombinedView } from "./PersonContentCombinedView"; + +/** + * A person's saved content response. + */ +export type ListPersonSavedResponse = { + saved: Array; +}; diff --git a/src/types/ModAdd.ts b/src/types/ModAdd.ts index 2ea811f..37f910c 100644 --- a/src/types/ModAdd.ts +++ b/src/types/ModAdd.ts @@ -1,11 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ModAddId } from "./ModAddId"; import type { PersonId } from "./PersonId"; /** * When someone is added as a site moderator. */ export type ModAdd = { - id: number; + id: ModAddId; mod_person_id: PersonId; other_person_id: PersonId; removed: boolean; diff --git a/src/types/ModAddCommunity.ts b/src/types/ModAddCommunity.ts index 2399512..9a637fa 100644 --- a/src/types/ModAddCommunity.ts +++ b/src/types/ModAddCommunity.ts @@ -1,12 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommunityId } from "./CommunityId"; +import type { ModAddCommunityId } from "./ModAddCommunityId"; import type { PersonId } from "./PersonId"; /** * When someone is added as a community moderator. */ export type ModAddCommunity = { - id: number; + id: ModAddCommunityId; mod_person_id: PersonId; other_person_id: PersonId; community_id: CommunityId; diff --git a/src/types/ModAddCommunityId.ts b/src/types/ModAddCommunityId.ts new file mode 100644 index 0000000..9965916 --- /dev/null +++ b/src/types/ModAddCommunityId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModAddCommunityId = number; diff --git a/src/types/ModAddId.ts b/src/types/ModAddId.ts new file mode 100644 index 0000000..6de05e6 --- /dev/null +++ b/src/types/ModAddId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModAddId = number; diff --git a/src/types/ModBan.ts b/src/types/ModBan.ts index ffc8918..eadb07c 100644 --- a/src/types/ModBan.ts +++ b/src/types/ModBan.ts @@ -1,11 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ModBanId } from "./ModBanId"; import type { PersonId } from "./PersonId"; /** * When someone is banned from the site. */ export type ModBan = { - id: number; + id: ModBanId; mod_person_id: PersonId; other_person_id: PersonId; reason?: string; diff --git a/src/types/ModBanFromCommunity.ts b/src/types/ModBanFromCommunity.ts index 64d7174..836d2e9 100644 --- a/src/types/ModBanFromCommunity.ts +++ b/src/types/ModBanFromCommunity.ts @@ -1,12 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommunityId } from "./CommunityId"; +import type { ModBanFromCommunityId } from "./ModBanFromCommunityId"; import type { PersonId } from "./PersonId"; /** * When someone is banned from a community. */ export type ModBanFromCommunity = { - id: number; + id: ModBanFromCommunityId; mod_person_id: PersonId; other_person_id: PersonId; community_id: CommunityId; diff --git a/src/types/ModBanFromCommunityId.ts b/src/types/ModBanFromCommunityId.ts new file mode 100644 index 0000000..a0c1e01 --- /dev/null +++ b/src/types/ModBanFromCommunityId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModBanFromCommunityId = number; diff --git a/src/types/ModBanFromCommunityView.ts b/src/types/ModBanFromCommunityView.ts index d63784c..99255cb 100644 --- a/src/types/ModBanFromCommunityView.ts +++ b/src/types/ModBanFromCommunityView.ts @@ -10,5 +10,5 @@ export type ModBanFromCommunityView = { mod_ban_from_community: ModBanFromCommunity; moderator?: Person; community: Community; - banned_person: Person; + modded_person: Person; }; diff --git a/src/types/ModBanId.ts b/src/types/ModBanId.ts new file mode 100644 index 0000000..1f8abfb --- /dev/null +++ b/src/types/ModBanId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModBanId = number; diff --git a/src/types/ModBanView.ts b/src/types/ModBanView.ts index ddacb59..14ff18a 100644 --- a/src/types/ModBanView.ts +++ b/src/types/ModBanView.ts @@ -8,5 +8,5 @@ import type { Person } from "./Person"; export type ModBanView = { mod_ban: ModBan; moderator?: Person; - banned_person: Person; + modded_person: Person; }; diff --git a/src/types/ModFeaturePost.ts b/src/types/ModFeaturePost.ts index 65f278e..e3d4735 100644 --- a/src/types/ModFeaturePost.ts +++ b/src/types/ModFeaturePost.ts @@ -1,4 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ModFeaturePostId } from "./ModFeaturePostId"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; @@ -6,7 +7,7 @@ import type { PostId } from "./PostId"; * When a moderator features a post on a community (pins it to the top). */ export type ModFeaturePost = { - id: number; + id: ModFeaturePostId; mod_person_id: PersonId; post_id: PostId; featured: boolean; diff --git a/src/types/ModFeaturePostId.ts b/src/types/ModFeaturePostId.ts new file mode 100644 index 0000000..b9aa25d --- /dev/null +++ b/src/types/ModFeaturePostId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModFeaturePostId = number; diff --git a/src/types/ModFeaturePostView.ts b/src/types/ModFeaturePostView.ts index e8b5078..c535339 100644 --- a/src/types/ModFeaturePostView.ts +++ b/src/types/ModFeaturePostView.ts @@ -10,6 +10,7 @@ import type { Post } from "./Post"; export type ModFeaturePostView = { mod_feature_post: ModFeaturePost; moderator?: Person; + modded_person: Person; post: Post; community: Community; }; diff --git a/src/types/ModHideCommunity.ts b/src/types/ModHideCommunity.ts index b361cfc..0dd76a0 100644 --- a/src/types/ModHideCommunity.ts +++ b/src/types/ModHideCommunity.ts @@ -1,12 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommunityId } from "./CommunityId"; +import type { ModHideCommunityId } from "./ModHideCommunityId"; import type { PersonId } from "./PersonId"; /** * When a community is hidden from public view. */ export type ModHideCommunity = { - id: number; + id: ModHideCommunityId; community_id: CommunityId; mod_person_id: PersonId; when_: string; diff --git a/src/types/ModHideCommunityId.ts b/src/types/ModHideCommunityId.ts new file mode 100644 index 0000000..772d0e2 --- /dev/null +++ b/src/types/ModHideCommunityId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModHideCommunityId = number; diff --git a/src/types/ModLockPost.ts b/src/types/ModLockPost.ts index 32396bc..346d186 100644 --- a/src/types/ModLockPost.ts +++ b/src/types/ModLockPost.ts @@ -1,4 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ModLockPostId } from "./ModLockPostId"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; @@ -6,7 +7,7 @@ import type { PostId } from "./PostId"; * When a moderator locks a post (prevents new comments being made). */ export type ModLockPost = { - id: number; + id: ModLockPostId; mod_person_id: PersonId; post_id: PostId; locked: boolean; diff --git a/src/types/ModLockPostId.ts b/src/types/ModLockPostId.ts new file mode 100644 index 0000000..4bba2da --- /dev/null +++ b/src/types/ModLockPostId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModLockPostId = number; diff --git a/src/types/ModLockPostView.ts b/src/types/ModLockPostView.ts index f44bc78..31c3482 100644 --- a/src/types/ModLockPostView.ts +++ b/src/types/ModLockPostView.ts @@ -10,6 +10,7 @@ import type { Post } from "./Post"; export type ModLockPostView = { mod_lock_post: ModLockPost; moderator?: Person; + modded_person: Person; post: Post; community: Community; }; diff --git a/src/types/ModRemoveComment.ts b/src/types/ModRemoveComment.ts index 749b134..2a8b84c 100644 --- a/src/types/ModRemoveComment.ts +++ b/src/types/ModRemoveComment.ts @@ -1,12 +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 { ModRemoveCommentId } from "./ModRemoveCommentId"; import type { PersonId } from "./PersonId"; /** * When a moderator removes a comment. */ export type ModRemoveComment = { - id: number; + id: ModRemoveCommentId; mod_person_id: PersonId; comment_id: CommentId; reason?: string; diff --git a/src/types/ModRemoveCommentId.ts b/src/types/ModRemoveCommentId.ts new file mode 100644 index 0000000..bb83887 --- /dev/null +++ b/src/types/ModRemoveCommentId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModRemoveCommentId = number; diff --git a/src/types/ModRemoveCommentView.ts b/src/types/ModRemoveCommentView.ts index 59a365e..8fc88de 100644 --- a/src/types/ModRemoveCommentView.ts +++ b/src/types/ModRemoveCommentView.ts @@ -11,8 +11,8 @@ import type { Post } from "./Post"; export type ModRemoveCommentView = { mod_remove_comment: ModRemoveComment; moderator?: Person; + modded_person: Person; comment: Comment; - commenter: Person; post: Post; community: Community; }; diff --git a/src/types/ModRemoveCommunity.ts b/src/types/ModRemoveCommunity.ts index bd8358e..a47c1c4 100644 --- a/src/types/ModRemoveCommunity.ts +++ b/src/types/ModRemoveCommunity.ts @@ -1,12 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommunityId } from "./CommunityId"; +import type { ModRemoveCommunityId } from "./ModRemoveCommunityId"; import type { PersonId } from "./PersonId"; /** * When a moderator removes a community. */ export type ModRemoveCommunity = { - id: number; + id: ModRemoveCommunityId; mod_person_id: PersonId; community_id: CommunityId; reason?: string; diff --git a/src/types/ModRemoveCommunityId.ts b/src/types/ModRemoveCommunityId.ts new file mode 100644 index 0000000..a5c71b6 --- /dev/null +++ b/src/types/ModRemoveCommunityId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModRemoveCommunityId = number; diff --git a/src/types/ModRemovePost.ts b/src/types/ModRemovePost.ts index 7adaa6b..82ac2b6 100644 --- a/src/types/ModRemovePost.ts +++ b/src/types/ModRemovePost.ts @@ -1,4 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ModRemovePostId } from "./ModRemovePostId"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; @@ -6,7 +7,7 @@ import type { PostId } from "./PostId"; * When a moderator removes a post. */ export type ModRemovePost = { - id: number; + id: ModRemovePostId; mod_person_id: PersonId; post_id: PostId; reason?: string; diff --git a/src/types/ModRemovePostId.ts b/src/types/ModRemovePostId.ts new file mode 100644 index 0000000..4d5f056 --- /dev/null +++ b/src/types/ModRemovePostId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModRemovePostId = number; diff --git a/src/types/ModRemovePostView.ts b/src/types/ModRemovePostView.ts index 128566c..6881828 100644 --- a/src/types/ModRemovePostView.ts +++ b/src/types/ModRemovePostView.ts @@ -10,6 +10,7 @@ import type { Post } from "./Post"; export type ModRemovePostView = { mod_remove_post: ModRemovePost; moderator?: Person; + modded_person: Person; post: Post; community: Community; }; diff --git a/src/types/ModTransferCommunity.ts b/src/types/ModTransferCommunity.ts index 78b9887..505c1bf 100644 --- a/src/types/ModTransferCommunity.ts +++ b/src/types/ModTransferCommunity.ts @@ -1,12 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommunityId } from "./CommunityId"; +import type { ModTransferCommunityId } from "./ModTransferCommunityId"; import type { PersonId } from "./PersonId"; /** * When a moderator transfers a community to a new owner. */ export type ModTransferCommunity = { - id: number; + id: ModTransferCommunityId; mod_person_id: PersonId; other_person_id: PersonId; community_id: CommunityId; diff --git a/src/types/ModTransferCommunityId.ts b/src/types/ModTransferCommunityId.ts new file mode 100644 index 0000000..24a5ec5 --- /dev/null +++ b/src/types/ModTransferCommunityId.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ModTransferCommunityId = number; diff --git a/src/types/ModlogCombinedPaginationCursor.ts b/src/types/ModlogCombinedPaginationCursor.ts new file mode 100644 index 0000000..7b8e96e --- /dev/null +++ b/src/types/ModlogCombinedPaginationCursor.ts @@ -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 modlog_combined + */ +export type ModlogCombinedPaginationCursor = string; diff --git a/src/types/ModlogCombinedView.ts b/src/types/ModlogCombinedView.ts new file mode 100644 index 0000000..3963c57 --- /dev/null +++ b/src/types/ModlogCombinedView.ts @@ -0,0 +1,37 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { AdminAllowInstanceView } from "./AdminAllowInstanceView"; +import type { AdminBlockInstanceView } from "./AdminBlockInstanceView"; +import type { AdminPurgeCommentView } from "./AdminPurgeCommentView"; +import type { AdminPurgeCommunityView } from "./AdminPurgeCommunityView"; +import type { AdminPurgePersonView } from "./AdminPurgePersonView"; +import type { AdminPurgePostView } from "./AdminPurgePostView"; +import type { ModAddCommunityView } from "./ModAddCommunityView"; +import type { ModAddView } from "./ModAddView"; +import type { ModBanFromCommunityView } from "./ModBanFromCommunityView"; +import type { ModBanView } from "./ModBanView"; +import type { ModFeaturePostView } from "./ModFeaturePostView"; +import type { ModHideCommunityView } from "./ModHideCommunityView"; +import type { ModLockPostView } from "./ModLockPostView"; +import type { ModRemoveCommentView } from "./ModRemoveCommentView"; +import type { ModRemoveCommunityView } from "./ModRemoveCommunityView"; +import type { ModRemovePostView } from "./ModRemovePostView"; +import type { ModTransferCommunityView } from "./ModTransferCommunityView"; + +export type ModlogCombinedView = + | ({ type_: "AdminAllowInstance" } & AdminAllowInstanceView) + | ({ type_: "AdminBlockInstance" } & AdminBlockInstanceView) + | ({ type_: "AdminPurgeComment" } & AdminPurgeCommentView) + | ({ type_: "AdminPurgeCommunity" } & AdminPurgeCommunityView) + | ({ type_: "AdminPurgePerson" } & AdminPurgePersonView) + | ({ type_: "AdminPurgePost" } & AdminPurgePostView) + | ({ type_: "ModAdd" } & ModAddView) + | ({ type_: "ModAddCommunity" } & ModAddCommunityView) + | ({ type_: "ModBan" } & ModBanView) + | ({ type_: "ModBanFromCommunity" } & ModBanFromCommunityView) + | ({ type_: "ModFeaturePost" } & ModFeaturePostView) + | ({ type_: "ModHideCommunity" } & ModHideCommunityView) + | ({ type_: "ModLockPost" } & ModLockPostView) + | ({ type_: "ModRemoveComment" } & ModRemoveCommentView) + | ({ type_: "ModRemoveCommunity" } & ModRemoveCommunityView) + | ({ type_: "ModRemovePost" } & ModRemovePostView) + | ({ type_: "ModTransferCommunity" } & ModTransferCommunityView); diff --git a/src/types/ModlogListParams.ts b/src/types/ModlogListParams.ts deleted file mode 100644 index 23b2832..0000000 --- a/src/types/ModlogListParams.ts +++ /dev/null @@ -1,19 +0,0 @@ -// 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 { CommunityId } from "./CommunityId"; -import type { PersonId } from "./PersonId"; -import type { PostId } from "./PostId"; - -/** - * Querying / filtering the modlog. - */ -export type ModlogListParams = { - community_id?: CommunityId; - mod_person_id?: PersonId; - other_person_id?: PersonId; - post_id?: PostId; - comment_id?: CommentId; - page?: number; - limit?: number; - hide_modlog_names: boolean; -}; diff --git a/src/types/PersonContentCombinedPaginationCursor.ts b/src/types/PersonContentCombinedPaginationCursor.ts new file mode 100644 index 0000000..c398a22 --- /dev/null +++ b/src/types/PersonContentCombinedPaginationCursor.ts @@ -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 person_content_combined table + */ +export type PersonContentCombinedPaginationCursor = string; diff --git a/src/types/PersonContentCombinedView.ts b/src/types/PersonContentCombinedView.ts new file mode 100644 index 0000000..dc88d1e --- /dev/null +++ b/src/types/PersonContentCombinedView.ts @@ -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 { CommentView } from "./CommentView"; +import type { PostView } from "./PostView"; + +export type PersonContentCombinedView = + | ({ type_: "Post" } & PostView) + | ({ type_: "Comment" } & CommentView); diff --git a/src/types/PersonContentType.ts b/src/types/PersonContentType.ts new file mode 100644 index 0000000..1f61ba1 --- /dev/null +++ b/src/types/PersonContentType.ts @@ -0,0 +1,6 @@ +// 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 various modlog actions. + */ +export type PersonContentType = "All" | "Comments" | "Posts"; diff --git a/src/types/PersonSavedCombinedPaginationCursor.ts b/src/types/PersonSavedCombinedPaginationCursor.ts new file mode 100644 index 0000000..9f207d9 --- /dev/null +++ b/src/types/PersonSavedCombinedPaginationCursor.ts @@ -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 person_saved_combined table + */ +export type PersonSavedCombinedPaginationCursor = string; diff --git a/src/types/PostTags.ts b/src/types/PostTags.ts new file mode 100644 index 0000000..4c88826 --- /dev/null +++ b/src/types/PostTags.ts @@ -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 { Tag } from "./Tag"; + +/** + * we wrap this in a struct so we can implement FromSqlRow for it + */ +export type PostTags = { tags: Array }; diff --git a/src/types/PostView.ts b/src/types/PostView.ts index cd8a908..7c74e72 100644 --- a/src/types/PostView.ts +++ b/src/types/PostView.ts @@ -4,6 +4,7 @@ import type { ImageDetails } from "./ImageDetails"; import type { Person } from "./Person"; import type { Post } from "./Post"; import type { PostAggregates } from "./PostAggregates"; +import type { PostTags } from "./PostTags"; import type { SubscribedType } from "./SubscribedType"; /** @@ -26,4 +27,5 @@ export type PostView = { creator_blocked: boolean; my_vote?: number; unread_comments: number; + tags: PostTags; }; diff --git a/src/types/ReportCombined.ts b/src/types/ReportCombined.ts deleted file mode 100644 index 4e0788e..0000000 --- a/src/types/ReportCombined.ts +++ /dev/null @@ -1,16 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CommentReportId } from "./CommentReportId"; -import type { PostReportId } from "./PostReportId"; -import type { PrivateMessageReportId } from "./PrivateMessageReportId"; -import type { ReportCombinedId } from "./ReportCombinedId"; - -/** - * A combined reports table. - */ -export type ReportCombined = { - id: ReportCombinedId; - published: string; - post_report_id?: PostReportId; - comment_report_id?: CommentReportId; - private_message_report_id?: PrivateMessageReportId; -}; diff --git a/src/types/Search.ts b/src/types/Search.ts index 203590f..e867ae4 100644 --- a/src/types/Search.ts +++ b/src/types/Search.ts @@ -20,7 +20,6 @@ export type Search = { limit?: number; title_only?: boolean; post_url_only?: boolean; - saved_only?: boolean; liked_only?: boolean; disliked_only?: boolean; }; diff --git a/src/types/SiteResponse.ts b/src/types/SiteResponse.ts index 3f241cb..380e643 100644 --- a/src/types/SiteResponse.ts +++ b/src/types/SiteResponse.ts @@ -7,7 +7,7 @@ import type { SiteView } from "./SiteView"; export type SiteResponse = { site_view: SiteView; /** - * deprecated, use field `tagline` or /api/v3/tagline/list + * deprecated, use field `tagline` or /api/v4/tagline/list */ taglines: Array; }; diff --git a/src/types/Tag.ts b/src/types/Tag.ts new file mode 100644 index 0000000..7f16edb --- /dev/null +++ b/src/types/Tag.ts @@ -0,0 +1,29 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { CommunityId } from "./CommunityId"; +import type { DbUrl } from "./DbUrl"; +import type { TagId } from "./TagId"; + +/** + * A tag that can be assigned to a post within a community. + * The tag object is created by the community moderators. + * The assignment happens by the post creator and can be updated by the community moderators. + * + * A tag is a federatable object that gives additional context to another object, which can be + * displayed and filtered on currently, we only have community post tags, which is a tag that is + * created by post authors as well as mods of a community, to categorize a post. in the future we + * may add more tag types, depending on the requirements, this will lead to either expansion of + * this table (community_id optional, addition of tag_type enum) or split of this table / creation + * of new tables. + */ +export type Tag = { + id: TagId; + ap_id: DbUrl; + name: string; + /** + * the community that owns this tag + */ + community_id: CommunityId; + published: string; + updated?: string; + deleted: boolean; +}; diff --git a/src/types/ReportCombinedId.ts b/src/types/TagId.ts similarity index 64% rename from src/types/ReportCombinedId.ts rename to src/types/TagId.ts index d54a905..13a4052 100644 --- a/src/types/ReportCombinedId.ts +++ b/src/types/TagId.ts @@ -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 report combined id + * The internal tag id. */ -export type ReportCombinedId = number; +export type TagId = number;