diff --git a/src/http.ts b/src/http.ts index 0924cc2..8aa36e4 100644 --- a/src/http.ts +++ b/src/http.ts @@ -1,14 +1,21 @@ import fetch from "cross-fetch"; import FormData from "form-data"; import { AddAdmin } from "./types/AddAdmin"; +import { AddAdminResponse } from "./types/AddAdminResponse"; import { AddModToCommunity } from "./types/AddModToCommunity"; +import { AddModToCommunityResponse } from "./types/AddModToCommunityResponse"; import { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication"; import { BanFromCommunity } from "./types/BanFromCommunity"; +import { BanFromCommunityResponse } from "./types/BanFromCommunityResponse"; import { BanPerson } from "./types/BanPerson"; +import { BanPersonResponse } from "./types/BanPersonResponse"; import { BannedPersonsResponse } from "./types/BannedPersonsResponse"; import { BlockCommunity } from "./types/BlockCommunity"; +import { BlockCommunityResponse } from "./types/BlockCommunityResponse"; import { BlockPerson } from "./types/BlockPerson"; +import { BlockPersonResponse } from "./types/BlockPersonResponse"; import { ChangePassword } from "./types/ChangePassword"; +import { CommentReplyResponse } from "./types/CommentReplyResponse"; import { CommentReportResponse } from "./types/CommentReportResponse"; import { CommentResponse } from "./types/CommentResponse"; import { CommunityResponse } from "./types/CommunityResponse"; @@ -25,9 +32,11 @@ import { CreatePrivateMessageReport } from "./types/CreatePrivateMessageReport"; import { CreateSite } from "./types/CreateSite"; import { CustomEmojiResponse } from "./types/CustomEmojiResponse"; import { DeleteAccount } from "./types/DeleteAccount"; +import { DeleteAccountResponse } from "./types/DeleteAccountResponse"; import { DeleteComment } from "./types/DeleteComment"; import { DeleteCommunity } from "./types/DeleteCommunity"; import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji"; +import { DeleteCustomEmojiResponse } from "./types/DeleteCustomEmojiResponse"; import { DeletePost } from "./types/DeletePost"; import { DeletePrivateMessage } from "./types/DeletePrivateMessage"; import { DistinguishComment } from "./types/DistinguishComment"; @@ -85,6 +94,7 @@ import { MarkPostAsRead } from "./types/MarkPostAsRead"; import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead"; import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset"; import { PasswordReset } from "./types/PasswordReset"; +import { PasswordResetResponse } from "./types/PasswordResetResponse"; import { PersonMentionResponse } from "./types/PersonMentionResponse"; import { PostReportResponse } from "./types/PostReportResponse"; import { PostResponse } from "./types/PostResponse"; @@ -93,6 +103,7 @@ import { PrivateMessageResponse } from "./types/PrivateMessageResponse"; import { PrivateMessagesResponse } from "./types/PrivateMessagesResponse"; import { PurgeComment } from "./types/PurgeComment"; import { PurgeCommunity } from "./types/PurgeCommunity"; +import { PurgeItemResponse } from "./types/PurgeItemResponse"; import { PurgePerson } from "./types/PurgePerson"; import { PurgePost } from "./types/PurgePost"; import { Register } from "./types/Register"; @@ -113,6 +124,7 @@ import { SearchResponse } from "./types/SearchResponse"; import { SiteResponse } from "./types/SiteResponse"; import { TransferCommunity } from "./types/TransferCommunity"; import { VerifyEmail } from "./types/VerifyEmail"; +import { VerifyEmailResponse } from "./types/VerifyEmailResponse"; import { DeleteImage, UploadImage, @@ -121,6 +133,7 @@ import { } from "./types/others"; import { HideCommunity } from "./types/HideCommunity"; import { BlockInstance } from "./types/BlockInstance"; +import { BlockInstanceResponse } from "./types/BlockInstanceResponse"; import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse"; import { UpdateTotp } from "./types/UpdateTotp"; import { UpdateTotpResponse } from "./types/UpdateTotpResponse"; @@ -400,7 +413,7 @@ export class LemmyHttp { * `HTTP.POST /community/block` */ blockCommunity(form: BlockCommunity) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/community/block", form, @@ -465,7 +478,7 @@ export class LemmyHttp { * `HTTP.POST /community/ban_user` */ banFromCommunity(form: BanFromCommunity) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/community/ban_user", form, @@ -478,7 +491,7 @@ export class LemmyHttp { * `HTTP.POST /community/mod` */ addModToCommunity(form: AddModToCommunity) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/community/mod", form, @@ -730,7 +743,7 @@ export class LemmyHttp { * `HTTP.POST /comment/mark_as_read` */ markCommentReplyAsRead(form: MarkCommentReplyAsRead) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/comment/mark_as_read", form, @@ -1026,7 +1039,7 @@ export class LemmyHttp { * `HTTP.POST /user/ban` */ banPerson(form: BanPerson) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/user/ban", form, @@ -1052,7 +1065,7 @@ export class LemmyHttp { * `HTTP.POST /user/block` */ blockPerson(form: BlockPerson) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/user/block", form, @@ -1078,7 +1091,7 @@ export class LemmyHttp { * `HTTP.POST /user/delete_account` */ deleteAccount(form: DeleteAccount) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/user/delete_account", form, @@ -1091,7 +1104,7 @@ export class LemmyHttp { * `HTTP.POST /user/password_reset` */ passwordReset(form: PasswordReset) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/user/password_reset", form, @@ -1182,7 +1195,7 @@ export class LemmyHttp { * `HTTP.POST /user/verify_email` */ verifyEmail(form: VerifyEmail) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/user/verify_email", form, @@ -1195,7 +1208,7 @@ export class LemmyHttp { * `HTTP.POST /admin/add` */ addAdmin(form: AddAdmin) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/admin/add", form, @@ -1245,7 +1258,7 @@ export class LemmyHttp { * `HTTP.POST /admin/purge/person` */ purgePerson(form: PurgePerson) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/admin/purge/person", form, @@ -1258,7 +1271,7 @@ export class LemmyHttp { * `HTTP.POST /admin/purge/community` */ purgeCommunity(form: PurgeCommunity) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/admin/purge/community", form, @@ -1271,7 +1284,7 @@ export class LemmyHttp { * `HTTP.POST /admin/purge/post` */ purgePost(form: PurgePost) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/admin/purge/post", form, @@ -1284,7 +1297,7 @@ export class LemmyHttp { * `HTTP.POST /admin/purge/comment` */ purgeComment(form: PurgeComment) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/admin/purge/comment", form, @@ -1323,7 +1336,7 @@ export class LemmyHttp { * `HTTP.Post /custom_emoji/delete` */ deleteCustomEmoji(form: DeleteCustomEmoji) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/custom_emoji/delete", form, @@ -1349,7 +1362,7 @@ export class LemmyHttp { * `HTTP.Post /site/block` */ blockInstance(form: BlockInstance) { - return this.#wrapper( + return this.#wrapper( HttpType.Post, "/site/block", form, diff --git a/src/index.ts b/src/index.ts index 795b4c5..2ea8906 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ export * from "./http"; export { AddAdmin } from "./types/AddAdmin"; +export { AddAdminResponse } from "./types/AddAdminResponse"; export { AddModToCommunity } from "./types/AddModToCommunity"; +export { AddModToCommunityResponse } from "./types/AddModToCommunityResponse"; export { AdminPurgeComment } from "./types/AdminPurgeComment"; export { AdminPurgeCommentView } from "./types/AdminPurgeCommentView"; export { AdminPurgeCommunity } from "./types/AdminPurgeCommunity"; @@ -11,11 +13,16 @@ export { AdminPurgePost } from "./types/AdminPurgePost"; export { AdminPurgePostView } from "./types/AdminPurgePostView"; export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication"; export { BanFromCommunity } from "./types/BanFromCommunity"; +export { BanFromCommunityResponse } from "./types/BanFromCommunityResponse"; export { BanPerson } from "./types/BanPerson"; +export { BanPersonResponse } from "./types/BanPersonResponse"; export { BannedPersonsResponse } from "./types/BannedPersonsResponse"; export { BlockCommunity } from "./types/BlockCommunity"; +export { BlockCommunityResponse } from "./types/BlockCommunityResponse"; export { BlockInstance } from "./types/BlockInstance"; +export { BlockInstanceResponse } from "./types/BlockInstanceResponse"; export { BlockPerson } from "./types/BlockPerson"; +export { BlockPersonResponse } from "./types/BlockPersonResponse"; export { CaptchaResponse } from "./types/CaptchaResponse"; export { ChangePassword } from "./types/ChangePassword"; export { Comment } from "./types/Comment"; @@ -23,6 +30,7 @@ export { CommentAggregates } from "./types/CommentAggregates"; export { CommentId } from "./types/CommentId"; export { CommentReply } from "./types/CommentReply"; export { CommentReplyId } from "./types/CommentReplyId"; +export { CommentReplyResponse } from "./types/CommentReplyResponse"; export { CommentReplyView } from "./types/CommentReplyView"; export { CommentReport } from "./types/CommentReport"; export { CommentReportId } from "./types/CommentReportId"; @@ -57,9 +65,11 @@ export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword"; export { CustomEmojiResponse } from "./types/CustomEmojiResponse"; export { CustomEmojiView } from "./types/CustomEmojiView"; export { DeleteAccount } from "./types/DeleteAccount"; +export { DeleteAccountResponse } from "./types/DeleteAccountResponse"; export { DeleteComment } from "./types/DeleteComment"; export { DeleteCommunity } from "./types/DeleteCommunity"; export { DeleteCustomEmoji } from "./types/DeleteCustomEmoji"; +export { DeleteCustomEmojiResponse } from "./types/DeleteCustomEmojiResponse"; export { DeletePost } from "./types/DeletePost"; export { DeletePrivateMessage } from "./types/DeletePrivateMessage"; export { DistinguishComment } from "./types/DistinguishComment"; @@ -162,6 +172,7 @@ export { MyUserInfo } from "./types/MyUserInfo"; export { PaginationCursor } from "./types/PaginationCursor"; export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset"; export { PasswordReset } from "./types/PasswordReset"; +export { PasswordResetResponse } from "./types/PasswordResetResponse"; export { Person } from "./types/Person"; export { PersonAggregates } from "./types/PersonAggregates"; export { PersonBlockId } from "./types/PersonBlockId"; @@ -171,6 +182,7 @@ export { PersonMention } from "./types/PersonMention"; export { PersonMentionId } from "./types/PersonMentionId"; export { PersonMentionResponse } from "./types/PersonMentionResponse"; export { PersonMentionView } from "./types/PersonMentionView"; +export { PersonSortType } from "./types/PersonSortType"; export { PersonView } from "./types/PersonView"; export { Post } from "./types/Post"; export { PostAggregates } from "./types/PostAggregates"; @@ -194,6 +206,7 @@ export { PrivateMessageView } from "./types/PrivateMessageView"; export { PrivateMessagesResponse } from "./types/PrivateMessagesResponse"; export { PurgeComment } from "./types/PurgeComment"; export { PurgeCommunity } from "./types/PurgeCommunity"; +export { PurgeItemResponse } from "./types/PurgeItemResponse"; export { PurgePerson } from "./types/PurgePerson"; export { PurgePost } from "./types/PurgePost"; export { Register } from "./types/Register"; @@ -229,6 +242,7 @@ export { TransferCommunity } from "./types/TransferCommunity"; export { UpdateTotp } from "./types/UpdateTotp"; export { UpdateTotpResponse } from "./types/UpdateTotpResponse"; export { VerifyEmail } from "./types/VerifyEmail"; +export { VerifyEmailResponse } from "./types/VerifyEmailResponse"; export { UploadImage, UploadImageResponse, diff --git a/src/types/AddAdminResponse.ts b/src/types/AddAdminResponse.ts new file mode 100644 index 0000000..ea12e9c --- /dev/null +++ b/src/types/AddAdminResponse.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 { PersonView } from "./PersonView"; + +export interface AddAdminResponse { + admins: Array; +} diff --git a/src/types/AddModToCommunityResponse.ts b/src/types/AddModToCommunityResponse.ts new file mode 100644 index 0000000..fea925d --- /dev/null +++ b/src/types/AddModToCommunityResponse.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 { CommunityModeratorView } from "./CommunityModeratorView"; + +export interface AddModToCommunityResponse { + moderators: Array; +} diff --git a/src/types/BanFromCommunityResponse.ts b/src/types/BanFromCommunityResponse.ts new file mode 100644 index 0000000..38e770c --- /dev/null +++ b/src/types/BanFromCommunityResponse.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 { PersonView } from "./PersonView"; + +export interface BanFromCommunityResponse { + person_view: PersonView; + banned: boolean; +} diff --git a/src/types/BanPersonResponse.ts b/src/types/BanPersonResponse.ts new file mode 100644 index 0000000..1635ba7 --- /dev/null +++ b/src/types/BanPersonResponse.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 { PersonView } from "./PersonView"; + +export interface BanPersonResponse { + person_view: PersonView; + banned: boolean; +} diff --git a/src/types/BlockCommunityResponse.ts b/src/types/BlockCommunityResponse.ts new file mode 100644 index 0000000..cf79c82 --- /dev/null +++ b/src/types/BlockCommunityResponse.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 { CommunityView } from "./CommunityView"; + +export interface BlockCommunityResponse { + community_view: CommunityView; + blocked: boolean; +} diff --git a/src/types/BlockInstanceResponse.ts b/src/types/BlockInstanceResponse.ts new file mode 100644 index 0000000..88e4323 --- /dev/null +++ b/src/types/BlockInstanceResponse.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 BlockInstanceResponse { + blocked: boolean; +} diff --git a/src/types/BlockPersonResponse.ts b/src/types/BlockPersonResponse.ts new file mode 100644 index 0000000..e42edc1 --- /dev/null +++ b/src/types/BlockPersonResponse.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 { PersonView } from "./PersonView"; + +export interface BlockPersonResponse { + person_view: PersonView; + blocked: boolean; +} diff --git a/src/types/CommentReplyResponse.ts b/src/types/CommentReplyResponse.ts new file mode 100644 index 0000000..5b0a5c1 --- /dev/null +++ b/src/types/CommentReplyResponse.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 { CommentReplyView } from "./CommentReplyView"; + +export interface CommentReplyResponse { + comment_reply_view: CommentReplyView; +} diff --git a/src/types/DeleteAccountResponse.ts b/src/types/DeleteAccountResponse.ts new file mode 100644 index 0000000..f6f0fcd --- /dev/null +++ b/src/types/DeleteAccountResponse.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 DeleteAccountResponse = Record; diff --git a/src/types/DeleteCustomEmojiResponse.ts b/src/types/DeleteCustomEmojiResponse.ts new file mode 100644 index 0000000..c242f27 --- /dev/null +++ b/src/types/DeleteCustomEmojiResponse.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 { CustomEmojiId } from "./CustomEmojiId"; + +export interface DeleteCustomEmojiResponse { + id: CustomEmojiId; + success: boolean; +} diff --git a/src/types/LemmyErrorType.ts b/src/types/LemmyErrorType.ts index deef2b2..53baea7 100644 --- a/src/types/LemmyErrorType.ts +++ b/src/types/LemmyErrorType.ts @@ -1,151 +1,139 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. export type LemmyErrorType = - | { error: "report_reason_required" } - | { error: "report_too_long" } - | { error: "not_a_moderator" } - | { error: "not_an_admin" } - | { error: "cant_block_yourself" } - | { error: "cant_block_admin" } - | { error: "couldnt_update_user" } - | { error: "passwords_do_not_match" } - | { error: "email_not_verified" } - | { error: "email_required" } - | { error: "couldnt_update_comment" } - | { error: "couldnt_update_private_message" } - | { error: "cannot_leave_admin" } - | { error: "no_lines_in_html" } - | { error: "site_metadata_page_is_not_doctype_html" } - | { error: "pictrs_response_error"; message: string } - | { error: "pictrs_purge_response_error"; message: string } - | { error: "pictrs_caching_disabled" } - | { error: "image_url_missing_path_segments" } - | { error: "image_url_missing_last_path_segment" } - | { error: "pictrs_api_key_not_provided" } - | { error: "no_content_type_header" } - | { error: "not_an_image_type" } - | { error: "not_a_mod_or_admin" } - | { error: "no_admins" } - | { error: "not_top_admin" } - | { error: "not_top_mod" } - | { error: "not_logged_in" } - | { error: "site_ban" } - | { error: "deleted" } - | { error: "banned_from_community" } - | { error: "couldnt_find_community" } - | { error: "couldnt_find_person" } - | { error: "person_is_blocked" } - | { error: "downvotes_are_disabled" } - | { error: "instance_is_private" } - | { error: "invalid_password" } - | { error: "site_description_length_overflow" } - | { error: "honeypot_failed" } - | { error: "registration_application_is_pending" } - | { error: "cant_enable_private_instance_and_federation_together" } - | { error: "locked" } - | { error: "couldnt_create_comment" } - | { error: "max_comment_depth_reached" } - | { error: "no_comment_edit_allowed" } - | { error: "only_admins_can_create_communities" } - | { error: "community_already_exists" } - | { error: "language_not_allowed" } - | { 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" } - | { error: "invalid_default_post_listing_type" } - | { error: "registration_closed" } - | { error: "registration_application_answer_required" } - | { error: "email_already_exists" } - | { error: "federation_forbidden_by_strict_allow_list" } - | { error: "person_is_banned_from_community" } - | { error: "object_is_not_public" } - | { error: "invalid_community" } - | { error: "cannot_create_post_or_comment_in_deleted_or_removed_community" } - | { error: "cannot_receive_page" } - | { error: "new_post_cannot_be_locked" } - | { error: "only_local_admin_can_remove_community" } - | { error: "only_local_admin_can_restore_community" } - | { error: "no_id_given" } - | { error: "incorrect_login" } - | { error: "invalid_query" } - | { error: "object_not_local" } - | { error: "post_is_locked" } - | { error: "person_is_banned_from_site"; message: string } - | { error: "invalid_vote_value" } - | { error: "page_does_not_specify_creator" } - | { error: "page_does_not_specify_group" } - | { error: "no_community_found_in_cc" } - | { error: "no_email_setup" } - | { error: "email_smtp_server_needs_a_port" } - | { error: "missing_an_email" } - | { error: "rate_limit_error" } - | { error: "invalid_name" } - | { error: "invalid_display_name" } - | { error: "invalid_matrix_id" } - | { error: "invalid_post_title" } - | { error: "invalid_body_field" } - | { error: "bio_length_overflow" } - | { error: "missing_totp_token" } - | { error: "missing_totp_secret" } - | { error: "incorrect_totp_token" } - | { error: "couldnt_parse_totp_secret" } - | { error: "couldnt_generate_totp" } - | { error: "totp_already_enabled" } - | { error: "couldnt_like_comment" } - | { error: "couldnt_save_comment" } - | { error: "couldnt_create_report" } - | { error: "couldnt_resolve_report" } - | { error: "community_moderator_already_exists" } - | { error: "community_user_already_banned" } - | { error: "community_block_already_exists" } - | { error: "community_follower_already_exists" } - | { 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" } - | { error: "couldnt_update_community" } - | { error: "couldnt_update_replies" } - | { error: "couldnt_update_person_mentions" } - | { error: "post_title_too_long" } - | { error: "couldnt_create_post" } - | { error: "couldnt_create_private_message" } - | { error: "couldnt_update_private" } - | { error: "system_err_login" } - | { error: "couldnt_set_all_registrations_accepted" } - | { error: "couldnt_set_all_email_verified" } - | { error: "banned" } - | { error: "couldnt_get_comments" } - | { error: "couldnt_get_posts" } - | { 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 } - | { error: "domain_not_in_allow_list"; message: string } - | { error: "federation_disabled_by_strict_allow_list" } - | { error: "site_name_required" } - | { error: "site_name_length_overflow" } - | { error: "permissive_regex" } - | { error: "invalid_regex" } - | { error: "captcha_incorrect" } - | { error: "password_reset_limit_reached" } - | { error: "couldnt_create_audio_captcha" } - | { error: "invalid_url_scheme" } - | { error: "couldnt_send_webmention" } - | { error: "contradicting_filters" } - | { error: "instance_block_already_exists" } - | { error: "auth_cookie_insecure" } - | { error: "too_many_items" } - | { error: "community_has_no_followers" } - | { error: "ban_expiration_in_past" } - | { error: "invalid_unix_time" } - | { error: "unknown"; message: string }; + | { error_type: "ReportReasonRequired" } + | { error_type: "ReportTooLong" } + | { error_type: "NotAModerator" } + | { error_type: "NotAnAdmin" } + | { error_type: "CannotBlockYourself" } + | { error_type: "CannotBlockAdmin" } + | { error_type: "CouldNotUpdateUser" } + | { error_type: "PasswordsDoNotMatch" } + | { error_type: "PasswordIncorrect" } + | { error_type: "EmailNotVerified" } + | { error_type: "EmailRequired" } + | { error_type: "CouldNotUpdateComment" } + | { error_type: "CouldNotUpdatePrivateMessage" } + | { error_type: "CannotLeaveAdmin" } + | { error_type: "NoLinesInHtml" } + | { error_type: "SiteMetadataPageIsNotDoctypeHtml" } + | { error_type: "PictrsResponseError"; message: string } + | { error_type: "PictrsPurgeResponseError"; message: string } + | { error_type: "ImageUrlMissingPathSegments" } + | { error_type: "ImageUrlMissingLastPathSegment" } + | { error_type: "PictrsApiKeyNotProvided" } + | { error_type: "NoContentTypeHeader" } + | { error_type: "NotAnImageType" } + | { error_type: "NotAModOrAdmin" } + | { error_type: "NoAdmins" } + | { error_type: "NotTopAdmin" } + | { error_type: "NotTopMod" } + | { error_type: "NotLoggedIn" } + | { error_type: "SiteBan" } + | { error_type: "Deleted" } + | { error_type: "BannedFromCommunity" } + | { error_type: "CouldNotFindCommunity" } + | { error_type: "PersonIsBlocked" } + | { error_type: "DownvotesAreDisabled" } + | { error_type: "InstanceIsPrivate" } + | { error_type: "InvalidPassword" } + | { error_type: "SiteDescriptionLengthOverflow" } + | { error_type: "HoneypotFailed" } + | { error_type: "RegistrationApplicationIsPending" } + | { error_type: "PrivateInstanceCannotHaveFederationEnabled" } + | { error_type: "Locked" } + | { error_type: "CouldNotCreateComment" } + | { error_type: "MaxCommentDepthReached" } + | { error_type: "EditCommentNotAllowed" } + | { error_type: "OnlyAdminsCanCreateCommunities" } + | { error_type: "CommunityAlreadyExists" } + | { error_type: "LanguageNotAllowed" } + | { error_type: "OnlyModsCanPostInCommunity" } + | { error_type: "CouldNotUpdatePost" } + | { error_type: "EditPostNotAllowed" } + | { error_type: "CouldNotFindPost" } + | { error_type: "EditPrivateMessageNotAllowed" } + | { error_type: "SiteAlreadyExists" } + | { error_type: "ApplicationQuestionRequired" } + | { error_type: "InvalidDefaultPostListingType" } + | { error_type: "RegistrationClosed" } + | { error_type: "RegistrationApplicationAnswerRequired" } + | { error_type: "EmailAlreadyExists" } + | { error_type: "FederationError"; message: string } + | { error_type: "FederationForbiddenByStrictAllowList" } + | { error_type: "PersonIsBannedFromCommunity" } + | { error_type: "ObjectIsNotPublic" } + | { error_type: "InvalidCommunity" } + | { error_type: "CannotCreatePostOrCommentInDeletedOrRemovedCommunity" } + | { error_type: "CannotReceivePage" } + | { error_type: "NewPostCannotBeLocked" } + | { error_type: "OnlyLocalAdminCanRemoveCommunity" } + | { error_type: "OnlyLocalAdminCanRestoreCommunity" } + | { error_type: "NoIdGiven" } + | { error_type: "CouldNotFindUsernameOrEmail" } + | { error_type: "InvalidQuery" } + | { error_type: "ObjectNotLocal" } + | { error_type: "PostIsLocked" } + | { error_type: "PersonIsBannedFromSite" } + | { error_type: "InvalidVoteValue" } + | { error_type: "PageDoesNotSpecifyCreator" } + | { error_type: "PageDoesNotSpecifyGroup" } + | { error_type: "NoCommunityFoundInCC" } + | { error_type: "NoEmailSetup" } + | { error_type: "EmailSmtpServerNeedsAPort" } + | { error_type: "MissingAnEmail" } + | { error_type: "RateLimitError" } + | { error_type: "InvalidName" } + | { error_type: "InvalidDisplayName" } + | { error_type: "InvalidMatrixId" } + | { error_type: "InvalidPostTitle" } + | { error_type: "InvalidBodyField" } + | { error_type: "BioLengthOverflow" } + | { error_type: "MissingTotpToken" } + | { error_type: "IncorrectTotpToken" } + | { error_type: "CouldNotParseTotpSecret" } + | { error_type: "CouldNotLikeComment" } + | { error_type: "CouldNotSaveComment" } + | { error_type: "CouldNotCreateReport" } + | { error_type: "CouldNotResolveReport" } + | { error_type: "CommunityModeratorAlreadyExists" } + | { error_type: "CommunityUserIsAlreadyBanned" } + | { error_type: "CommunityBlockAlreadyExists" } + | { error_type: "CommunityFollowerAlreadyExists" } + | { error_type: "CouldNotUpdateCommunityHiddenStatus" } + | { error_type: "PersonBlockAlreadyExists" } + | { error_type: "UserAlreadyExists" } + | { error_type: "TokenNotFound" } + | { error_type: "CouldNotLikePost" } + | { error_type: "CouldNotSavePost" } + | { error_type: "CouldNotMarkPostAsRead" } + | { error_type: "CouldNotUpdateCommunity" } + | { error_type: "CouldNotUpdateReplies" } + | { error_type: "CouldNotUpdatePersonMentions" } + | { error_type: "PostTitleTooLong" } + | { error_type: "CouldNotCreatePost" } + | { error_type: "CouldNotCreatePrivateMessage" } + | { error_type: "CouldNotUpdatePrivate" } + | { error_type: "SystemErrLogin" } + | { error_type: "CouldNotSetAllRegistrationsAccepted" } + | { error_type: "CouldNotSetAllEmailVerified" } + | { error_type: "Banned" } + | { error_type: "CouldNotGetComments" } + | { error_type: "CouldNotGetPosts" } + | { error_type: "InvalidUrl" } + | { error_type: "EmailSendFailed" } + | { error_type: "Slurs" } + | { error_type: "CouldNotGenerateTotp" } + | { error_type: "CouldNotFindObject" } + | { error_type: "RegistrationDenied"; message: string } + | { error_type: "FederationDisabled" } + | { error_type: "DomainBlocked" } + | { error_type: "DomainNotInAllowList" } + | { error_type: "FederationDisabledByStrictAllowList" } + | { error_type: "SiteNameRequired" } + | { error_type: "SiteNameLengthOverflow" } + | { error_type: "PermissiveRegex" } + | { error_type: "InvalidRegex" } + | { error_type: "CaptchaIncorrect" } + | { error_type: "PasswordResetLimitReached" } + | { error_type: "CouldNotCreateAudioCaptcha" }; diff --git a/src/types/PasswordResetResponse.ts b/src/types/PasswordResetResponse.ts new file mode 100644 index 0000000..e76960c --- /dev/null +++ b/src/types/PasswordResetResponse.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 PasswordResetResponse = Record; diff --git a/src/types/PersonSortType.ts b/src/types/PersonSortType.ts new file mode 100644 index 0000000..54591c7 --- /dev/null +++ b/src/types/PersonSortType.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 type PersonSortType = + | "New" + | "Old" + | "MostComments" + | "CommentScore" + | "PostScore" + | "PostCount"; diff --git a/src/types/PurgeItemResponse.ts b/src/types/PurgeItemResponse.ts new file mode 100644 index 0000000..05b2991 --- /dev/null +++ b/src/types/PurgeItemResponse.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 PurgeItemResponse { + success: boolean; +} diff --git a/src/types/VerifyEmailResponse.ts b/src/types/VerifyEmailResponse.ts new file mode 100644 index 0000000..2f0bd27 --- /dev/null +++ b/src/types/VerifyEmailResponse.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 VerifyEmailResponse = Record;