From 817baf35bbb90a8da6c864bff87540c1c42f23d5 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 16 Feb 2024 09:46:06 -0500 Subject: [PATCH] Adding some types from lemmy/main. --- src/index.ts | 5 +++-- src/types/Community.ts | 2 ++ src/types/CommunityAggregates.ts | 1 + src/types/CommunityVisibility.ts | 3 +++ src/types/CreateCommunity.ts | 2 ++ src/types/CreatePost.ts | 1 + src/types/CreateSite.ts | 5 +++++ src/types/EditCommunity.ts | 2 ++ src/types/EditPost.ts | 1 + src/types/EditSite.ts | 5 +++++ src/types/GetSiteMetadataResponse.ts | 4 ++-- src/types/ImageUpload.ts | 9 --------- src/types/LinkMetadata.ts | 9 +++++++++ src/types/LocalSite.ts | 4 ++++ src/types/{SiteMetadata.ts => OpenGraphData.ts} | 2 +- src/types/Post.ts | 1 + src/types/Site.ts | 1 + 17 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 src/types/CommunityVisibility.ts delete mode 100644 src/types/ImageUpload.ts create mode 100644 src/types/LinkMetadata.ts rename src/types/{SiteMetadata.ts => OpenGraphData.ts} (85%) diff --git a/src/index.ts b/src/index.ts index 28fe1cf..0657657 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,6 +48,7 @@ export { CommunityId } from "./types/CommunityId"; export { CommunityModeratorView } from "./types/CommunityModeratorView"; export { CommunityResponse } from "./types/CommunityResponse"; export { CommunityView } from "./types/CommunityView"; +export { CommunityVisibility } from "./types/CommunityVisibility"; export { CreateComment } from "./types/CreateComment"; export { CreateCommentLike } from "./types/CreateCommentLike"; export { CreateCommentReport } from "./types/CreateCommentReport"; @@ -109,7 +110,6 @@ export { GetSiteResponse } from "./types/GetSiteResponse"; export { GetUnreadCountResponse } from "./types/GetUnreadCountResponse"; export { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse"; export { HideCommunity } from "./types/HideCommunity"; -export { ImageUpload } from "./types/ImageUpload"; export { Instance } from "./types/Instance"; export { InstanceBlockView } from "./types/InstanceBlockView"; export { InstanceId } from "./types/InstanceId"; @@ -117,6 +117,7 @@ export { InstanceWithFederationState } from "./types/InstanceWithFederationState export { Language } from "./types/Language"; export { LanguageId } from "./types/LanguageId"; export { LemmyErrorType } from "./types/LemmyErrorType"; +export { LinkMetadata } from "./types/LinkMetadata"; export { ListCommentLikes } from "./types/ListCommentLikes"; export { ListCommentLikesResponse } from "./types/ListCommentLikesResponse"; export { ListCommentReports } from "./types/ListCommentReports"; @@ -171,6 +172,7 @@ export { ModTransferCommunityView } from "./types/ModTransferCommunityView"; export { ModlogActionType } from "./types/ModlogActionType"; export { ModlogListParams } from "./types/ModlogListParams"; export { MyUserInfo } from "./types/MyUserInfo"; +export { OpenGraphData } from "./types/OpenGraphData"; export { PaginationCursor } from "./types/PaginationCursor"; export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset"; export { PasswordReset } from "./types/PasswordReset"; @@ -231,7 +233,6 @@ export { SearchType } from "./types/SearchType"; export { Site } from "./types/Site"; export { SiteAggregates } from "./types/SiteAggregates"; export { SiteId } from "./types/SiteId"; -export { SiteMetadata } from "./types/SiteMetadata"; export { SiteResponse } from "./types/SiteResponse"; export { SiteView } from "./types/SiteView"; export { SortType } from "./types/SortType"; diff --git a/src/types/Community.ts b/src/types/Community.ts index 31f0859..496eb89 100644 --- a/src/types/Community.ts +++ b/src/types/Community.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 { CommunityId } from "./CommunityId"; +import type { CommunityVisibility } from "./CommunityVisibility"; import type { InstanceId } from "./InstanceId"; export interface Community { @@ -19,4 +20,5 @@ export interface Community { hidden: boolean; posting_restricted_to_mods: boolean; instance_id: InstanceId; + visibility: CommunityVisibility; } diff --git a/src/types/CommunityAggregates.ts b/src/types/CommunityAggregates.ts index d686794..b8fc455 100644 --- a/src/types/CommunityAggregates.ts +++ b/src/types/CommunityAggregates.ts @@ -11,4 +11,5 @@ export interface CommunityAggregates { users_active_week: /* integer */ number; users_active_month: /* integer */ number; users_active_half_year: /* integer */ number; + subscribers_local: /* integer */ number; } diff --git a/src/types/CommunityVisibility.ts b/src/types/CommunityVisibility.ts new file mode 100644 index 0000000..f899643 --- /dev/null +++ b/src/types/CommunityVisibility.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 CommunityVisibility = "Public" | "LocalOnly"; diff --git a/src/types/CreateCommunity.ts b/src/types/CreateCommunity.ts index 41c06c1..3465267 100644 --- a/src/types/CreateCommunity.ts +++ b/src/types/CreateCommunity.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 { CommunityVisibility } from "./CommunityVisibility"; import type { LanguageId } from "./LanguageId"; export interface CreateCommunity { @@ -10,4 +11,5 @@ export interface CreateCommunity { nsfw?: boolean; posting_restricted_to_mods?: boolean; discussion_languages?: Array; + visibility?: CommunityVisibility; } diff --git a/src/types/CreatePost.ts b/src/types/CreatePost.ts index 5152a0e..3b77adb 100644 --- a/src/types/CreatePost.ts +++ b/src/types/CreatePost.ts @@ -10,4 +10,5 @@ export interface CreatePost { honeypot?: string; nsfw?: boolean; language_id?: LanguageId; + custom_thumbnail?: string; } diff --git a/src/types/CreateSite.ts b/src/types/CreateSite.ts index 107c3fb..3cb7431 100644 --- a/src/types/CreateSite.ts +++ b/src/types/CreateSite.ts @@ -1,7 +1,9 @@ // 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 { ListingType } from "./ListingType"; +import type { PostListingMode } from "./PostListingMode"; import type { RegistrationMode } from "./RegistrationMode"; +import type { SortType } from "./SortType"; export interface CreateSite { name: string; @@ -17,6 +19,7 @@ export interface CreateSite { private_instance?: boolean; default_theme?: string; default_post_listing_type?: ListingType; + default_sort_type?: SortType; legal_information?: string; application_email_admins?: boolean; hide_modlog_mod_names?: boolean; @@ -43,4 +46,6 @@ export interface CreateSite { blocked_instances?: Array; taglines?: Array; registration_mode?: RegistrationMode; + content_warning?: string; + default_post_listing_mode?: PostListingMode; } diff --git a/src/types/EditCommunity.ts b/src/types/EditCommunity.ts index 9d48fb4..fe46e19 100644 --- a/src/types/EditCommunity.ts +++ b/src/types/EditCommunity.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 { CommunityId } from "./CommunityId"; +import type { CommunityVisibility } from "./CommunityVisibility"; import type { LanguageId } from "./LanguageId"; export interface EditCommunity { @@ -11,4 +12,5 @@ export interface EditCommunity { nsfw?: boolean; posting_restricted_to_mods?: boolean; discussion_languages?: Array; + visibility?: CommunityVisibility; } diff --git a/src/types/EditPost.ts b/src/types/EditPost.ts index 05d89b1..c8fac6f 100644 --- a/src/types/EditPost.ts +++ b/src/types/EditPost.ts @@ -9,4 +9,5 @@ export interface EditPost { body?: string; nsfw?: boolean; language_id?: LanguageId; + custom_thumbnail?: string; } diff --git a/src/types/EditSite.ts b/src/types/EditSite.ts index fae73a9..b7b312d 100644 --- a/src/types/EditSite.ts +++ b/src/types/EditSite.ts @@ -1,7 +1,9 @@ // 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 { ListingType } from "./ListingType"; +import type { PostListingMode } from "./PostListingMode"; import type { RegistrationMode } from "./RegistrationMode"; +import type { SortType } from "./SortType"; export interface EditSite { name?: string; @@ -17,6 +19,7 @@ export interface EditSite { private_instance?: boolean; default_theme?: string; default_post_listing_type?: ListingType; + default_sort_type?: SortType; legal_information?: string; application_email_admins?: boolean; hide_modlog_mod_names?: boolean; @@ -44,4 +47,6 @@ export interface EditSite { taglines?: Array; registration_mode?: RegistrationMode; reports_email_admins?: boolean; + content_warning?: string; + default_post_listing_mode?: PostListingMode; } diff --git a/src/types/GetSiteMetadataResponse.ts b/src/types/GetSiteMetadataResponse.ts index 2899d8c..fbe4e83 100644 --- a/src/types/GetSiteMetadataResponse.ts +++ b/src/types/GetSiteMetadataResponse.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. -import type { SiteMetadata } from "./SiteMetadata"; +import type { LinkMetadata } from "./LinkMetadata"; export interface GetSiteMetadataResponse { - metadata: SiteMetadata; + metadata: LinkMetadata; } diff --git a/src/types/ImageUpload.ts b/src/types/ImageUpload.ts deleted file mode 100644 index 34bf9cc..0000000 --- a/src/types/ImageUpload.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { LocalUserId } from "./LocalUserId"; - -export interface ImageUpload { - local_user_id: LocalUserId; - pictrs_alias: string; - pictrs_delete_token: string; - published: string; -} diff --git a/src/types/LinkMetadata.ts b/src/types/LinkMetadata.ts new file mode 100644 index 0000000..f6a027c --- /dev/null +++ b/src/types/LinkMetadata.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. + +export interface LinkMetadata { + title?: string; + description?: string; + image?: string; + embed_video_url?: string; + content_type?: string; +} diff --git a/src/types/LocalSite.ts b/src/types/LocalSite.ts index 67aab50..0d2e24b 100644 --- a/src/types/LocalSite.ts +++ b/src/types/LocalSite.ts @@ -1,8 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ListingType } from "./ListingType"; import type { LocalSiteId } from "./LocalSiteId"; +import type { PostListingMode } from "./PostListingMode"; import type { RegistrationMode } from "./RegistrationMode"; import type { SiteId } from "./SiteId"; +import type { SortType } from "./SortType"; export interface LocalSite { id: LocalSiteId; @@ -29,4 +31,6 @@ export interface LocalSite { registration_mode: RegistrationMode; reports_email_admins: boolean; federation_signed_fetch: boolean; + default_post_listing_mode: PostListingMode; + default_sort_type: SortType; } diff --git a/src/types/SiteMetadata.ts b/src/types/OpenGraphData.ts similarity index 85% rename from src/types/SiteMetadata.ts rename to src/types/OpenGraphData.ts index a18d78c..2b85655 100644 --- a/src/types/SiteMetadata.ts +++ b/src/types/OpenGraphData.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. -export interface SiteMetadata { +export interface OpenGraphData { title?: string; description?: string; image?: string; diff --git a/src/types/Post.ts b/src/types/Post.ts index cb1674d..2bf377e 100644 --- a/src/types/Post.ts +++ b/src/types/Post.ts @@ -26,4 +26,5 @@ export interface Post { language_id: LanguageId; featured_community: boolean; featured_local: boolean; + url_content_type?: string; } diff --git a/src/types/Site.ts b/src/types/Site.ts index b7d82af..1ed7ce6 100644 --- a/src/types/Site.ts +++ b/src/types/Site.ts @@ -17,4 +17,5 @@ export interface Site { private_key?: string; public_key: string; instance_id: InstanceId; + content_warning?: string; }