mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-29 15:51:12 +00:00
Updating successresponses.
This commit is contained in:
parent
959d428c48
commit
6de51027d4
17 changed files with 165 additions and 260 deletions
46
src/http.ts
46
src/http.ts
|
@ -1,21 +1,14 @@
|
|||
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";
|
||||
|
@ -32,11 +25,9 @@ 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";
|
||||
|
@ -94,7 +85,6 @@ 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";
|
||||
|
@ -103,7 +93,6 @@ 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";
|
||||
|
@ -124,7 +113,6 @@ 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,
|
||||
|
@ -133,10 +121,10 @@ 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";
|
||||
import { SuccessResponse } from "./types/SuccessResponse";
|
||||
|
||||
enum HttpType {
|
||||
Get = "GET",
|
||||
|
@ -358,7 +346,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /community/block`
|
||||
*/
|
||||
blockCommunity(form: BlockCommunity) {
|
||||
return this.#wrapper<BlockCommunity, BlockCommunityResponse>(
|
||||
return this.#wrapper<BlockCommunity, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/community/block",
|
||||
form,
|
||||
|
@ -423,7 +411,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /community/ban_user`
|
||||
*/
|
||||
banFromCommunity(form: BanFromCommunity) {
|
||||
return this.#wrapper<BanFromCommunity, BanFromCommunityResponse>(
|
||||
return this.#wrapper<BanFromCommunity, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/community/ban_user",
|
||||
form,
|
||||
|
@ -436,7 +424,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /community/mod`
|
||||
*/
|
||||
addModToCommunity(form: AddModToCommunity) {
|
||||
return this.#wrapper<AddModToCommunity, AddModToCommunityResponse>(
|
||||
return this.#wrapper<AddModToCommunity, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/community/mod",
|
||||
form,
|
||||
|
@ -688,7 +676,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /comment/mark_as_read`
|
||||
*/
|
||||
markCommentReplyAsRead(form: MarkCommentReplyAsRead) {
|
||||
return this.#wrapper<MarkCommentReplyAsRead, CommentReplyResponse>(
|
||||
return this.#wrapper<MarkCommentReplyAsRead, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/comment/mark_as_read",
|
||||
form,
|
||||
|
@ -984,7 +972,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /user/ban`
|
||||
*/
|
||||
banPerson(form: BanPerson) {
|
||||
return this.#wrapper<BanPerson, BanPersonResponse>(
|
||||
return this.#wrapper<BanPerson, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/user/ban",
|
||||
form,
|
||||
|
@ -1010,7 +998,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /user/block`
|
||||
*/
|
||||
blockPerson(form: BlockPerson) {
|
||||
return this.#wrapper<BlockPerson, BlockPersonResponse>(
|
||||
return this.#wrapper<BlockPerson, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/user/block",
|
||||
form,
|
||||
|
@ -1036,7 +1024,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /user/delete_account`
|
||||
*/
|
||||
deleteAccount(form: DeleteAccount) {
|
||||
return this.#wrapper<DeleteAccount, DeleteAccountResponse>(
|
||||
return this.#wrapper<DeleteAccount, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/user/delete_account",
|
||||
form,
|
||||
|
@ -1049,7 +1037,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /user/password_reset`
|
||||
*/
|
||||
passwordReset(form: PasswordReset) {
|
||||
return this.#wrapper<PasswordReset, PasswordResetResponse>(
|
||||
return this.#wrapper<PasswordReset, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/user/password_reset",
|
||||
form,
|
||||
|
@ -1140,7 +1128,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /user/verify_email`
|
||||
*/
|
||||
verifyEmail(form: VerifyEmail) {
|
||||
return this.#wrapper<VerifyEmail, VerifyEmailResponse>(
|
||||
return this.#wrapper<VerifyEmail, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/user/verify_email",
|
||||
form,
|
||||
|
@ -1153,7 +1141,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /admin/add`
|
||||
*/
|
||||
addAdmin(form: AddAdmin) {
|
||||
return this.#wrapper<AddAdmin, AddAdminResponse>(
|
||||
return this.#wrapper<AddAdmin, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/admin/add",
|
||||
form,
|
||||
|
@ -1203,7 +1191,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /admin/purge/person`
|
||||
*/
|
||||
purgePerson(form: PurgePerson) {
|
||||
return this.#wrapper<PurgePerson, PurgeItemResponse>(
|
||||
return this.#wrapper<PurgePerson, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/admin/purge/person",
|
||||
form,
|
||||
|
@ -1216,7 +1204,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /admin/purge/community`
|
||||
*/
|
||||
purgeCommunity(form: PurgeCommunity) {
|
||||
return this.#wrapper<PurgeCommunity, PurgeItemResponse>(
|
||||
return this.#wrapper<PurgeCommunity, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/admin/purge/community",
|
||||
form,
|
||||
|
@ -1229,7 +1217,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /admin/purge/post`
|
||||
*/
|
||||
purgePost(form: PurgePost) {
|
||||
return this.#wrapper<PurgePost, PurgeItemResponse>(
|
||||
return this.#wrapper<PurgePost, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/admin/purge/post",
|
||||
form,
|
||||
|
@ -1242,7 +1230,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /admin/purge/comment`
|
||||
*/
|
||||
purgeComment(form: PurgeComment) {
|
||||
return this.#wrapper<PurgeComment, PurgeItemResponse>(
|
||||
return this.#wrapper<PurgeComment, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/admin/purge/comment",
|
||||
form,
|
||||
|
@ -1281,7 +1269,7 @@ export class LemmyHttp {
|
|||
* `HTTP.Post /custom_emoji/delete`
|
||||
*/
|
||||
deleteCustomEmoji(form: DeleteCustomEmoji) {
|
||||
return this.#wrapper<DeleteCustomEmoji, DeleteCustomEmojiResponse>(
|
||||
return this.#wrapper<DeleteCustomEmoji, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/custom_emoji/delete",
|
||||
form,
|
||||
|
@ -1307,7 +1295,7 @@ export class LemmyHttp {
|
|||
* `HTTP.Post /site/block`
|
||||
*/
|
||||
blockInstance(form: BlockInstance) {
|
||||
return this.#wrapper<BlockInstance, BlockInstanceResponse>(
|
||||
return this.#wrapper<BlockInstance, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/site/block",
|
||||
form,
|
||||
|
|
14
src/index.ts
14
src/index.ts
|
@ -1,8 +1,6 @@
|
|||
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";
|
||||
|
@ -13,16 +11,11 @@ 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";
|
||||
|
@ -30,7 +23,6 @@ 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";
|
||||
|
@ -65,11 +57,9 @@ 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";
|
||||
|
@ -171,7 +161,6 @@ 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";
|
||||
|
@ -181,7 +170,6 @@ 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";
|
||||
|
@ -205,7 +193,6 @@ 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";
|
||||
|
@ -241,7 +228,6 @@ 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,
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
// 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<PersonView>;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
// 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<CommunityModeratorView>;
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type DeleteAccountResponse = Record<string, never>;
|
|
@ -1,7 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -1,139 +1,151 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type LemmyErrorType =
|
||||
| { 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" };
|
||||
| { 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 };
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type PasswordResetResponse = Record<string, never>;
|
|
@ -1,9 +0,0 @@
|
|||
// 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";
|
|
@ -1,5 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type VerifyEmailResponse = Record<string, never>;
|
Loading…
Reference in a new issue