diff --git a/src/http.ts b/src/http.ts index 5f0e6c7..cb4d36e 100644 --- a/src/http.ts +++ b/src/http.ts @@ -154,6 +154,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"; import { DeleteImageParams } from "./types/DeleteImageParams"; import { UploadImageResponse } from "./types/UploadImageResponse"; @@ -1224,6 +1228,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. * @@ -1468,6 +1486,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 e496d6e..6edddaa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,18 +6,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"; @@ -53,6 +59,9 @@ export { CommunityFollowerState } from "./types/CommunityFollowerState"; export { CommunityFollowerView } from "./types/CommunityFollowerView"; export { CommunityId } from "./types/CommunityId"; export { CommunityModeratorView } from "./types/CommunityModeratorView"; +export { CommunityReport } from "./types/CommunityReport"; +export { CommunityReportId } from "./types/CommunityReportId"; +export { CommunityReportView } from "./types/CommunityReportView"; export { CommunityResponse } from "./types/CommunityResponse"; export { CommunitySortType } from "./types/CommunitySortType"; export { CommunityView } from "./types/CommunityView"; @@ -154,6 +163,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"; @@ -184,28 +197,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"; @@ -217,11 +242,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"; @@ -234,6 +263,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"; @@ -259,8 +289,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"; @@ -282,6 +310,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..2a1a873 100644 --- a/src/types/AdminAllowInstance.ts +++ b/src/types/AdminAllowInstance.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 { 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; reason?: string; - when_: string; + published: string; }; 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..e8189ee 100644 --- a/src/types/AdminBlockInstance.ts +++ b/src/types/AdminBlockInstance.ts @@ -1,13 +1,14 @@ // 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; reason?: string; expires?: string; - when_: string; + published: string; }; 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..57a9eef 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,9 +7,9 @@ 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; - when_: string; + published: 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..dbaf744 100644 --- a/src/types/AdminPurgeCommunity.ts +++ b/src/types/AdminPurgeCommunity.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 { 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; + published: 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..bde8904 100644 --- a/src/types/AdminPurgePerson.ts +++ b/src/types/AdminPurgePerson.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 { 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; + published: 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..1bf8b88 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,9 +7,9 @@ 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; - when_: string; + published: 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/CommunityAggregates.ts b/src/types/CommunityAggregates.ts index ece11e3..b546c18 100644 --- a/src/types/CommunityAggregates.ts +++ b/src/types/CommunityAggregates.ts @@ -27,4 +27,6 @@ export type CommunityAggregates = { */ users_active_half_year: number; subscribers_local: number; + report_count: number; + unresolved_report_count: number; }; diff --git a/src/types/CommunityReport.ts b/src/types/CommunityReport.ts new file mode 100644 index 0000000..30bf72b --- /dev/null +++ b/src/types/CommunityReport.ts @@ -0,0 +1,24 @@ +// 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 { CommunityReportId } from "./CommunityReportId"; +import type { PersonId } from "./PersonId"; + +/** + * A comment report. + */ +export type CommunityReport = { + id: CommunityReportId; + creator_id: PersonId; + community_id: CommunityId; + original_community_name: string; + original_community_title: string; + original_community_description?: string; + original_community_sidebar?: string; + original_community_icon?: string; + original_community_banner?: string; + reason: string; + resolved: boolean; + resolver_id?: PersonId; + published: string; + updated?: string; +}; diff --git a/src/types/CommunityReportId.ts b/src/types/CommunityReportId.ts new file mode 100644 index 0000000..7874305 --- /dev/null +++ b/src/types/CommunityReportId.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. + +/** + * The community report id. + */ +export type CommunityReportId = number; diff --git a/src/types/CommunityReportView.ts b/src/types/CommunityReportView.ts new file mode 100644 index 0000000..dd43d39 --- /dev/null +++ b/src/types/CommunityReportView.ts @@ -0,0 +1,18 @@ +// 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 { CommunityAggregates } from "./CommunityAggregates"; +import type { CommunityReport } from "./CommunityReport"; +import type { Person } from "./Person"; +import type { SubscribedType } from "./SubscribedType"; + +/** + * A community report view. + */ +export type CommunityReportView = { + community_report: CommunityReport; + community: Community; + creator: Person; + counts: CommunityAggregates; + subscribed: SubscribedType; + resolver?: Person; +}; 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/CreateSite.ts b/src/types/CreateSite.ts index a7c9de6..966a739 100644 --- a/src/types/CreateSite.ts +++ b/src/types/CreateSite.ts @@ -14,7 +14,6 @@ export type CreateSite = { name: string; sidebar?: string; description?: string; - enable_nsfw?: boolean; community_creation_admin_only?: boolean; require_email_verification?: boolean; application_question?: string; @@ -43,7 +42,6 @@ export type CreateSite = { rate_limit_search?: number; rate_limit_search_per_second?: number; federation_enabled?: boolean; - federation_debug?: boolean; captcha_enabled?: boolean; captcha_difficulty?: string; registration_mode?: RegistrationMode; 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/EditSite.ts b/src/types/EditSite.ts index 75b4fb1..85fecac 100644 --- a/src/types/EditSite.ts +++ b/src/types/EditSite.ts @@ -20,10 +20,6 @@ export type EditSite = { * A shorter, one line description of your site. */ description?: string; - /** - * Whether to enable NSFW. - */ - enable_nsfw?: boolean; /** * Limits community creation to admins only. */ @@ -118,10 +114,6 @@ export type EditSite = { * Whether to enable federation. */ federation_enabled?: boolean; - /** - * Enables federation debugging. - */ - federation_debug?: boolean; /** * Whether to enable captchas for signups. */ diff --git a/src/types/FederationError.ts b/src/types/FederationError.ts index 9574192..1e209f5 100644 --- a/src/types/FederationError.ts +++ b/src/types/FederationError.ts @@ -4,7 +4,6 @@ * Federation related errors, these dont need to be translated. */ export type FederationError = - | "CouldntFindActivity" | "InvalidCommunity" | "CannotCreatePostOrCommentInDeletedOrRemovedCommunity" | "CannotReceivePage" 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..e4a650a 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; 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 15e4176..8a3f8a9 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 fbc7fa4..5b9e0df 100644 --- a/src/types/LemmyErrorType.ts +++ b/src/types/LemmyErrorType.ts @@ -105,7 +105,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..5ce1119 100644 --- a/src/types/ModAdd.ts +++ b/src/types/ModAdd.ts @@ -1,13 +1,14 @@ // 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; - when_: string; + published: string; }; diff --git a/src/types/ModAddCommunity.ts b/src/types/ModAddCommunity.ts index 2399512..089b9aa 100644 --- a/src/types/ModAddCommunity.ts +++ b/src/types/ModAddCommunity.ts @@ -1,15 +1,16 @@ // 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; removed: boolean; - when_: string; + published: string; }; 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/ModAddCommunityView.ts b/src/types/ModAddCommunityView.ts index 7d2860a..5ddd5c1 100644 --- a/src/types/ModAddCommunityView.ts +++ b/src/types/ModAddCommunityView.ts @@ -10,5 +10,5 @@ export type ModAddCommunityView = { mod_add_community: ModAddCommunity; moderator?: Person; community: Community; - modded_person: Person; + other_person: Person; }; 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/ModAddView.ts b/src/types/ModAddView.ts index 83253f6..c3ba691 100644 --- a/src/types/ModAddView.ts +++ b/src/types/ModAddView.ts @@ -8,5 +8,5 @@ import type { Person } from "./Person"; export type ModAddView = { mod_add: ModAdd; moderator?: Person; - modded_person: Person; + other_person: Person; }; diff --git a/src/types/ModBan.ts b/src/types/ModBan.ts index ffc8918..6fe2dad 100644 --- a/src/types/ModBan.ts +++ b/src/types/ModBan.ts @@ -1,15 +1,16 @@ // 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; banned: boolean; expires?: string; - when_: string; + published: string; }; diff --git a/src/types/ModBanFromCommunity.ts b/src/types/ModBanFromCommunity.ts index 64d7174..009ffdc 100644 --- a/src/types/ModBanFromCommunity.ts +++ b/src/types/ModBanFromCommunity.ts @@ -1,17 +1,18 @@ // 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; reason?: string; banned: boolean; expires?: string; - when_: string; + published: string; }; 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..8b7204d 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; + other_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..62edf0f 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; + other_person: Person; }; diff --git a/src/types/ModFeaturePost.ts b/src/types/ModFeaturePost.ts index 65f278e..ff9550c 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,10 +7,10 @@ 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; - when_: string; + published: string; is_featured_community: 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..10e13af 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; + other_person: Person; post: Post; community: Community; }; diff --git a/src/types/ModHideCommunity.ts b/src/types/ModHideCommunity.ts index b361cfc..d40cc37 100644 --- a/src/types/ModHideCommunity.ts +++ b/src/types/ModHideCommunity.ts @@ -1,15 +1,16 @@ // 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; + published: string; reason?: string; hidden: boolean; }; 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..13c7e3c 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,9 +7,9 @@ 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; - when_: string; + published: string; }; 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..a4b0ba9 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; + other_person: Person; post: Post; community: Community; }; diff --git a/src/types/ModRemoveComment.ts b/src/types/ModRemoveComment.ts index 749b134..aaa09f4 100644 --- a/src/types/ModRemoveComment.ts +++ b/src/types/ModRemoveComment.ts @@ -1,15 +1,16 @@ // 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; removed: boolean; - when_: string; + published: 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..fa5014b 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; + other_person: Person; comment: Comment; - commenter: Person; post: Post; community: Community; }; diff --git a/src/types/ModRemoveCommunity.ts b/src/types/ModRemoveCommunity.ts index bd8358e..728bcbd 100644 --- a/src/types/ModRemoveCommunity.ts +++ b/src/types/ModRemoveCommunity.ts @@ -1,15 +1,16 @@ // 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; removed: boolean; - when_: string; + published: 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..be475e1 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,10 +7,10 @@ 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; removed: boolean; - when_: string; + published: 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..c0ed552 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; + other_person: Person; post: Post; community: Community; }; diff --git a/src/types/ModTransferCommunity.ts b/src/types/ModTransferCommunity.ts index 78b9887..eccc9fa 100644 --- a/src/types/ModTransferCommunity.ts +++ b/src/types/ModTransferCommunity.ts @@ -1,14 +1,15 @@ // 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; - when_: string; + published: string; }; 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/ModTransferCommunityView.ts b/src/types/ModTransferCommunityView.ts index 2be8158..d0338d3 100644 --- a/src/types/ModTransferCommunityView.ts +++ b/src/types/ModTransferCommunityView.ts @@ -10,5 +10,5 @@ export type ModTransferCommunityView = { mod_transfer_community: ModTransferCommunity; moderator?: Person; community: Community; - modded_person: Person; + other_person: Person; }; 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/ReportCombinedView.ts b/src/types/ReportCombinedView.ts index b8d4420..a209c86 100644 --- a/src/types/ReportCombinedView.ts +++ b/src/types/ReportCombinedView.ts @@ -1,9 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentReportView } from "./CommentReportView"; +import type { CommunityReportView } from "./CommunityReportView"; import type { PostReportView } from "./PostReportView"; import type { PrivateMessageReportView } from "./PrivateMessageReportView"; export type ReportCombinedView = | ({ type_: "Post" } & PostReportView) | ({ type_: "Comment" } & CommentReportView) - | ({ type_: "PrivateMessage" } & PrivateMessageReportView); + | ({ type_: "PrivateMessage" } & PrivateMessageReportView) + | ({ type_: "Community" } & CommunityReportView); 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/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;