From 95946cc50af51253c107f1f80c4c3cdf74afe059 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 10 Nov 2024 10:33:44 -0500 Subject: [PATCH] Updating types from release/v0.19 branch of lemmy. --- src/index.ts | 4 +++- src/types/ApproveRegistrationApplication.ts | 3 ++- src/types/GetPosts.ts | 2 ++ src/types/GetRegistrationApplication.ts | 6 ++++++ src/types/ImageDetails.ts | 8 ++++++++ src/types/LemmyErrorType.ts | 6 +++++- src/types/PostView.ts | 2 ++ src/types/RegistrationApplication.ts | 3 ++- .../{PersonBlockId.ts => RegistrationApplicationId.ts} | 2 +- src/types/Search.ts | 1 + 10 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 src/types/GetRegistrationApplication.ts create mode 100644 src/types/ImageDetails.ts rename src/types/{PersonBlockId.ts => RegistrationApplicationId.ts} (69%) diff --git a/src/index.ts b/src/index.ts index 9256209..ae03320 100644 --- a/src/index.ts +++ b/src/index.ts @@ -100,6 +100,7 @@ export { GetPostResponse } from "./types/GetPostResponse"; export { GetPosts } from "./types/GetPosts"; export { GetPostsResponse } from "./types/GetPostsResponse"; export { GetPrivateMessages } from "./types/GetPrivateMessages"; +export { GetRegistrationApplication } from "./types/GetRegistrationApplication"; export { GetReplies } from "./types/GetReplies"; export { GetRepliesResponse } from "./types/GetRepliesResponse"; export { GetReportCount } from "./types/GetReportCount"; @@ -111,6 +112,7 @@ export { GetUnreadCountResponse } from "./types/GetUnreadCountResponse"; export { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse"; export { HideCommunity } from "./types/HideCommunity"; export { HidePost } from "./types/HidePost"; +export { ImageDetails } from "./types/ImageDetails"; export { Instance } from "./types/Instance"; export { InstanceBlockView } from "./types/InstanceBlockView"; export { InstanceId } from "./types/InstanceId"; @@ -185,7 +187,6 @@ export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset"; export { PasswordReset } from "./types/PasswordReset"; export { Person } from "./types/Person"; export { PersonAggregates } from "./types/PersonAggregates"; -export { PersonBlockId } from "./types/PersonBlockId"; export { PersonBlockView } from "./types/PersonBlockView"; export { PersonId } from "./types/PersonId"; export { PersonMention } from "./types/PersonMention"; @@ -220,6 +221,7 @@ export { PurgePost } from "./types/PurgePost"; export { ReadableFederationState } from "./types/ReadableFederationState"; export { Register } from "./types/Register"; export { RegistrationApplication } from "./types/RegistrationApplication"; +export { RegistrationApplicationId } from "./types/RegistrationApplicationId"; export { RegistrationApplicationResponse } from "./types/RegistrationApplicationResponse"; export { RegistrationApplicationView } from "./types/RegistrationApplicationView"; export { RegistrationMode } from "./types/RegistrationMode"; diff --git a/src/types/ApproveRegistrationApplication.ts b/src/types/ApproveRegistrationApplication.ts index 88d172a..273d31f 100644 --- a/src/types/ApproveRegistrationApplication.ts +++ b/src/types/ApproveRegistrationApplication.ts @@ -1,7 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { RegistrationApplicationId } from "./RegistrationApplicationId"; export interface ApproveRegistrationApplication { - id: number; + id: RegistrationApplicationId; approve: boolean; deny_reason?: string; } diff --git a/src/types/GetPosts.ts b/src/types/GetPosts.ts index 9da3149..f77f060 100644 --- a/src/types/GetPosts.ts +++ b/src/types/GetPosts.ts @@ -15,5 +15,7 @@ export interface GetPosts { liked_only?: boolean; disliked_only?: boolean; show_hidden?: boolean; + show_read?: boolean; + show_nsfw?: boolean; page_cursor?: PaginationCursor; } diff --git a/src/types/GetRegistrationApplication.ts b/src/types/GetRegistrationApplication.ts new file mode 100644 index 0000000..2a63a55 --- /dev/null +++ b/src/types/GetRegistrationApplication.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. +import type { PersonId } from "./PersonId"; + +export interface GetRegistrationApplication { + person_id: PersonId; +} diff --git a/src/types/ImageDetails.ts b/src/types/ImageDetails.ts new file mode 100644 index 0000000..8d350ab --- /dev/null +++ b/src/types/ImageDetails.ts @@ -0,0 +1,8 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface ImageDetails { + link: string; + width: number; + height: number; + content_type: string; +} diff --git a/src/types/LemmyErrorType.ts b/src/types/LemmyErrorType.ts index 16cc665..e7ccf1f 100644 --- a/src/types/LemmyErrorType.ts +++ b/src/types/LemmyErrorType.ts @@ -29,6 +29,8 @@ export type LemmyErrorType = | { error: "not_top_admin" } | { error: "not_top_mod" } | { error: "not_logged_in" } + | { error: "not_higher_mod" } + | { error: "not_higher_admin" } | { error: "site_ban" } | { error: "deleted" } | { error: "banned_from_community" } @@ -164,4 +166,6 @@ export type LemmyErrorType = | { error: "cant_block_local_instance" } | { error: "url_without_domain" } | { error: "inbox_timeout" } - | { error: "unknown"; message: string }; + | { error: "unknown"; message: string } + | { error: "cant_delete_site" } + | { error: "url_length_overflow" }; diff --git a/src/types/PostView.ts b/src/types/PostView.ts index a17cd51..c66de23 100644 --- a/src/types/PostView.ts +++ b/src/types/PostView.ts @@ -1,5 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Community } from "./Community"; +import type { ImageDetails } from "./ImageDetails"; import type { Person } from "./Person"; import type { Post } from "./Post"; import type { PostAggregates } from "./PostAggregates"; @@ -9,6 +10,7 @@ export interface PostView { post: Post; creator: Person; community: Community; + image_details?: ImageDetails; creator_banned_from_community: boolean; banned_from_community: boolean; creator_is_moderator: boolean; diff --git a/src/types/RegistrationApplication.ts b/src/types/RegistrationApplication.ts index 67c1a89..12ce2f2 100644 --- a/src/types/RegistrationApplication.ts +++ b/src/types/RegistrationApplication.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 { LocalUserId } from "./LocalUserId"; import type { PersonId } from "./PersonId"; +import type { RegistrationApplicationId } from "./RegistrationApplicationId"; export interface RegistrationApplication { - id: number; + id: RegistrationApplicationId; local_user_id: LocalUserId; answer: string; admin_id?: PersonId; diff --git a/src/types/PersonBlockId.ts b/src/types/RegistrationApplicationId.ts similarity index 69% rename from src/types/PersonBlockId.ts rename to src/types/RegistrationApplicationId.ts index 7e41573..3734700 100644 --- a/src/types/PersonBlockId.ts +++ b/src/types/RegistrationApplicationId.ts @@ -1,3 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type PersonBlockId = number; +export type RegistrationApplicationId = number; diff --git a/src/types/Search.ts b/src/types/Search.ts index da9817e..6973e82 100644 --- a/src/types/Search.ts +++ b/src/types/Search.ts @@ -15,4 +15,5 @@ export interface Search { listing_type?: ListingType; page?: number; limit?: number; + post_title_only?: boolean; }