diff --git a/package.json b/package.json index ddf7db1..256a9e3 100644 --- a/package.json +++ b/package.json @@ -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 ", "license": "AGPL-3.0", "main": "./dist/index.js", diff --git a/src/index.ts b/src/index.ts index a7d3d6b..81badb8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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"; diff --git a/src/types/CreateSite.ts b/src/types/CreateSite.ts index 7be2e77..d0f376d 100644 --- a/src/types/CreateSite.ts +++ b/src/types/CreateSite.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 { 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; blocked_instances?: Array; - taglines?: Array; registration_mode?: RegistrationMode; oauth_registration?: boolean; content_warning?: string; - default_post_listing_mode?: PostListingMode; } diff --git a/src/types/CreateTagline.ts b/src/types/CreateTagline.ts new file mode 100644 index 0000000..d3f5fc9 --- /dev/null +++ b/src/types/CreateTagline.ts @@ -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; +} diff --git a/src/types/CustomEmoji.ts b/src/types/CustomEmoji.ts index 32beaa6..4fd49d7 100644 --- a/src/types/CustomEmoji.ts +++ b/src/types/CustomEmoji.ts @@ -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; diff --git a/src/types/DeleteTagline.ts b/src/types/DeleteTagline.ts new file mode 100644 index 0000000..de408a8 --- /dev/null +++ b/src/types/DeleteTagline.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 { TaglineId } from "./TaglineId"; + +export interface DeleteTagline { + id: TaglineId; +} diff --git a/src/types/EditSite.ts b/src/types/EditSite.ts index f515221..ee613ef 100644 --- a/src/types/EditSite.ts +++ b/src/types/EditSite.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 { 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; blocked_instances?: Array; blocked_urls?: Array; - taglines?: Array; registration_mode?: RegistrationMode; oauth_registration?: boolean; reports_email_admins?: boolean; content_warning?: string; - default_post_listing_mode?: PostListingMode; } diff --git a/src/types/GetPersonDetails.ts b/src/types/GetPersonDetails.ts index ca5f1d2..5fac9b8 100644 --- a/src/types/GetPersonDetails.ts +++ b/src/types/GetPersonDetails.ts @@ -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; diff --git a/src/types/GetPosts.ts b/src/types/GetPosts.ts index f77f060..cce40a4 100644 --- a/src/types/GetPosts.ts +++ b/src/types/GetPosts.ts @@ -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; diff --git a/src/types/GetSiteResponse.ts b/src/types/GetSiteResponse.ts index 8408b9f..df68546 100644 --- a/src/types/GetSiteResponse.ts +++ b/src/types/GetSiteResponse.ts @@ -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; discussion_languages: Array; - taglines: Array; - custom_emojis: Array; + tagline?: Tagline; oauth_providers?: Array; admin_oauth_providers?: Array; blocked_urls: Array; diff --git a/src/types/LemmyErrorType.ts b/src/types/LemmyErrorType.ts index 9d73bc4..fa7fe2c 100644 --- a/src/types/LemmyErrorType.ts +++ b/src/types/LemmyErrorType.ts @@ -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" }; diff --git a/src/types/ListCommunities.ts b/src/types/ListCommunities.ts index 063614b..83a78f6 100644 --- a/src/types/ListCommunities.ts +++ b/src/types/ListCommunities.ts @@ -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; diff --git a/src/types/ListCustomEmojis.ts b/src/types/ListCustomEmojis.ts new file mode 100644 index 0000000..68b4bfb --- /dev/null +++ b/src/types/ListCustomEmojis.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 ListCustomEmojis { + page?: number; + limit?: number; + category?: string; + ignore_page_limits?: boolean; +} diff --git a/src/types/ListCustomEmojisResponse.ts b/src/types/ListCustomEmojisResponse.ts new file mode 100644 index 0000000..7d76905 --- /dev/null +++ b/src/types/ListCustomEmojisResponse.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 { CustomEmojiView } from "./CustomEmojiView"; + +export interface ListCustomEmojisResponse { + custom_emojis: Array; +} diff --git a/src/types/ListTaglines.ts b/src/types/ListTaglines.ts new file mode 100644 index 0000000..70f2538 --- /dev/null +++ b/src/types/ListTaglines.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. + +export interface ListTaglines { + page?: number; + limit?: number; +} diff --git a/src/types/ListTaglinesResponse.ts b/src/types/ListTaglinesResponse.ts new file mode 100644 index 0000000..7112239 --- /dev/null +++ b/src/types/ListTaglinesResponse.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 { Tagline } from "./Tagline"; + +export interface ListTaglinesResponse { + taglines: Array; +} diff --git a/src/types/LocalSite.ts b/src/types/LocalSite.ts index 8d18f67..1b5bac0 100644 --- a/src/types/LocalSite.ts +++ b/src/types/LocalSite.ts @@ -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; } diff --git a/src/types/LocalUser.ts b/src/types/LocalUser.ts index 3057f43..773e4af 100644 --- a/src/types/LocalUser.ts +++ b/src/types/LocalUser.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 { 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; } diff --git a/src/types/SortType.ts b/src/types/PostSortType.ts similarity index 93% rename from src/types/SortType.ts rename to src/types/PostSortType.ts index ee868e7..9ae6afb 100644 --- a/src/types/SortType.ts +++ b/src/types/PostSortType.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 type SortType = +export type PostSortType = | "Active" | "Hot" | "New" diff --git a/src/types/SaveUserSettings.ts b/src/types/SaveUserSettings.ts index c9c15fd..b5cc617 100644 --- a/src/types/SaveUserSettings.ts +++ b/src/types/SaveUserSettings.ts @@ -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; 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; diff --git a/src/types/Search.ts b/src/types/Search.ts index 6973e82..5e37d71 100644 --- a/src/types/Search.ts +++ b/src/types/Search.ts @@ -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; diff --git a/src/types/SiteResponse.ts b/src/types/SiteResponse.ts index 7844e11..91b7bc9 100644 --- a/src/types/SiteResponse.ts +++ b/src/types/SiteResponse.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 { SiteView } from "./SiteView"; -import type { Tagline } from "./Tagline"; export interface SiteResponse { site_view: SiteView; - taglines: Array; } diff --git a/src/types/Tagline.ts b/src/types/Tagline.ts index e6d443e..508f313 100644 --- a/src/types/Tagline.ts +++ b/src/types/Tagline.ts @@ -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; diff --git a/src/types/TaglineId.ts b/src/types/TaglineId.ts new file mode 100644 index 0000000..fa2615d --- /dev/null +++ b/src/types/TaglineId.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 TaglineId = number; diff --git a/src/types/TaglineResponse.ts b/src/types/TaglineResponse.ts new file mode 100644 index 0000000..bfbfef0 --- /dev/null +++ b/src/types/TaglineResponse.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 { Tagline } from "./Tagline"; + +export interface TaglineResponse { + tagline: Tagline; +} diff --git a/src/types/UpdateTagline.ts b/src/types/UpdateTagline.ts new file mode 100644 index 0000000..20309b2 --- /dev/null +++ b/src/types/UpdateTagline.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 { TaglineId } from "./TaglineId"; + +export interface UpdateTagline { + id: TaglineId; + content: string; +}