Update types from main branch (#356)

* Update types from main branch

* 0.20.0-alpha.9

* add missing files

* 0.20.0-alpha.10

* add block back

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
Nutomic 2024-09-23 14:39:46 +02:00 committed by GitHub
parent 56eb0c6ecf
commit df67ca2220
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 99 additions and 52 deletions

View file

@ -1,7 +1,7 @@
{
"name": "lemmy-js-client",
"description": "A javascript / typescript client for Lemmy",
"version": "0.20.0-alpha.8",
"version": "0.20.0-alpha.10",
"author": "Dessalines <tyhou13@gmx.com>",
"license": "AGPL-3.0",
"main": "./dist/index.js",

View file

@ -61,6 +61,7 @@ export { CreatePostReport } from "./types/CreatePostReport";
export { CreatePrivateMessage } from "./types/CreatePrivateMessage";
export { CreatePrivateMessageReport } from "./types/CreatePrivateMessageReport";
export { CreateSite } from "./types/CreateSite";
export { CreateTagline } from "./types/CreateTagline";
export { CustomEmoji } from "./types/CustomEmoji";
export { CustomEmojiId } from "./types/CustomEmojiId";
export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword";
@ -73,6 +74,7 @@ export { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
export { DeleteOAuthProvider } from "./types/DeleteOAuthProvider";
export { DeletePost } from "./types/DeletePost";
export { DeletePrivateMessage } from "./types/DeletePrivateMessage";
export { DeleteTagline } from "./types/DeleteTagline";
export { DistinguishComment } from "./types/DistinguishComment";
export { EditComment } from "./types/EditComment";
export { EditCommunity } from "./types/EditCommunity";
@ -129,6 +131,8 @@ export { ListCommentReports } from "./types/ListCommentReports";
export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
export { ListCommunities } from "./types/ListCommunities";
export { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
export { ListCustomEmojis } from "./types/ListCustomEmojis";
export { ListCustomEmojisResponse } from "./types/ListCustomEmojisResponse";
export { ListLoginsResponse } from "./types/ListLoginsResponse";
export { ListMedia } from "./types/ListMedia";
export { ListMediaResponse } from "./types/ListMediaResponse";
@ -140,6 +144,8 @@ export { ListPrivateMessageReports } from "./types/ListPrivateMessageReports";
export { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageReportsResponse";
export { ListRegistrationApplications } from "./types/ListRegistrationApplications";
export { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
export { ListTaglines } from "./types/ListTaglines";
export { ListTaglinesResponse } from "./types/ListTaglinesResponse";
export { ListingType } from "./types/ListingType";
export { LocalImage } from "./types/LocalImage";
export { LocalImageView } from "./types/LocalImageView";
@ -211,6 +217,7 @@ export { PostReportId } from "./types/PostReportId";
export { PostReportResponse } from "./types/PostReportResponse";
export { PostReportView } from "./types/PostReportView";
export { PostResponse } from "./types/PostResponse";
export { PostSortType } from "./types/PostSortType";
export { PostView } from "./types/PostView";
export { PrivateMessage } from "./types/PrivateMessage";
export { PrivateMessageId } from "./types/PrivateMessageId";
@ -252,11 +259,13 @@ export { SiteAggregates } from "./types/SiteAggregates";
export { SiteId } from "./types/SiteId";
export { SiteResponse } from "./types/SiteResponse";
export { SiteView } from "./types/SiteView";
export { SortType } from "./types/SortType";
export { SubscribedType } from "./types/SubscribedType";
export { SuccessResponse } from "./types/SuccessResponse";
export { Tagline } from "./types/Tagline";
export { TaglineId } from "./types/TaglineId";
export { TaglineResponse } from "./types/TaglineResponse";
export { TransferCommunity } from "./types/TransferCommunity";
export { UpdateTagline } from "./types/UpdateTagline";
export { UpdateTotp } from "./types/UpdateTotp";
export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
export { VerifyEmail } from "./types/VerifyEmail";

View file

@ -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 { CommentSortType } from "./CommentSortType";
import type { LanguageId } from "./LanguageId";
import type { ListingType } from "./ListingType";
import type { PostListingMode } from "./PostListingMode";
import type { PostSortType } from "./PostSortType";
import type { RegistrationMode } from "./RegistrationMode";
import type { SortType } from "./SortType";
export interface CreateSite {
name: string;
@ -19,7 +20,9 @@ export interface CreateSite {
private_instance?: boolean;
default_theme?: string;
default_post_listing_type?: ListingType;
default_sort_type?: SortType;
default_post_listing_mode?: PostListingMode;
default_post_sort_type?: PostSortType;
default_comment_sort_type?: CommentSortType;
legal_information?: string;
application_email_admins?: boolean;
hide_modlog_mod_names?: boolean;
@ -44,9 +47,7 @@ export interface CreateSite {
captcha_difficulty?: string;
allowed_instances?: Array<string>;
blocked_instances?: Array<string>;
taglines?: Array<string>;
registration_mode?: RegistrationMode;
oauth_registration?: boolean;
content_warning?: string;
default_post_listing_mode?: PostListingMode;
}

View file

@ -0,0 +1,5 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface CreateTagline {
content: string;
}

View file

@ -1,10 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CustomEmojiId } from "./CustomEmojiId";
import type { LocalSiteId } from "./LocalSiteId";
export interface CustomEmoji {
id: CustomEmojiId;
local_site_id: LocalSiteId;
shortcode: string;
image_url: string;
alt_text: string;

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { TaglineId } from "./TaglineId";
export interface DeleteTagline {
id: TaglineId;
}

View file

@ -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 { CommentSortType } from "./CommentSortType";
import type { LanguageId } from "./LanguageId";
import type { ListingType } from "./ListingType";
import type { PostListingMode } from "./PostListingMode";
import type { PostSortType } from "./PostSortType";
import type { RegistrationMode } from "./RegistrationMode";
import type { SortType } from "./SortType";
export interface EditSite {
name?: string;
@ -19,7 +20,9 @@ export interface EditSite {
private_instance?: boolean;
default_theme?: string;
default_post_listing_type?: ListingType;
default_sort_type?: SortType;
default_post_listing_mode?: PostListingMode;
default_post_sort_type?: PostSortType;
default_comment_sort_type?: CommentSortType;
legal_information?: string;
application_email_admins?: boolean;
hide_modlog_mod_names?: boolean;
@ -45,10 +48,8 @@ export interface EditSite {
allowed_instances?: Array<string>;
blocked_instances?: Array<string>;
blocked_urls?: Array<string>;
taglines?: Array<string>;
registration_mode?: RegistrationMode;
oauth_registration?: boolean;
reports_email_admins?: boolean;
content_warning?: string;
default_post_listing_mode?: PostListingMode;
}

View file

@ -1,12 +1,12 @@
// 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 { SortType } from "./SortType";
import type { PostSortType } from "./PostSortType";
export interface GetPersonDetails {
person_id?: PersonId;
username?: string;
sort?: SortType;
sort?: PostSortType;
page?: number;
limit?: number;
community_id?: CommunityId;

View file

@ -2,11 +2,11 @@
import type { CommunityId } from "./CommunityId";
import type { ListingType } from "./ListingType";
import type { PaginationCursor } from "./PaginationCursor";
import type { SortType } from "./SortType";
import type { PostSortType } from "./PostSortType";
export interface GetPosts {
type_?: ListingType;
sort?: SortType;
sort?: PostSortType;
page?: number;
limit?: number;
community_id?: CommunityId;

View file

@ -1,5 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CustomEmojiView } from "./CustomEmojiView";
import type { Language } from "./Language";
import type { LanguageId } from "./LanguageId";
import type { LocalSiteUrlBlocklist } from "./LocalSiteUrlBlocklist";
@ -17,8 +16,7 @@ export interface GetSiteResponse {
my_user?: MyUserInfo;
all_languages: Array<Language>;
discussion_languages: Array<LanguageId>;
taglines: Array<Tagline>;
custom_emojis: Array<CustomEmojiView>;
tagline?: Tagline;
oauth_providers?: Array<PublicOAuthProvider>;
admin_oauth_providers?: Array<OAuthProvider>;
blocked_urls: Array<LocalSiteUrlBlocklist>;

View file

@ -34,19 +34,6 @@ export type LemmyErrorType =
| { error: "site_ban" }
| { error: "deleted" }
| { error: "banned_from_community" }
| { error: "couldnt_find_community" }
| { error: "couldnt_find_person" }
| { error: "couldnt_find_comment" }
| { error: "couldnt_find_comment_report" }
| { error: "couldnt_find_post_report" }
| { error: "couldnt_find_private_message_report" }
| { error: "couldnt_find_local_user" }
| { error: "couldnt_find_person_mention" }
| { error: "couldnt_find_registration_application" }
| { error: "couldnt_find_comment_reply" }
| { error: "couldnt_find_private_message" }
| { error: "couldnt_find_activity" }
| { error: "couldnt_find_oauth_provider" }
| { error: "person_is_blocked" }
| { error: "community_is_blocked" }
| { error: "instance_is_blocked" }
@ -67,7 +54,6 @@ export type LemmyErrorType =
| { error: "only_mods_can_post_in_community" }
| { error: "couldnt_update_post" }
| { error: "no_post_edit_allowed" }
| { error: "couldnt_find_post" }
| { error: "edit_private_message_not_allowed" }
| { error: "site_already_exists" }
| { error: "application_question_required" }
@ -123,7 +109,6 @@ export type LemmyErrorType =
| { error: "couldnt_update_community_hidden_status" }
| { error: "person_block_already_exists" }
| { error: "user_already_exists" }
| { error: "token_not_found" }
| { error: "couldnt_like_post" }
| { error: "couldnt_save_post" }
| { error: "couldnt_mark_post_as_read" }
@ -145,7 +130,6 @@ export type LemmyErrorType =
| { error: "invalid_url" }
| { error: "email_send_failed" }
| { error: "slurs" }
| { error: "couldnt_find_object" }
| { error: "registration_denied"; message: string | null }
| { error: "federation_disabled" }
| { error: "domain_blocked"; message: string }
@ -175,4 +159,5 @@ export type LemmyErrorType =
| { error: "couldnt_delete_oauth_provider" }
| { error: "unknown"; message: string }
| { error: "cant_delete_site" }
| { error: "url_length_overflow" };
| { error: "url_length_overflow" }
| { error: "not_found" };

View file

@ -1,10 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ListingType } from "./ListingType";
import type { SortType } from "./SortType";
import type { PostSortType } from "./PostSortType";
export interface ListCommunities {
type_?: ListingType;
sort?: SortType;
sort?: PostSortType;
show_nsfw?: boolean;
page?: number;
limit?: number;

View file

@ -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 ListCustomEmojis {
page?: number;
limit?: number;
category?: string;
ignore_page_limits?: boolean;
}

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CustomEmojiView } from "./CustomEmojiView";
export interface ListCustomEmojisResponse {
custom_emojis: Array<CustomEmojiView>;
}

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface ListTaglines {
page?: number;
limit?: number;
}

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Tagline } from "./Tagline";
export interface ListTaglinesResponse {
taglines: Array<Tagline>;
}

View file

@ -1,10 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentSortType } from "./CommentSortType";
import type { ListingType } from "./ListingType";
import type { LocalSiteId } from "./LocalSiteId";
import type { PostListingMode } from "./PostListingMode";
import type { PostSortType } from "./PostSortType";
import type { RegistrationMode } from "./RegistrationMode";
import type { SiteId } from "./SiteId";
import type { SortType } from "./SortType";
export interface LocalSite {
id: LocalSiteId;
@ -31,6 +32,7 @@ export interface LocalSite {
reports_email_admins: boolean;
federation_signed_fetch: boolean;
default_post_listing_mode: PostListingMode;
default_sort_type: SortType;
default_post_sort_type: PostSortType;
default_comment_sort_type: CommentSortType;
oauth_registration: boolean;
}

View file

@ -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 { CommentSortType } from "./CommentSortType";
import type { ListingType } from "./ListingType";
import type { LocalUserId } from "./LocalUserId";
import type { PersonId } from "./PersonId";
import type { PostListingMode } from "./PostListingMode";
import type { SortType } from "./SortType";
import type { PostSortType } from "./PostSortType";
export interface LocalUser {
id: LocalUserId;
@ -11,7 +12,7 @@ export interface LocalUser {
email?: string;
show_nsfw: boolean;
theme: string;
default_sort_type: SortType;
default_post_sort_type: PostSortType;
default_listing_type: ListingType;
interface_language: string;
show_avatars: boolean;
@ -30,4 +31,5 @@ export interface LocalUser {
enable_keyboard_navigation: boolean;
enable_animated_images: boolean;
collapse_bot_comments: boolean;
default_comment_sort_type: CommentSortType;
}

View file

@ -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 type SortType =
export type PostSortType =
| "Active"
| "Hot"
| "New"

View file

@ -1,16 +1,19 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentSortType } from "./CommentSortType";
import type { LanguageId } from "./LanguageId";
import type { ListingType } from "./ListingType";
import type { PostListingMode } from "./PostListingMode";
import type { SortType } from "./SortType";
import type { PostSortType } from "./PostSortType";
export interface SaveUserSettings {
show_nsfw?: boolean;
blur_nsfw?: boolean;
auto_expand?: boolean;
theme?: string;
default_sort_type?: SortType;
default_listing_type?: ListingType;
post_listing_mode?: PostListingMode;
default_post_sort_type?: PostSortType;
default_comment_sort_type?: CommentSortType;
interface_language?: string;
avatar?: string;
banner?: string;
@ -26,7 +29,6 @@ export interface SaveUserSettings {
discussion_languages?: Array<LanguageId>;
open_links_in_new_tab?: boolean;
infinite_scroll_enabled?: boolean;
post_listing_mode?: PostListingMode;
enable_keyboard_navigation?: boolean;
enable_animated_images?: boolean;
collapse_bot_comments?: boolean;

View file

@ -2,8 +2,8 @@
import type { CommunityId } from "./CommunityId";
import type { ListingType } from "./ListingType";
import type { PersonId } from "./PersonId";
import type { PostSortType } from "./PostSortType";
import type { SearchType } from "./SearchType";
import type { SortType } from "./SortType";
export interface Search {
q: string;
@ -11,7 +11,7 @@ export interface Search {
community_name?: string;
creator_id?: PersonId;
type_?: SearchType;
sort?: SortType;
sort?: PostSortType;
listing_type?: ListingType;
page?: number;
limit?: number;

View file

@ -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 { SiteView } from "./SiteView";
import type { Tagline } from "./Tagline";
export interface SiteResponse {
site_view: SiteView;
taglines: Array<Tagline>;
}

View file

@ -1,9 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LocalSiteId } from "./LocalSiteId";
export interface Tagline {
id: number;
local_site_id: LocalSiteId;
content: string;
published: string;
updated?: string;

3
src/types/TaglineId.ts Normal file
View file

@ -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 TaglineId = number;

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Tagline } from "./Tagline";
export interface TaglineResponse {
tagline: Tagline;
}

View file

@ -0,0 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { TaglineId } from "./TaglineId";
export interface UpdateTagline {
id: TaglineId;
content: string;
}