From c1545659b2e6d669a30bac894d6ffc442fa92166 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 7 Nov 2024 12:07:49 -0500 Subject: [PATCH] Upgrading to use ts-rs 10.0.0 (#394) * Upgrading to use ts-ns 10.0.0 * Adding no_comments_only --- copy_generated_types_from_lemmy.sh | 6 +- src/index.ts | 4 + src/types/AddAdmin.ts | 8 +- src/types/AddAdminResponse.ts | 7 +- src/types/AddModToCommunity.ts | 7 +- src/types/AddModToCommunityResponse.ts | 7 +- src/types/AdminPurgeComment.ts | 7 +- src/types/AdminPurgeCommentView.ts | 7 +- src/types/AdminPurgeCommunity.ts | 7 +- src/types/AdminPurgeCommunityView.ts | 7 +- src/types/AdminPurgePerson.ts | 7 +- src/types/AdminPurgePersonView.ts | 7 +- src/types/AdminPurgePost.ts | 7 +- src/types/AdminPurgePostView.ts | 7 +- src/types/ApproveRegistrationApplication.ts | 7 +- src/types/AuthenticateWithOauth.ts | 16 ++- src/types/BanFromCommunity.ts | 16 ++- src/types/BanFromCommunityResponse.ts | 7 +- src/types/BanPerson.ts | 16 ++- src/types/BanPersonResponse.ts | 8 +- src/types/BannedPersonsResponse.ts | 7 +- src/types/BlockCommunity.ts | 8 +- src/types/BlockCommunityResponse.ts | 7 +- src/types/BlockInstance.ts | 8 +- src/types/BlockInstanceResponse.ts | 4 +- src/types/BlockPerson.ts | 8 +- src/types/BlockPersonResponse.ts | 8 +- src/types/CaptchaResponse.ts | 16 ++- src/types/ChangePassword.ts | 14 +- src/types/Comment.ts | 29 +++- src/types/CommentAggregates.ts | 10 +- src/types/CommentId.ts | 3 + src/types/CommentReply.ts | 7 +- src/types/CommentReplyId.ts | 3 + src/types/CommentReplyResponse.ts | 7 +- src/types/CommentReplyView.ts | 7 +- src/types/CommentReport.ts | 7 +- src/types/CommentReportId.ts | 3 + src/types/CommentReportResponse.ts | 7 +- src/types/CommentReportView.ts | 7 +- src/types/CommentResponse.ts | 7 +- src/types/CommentSortType.ts | 3 + src/types/CommentView.ts | 7 +- src/types/Community.ts | 53 +++++++- src/types/CommunityAggregates.ts | 19 ++- src/types/CommunityFollowerView.ts | 8 +- src/types/CommunityId.ts | 3 + src/types/CommunityModeratorView.ts | 7 +- src/types/CommunityResponse.ts | 7 +- src/types/CommunitySortType.ts | 27 ++++ src/types/CommunityView.ts | 7 +- src/types/CommunityVisibility.ts | 5 + src/types/CreateComment.ts | 7 +- src/types/CreateCommentLike.ts | 10 +- src/types/CreateCommentReport.ts | 8 +- src/types/CreateCommunity.ts | 32 ++++- src/types/CreateCustomEmoji.ts | 7 +- src/types/CreateOAuthProvider.ts | 7 +- src/types/CreatePost.ts | 22 ++- src/types/CreatePostLike.ts | 10 +- src/types/CreatePostReport.ts | 8 +- src/types/CreatePrivateMessage.ts | 8 +- src/types/CreatePrivateMessageReport.ts | 7 +- src/types/CreateSite.ts | 7 +- src/types/CreateTagline.ts | 7 +- src/types/CustomEmoji.ts | 10 +- src/types/CustomEmojiId.ts | 3 + src/types/CustomEmojiKeyword.ts | 7 +- src/types/CustomEmojiResponse.ts | 7 +- src/types/CustomEmojiView.ts | 7 +- src/types/DbUrl.ts | 3 + src/types/DeleteAccount.ts | 10 +- src/types/DeleteComment.ts | 8 +- src/types/DeleteCommunity.ts | 8 +- src/types/DeleteCustomEmoji.ts | 7 +- src/types/DeleteOAuthProvider.ts | 7 +- src/types/DeletePost.ts | 8 +- src/types/DeletePrivateMessage.ts | 7 +- src/types/DeleteTagline.ts | 7 +- src/types/DistinguishComment.ts | 7 +- src/types/EditComment.ts | 7 +- src/types/EditCommunity.ts | 29 +++- src/types/EditCustomEmoji.ts | 7 +- src/types/EditOAuthProvider.ts | 7 +- src/types/EditPost.ts | 19 ++- src/types/EditPrivateMessage.ts | 7 +- src/types/EditSite.ts | 128 +++++++++++++++++- src/types/FeaturePost.ts | 7 +- src/types/FederatedInstances.ts | 7 +- src/types/FederationError.ts | 27 ++++ src/types/FederationMode.ts | 3 + src/types/FollowCommunity.ts | 8 +- src/types/GenerateTotpSecretResponse.ts | 5 +- src/types/GetCaptchaResponse.ts | 10 +- src/types/GetComment.ts | 7 +- src/types/GetComments.ts | 7 +- src/types/GetCommentsResponse.ts | 7 +- src/types/GetCommunity.ts | 10 +- src/types/GetCommunityResponse.ts | 7 +- src/types/GetFederatedInstancesResponse.ts | 10 +- src/types/GetModlog.ts | 7 +- src/types/GetModlogResponse.ts | 7 +- src/types/GetPersonDetails.ts | 12 +- src/types/GetPersonDetailsResponse.ts | 7 +- src/types/GetPersonMentions.ts | 7 +- src/types/GetPersonMentionsResponse.ts | 7 +- src/types/GetPost.ts | 8 +- src/types/GetPostResponse.ts | 10 +- src/types/GetPosts.ts | 20 ++- src/types/GetPostsResponse.ts | 10 +- src/types/GetPrivateMessages.ts | 7 +- src/types/GetRandomCommunity.ts | 7 +- src/types/GetRegistrationApplication.ts | 7 +- src/types/GetReplies.ts | 7 +- src/types/GetRepliesResponse.ts | 7 +- src/types/GetReportCount.ts | 7 +- src/types/GetReportCountResponse.ts | 7 +- src/types/GetSiteMetadata.ts | 7 +- src/types/GetSiteMetadataResponse.ts | 7 +- src/types/GetSiteResponse.ts | 19 ++- src/types/GetUnreadCountResponse.ts | 7 +- ...eadRegistrationApplicationCountResponse.ts | 7 +- src/types/HideCommunity.ts | 7 +- src/types/HidePost.ts | 8 +- src/types/ImageDetails.ts | 7 +- src/types/Instance.ts | 7 +- src/types/InstanceId.ts | 3 + src/types/InstanceWithFederationState.ts | 10 +- src/types/Language.ts | 9 +- src/types/LanguageId.ts | 3 + src/types/LemmyErrorType.ts | 41 +----- src/types/LinkMetadata.ts | 14 +- src/types/ListCommentLikes.ts | 7 +- src/types/ListCommentLikesResponse.ts | 7 +- src/types/ListCommentReports.ts | 13 +- src/types/ListCommentReportsResponse.ts | 7 +- src/types/ListCommunities.ts | 11 +- src/types/ListCommunitiesResponse.ts | 7 +- src/types/ListCustomEmojis.ts | 7 +- src/types/ListCustomEmojisResponse.ts | 7 +- src/types/ListLoginsResponse.ts | 4 +- src/types/ListMedia.ts | 8 +- src/types/ListMediaResponse.ts | 4 +- src/types/ListPostLikes.ts | 9 +- src/types/ListPostLikesResponse.ts | 7 +- src/types/ListPostReports.ts | 13 +- src/types/ListPostReportsResponse.ts | 7 +- src/types/ListPrivateMessageReports.ts | 10 +- .../ListPrivateMessageReportsResponse.ts | 7 +- src/types/ListRegistrationApplications.ts | 10 +- .../ListRegistrationApplicationsResponse.ts | 7 +- src/types/ListTaglines.ts | 8 +- src/types/ListTaglinesResponse.ts | 7 +- src/types/ListingType.ts | 3 + src/types/LocalImage.ts | 4 +- src/types/LocalImageView.ts | 8 +- src/types/LocalSite.ts | 80 ++++++++++- src/types/LocalSiteId.ts | 3 + src/types/LocalSiteRateLimit.ts | 7 +- src/types/LocalSiteUrlBlocklist.ts | 4 +- src/types/LocalUser.ts | 53 +++++++- src/types/LocalUserId.ts | 3 + src/types/LocalUserView.ts | 7 +- src/types/LocalUserVoteDisplayMode.ts | 7 +- src/types/LockPost.ts | 8 +- src/types/Login.ts | 15 +- src/types/LoginResponse.ts | 20 ++- src/types/LoginToken.ts | 14 +- src/types/MarkCommentReplyAsRead.ts | 7 +- src/types/MarkPersonMentionAsRead.ts | 7 +- src/types/MarkPostAsRead.ts | 8 +- src/types/MarkPrivateMessageAsRead.ts | 7 +- src/types/ModAdd.ts | 7 +- src/types/ModAddCommunity.ts | 7 +- src/types/ModAddCommunityView.ts | 7 +- src/types/ModAddView.ts | 7 +- src/types/ModBan.ts | 7 +- src/types/ModBanFromCommunity.ts | 7 +- src/types/ModBanFromCommunityView.ts | 7 +- src/types/ModBanView.ts | 7 +- src/types/ModFeaturePost.ts | 7 +- src/types/ModFeaturePostView.ts | 7 +- src/types/ModHideCommunity.ts | 7 +- src/types/ModHideCommunityView.ts | 7 +- src/types/ModLockPost.ts | 7 +- src/types/ModLockPostView.ts | 7 +- src/types/ModRemoveComment.ts | 7 +- src/types/ModRemoveCommentView.ts | 7 +- src/types/ModRemoveCommunity.ts | 7 +- src/types/ModRemoveCommunityView.ts | 7 +- src/types/ModRemovePost.ts | 7 +- src/types/ModRemovePostView.ts | 7 +- src/types/ModTransferCommunity.ts | 7 +- src/types/ModTransferCommunityView.ts | 7 +- src/types/ModlogActionType.ts | 3 + src/types/ModlogListParams.ts | 7 +- src/types/MyUserInfo.ts | 7 +- src/types/OAuthAccount.ts | 7 +- src/types/OAuthProvider.ts | 46 ++++++- src/types/OAuthProviderId.ts | 3 + src/types/OpenGraphData.ts | 12 +- src/types/PaginationCursor.ts | 6 + src/types/PasswordChangeAfterReset.ts | 14 +- src/types/PasswordReset.ts | 8 +- src/types/Person.ts | 47 ++++++- src/types/PersonAggregates.ts | 7 +- src/types/PersonId.ts | 3 + src/types/PersonMention.ts | 7 +- src/types/PersonMentionId.ts | 3 + src/types/PersonMentionResponse.ts | 7 +- src/types/PersonMentionView.ts | 7 +- src/types/PersonView.ts | 7 +- src/types/Post.ts | 64 ++++++++- src/types/PostAggregates.ts | 10 +- src/types/PostFeatureType.ts | 3 + src/types/PostId.ts | 3 + src/types/PostListingMode.ts | 3 + src/types/PostReport.ts | 19 ++- src/types/PostReportId.ts | 3 + src/types/PostReportResponse.ts | 7 +- src/types/PostReportView.ts | 7 +- src/types/PostResponse.ts | 4 +- src/types/PostSortType.ts | 3 + src/types/PostView.ts | 7 +- src/types/PrivateMessage.ts | 10 +- src/types/PrivateMessageId.ts | 3 + src/types/PrivateMessageReport.ts | 10 +- src/types/PrivateMessageReportId.ts | 3 + src/types/PrivateMessageReportResponse.ts | 7 +- src/types/PrivateMessageReportView.ts | 7 +- src/types/PrivateMessageResponse.ts | 7 +- src/types/PrivateMessageView.ts | 7 +- src/types/PrivateMessagesResponse.ts | 7 +- src/types/PurgeComment.ts | 8 +- src/types/PurgeCommunity.ts | 8 +- src/types/PurgePerson.ts | 8 +- src/types/PurgePost.ts | 8 +- src/types/ReadableFederationState.ts | 18 ++- src/types/Register.ts | 29 +++- src/types/RegistrationApplication.ts | 7 +- src/types/RegistrationApplicationId.ts | 3 + src/types/RegistrationApplicationResponse.ts | 7 +- src/types/RegistrationApplicationView.ts | 7 +- src/types/RegistrationMode.ts | 3 + src/types/RemoveComment.ts | 7 +- src/types/RemoveCommunity.ts | 7 +- src/types/RemovePost.ts | 9 +- src/types/ResolveCommentReport.ts | 7 +- src/types/ResolveObject.ts | 10 +- src/types/ResolveObjectResponse.ts | 7 +- src/types/ResolvePostReport.ts | 8 +- src/types/ResolvePrivateMessageReport.ts | 7 +- src/types/SaveComment.ts | 8 +- src/types/SavePost.ts | 8 +- src/types/SaveUserSettings.ts | 89 +++++++++++- src/types/Search.ts | 7 +- src/types/SearchResponse.ts | 7 +- src/types/SearchType.ts | 3 + src/types/SensitiveString.ts | 3 + src/types/Site.ts | 41 +++++- src/types/SiteAggregates.ts | 19 ++- src/types/SiteId.ts | 3 + src/types/SiteResponse.ts | 10 +- src/types/SiteView.ts | 7 +- src/types/SubscribedType.ts | 3 + src/types/SuccessResponse.ts | 7 +- src/types/Tagline.ts | 7 +- src/types/TaglineId.ts | 3 + src/types/TaglineResponse.ts | 4 +- src/types/TransferCommunity.ts | 7 +- src/types/UpdateTagline.ts | 8 +- src/types/UpdateTotp.ts | 5 +- src/types/UpdateTotpResponse.ts | 4 +- src/types/VerifyEmail.ts | 7 +- src/types/VoteView.ts | 7 +- 275 files changed, 2109 insertions(+), 660 deletions(-) create mode 100644 src/types/CommunitySortType.ts create mode 100644 src/types/DbUrl.ts create mode 100644 src/types/FederationError.ts create mode 100644 src/types/SensitiveString.ts diff --git a/copy_generated_types_from_lemmy.sh b/copy_generated_types_from_lemmy.sh index dc40742..a895528 100755 --- a/copy_generated_types_from_lemmy.sh +++ b/copy_generated_types_from_lemmy.sh @@ -9,10 +9,10 @@ rm -rf **/bindings popd # First re-generate the types by running cargo test on lemmy -pushd ../lemmy/scripts -./test.sh +pushd ../lemmy +cargo test --workspace export_bindings -cd ../crates +cd crates # Copy them over to the types folder cp api_common/bindings/* ../../lemmy-js-client/src/types/ diff --git a/src/index.ts b/src/index.ts index dc0fbb1..af0b610 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,6 +53,7 @@ export { CommunityFollowerView } from "./types/CommunityFollowerView"; export { CommunityId } from "./types/CommunityId"; export { CommunityModeratorView } from "./types/CommunityModeratorView"; export { CommunityResponse } from "./types/CommunityResponse"; +export { CommunitySortType } from "./types/CommunitySortType"; export { CommunityView } from "./types/CommunityView"; export { CommunityVisibility } from "./types/CommunityVisibility"; export { CreateComment } from "./types/CreateComment"; @@ -73,6 +74,7 @@ export { CustomEmojiId } from "./types/CustomEmojiId"; export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword"; export { CustomEmojiResponse } from "./types/CustomEmojiResponse"; export { CustomEmojiView } from "./types/CustomEmojiView"; +export { DbUrl } from "./types/DbUrl"; export { DeleteAccount } from "./types/DeleteAccount"; export { DeleteComment } from "./types/DeleteComment"; export { DeleteCommunity } from "./types/DeleteCommunity"; @@ -91,6 +93,7 @@ export { EditPrivateMessage } from "./types/EditPrivateMessage"; export { EditSite } from "./types/EditSite"; export { FeaturePost } from "./types/FeaturePost"; export { FederatedInstances } from "./types/FederatedInstances"; +export { FederationError } from "./types/FederationError"; export { FederationMode } from "./types/FederationMode"; export { FollowCommunity } from "./types/FollowCommunity"; export { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse"; @@ -260,6 +263,7 @@ export { SaveUserSettings } from "./types/SaveUserSettings"; export { Search } from "./types/Search"; export { SearchResponse } from "./types/SearchResponse"; export { SearchType } from "./types/SearchType"; +export { SensitiveString } from "./types/SensitiveString"; export { Site } from "./types/Site"; export { SiteAggregates } from "./types/SiteAggregates"; export { SiteId } from "./types/SiteId"; diff --git a/src/types/AddAdmin.ts b/src/types/AddAdmin.ts index ab5313d..be33e9b 100644 --- a/src/types/AddAdmin.ts +++ b/src/types/AddAdmin.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface AddAdmin { - person_id: PersonId; - added: boolean; -} +/** + * Adds an admin to a site. + */ +export type AddAdmin = { person_id: PersonId; added: boolean }; diff --git a/src/types/AddAdminResponse.ts b/src/types/AddAdminResponse.ts index ea12e9c..6f741de 100644 --- a/src/types/AddAdminResponse.ts +++ b/src/types/AddAdminResponse.ts @@ -1,6 +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 AddAdminResponse { - admins: Array; -} +/** + * The response of current admins. + */ +export type AddAdminResponse = { admins: Array }; diff --git a/src/types/AddModToCommunity.ts b/src/types/AddModToCommunity.ts index bef4b58..bede41d 100644 --- a/src/types/AddModToCommunity.ts +++ b/src/types/AddModToCommunity.ts @@ -2,8 +2,11 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -export interface AddModToCommunity { +/** + * Add a moderator to a community. + */ +export type AddModToCommunity = { community_id: CommunityId; person_id: PersonId; added: boolean; -} +}; diff --git a/src/types/AddModToCommunityResponse.ts b/src/types/AddModToCommunityResponse.ts index fea925d..da65037 100644 --- a/src/types/AddModToCommunityResponse.ts +++ b/src/types/AddModToCommunityResponse.ts @@ -1,6 +1,9 @@ // 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 { +/** + * The response of adding a moderator to a community. + */ +export type AddModToCommunityResponse = { moderators: Array; -} +}; diff --git a/src/types/AdminPurgeComment.ts b/src/types/AdminPurgeComment.ts index 75ca213..8d5cd35 100644 --- a/src/types/AdminPurgeComment.ts +++ b/src/types/AdminPurgeComment.ts @@ -2,10 +2,13 @@ import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; -export interface AdminPurgeComment { +/** + * When an admin purges a comment. + */ +export type AdminPurgeComment = { id: number; admin_person_id: PersonId; post_id: PostId; reason?: string; when_: string; -} +}; diff --git a/src/types/AdminPurgeCommentView.ts b/src/types/AdminPurgeCommentView.ts index 20b598b..b0f5c92 100644 --- a/src/types/AdminPurgeCommentView.ts +++ b/src/types/AdminPurgeCommentView.ts @@ -3,8 +3,11 @@ import type { AdminPurgeComment } from "./AdminPurgeComment"; import type { Person } from "./Person"; import type { Post } from "./Post"; -export interface AdminPurgeCommentView { +/** + * When an admin purges a comment. + */ +export type AdminPurgeCommentView = { admin_purge_comment: AdminPurgeComment; admin?: Person; post: Post; -} +}; diff --git a/src/types/AdminPurgeCommunity.ts b/src/types/AdminPurgeCommunity.ts index 37f7cf0..aa17a95 100644 --- a/src/types/AdminPurgeCommunity.ts +++ b/src/types/AdminPurgeCommunity.ts @@ -1,9 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface AdminPurgeCommunity { +/** + * When an admin purges a community. + */ +export type AdminPurgeCommunity = { id: number; admin_person_id: PersonId; reason?: string; when_: string; -} +}; diff --git a/src/types/AdminPurgeCommunityView.ts b/src/types/AdminPurgeCommunityView.ts index be86e0b..cbfe8d5 100644 --- a/src/types/AdminPurgeCommunityView.ts +++ b/src/types/AdminPurgeCommunityView.ts @@ -2,7 +2,10 @@ import type { AdminPurgeCommunity } from "./AdminPurgeCommunity"; import type { Person } from "./Person"; -export interface AdminPurgeCommunityView { +/** + * When an admin purges a community. + */ +export type AdminPurgeCommunityView = { admin_purge_community: AdminPurgeCommunity; admin?: Person; -} +}; diff --git a/src/types/AdminPurgePerson.ts b/src/types/AdminPurgePerson.ts index bdb369e..36d0358 100644 --- a/src/types/AdminPurgePerson.ts +++ b/src/types/AdminPurgePerson.ts @@ -1,9 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface AdminPurgePerson { +/** + * When an admin purges a person. + */ +export type AdminPurgePerson = { id: number; admin_person_id: PersonId; reason?: string; when_: string; -} +}; diff --git a/src/types/AdminPurgePersonView.ts b/src/types/AdminPurgePersonView.ts index de801d4..e693a73 100644 --- a/src/types/AdminPurgePersonView.ts +++ b/src/types/AdminPurgePersonView.ts @@ -2,7 +2,10 @@ import type { AdminPurgePerson } from "./AdminPurgePerson"; import type { Person } from "./Person"; -export interface AdminPurgePersonView { +/** + * When an admin purges a person. + */ +export type AdminPurgePersonView = { admin_purge_person: AdminPurgePerson; admin?: Person; -} +}; diff --git a/src/types/AdminPurgePost.ts b/src/types/AdminPurgePost.ts index f7607db..79e3472 100644 --- a/src/types/AdminPurgePost.ts +++ b/src/types/AdminPurgePost.ts @@ -2,10 +2,13 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -export interface AdminPurgePost { +/** + * When an admin purges a post. + */ +export type AdminPurgePost = { id: number; admin_person_id: PersonId; community_id: CommunityId; reason?: string; when_: string; -} +}; diff --git a/src/types/AdminPurgePostView.ts b/src/types/AdminPurgePostView.ts index 3cf7e51..52cf8e7 100644 --- a/src/types/AdminPurgePostView.ts +++ b/src/types/AdminPurgePostView.ts @@ -3,8 +3,11 @@ import type { AdminPurgePost } from "./AdminPurgePost"; import type { Community } from "./Community"; import type { Person } from "./Person"; -export interface AdminPurgePostView { +/** + * When an admin purges a post. + */ +export type AdminPurgePostView = { admin_purge_post: AdminPurgePost; admin?: Person; community: Community; -} +}; diff --git a/src/types/ApproveRegistrationApplication.ts b/src/types/ApproveRegistrationApplication.ts index 273d31f..9c9a95f 100644 --- a/src/types/ApproveRegistrationApplication.ts +++ b/src/types/ApproveRegistrationApplication.ts @@ -1,8 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { RegistrationApplicationId } from "./RegistrationApplicationId"; -export interface ApproveRegistrationApplication { +/** + * Approves a registration application. + */ +export type ApproveRegistrationApplication = { id: RegistrationApplicationId; approve: boolean; deny_reason?: string; -} +}; diff --git a/src/types/AuthenticateWithOauth.ts b/src/types/AuthenticateWithOauth.ts index 157a5ce..862017f 100644 --- a/src/types/AuthenticateWithOauth.ts +++ b/src/types/AuthenticateWithOauth.ts @@ -1,10 +1,20 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { OAuthProviderId } from "./OAuthProviderId"; -export interface AuthenticateWithOauth { +/** + * Logging in with an OAuth 2.0 authorization + */ +export type AuthenticateWithOauth = { code: string; - oauth_provider_id: string; + oauth_provider_id: OAuthProviderId; redirect_uri: string; show_nsfw?: boolean; + /** + * Username is mandatory at registration time + */ username?: string; + /** + * An answer is mandatory if require application is enabled on the server + */ answer?: string; -} +}; diff --git a/src/types/BanFromCommunity.ts b/src/types/BanFromCommunity.ts index 8571430..c579ced 100644 --- a/src/types/BanFromCommunity.ts +++ b/src/types/BanFromCommunity.ts @@ -2,11 +2,23 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -export interface BanFromCommunity { +/** + * Ban a user from a community. + */ +export type BanFromCommunity = { community_id: CommunityId; person_id: PersonId; ban: boolean; + /** + * Optionally remove or restore all their data. Useful for new troll accounts. + * If ban is true, then this means remove. If ban is false, it means restore. + */ remove_or_restore_data?: boolean; reason?: string; + /** + * A time that the ban will expire, in unix epoch seconds. + * + * An i64 unix timestamp is used for a simpler API client implementation. + */ expires?: number; -} +}; diff --git a/src/types/BanFromCommunityResponse.ts b/src/types/BanFromCommunityResponse.ts index 38e770c..04a09a0 100644 --- a/src/types/BanFromCommunityResponse.ts +++ b/src/types/BanFromCommunityResponse.ts @@ -1,7 +1,10 @@ // 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 { +/** + * The response for banning a user from a community. + */ +export type BanFromCommunityResponse = { person_view: PersonView; banned: boolean; -} +}; diff --git a/src/types/BanPerson.ts b/src/types/BanPerson.ts index bfd1bba..054d792 100644 --- a/src/types/BanPerson.ts +++ b/src/types/BanPerson.ts @@ -1,10 +1,22 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface BanPerson { +/** + * Ban a person from the site. + */ +export type BanPerson = { person_id: PersonId; ban: boolean; + /** + * Optionally remove or restore all their data. Useful for new troll accounts. + * If ban is true, then this means remove. If ban is false, it means restore. + */ remove_or_restore_data?: boolean; reason?: string; + /** + * A time that the ban will expire, in unix epoch seconds. + * + * An i64 unix timestamp is used for a simpler API client implementation. + */ expires?: number; -} +}; diff --git a/src/types/BanPersonResponse.ts b/src/types/BanPersonResponse.ts index 1635ba7..53e8e48 100644 --- a/src/types/BanPersonResponse.ts +++ b/src/types/BanPersonResponse.ts @@ -1,7 +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; -} +/** + * A response for a banned person. + */ +export type BanPersonResponse = { person_view: PersonView; banned: boolean }; diff --git a/src/types/BannedPersonsResponse.ts b/src/types/BannedPersonsResponse.ts index dc81d03..ac73010 100644 --- a/src/types/BannedPersonsResponse.ts +++ b/src/types/BannedPersonsResponse.ts @@ -1,6 +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 BannedPersonsResponse { - banned: Array; -} +/** + * The list of banned persons. + */ +export type BannedPersonsResponse = { banned: Array }; diff --git a/src/types/BlockCommunity.ts b/src/types/BlockCommunity.ts index 5afd00e..7f47b6c 100644 --- a/src/types/BlockCommunity.ts +++ b/src/types/BlockCommunity.ts @@ -1,7 +1,7 @@ // 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"; -export interface BlockCommunity { - community_id: CommunityId; - block: boolean; -} +/** + * Block a community. + */ +export type BlockCommunity = { community_id: CommunityId; block: boolean }; diff --git a/src/types/BlockCommunityResponse.ts b/src/types/BlockCommunityResponse.ts index cf79c82..0ec0637 100644 --- a/src/types/BlockCommunityResponse.ts +++ b/src/types/BlockCommunityResponse.ts @@ -1,7 +1,10 @@ // 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 { +/** + * The block community response. + */ +export type BlockCommunityResponse = { community_view: CommunityView; blocked: boolean; -} +}; diff --git a/src/types/BlockInstance.ts b/src/types/BlockInstance.ts index 4b476f3..ce30a75 100644 --- a/src/types/BlockInstance.ts +++ b/src/types/BlockInstance.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { InstanceId } from "./InstanceId"; -export interface BlockInstance { - instance_id: InstanceId; - block: boolean; -} +/** + * Block an instance as user + */ +export type BlockInstance = { instance_id: InstanceId; block: boolean }; diff --git a/src/types/BlockInstanceResponse.ts b/src/types/BlockInstanceResponse.ts index 88e4323..c4cc5b2 100644 --- a/src/types/BlockInstanceResponse.ts +++ b/src/types/BlockInstanceResponse.ts @@ -1,5 +1,3 @@ // 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; -} +export type BlockInstanceResponse = { blocked: boolean }; diff --git a/src/types/BlockPerson.ts b/src/types/BlockPerson.ts index 5d83aab..ab02e93 100644 --- a/src/types/BlockPerson.ts +++ b/src/types/BlockPerson.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface BlockPerson { - person_id: PersonId; - block: boolean; -} +/** + * Block a person. + */ +export type BlockPerson = { person_id: PersonId; block: boolean }; diff --git a/src/types/BlockPersonResponse.ts b/src/types/BlockPersonResponse.ts index e42edc1..3057ac8 100644 --- a/src/types/BlockPersonResponse.ts +++ b/src/types/BlockPersonResponse.ts @@ -1,7 +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; -} +/** + * The response for a person block. + */ +export type BlockPersonResponse = { person_view: PersonView; blocked: boolean }; diff --git a/src/types/CaptchaResponse.ts b/src/types/CaptchaResponse.ts index 9469d1f..4b9db2e 100644 --- a/src/types/CaptchaResponse.ts +++ b/src/types/CaptchaResponse.ts @@ -1,7 +1,19 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface CaptchaResponse { +/** + * A captcha response. + */ +export type CaptchaResponse = { + /** + * A Base64 encoded png + */ png: string; + /** + * A Base64 encoded wav audio + */ wav: string; + /** + * The UUID for the captcha item. + */ uuid: string; -} +}; diff --git a/src/types/ChangePassword.ts b/src/types/ChangePassword.ts index 219bd2f..363ef0f 100644 --- a/src/types/ChangePassword.ts +++ b/src/types/ChangePassword.ts @@ -1,7 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SensitiveString } from "./SensitiveString"; -export interface ChangePassword { - new_password: string; - new_password_verify: string; - old_password: string; -} +/** + * Changes your account password. + */ +export type ChangePassword = { + new_password: SensitiveString; + new_password_verify: SensitiveString; + old_password: SensitiveString; +}; diff --git a/src/types/Comment.ts b/src/types/Comment.ts index 5488782..e17dc4b 100644 --- a/src/types/Comment.ts +++ b/src/types/Comment.ts @@ -1,21 +1,44 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; +import type { DbUrl } from "./DbUrl"; import type { LanguageId } from "./LanguageId"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; -export interface Comment { +/** + * A comment. + */ +export type Comment = { id: CommentId; creator_id: PersonId; post_id: PostId; content: string; + /** + * Whether the comment has been removed. + */ removed: boolean; published: string; updated?: string; + /** + * Whether the comment has been deleted by its creator. + */ deleted: boolean; - ap_id: string; + /** + * The federated activity id / ap_id. + */ + ap_id: DbUrl; + /** + * Whether the comment is local. + */ local: boolean; + /** + * The path / tree location of a comment, separated by dots, ending with the comment's id. Ex: + * 0.24.27 + */ path: string; + /** + * Whether the comment has been distinguished(speaking officially) by a mod. + */ distinguished: boolean; language_id: LanguageId; -} +}; diff --git a/src/types/CommentAggregates.ts b/src/types/CommentAggregates.ts index 0da21fe..f25ba70 100644 --- a/src/types/CommentAggregates.ts +++ b/src/types/CommentAggregates.ts @@ -1,11 +1,17 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface CommentAggregates { +/** + * Aggregate data for a comment. + */ +export type CommentAggregates = { comment_id: CommentId; score: number; upvotes: number; downvotes: number; published: string; + /** + * The total number of children in this comment branch. + */ child_count: number; -} +}; diff --git a/src/types/CommentId.ts b/src/types/CommentId.ts index fca0032..072efee 100644 --- a/src/types/CommentId.ts +++ b/src/types/CommentId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The comment id. + */ export type CommentId = number; diff --git a/src/types/CommentReply.ts b/src/types/CommentReply.ts index fffd0eb..4a3bfaa 100644 --- a/src/types/CommentReply.ts +++ b/src/types/CommentReply.ts @@ -3,10 +3,13 @@ import type { CommentId } from "./CommentId"; import type { CommentReplyId } from "./CommentReplyId"; import type { PersonId } from "./PersonId"; -export interface CommentReply { +/** + * A comment reply. + */ +export type CommentReply = { id: CommentReplyId; recipient_id: PersonId; comment_id: CommentId; read: boolean; published: string; -} +}; diff --git a/src/types/CommentReplyId.ts b/src/types/CommentReplyId.ts index de65bbb..1f2fb11 100644 --- a/src/types/CommentReplyId.ts +++ b/src/types/CommentReplyId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The comment reply id. + */ export type CommentReplyId = number; diff --git a/src/types/CommentReplyResponse.ts b/src/types/CommentReplyResponse.ts index 5b0a5c1..40c58a7 100644 --- a/src/types/CommentReplyResponse.ts +++ b/src/types/CommentReplyResponse.ts @@ -1,6 +1,7 @@ // 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; -} +/** + * The response for a comment reply action. + */ +export type CommentReplyResponse = { comment_reply_view: CommentReplyView }; diff --git a/src/types/CommentReplyView.ts b/src/types/CommentReplyView.ts index b7348b4..11a8786 100644 --- a/src/types/CommentReplyView.ts +++ b/src/types/CommentReplyView.ts @@ -7,7 +7,10 @@ import type { Person } from "./Person"; import type { Post } from "./Post"; import type { SubscribedType } from "./SubscribedType"; -export interface CommentReplyView { +/** + * A comment reply view. + */ +export type CommentReplyView = { comment_reply: CommentReply; comment: Comment; creator: Person; @@ -23,4 +26,4 @@ export interface CommentReplyView { saved: boolean; creator_blocked: boolean; my_vote?: number; -} +}; diff --git a/src/types/CommentReport.ts b/src/types/CommentReport.ts index fe79812..b545a65 100644 --- a/src/types/CommentReport.ts +++ b/src/types/CommentReport.ts @@ -3,7 +3,10 @@ import type { CommentId } from "./CommentId"; import type { CommentReportId } from "./CommentReportId"; import type { PersonId } from "./PersonId"; -export interface CommentReport { +/** + * A comment report. + */ +export type CommentReport = { id: CommentReportId; creator_id: PersonId; comment_id: CommentId; @@ -13,4 +16,4 @@ export interface CommentReport { resolver_id?: PersonId; published: string; updated?: string; -} +}; diff --git a/src/types/CommentReportId.ts b/src/types/CommentReportId.ts index f39173c..f149719 100644 --- a/src/types/CommentReportId.ts +++ b/src/types/CommentReportId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The comment report id. + */ export type CommentReportId = number; diff --git a/src/types/CommentReportResponse.ts b/src/types/CommentReportResponse.ts index 794be58..5c50028 100644 --- a/src/types/CommentReportResponse.ts +++ b/src/types/CommentReportResponse.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentReportView } from "./CommentReportView"; -export interface CommentReportResponse { - comment_report_view: CommentReportView; -} +/** + * The comment report response. + */ +export type CommentReportResponse = { comment_report_view: CommentReportView }; diff --git a/src/types/CommentReportView.ts b/src/types/CommentReportView.ts index 59ef498..f5d1e67 100644 --- a/src/types/CommentReportView.ts +++ b/src/types/CommentReportView.ts @@ -7,7 +7,10 @@ import type { Person } from "./Person"; import type { Post } from "./Post"; import type { SubscribedType } from "./SubscribedType"; -export interface CommentReportView { +/** + * A comment report view. + */ +export type CommentReportView = { comment_report: CommentReport; comment: Comment; post: Post; @@ -23,4 +26,4 @@ export interface CommentReportView { saved: boolean; my_vote?: number; resolver?: Person; -} +}; diff --git a/src/types/CommentResponse.ts b/src/types/CommentResponse.ts index 3e0d12e..cddd72a 100644 --- a/src/types/CommentResponse.ts +++ b/src/types/CommentResponse.ts @@ -2,7 +2,10 @@ import type { CommentView } from "./CommentView"; import type { LocalUserId } from "./LocalUserId"; -export interface CommentResponse { +/** + * A comment response. + */ +export type CommentResponse = { comment_view: CommentView; recipient_ids: Array; -} +}; diff --git a/src/types/CommentSortType.ts b/src/types/CommentSortType.ts index 421e19b..8c768b4 100644 --- a/src/types/CommentSortType.ts +++ b/src/types/CommentSortType.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html + */ export type CommentSortType = "Hot" | "Top" | "New" | "Old" | "Controversial"; diff --git a/src/types/CommentView.ts b/src/types/CommentView.ts index 966dae4..4309087 100644 --- a/src/types/CommentView.ts +++ b/src/types/CommentView.ts @@ -6,7 +6,10 @@ import type { Person } from "./Person"; import type { Post } from "./Post"; import type { SubscribedType } from "./SubscribedType"; -export interface CommentView { +/** + * A comment view. + */ +export type CommentView = { comment: Comment; creator: Person; post: Post; @@ -20,4 +23,4 @@ export interface CommentView { saved: boolean; creator_blocked: boolean; my_vote?: number; -} +}; diff --git a/src/types/Community.ts b/src/types/Community.ts index 496eb89..34faa02 100644 --- a/src/types/Community.ts +++ b/src/types/Community.ts @@ -1,24 +1,65 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommunityId } from "./CommunityId"; import type { CommunityVisibility } from "./CommunityVisibility"; +import type { DbUrl } from "./DbUrl"; import type { InstanceId } from "./InstanceId"; -export interface Community { +/** + * A community. + */ +export type Community = { id: CommunityId; name: string; + /** + * A longer title, that can contain other characters, and doesn't have to be unique. + */ title: string; - description?: string; + /** + * A sidebar for the community in markdown. + */ + sidebar?: string; + /** + * Whether the community is removed by a mod. + */ removed: boolean; published: string; updated?: string; + /** + * Whether the community has been deleted by its creator. + */ deleted: boolean; + /** + * Whether its an NSFW community. + */ nsfw: boolean; - actor_id: string; + /** + * The federated actor_id. + */ + actor_id: DbUrl; + /** + * Whether the community is local. + */ local: boolean; - icon?: string; - banner?: string; + /** + * A URL for an icon. + */ + icon?: DbUrl; + /** + * A URL for a banner. + */ + banner?: DbUrl; + /** + * Whether the community is hidden. + */ hidden: boolean; + /** + * Whether posting is restricted to mods only. + */ posting_restricted_to_mods: boolean; instance_id: InstanceId; visibility: CommunityVisibility; -} + /** + * A shorter, one-line description of the site. + */ + description?: string; +}; diff --git a/src/types/CommunityAggregates.ts b/src/types/CommunityAggregates.ts index f9da9f3..ece11e3 100644 --- a/src/types/CommunityAggregates.ts +++ b/src/types/CommunityAggregates.ts @@ -1,15 +1,30 @@ // 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"; -export interface CommunityAggregates { +/** + * Aggregate data for a community. + */ +export type CommunityAggregates = { community_id: CommunityId; subscribers: number; posts: number; comments: number; published: string; + /** + * The number of users with any activity in the last day. + */ users_active_day: number; + /** + * The number of users with any activity in the last week. + */ users_active_week: number; + /** + * The number of users with any activity in the last month. + */ users_active_month: number; + /** + * The number of users with any activity in the last year. + */ users_active_half_year: number; subscribers_local: number; -} +}; diff --git a/src/types/CommunityFollowerView.ts b/src/types/CommunityFollowerView.ts index bf6ab2f..b4beb20 100644 --- a/src/types/CommunityFollowerView.ts +++ b/src/types/CommunityFollowerView.ts @@ -2,7 +2,7 @@ import type { Community } from "./Community"; import type { Person } from "./Person"; -export interface CommunityFollowerView { - community: Community; - follower: Person; -} +/** + * A community follower. + */ +export type CommunityFollowerView = { community: Community; follower: Person }; diff --git a/src/types/CommunityId.ts b/src/types/CommunityId.ts index 79be635..38e308e 100644 --- a/src/types/CommunityId.ts +++ b/src/types/CommunityId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The community id. + */ export type CommunityId = number; diff --git a/src/types/CommunityModeratorView.ts b/src/types/CommunityModeratorView.ts index e13156c..e93961b 100644 --- a/src/types/CommunityModeratorView.ts +++ b/src/types/CommunityModeratorView.ts @@ -2,7 +2,10 @@ import type { Community } from "./Community"; import type { Person } from "./Person"; -export interface CommunityModeratorView { +/** + * A community moderator. + */ +export type CommunityModeratorView = { community: Community; moderator: Person; -} +}; diff --git a/src/types/CommunityResponse.ts b/src/types/CommunityResponse.ts index 3b92c70..97189ca 100644 --- a/src/types/CommunityResponse.ts +++ b/src/types/CommunityResponse.ts @@ -2,7 +2,10 @@ import type { CommunityView } from "./CommunityView"; import type { LanguageId } from "./LanguageId"; -export interface CommunityResponse { +/** + * A simple community response. + */ +export type CommunityResponse = { community_view: CommunityView; discussion_languages: Array; -} +}; diff --git a/src/types/CommunitySortType.ts b/src/types/CommunitySortType.ts new file mode 100644 index 0000000..951895b --- /dev/null +++ b/src/types/CommunitySortType.ts @@ -0,0 +1,27 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * The community sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html + */ +export type CommunitySortType = + | "Active" + | "Hot" + | "New" + | "Old" + | "TopDay" + | "TopWeek" + | "TopMonth" + | "TopYear" + | "TopAll" + | "MostComments" + | "NewComments" + | "TopHour" + | "TopSixHour" + | "TopTwelveHour" + | "TopThreeMonths" + | "TopSixMonths" + | "TopNineMonths" + | "Controversial" + | "Scaled" + | "NameAsc" + | "NameDesc"; diff --git a/src/types/CommunityView.ts b/src/types/CommunityView.ts index 428817d..f3ead03 100644 --- a/src/types/CommunityView.ts +++ b/src/types/CommunityView.ts @@ -3,10 +3,13 @@ import type { Community } from "./Community"; import type { CommunityAggregates } from "./CommunityAggregates"; import type { SubscribedType } from "./SubscribedType"; -export interface CommunityView { +/** + * A community view. + */ +export type CommunityView = { community: Community; subscribed: SubscribedType; blocked: boolean; counts: CommunityAggregates; banned_from_community: boolean; -} +}; diff --git a/src/types/CommunityVisibility.ts b/src/types/CommunityVisibility.ts index f899643..b062ab0 100644 --- a/src/types/CommunityVisibility.ts +++ b/src/types/CommunityVisibility.ts @@ -1,3 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * Defines who can browse and interact with content in a community. + * + * TODO: Also use this to define private communities + */ export type CommunityVisibility = "Public" | "LocalOnly"; diff --git a/src/types/CreateComment.ts b/src/types/CreateComment.ts index 6bc5860..e10dca1 100644 --- a/src/types/CreateComment.ts +++ b/src/types/CreateComment.ts @@ -3,9 +3,12 @@ import type { CommentId } from "./CommentId"; import type { LanguageId } from "./LanguageId"; import type { PostId } from "./PostId"; -export interface CreateComment { +/** + * Create a comment. + */ +export type CreateComment = { content: string; post_id: PostId; parent_id?: CommentId; language_id?: LanguageId; -} +}; diff --git a/src/types/CreateCommentLike.ts b/src/types/CreateCommentLike.ts index 585593c..73cc123 100644 --- a/src/types/CreateCommentLike.ts +++ b/src/types/CreateCommentLike.ts @@ -1,7 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface CreateCommentLike { +/** + * Like a comment. + */ +export type CreateCommentLike = { comment_id: CommentId; + /** + * Must be -1, 0, or 1 . + */ score: number; -} +}; diff --git a/src/types/CreateCommentReport.ts b/src/types/CreateCommentReport.ts index a604894..fc9ceb4 100644 --- a/src/types/CreateCommentReport.ts +++ b/src/types/CreateCommentReport.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface CreateCommentReport { - comment_id: CommentId; - reason: string; -} +/** + * Report a comment. + */ +export type CreateCommentReport = { comment_id: CommentId; reason: string }; diff --git a/src/types/CreateCommunity.ts b/src/types/CreateCommunity.ts index 3465267..98155ef 100644 --- a/src/types/CreateCommunity.ts +++ b/src/types/CreateCommunity.ts @@ -2,14 +2,42 @@ import type { CommunityVisibility } from "./CommunityVisibility"; import type { LanguageId } from "./LanguageId"; -export interface CreateCommunity { +/** + * Create a community. + */ +export type CreateCommunity = { + /** + * The unique name. + */ name: string; + /** + * A longer title. + */ title: string; + /** + * A sidebar for the community in markdown. + */ + sidebar?: string; + /** + * A shorter, one line description of your community. + */ description?: string; + /** + * An icon URL. + */ icon?: string; + /** + * A banner URL. + */ banner?: string; + /** + * Whether its an NSFW community. + */ nsfw?: boolean; + /** + * Whether to restrict posting only to moderators. + */ posting_restricted_to_mods?: boolean; discussion_languages?: Array; visibility?: CommunityVisibility; -} +}; diff --git a/src/types/CreateCustomEmoji.ts b/src/types/CreateCustomEmoji.ts index f5be274..9d8a37a 100644 --- a/src/types/CreateCustomEmoji.ts +++ b/src/types/CreateCustomEmoji.ts @@ -1,9 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface CreateCustomEmoji { +/** + * Create a custom emoji. + */ +export type CreateCustomEmoji = { category: string; shortcode: string; image_url: string; alt_text: string; keywords: Array; -} +}; diff --git a/src/types/CreateOAuthProvider.ts b/src/types/CreateOAuthProvider.ts index 4d14f3c..9c9e17c 100644 --- a/src/types/CreateOAuthProvider.ts +++ b/src/types/CreateOAuthProvider.ts @@ -1,6 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface CreateOAuthProvider { +/** + * Create an external auth method. + */ +export type CreateOAuthProvider = { display_name: string; issuer: string; authorization_endpoint: string; @@ -13,4 +16,4 @@ export interface CreateOAuthProvider { auto_verify_email?: boolean; account_linking_enabled?: boolean; enabled?: boolean; -} +}; diff --git a/src/types/CreatePost.ts b/src/types/CreatePost.ts index 462aff1..e2cd6d5 100644 --- a/src/types/CreatePost.ts +++ b/src/types/CreatePost.ts @@ -2,15 +2,33 @@ import type { CommunityId } from "./CommunityId"; import type { LanguageId } from "./LanguageId"; -export interface CreatePost { +/** + * Create a post. + */ +export type CreatePost = { name: string; community_id: CommunityId; url?: string; + /** + * An optional body for the post in markdown. + */ body?: string; + /** + * An optional alt_text, usable for image posts. + */ alt_text?: string; + /** + * A honeypot to catch bots. Should be None. + */ honeypot?: string; nsfw?: boolean; language_id?: LanguageId; + /** + * Instead of fetching a thumbnail, use a custom one. + */ custom_thumbnail?: string; + /** + * Time when this post should be scheduled. Null means publish immediately. + */ scheduled_publish_time?: number; -} +}; diff --git a/src/types/CreatePostLike.ts b/src/types/CreatePostLike.ts index d40d304..f719bdf 100644 --- a/src/types/CreatePostLike.ts +++ b/src/types/CreatePostLike.ts @@ -1,7 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface CreatePostLike { +/** + * Like a post. + */ +export type CreatePostLike = { post_id: PostId; + /** + * Score must be -1, 0, or 1. + */ score: number; -} +}; diff --git a/src/types/CreatePostReport.ts b/src/types/CreatePostReport.ts index 09fc269..b986ba3 100644 --- a/src/types/CreatePostReport.ts +++ b/src/types/CreatePostReport.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface CreatePostReport { - post_id: PostId; - reason: string; -} +/** + * Create a post report. + */ +export type CreatePostReport = { post_id: PostId; reason: string }; diff --git a/src/types/CreatePrivateMessage.ts b/src/types/CreatePrivateMessage.ts index 1f7c9b6..c245c96 100644 --- a/src/types/CreatePrivateMessage.ts +++ b/src/types/CreatePrivateMessage.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface CreatePrivateMessage { - content: string; - recipient_id: PersonId; -} +/** + * Create a private message. + */ +export type CreatePrivateMessage = { content: string; recipient_id: PersonId }; diff --git a/src/types/CreatePrivateMessageReport.ts b/src/types/CreatePrivateMessageReport.ts index 4e02913..7301144 100644 --- a/src/types/CreatePrivateMessageReport.ts +++ b/src/types/CreatePrivateMessageReport.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PrivateMessageId } from "./PrivateMessageId"; -export interface CreatePrivateMessageReport { +/** + * Create a report for a private message. + */ +export type CreatePrivateMessageReport = { private_message_id: PrivateMessageId; reason: string; -} +}; diff --git a/src/types/CreateSite.ts b/src/types/CreateSite.ts index 8aa6069..eb09f31 100644 --- a/src/types/CreateSite.ts +++ b/src/types/CreateSite.ts @@ -7,7 +7,10 @@ import type { PostListingMode } from "./PostListingMode"; import type { PostSortType } from "./PostSortType"; import type { RegistrationMode } from "./RegistrationMode"; -export interface CreateSite { +/** + * Creates a site. Should be done after first running lemmy. + */ +export type CreateSite = { name: string; sidebar?: string; description?: string; @@ -54,4 +57,4 @@ export interface CreateSite { post_downvotes?: FederationMode; comment_upvotes?: FederationMode; comment_downvotes?: FederationMode; -} +}; diff --git a/src/types/CreateTagline.ts b/src/types/CreateTagline.ts index d3f5fc9..e7d2e11 100644 --- a/src/types/CreateTagline.ts +++ b/src/types/CreateTagline.ts @@ -1,5 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface CreateTagline { - content: string; -} +/** + * Create a tagline + */ +export type CreateTagline = { content: string }; diff --git a/src/types/CustomEmoji.ts b/src/types/CustomEmoji.ts index 4fd49d7..6817d14 100644 --- a/src/types/CustomEmoji.ts +++ b/src/types/CustomEmoji.ts @@ -1,12 +1,16 @@ // 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 { DbUrl } from "./DbUrl"; -export interface CustomEmoji { +/** + * A custom emoji. + */ +export type CustomEmoji = { id: CustomEmojiId; shortcode: string; - image_url: string; + image_url: DbUrl; alt_text: string; category: string; published: string; updated?: string; -} +}; diff --git a/src/types/CustomEmojiId.ts b/src/types/CustomEmojiId.ts index 67e204b..654aa9b 100644 --- a/src/types/CustomEmojiId.ts +++ b/src/types/CustomEmojiId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The custom emoji id. + */ export type CustomEmojiId = number; diff --git a/src/types/CustomEmojiKeyword.ts b/src/types/CustomEmojiKeyword.ts index ddcb818..c5fb8ad 100644 --- a/src/types/CustomEmojiKeyword.ts +++ b/src/types/CustomEmojiKeyword.ts @@ -1,7 +1,10 @@ // 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 CustomEmojiKeyword { +/** + * A custom keyword for an emoji. + */ +export type CustomEmojiKeyword = { custom_emoji_id: CustomEmojiId; keyword: string; -} +}; diff --git a/src/types/CustomEmojiResponse.ts b/src/types/CustomEmojiResponse.ts index 52d824a..a791e5e 100644 --- a/src/types/CustomEmojiResponse.ts +++ b/src/types/CustomEmojiResponse.ts @@ -1,6 +1,7 @@ // 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 CustomEmojiResponse { - custom_emoji: CustomEmojiView; -} +/** + * A response for a custom emoji. + */ +export type CustomEmojiResponse = { custom_emoji: CustomEmojiView }; diff --git a/src/types/CustomEmojiView.ts b/src/types/CustomEmojiView.ts index 3d85986..7368a57 100644 --- a/src/types/CustomEmojiView.ts +++ b/src/types/CustomEmojiView.ts @@ -2,7 +2,10 @@ import type { CustomEmoji } from "./CustomEmoji"; import type { CustomEmojiKeyword } from "./CustomEmojiKeyword"; -export interface CustomEmojiView { +/** + * A custom emoji view. + */ +export type CustomEmojiView = { custom_emoji: CustomEmoji; keywords: Array; -} +}; diff --git a/src/types/DbUrl.ts b/src/types/DbUrl.ts new file mode 100644 index 0000000..5c16ec9 --- /dev/null +++ b/src/types/DbUrl.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 DbUrl = string; diff --git a/src/types/DeleteAccount.ts b/src/types/DeleteAccount.ts index 3ec7b9c..9cd3305 100644 --- a/src/types/DeleteAccount.ts +++ b/src/types/DeleteAccount.ts @@ -1,6 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SensitiveString } from "./SensitiveString"; -export interface DeleteAccount { - password: string; +/** + * Delete your account. + */ +export type DeleteAccount = { + password: SensitiveString; delete_content: boolean; -} +}; diff --git a/src/types/DeleteComment.ts b/src/types/DeleteComment.ts index 1ef61d5..b89789c 100644 --- a/src/types/DeleteComment.ts +++ b/src/types/DeleteComment.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface DeleteComment { - comment_id: CommentId; - deleted: boolean; -} +/** + * Delete your own comment. + */ +export type DeleteComment = { comment_id: CommentId; deleted: boolean }; diff --git a/src/types/DeleteCommunity.ts b/src/types/DeleteCommunity.ts index 447a91b..e955843 100644 --- a/src/types/DeleteCommunity.ts +++ b/src/types/DeleteCommunity.ts @@ -1,7 +1,7 @@ // 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"; -export interface DeleteCommunity { - community_id: CommunityId; - deleted: boolean; -} +/** + * Delete your own community. + */ +export type DeleteCommunity = { community_id: CommunityId; deleted: boolean }; diff --git a/src/types/DeleteCustomEmoji.ts b/src/types/DeleteCustomEmoji.ts index 064302d..4939281 100644 --- a/src/types/DeleteCustomEmoji.ts +++ b/src/types/DeleteCustomEmoji.ts @@ -1,6 +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 DeleteCustomEmoji { - id: CustomEmojiId; -} +/** + * Delete a custom emoji. + */ +export type DeleteCustomEmoji = { id: CustomEmojiId }; diff --git a/src/types/DeleteOAuthProvider.ts b/src/types/DeleteOAuthProvider.ts index c7c5675..e49e248 100644 --- a/src/types/DeleteOAuthProvider.ts +++ b/src/types/DeleteOAuthProvider.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { OAuthProviderId } from "./OAuthProviderId"; -export interface DeleteOAuthProvider { - id: OAuthProviderId; -} +/** + * Delete an external auth method. + */ +export type DeleteOAuthProvider = { id: OAuthProviderId }; diff --git a/src/types/DeletePost.ts b/src/types/DeletePost.ts index 02ca104..e4d6628 100644 --- a/src/types/DeletePost.ts +++ b/src/types/DeletePost.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface DeletePost { - post_id: PostId; - deleted: boolean; -} +/** + * Delete a post. + */ +export type DeletePost = { post_id: PostId; deleted: boolean }; diff --git a/src/types/DeletePrivateMessage.ts b/src/types/DeletePrivateMessage.ts index 952d207..bb7feb6 100644 --- a/src/types/DeletePrivateMessage.ts +++ b/src/types/DeletePrivateMessage.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PrivateMessageId } from "./PrivateMessageId"; -export interface DeletePrivateMessage { +/** + * Delete a private message. + */ +export type DeletePrivateMessage = { private_message_id: PrivateMessageId; deleted: boolean; -} +}; diff --git a/src/types/DeleteTagline.ts b/src/types/DeleteTagline.ts index de408a8..a5e0923 100644 --- a/src/types/DeleteTagline.ts +++ b/src/types/DeleteTagline.ts @@ -1,6 +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 DeleteTagline { - id: TaglineId; -} +/** + * Delete a tagline + */ +export type DeleteTagline = { id: TaglineId }; diff --git a/src/types/DistinguishComment.ts b/src/types/DistinguishComment.ts index b6d135e..77a029c 100644 --- a/src/types/DistinguishComment.ts +++ b/src/types/DistinguishComment.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface DistinguishComment { +/** + * Distinguish a comment (IE speak as moderator). + */ +export type DistinguishComment = { comment_id: CommentId; distinguished: boolean; -} +}; diff --git a/src/types/EditComment.ts b/src/types/EditComment.ts index 59e6ab0..b96493f 100644 --- a/src/types/EditComment.ts +++ b/src/types/EditComment.ts @@ -2,8 +2,11 @@ import type { CommentId } from "./CommentId"; import type { LanguageId } from "./LanguageId"; -export interface EditComment { +/** + * Edit a comment. + */ +export type EditComment = { comment_id: CommentId; content?: string; language_id?: LanguageId; -} +}; diff --git a/src/types/EditCommunity.ts b/src/types/EditCommunity.ts index fe46e19..8fb1b52 100644 --- a/src/types/EditCommunity.ts +++ b/src/types/EditCommunity.ts @@ -3,14 +3,39 @@ import type { CommunityId } from "./CommunityId"; import type { CommunityVisibility } from "./CommunityVisibility"; import type { LanguageId } from "./LanguageId"; -export interface EditCommunity { +/** + * Edit a community. + */ +export type EditCommunity = { community_id: CommunityId; + /** + * A longer title. + */ title?: string; + /** + * A sidebar for the community in markdown. + */ + sidebar?: string; + /** + * A shorter, one line description of your community. + */ description?: string; + /** + * An icon URL. + */ icon?: string; + /** + * A banner URL. + */ banner?: string; + /** + * Whether its an NSFW community. + */ nsfw?: boolean; + /** + * Whether to restrict posting only to moderators. + */ posting_restricted_to_mods?: boolean; discussion_languages?: Array; visibility?: CommunityVisibility; -} +}; diff --git a/src/types/EditCustomEmoji.ts b/src/types/EditCustomEmoji.ts index fc47e21..9bc41a5 100644 --- a/src/types/EditCustomEmoji.ts +++ b/src/types/EditCustomEmoji.ts @@ -1,10 +1,13 @@ // 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 EditCustomEmoji { +/** + * Edit a custom emoji. + */ +export type EditCustomEmoji = { id: CustomEmojiId; category: string; image_url: string; alt_text: string; keywords: Array; -} +}; diff --git a/src/types/EditOAuthProvider.ts b/src/types/EditOAuthProvider.ts index e76520a..472e7f1 100644 --- a/src/types/EditOAuthProvider.ts +++ b/src/types/EditOAuthProvider.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { OAuthProviderId } from "./OAuthProviderId"; -export interface EditOAuthProvider { +/** + * Edit an external auth method. + */ +export type EditOAuthProvider = { id: OAuthProviderId; display_name?: string; authorization_endpoint?: string; @@ -13,4 +16,4 @@ export interface EditOAuthProvider { auto_verify_email?: boolean; account_linking_enabled?: boolean; enabled?: boolean; -} +}; diff --git a/src/types/EditPost.ts b/src/types/EditPost.ts index fc4c62b..6b1f37d 100644 --- a/src/types/EditPost.ts +++ b/src/types/EditPost.ts @@ -2,14 +2,29 @@ import type { LanguageId } from "./LanguageId"; import type { PostId } from "./PostId"; -export interface EditPost { +/** + * Edit a post. + */ +export type EditPost = { post_id: PostId; name?: string; url?: string; + /** + * An optional body for the post in markdown. + */ body?: string; + /** + * An optional alt_text, usable for image posts. + */ alt_text?: string; nsfw?: boolean; language_id?: LanguageId; + /** + * Instead of fetching a thumbnail, use a custom one. + */ custom_thumbnail?: string; + /** + * Time when this post should be scheduled. Null means publish immediately. + */ scheduled_publish_time?: number; -} +}; diff --git a/src/types/EditPrivateMessage.ts b/src/types/EditPrivateMessage.ts index 0c38d0f..c5645bc 100644 --- a/src/types/EditPrivateMessage.ts +++ b/src/types/EditPrivateMessage.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PrivateMessageId } from "./PrivateMessageId"; -export interface EditPrivateMessage { +/** + * Edit a private message. + */ +export type EditPrivateMessage = { private_message_id: PrivateMessageId; content: string; -} +}; diff --git a/src/types/EditSite.ts b/src/types/EditSite.ts index e66d512..e9657dc 100644 --- a/src/types/EditSite.ts +++ b/src/types/EditSite.ts @@ -7,53 +7,177 @@ import type { PostListingMode } from "./PostListingMode"; import type { PostSortType } from "./PostSortType"; import type { RegistrationMode } from "./RegistrationMode"; -export interface EditSite { +/** + * Edits a site. + */ +export type EditSite = { name?: string; + /** + * A sidebar for the site, in markdown. + */ sidebar?: string; + /** + * A shorter, one line description of your site. + */ description?: string; + /** + * A url for your site's icon. + */ icon?: string; + /** + * A url for your site's banner. + */ banner?: string; + /** + * Whether to enable NSFW. + */ enable_nsfw?: boolean; + /** + * Limits community creation to admins only. + */ community_creation_admin_only?: boolean; + /** + * Whether to require email verification. + */ require_email_verification?: boolean; + /** + * Your application question form. This is in markdown, and can be many questions. + */ application_question?: string; + /** + * Whether your instance is public, or private. + */ private_instance?: boolean; + /** + * The default theme. Usually "browser" + */ default_theme?: string; + /** + * The default post listing type, usually "local" + */ default_post_listing_type?: ListingType; + /** + * Default value for listing mode, usually "list" + */ default_post_listing_mode?: PostListingMode; + /** + * The default post sort, usually "active" + */ default_post_sort_type?: PostSortType; + /** + * The default comment sort, usually "hot" + */ default_comment_sort_type?: CommentSortType; + /** + * An optional page of legal information + */ legal_information?: string; + /** + * Whether to email admins when receiving a new application. + */ application_email_admins?: boolean; + /** + * Whether to hide moderator names from the modlog. + */ hide_modlog_mod_names?: boolean; + /** + * A list of allowed discussion languages. + */ discussion_languages?: Array; + /** + * A regex string of items to filter. + */ slur_filter_regex?: string; + /** + * The max length of actor names. + */ actor_name_max_length?: number; + /** + * The number of messages allowed in a given time frame. + */ rate_limit_message?: number; rate_limit_message_per_second?: number; + /** + * The number of posts allowed in a given time frame. + */ rate_limit_post?: number; rate_limit_post_per_second?: number; + /** + * The number of registrations allowed in a given time frame. + */ rate_limit_register?: number; rate_limit_register_per_second?: number; + /** + * The number of image uploads allowed in a given time frame. + */ rate_limit_image?: number; rate_limit_image_per_second?: number; + /** + * The number of comments allowed in a given time frame. + */ rate_limit_comment?: number; rate_limit_comment_per_second?: number; + /** + * The number of searches allowed in a given time frame. + */ rate_limit_search?: number; rate_limit_search_per_second?: number; + /** + * Whether to enable federation. + */ federation_enabled?: boolean; + /** + * Enables federation debugging. + */ federation_debug?: boolean; + /** + * Whether to enable captchas for signups. + */ captcha_enabled?: boolean; + /** + * The captcha difficulty. Can be easy, medium, or hard + */ captcha_difficulty?: string; + /** + * A list of allowed instances. If none are set, federation is open. + */ allowed_instances?: Array; + /** + * A list of blocked instances. + */ blocked_instances?: Array; + /** + * A list of blocked URLs + */ blocked_urls?: Array; registration_mode?: RegistrationMode; + /** + * Whether to email admins for new reports. + */ reports_email_admins?: boolean; + /** + * If present, nsfw content is visible by default. Should be displayed by frontends/clients + * when the site is first opened by a user. + */ content_warning?: string; + /** + * Whether or not external auth methods can auto-register users. + */ oauth_registration?: boolean; + /** + * What kind of post upvotes your site allows. + */ post_upvotes?: FederationMode; + /** + * What kind of post downvotes your site allows. + */ post_downvotes?: FederationMode; + /** + * What kind of comment upvotes your site allows. + */ comment_upvotes?: FederationMode; + /** + * What kind of comment downvotes your site allows. + */ comment_downvotes?: FederationMode; -} +}; diff --git a/src/types/FeaturePost.ts b/src/types/FeaturePost.ts index 296ce9a..265e9a3 100644 --- a/src/types/FeaturePost.ts +++ b/src/types/FeaturePost.ts @@ -2,8 +2,11 @@ import type { PostFeatureType } from "./PostFeatureType"; import type { PostId } from "./PostId"; -export interface FeaturePost { +/** + * Feature a post (stickies / pins to the top). + */ +export type FeaturePost = { post_id: PostId; featured: boolean; feature_type: PostFeatureType; -} +}; diff --git a/src/types/FederatedInstances.ts b/src/types/FederatedInstances.ts index 55b56f8..f58d995 100644 --- a/src/types/FederatedInstances.ts +++ b/src/types/FederatedInstances.ts @@ -1,8 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { InstanceWithFederationState } from "./InstanceWithFederationState"; -export interface FederatedInstances { +/** + * A list of federated instances. + */ +export type FederatedInstances = { linked: Array; allowed: Array; blocked: Array; -} +}; diff --git a/src/types/FederationError.ts b/src/types/FederationError.ts new file mode 100644 index 0000000..c29b2f3 --- /dev/null +++ b/src/types/FederationError.ts @@ -0,0 +1,27 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Federation related errors, these dont need to be translated. + */ +export type FederationError = + | "CouldntFindActivity" + | "InvalidCommunity" + | "CannotCreatePostOrCommentInDeletedOrRemovedCommunity" + | "CannotReceivePage" + | "OnlyLocalAdminCanRemoveCommunity" + | "OnlyLocalAdminCanRestoreCommunity" + | "PostIsLocked" + | { PersonIsBannedFromSite: string } + | "InvalidVoteValue" + | "PageDoesNotSpecifyCreator" + | "CouldntGetComments" + | "CouldntGetPosts" + | "FederationDisabled" + | { DomainBlocked: string } + | { DomainNotInAllowList: string } + | "FederationDisabledByStrictAllowList" + | "ContradictingFilters" + | "UrlWithoutDomain" + | "InboxTimeout" + | "CantDeleteSite" + | "ObjectIsNotPublic"; diff --git a/src/types/FederationMode.ts b/src/types/FederationMode.ts index 2e9376d..6b20998 100644 --- a/src/types/FederationMode.ts +++ b/src/types/FederationMode.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The federation mode for an item + */ export type FederationMode = "All" | "Local" | "Disable"; diff --git a/src/types/FollowCommunity.ts b/src/types/FollowCommunity.ts index 48a7736..1ae00dc 100644 --- a/src/types/FollowCommunity.ts +++ b/src/types/FollowCommunity.ts @@ -1,7 +1,7 @@ // 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"; -export interface FollowCommunity { - community_id: CommunityId; - follow: boolean; -} +/** + * Follow / subscribe to a community. + */ +export type FollowCommunity = { community_id: CommunityId; follow: boolean }; diff --git a/src/types/GenerateTotpSecretResponse.ts b/src/types/GenerateTotpSecretResponse.ts index 08d7e47..55ca570 100644 --- a/src/types/GenerateTotpSecretResponse.ts +++ b/src/types/GenerateTotpSecretResponse.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 { SensitiveString } from "./SensitiveString"; -export interface GenerateTotpSecretResponse { - totp_secret_url: string; -} +export type GenerateTotpSecretResponse = { totp_secret_url: SensitiveString }; diff --git a/src/types/GetCaptchaResponse.ts b/src/types/GetCaptchaResponse.ts index 17ba568..99b8780 100644 --- a/src/types/GetCaptchaResponse.ts +++ b/src/types/GetCaptchaResponse.ts @@ -1,6 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CaptchaResponse } from "./CaptchaResponse"; -export interface GetCaptchaResponse { +/** + * A wrapper for the captcha response. + */ +export type GetCaptchaResponse = { + /** + * Will be None if captchas are disabled. + */ ok?: CaptchaResponse; -} +}; diff --git a/src/types/GetComment.ts b/src/types/GetComment.ts index ee74799..cfa0cbc 100644 --- a/src/types/GetComment.ts +++ b/src/types/GetComment.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface GetComment { - id: CommentId; -} +/** + * Fetch an individual comment. + */ +export type GetComment = { id: CommentId }; diff --git a/src/types/GetComments.ts b/src/types/GetComments.ts index da7e51b..e7bcb14 100644 --- a/src/types/GetComments.ts +++ b/src/types/GetComments.ts @@ -5,7 +5,10 @@ import type { CommunityId } from "./CommunityId"; import type { ListingType } from "./ListingType"; import type { PostId } from "./PostId"; -export interface GetComments { +/** + * Get a list of comments. + */ +export type GetComments = { type_?: ListingType; sort?: CommentSortType; max_depth?: number; @@ -18,4 +21,4 @@ export interface GetComments { saved_only?: boolean; liked_only?: boolean; disliked_only?: boolean; -} +}; diff --git a/src/types/GetCommentsResponse.ts b/src/types/GetCommentsResponse.ts index ecb6a5c..f82a047 100644 --- a/src/types/GetCommentsResponse.ts +++ b/src/types/GetCommentsResponse.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentView } from "./CommentView"; -export interface GetCommentsResponse { - comments: Array; -} +/** + * The comment list response. + */ +export type GetCommentsResponse = { comments: Array }; diff --git a/src/types/GetCommunity.ts b/src/types/GetCommunity.ts index 1aea643..399a144 100644 --- a/src/types/GetCommunity.ts +++ b/src/types/GetCommunity.ts @@ -1,7 +1,13 @@ // 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"; -export interface GetCommunity { +/** + * Get a community. Must provide either an id, or a name. + */ +export type GetCommunity = { id?: CommunityId; + /** + * Example: star_trek , or star_trek@xyz.tld + */ name?: string; -} +}; diff --git a/src/types/GetCommunityResponse.ts b/src/types/GetCommunityResponse.ts index 1ecf24d..9e630b8 100644 --- a/src/types/GetCommunityResponse.ts +++ b/src/types/GetCommunityResponse.ts @@ -4,9 +4,12 @@ import type { CommunityView } from "./CommunityView"; import type { LanguageId } from "./LanguageId"; import type { Site } from "./Site"; -export interface GetCommunityResponse { +/** + * The community response. + */ +export type GetCommunityResponse = { community_view: CommunityView; site?: Site; moderators: Array; discussion_languages: Array; -} +}; diff --git a/src/types/GetFederatedInstancesResponse.ts b/src/types/GetFederatedInstancesResponse.ts index 987e8be..9cb6c1a 100644 --- a/src/types/GetFederatedInstancesResponse.ts +++ b/src/types/GetFederatedInstancesResponse.ts @@ -1,6 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { FederatedInstances } from "./FederatedInstances"; -export interface GetFederatedInstancesResponse { +/** + * A response of federated instances. + */ +export type GetFederatedInstancesResponse = { + /** + * Optional, because federation may be disabled. + */ federated_instances?: FederatedInstances; -} +}; diff --git a/src/types/GetModlog.ts b/src/types/GetModlog.ts index 11dd9e2..8282fae 100644 --- a/src/types/GetModlog.ts +++ b/src/types/GetModlog.ts @@ -5,7 +5,10 @@ import type { ModlogActionType } from "./ModlogActionType"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; -export interface GetModlog { +/** + * Fetches the modlog. + */ +export type GetModlog = { mod_person_id?: PersonId; community_id?: CommunityId; page?: number; @@ -14,4 +17,4 @@ export interface GetModlog { other_person_id?: PersonId; post_id?: PostId; comment_id?: CommentId; -} +}; diff --git a/src/types/GetModlogResponse.ts b/src/types/GetModlogResponse.ts index 9fd6005..3e20647 100644 --- a/src/types/GetModlogResponse.ts +++ b/src/types/GetModlogResponse.ts @@ -15,7 +15,10 @@ import type { ModRemoveCommunityView } from "./ModRemoveCommunityView"; import type { ModRemovePostView } from "./ModRemovePostView"; import type { ModTransferCommunityView } from "./ModTransferCommunityView"; -export interface GetModlogResponse { +/** + * The modlog fetch response. + */ +export type GetModlogResponse = { removed_posts: Array; locked_posts: Array; featured_posts: Array; @@ -31,4 +34,4 @@ export interface GetModlogResponse { admin_purged_posts: Array; admin_purged_comments: Array; hidden_communities: Array; -} +}; diff --git a/src/types/GetPersonDetails.ts b/src/types/GetPersonDetails.ts index 5fac9b8..257a208 100644 --- a/src/types/GetPersonDetails.ts +++ b/src/types/GetPersonDetails.ts @@ -3,12 +3,20 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; import type { PostSortType } from "./PostSortType"; -export interface GetPersonDetails { +/** + * Gets a person's details. + * + * Either person_id, or username are required. + */ +export type GetPersonDetails = { person_id?: PersonId; + /** + * Example: dessalines , or dessalines@xyz.tld + */ username?: string; sort?: PostSortType; page?: number; limit?: number; community_id?: CommunityId; saved_only?: boolean; -} +}; diff --git a/src/types/GetPersonDetailsResponse.ts b/src/types/GetPersonDetailsResponse.ts index 6d14f77..e17dcd0 100644 --- a/src/types/GetPersonDetailsResponse.ts +++ b/src/types/GetPersonDetailsResponse.ts @@ -5,10 +5,13 @@ import type { PersonView } from "./PersonView"; import type { PostView } from "./PostView"; import type { Site } from "./Site"; -export interface GetPersonDetailsResponse { +/** + * A person's details response. + */ +export type GetPersonDetailsResponse = { person_view: PersonView; site?: Site; comments: Array; posts: Array; moderates: Array; -} +}; diff --git a/src/types/GetPersonMentions.ts b/src/types/GetPersonMentions.ts index be41920..82153c2 100644 --- a/src/types/GetPersonMentions.ts +++ b/src/types/GetPersonMentions.ts @@ -1,9 +1,12 @@ // 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"; -export interface GetPersonMentions { +/** + * Get mentions for your user. + */ +export type GetPersonMentions = { sort?: CommentSortType; page?: number; limit?: number; unread_only?: boolean; -} +}; diff --git a/src/types/GetPersonMentionsResponse.ts b/src/types/GetPersonMentionsResponse.ts index 163016a..5331356 100644 --- a/src/types/GetPersonMentionsResponse.ts +++ b/src/types/GetPersonMentionsResponse.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonMentionView } from "./PersonMentionView"; -export interface GetPersonMentionsResponse { - mentions: Array; -} +/** + * The response of mentions for your user. + */ +export type GetPersonMentionsResponse = { mentions: Array }; diff --git a/src/types/GetPost.ts b/src/types/GetPost.ts index 15b46dc..6adcef9 100644 --- a/src/types/GetPost.ts +++ b/src/types/GetPost.ts @@ -2,7 +2,7 @@ import type { CommentId } from "./CommentId"; import type { PostId } from "./PostId"; -export interface GetPost { - id?: PostId; - comment_id?: CommentId; -} +/** + * Get a post. Needs either the post id, or comment_id. + */ +export type GetPost = { id?: PostId; comment_id?: CommentId }; diff --git a/src/types/GetPostResponse.ts b/src/types/GetPostResponse.ts index 6209747..af507d0 100644 --- a/src/types/GetPostResponse.ts +++ b/src/types/GetPostResponse.ts @@ -3,9 +3,15 @@ import type { CommunityModeratorView } from "./CommunityModeratorView"; import type { CommunityView } from "./CommunityView"; import type { PostView } from "./PostView"; -export interface GetPostResponse { +/** + * The post response. + */ +export type GetPostResponse = { post_view: PostView; community_view: CommunityView; moderators: Array; + /** + * A list of cross-posts, or other times / communities this link has been posted to. + */ cross_posts: Array; -} +}; diff --git a/src/types/GetPosts.ts b/src/types/GetPosts.ts index cce40a4..1857c3c 100644 --- a/src/types/GetPosts.ts +++ b/src/types/GetPosts.ts @@ -4,9 +4,15 @@ import type { ListingType } from "./ListingType"; import type { PaginationCursor } from "./PaginationCursor"; import type { PostSortType } from "./PostSortType"; -export interface GetPosts { +/** + * Get a list of posts. + */ +export type GetPosts = { type_?: ListingType; sort?: PostSortType; + /** + * DEPRECATED, use page_cursor + */ page?: number; limit?: number; community_id?: CommunityId; @@ -15,7 +21,17 @@ export interface GetPosts { liked_only?: boolean; disliked_only?: boolean; show_hidden?: boolean; + /** + * If true, then show the read posts (even if your user setting is to hide them) + */ show_read?: boolean; + /** + * If true, then show the nsfw posts (even if your user setting is to hide them) + */ show_nsfw?: boolean; + /** + * If true, then only show posts with no comments + */ + no_comments_only?: boolean; page_cursor?: PaginationCursor; -} +}; diff --git a/src/types/GetPostsResponse.ts b/src/types/GetPostsResponse.ts index f7c10eb..79dc8cb 100644 --- a/src/types/GetPostsResponse.ts +++ b/src/types/GetPostsResponse.ts @@ -2,7 +2,13 @@ import type { PaginationCursor } from "./PaginationCursor"; import type { PostView } from "./PostView"; -export interface GetPostsResponse { +/** + * The post list response. + */ +export type GetPostsResponse = { posts: Array; + /** + * the pagination cursor to use to fetch the next page + */ next_page?: PaginationCursor; -} +}; diff --git a/src/types/GetPrivateMessages.ts b/src/types/GetPrivateMessages.ts index 57a4074..2e8aa60 100644 --- a/src/types/GetPrivateMessages.ts +++ b/src/types/GetPrivateMessages.ts @@ -1,9 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface GetPrivateMessages { +/** + * Get your private messages. + */ +export type GetPrivateMessages = { unread_only?: boolean; page?: number; limit?: number; creator_id?: PersonId; -} +}; diff --git a/src/types/GetRandomCommunity.ts b/src/types/GetRandomCommunity.ts index 7c6189e..ece9d1a 100644 --- a/src/types/GetRandomCommunity.ts +++ b/src/types/GetRandomCommunity.ts @@ -1,6 +1,7 @@ // 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"; -export interface GetRandomCommunity { - type_?: ListingType; -} +/** + * Fetches a random community + */ +export type GetRandomCommunity = { type_?: ListingType }; diff --git a/src/types/GetRegistrationApplication.ts b/src/types/GetRegistrationApplication.ts index 2a63a55..5586a7a 100644 --- a/src/types/GetRegistrationApplication.ts +++ b/src/types/GetRegistrationApplication.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface GetRegistrationApplication { - person_id: PersonId; -} +/** + * Gets a registration application for a person + */ +export type GetRegistrationApplication = { person_id: PersonId }; diff --git a/src/types/GetReplies.ts b/src/types/GetReplies.ts index bc8003b..49c1c37 100644 --- a/src/types/GetReplies.ts +++ b/src/types/GetReplies.ts @@ -1,9 +1,12 @@ // 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"; -export interface GetReplies { +/** + * Get comment replies. + */ +export type GetReplies = { sort?: CommentSortType; page?: number; limit?: number; unread_only?: boolean; -} +}; diff --git a/src/types/GetRepliesResponse.ts b/src/types/GetRepliesResponse.ts index 63691bf..64b1200 100644 --- a/src/types/GetRepliesResponse.ts +++ b/src/types/GetRepliesResponse.ts @@ -1,6 +1,7 @@ // 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 GetRepliesResponse { - replies: Array; -} +/** + * Fetches your replies. + */ +export type GetRepliesResponse = { replies: Array }; diff --git a/src/types/GetReportCount.ts b/src/types/GetReportCount.ts index 3dcadb2..a82e335 100644 --- a/src/types/GetReportCount.ts +++ b/src/types/GetReportCount.ts @@ -1,6 +1,7 @@ // 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"; -export interface GetReportCount { - community_id?: CommunityId; -} +/** + * Get a count of the number of reports. + */ +export type GetReportCount = { community_id?: CommunityId }; diff --git a/src/types/GetReportCountResponse.ts b/src/types/GetReportCountResponse.ts index f6e8e4d..356f643 100644 --- a/src/types/GetReportCountResponse.ts +++ b/src/types/GetReportCountResponse.ts @@ -1,9 +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"; -export interface GetReportCountResponse { +/** + * A response for the number of reports. + */ +export type GetReportCountResponse = { community_id?: CommunityId; comment_reports: number; post_reports: number; private_message_reports?: number; -} +}; diff --git a/src/types/GetSiteMetadata.ts b/src/types/GetSiteMetadata.ts index d12b033..ed5bc18 100644 --- a/src/types/GetSiteMetadata.ts +++ b/src/types/GetSiteMetadata.ts @@ -1,5 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface GetSiteMetadata { - url: string; -} +/** + * Get metadata for a given site. + */ +export type GetSiteMetadata = { url: string }; diff --git a/src/types/GetSiteMetadataResponse.ts b/src/types/GetSiteMetadataResponse.ts index fbe4e83..eb2e6c8 100644 --- a/src/types/GetSiteMetadataResponse.ts +++ b/src/types/GetSiteMetadataResponse.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LinkMetadata } from "./LinkMetadata"; -export interface GetSiteMetadataResponse { - metadata: LinkMetadata; -} +/** + * The site metadata response. + */ +export type GetSiteMetadataResponse = { metadata: LinkMetadata }; diff --git a/src/types/GetSiteResponse.ts b/src/types/GetSiteResponse.ts index 7c8b077..366cbfc 100644 --- a/src/types/GetSiteResponse.ts +++ b/src/types/GetSiteResponse.ts @@ -9,17 +9,32 @@ import type { PublicOAuthProvider } from "./PublicOAuthProvider"; import type { SiteView } from "./SiteView"; import type { Tagline } from "./Tagline"; -export interface GetSiteResponse { +/** + * An expanded response for a site. + */ +export type GetSiteResponse = { site_view: SiteView; admins: Array; version: string; my_user?: MyUserInfo; all_languages: Array; discussion_languages: Array; + /** + * deprecated, use field `tagline` or /api/v3/tagline/list + */ taglines: Array; + /** + * deprecated, use /api/v3/custom_emoji/list + */ custom_emojis: Array; + /** + * If the site has any taglines, a random one is included here for displaying + */ tagline?: Tagline; + /** + * A list of external auth methods your site supports. + */ oauth_providers?: Array; admin_oauth_providers?: Array; blocked_urls: Array; -} +}; diff --git a/src/types/GetUnreadCountResponse.ts b/src/types/GetUnreadCountResponse.ts index a156270..e9a9dc6 100644 --- a/src/types/GetUnreadCountResponse.ts +++ b/src/types/GetUnreadCountResponse.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface GetUnreadCountResponse { +/** + * A response containing counts for your notifications. + */ +export type GetUnreadCountResponse = { replies: number; mentions: number; private_messages: number; -} +}; diff --git a/src/types/GetUnreadRegistrationApplicationCountResponse.ts b/src/types/GetUnreadRegistrationApplicationCountResponse.ts index 2257f54..f279ded 100644 --- a/src/types/GetUnreadRegistrationApplicationCountResponse.ts +++ b/src/types/GetUnreadRegistrationApplicationCountResponse.ts @@ -1,5 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface GetUnreadRegistrationApplicationCountResponse { +/** + * The count of unread registration applications. + */ +export type GetUnreadRegistrationApplicationCountResponse = { registration_applications: number; -} +}; diff --git a/src/types/HideCommunity.ts b/src/types/HideCommunity.ts index 5b1de4f..738e3de 100644 --- a/src/types/HideCommunity.ts +++ b/src/types/HideCommunity.ts @@ -1,8 +1,11 @@ // 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"; -export interface HideCommunity { +/** + * Hide a community from the main view. + */ +export type HideCommunity = { community_id: CommunityId; hidden: boolean; reason?: string; -} +}; diff --git a/src/types/HidePost.ts b/src/types/HidePost.ts index b0a3da9..763a4a3 100644 --- a/src/types/HidePost.ts +++ b/src/types/HidePost.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface HidePost { - post_ids: Array; - hide: boolean; -} +/** + * Hide a post from list views + */ +export type HidePost = { post_ids: Array; hide: boolean }; diff --git a/src/types/ImageDetails.ts b/src/types/ImageDetails.ts index 8d350ab..e823f45 100644 --- a/src/types/ImageDetails.ts +++ b/src/types/ImageDetails.ts @@ -1,8 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DbUrl } from "./DbUrl"; -export interface ImageDetails { - link: string; +export type ImageDetails = { + link: DbUrl; width: number; height: number; content_type: string; -} +}; diff --git a/src/types/Instance.ts b/src/types/Instance.ts index 4a7debd..3d67092 100644 --- a/src/types/Instance.ts +++ b/src/types/Instance.ts @@ -1,11 +1,14 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { InstanceId } from "./InstanceId"; -export interface Instance { +/** + * A federated instance / site. + */ +export type Instance = { id: InstanceId; domain: string; published: string; updated?: string; software?: string; version?: string; -} +}; diff --git a/src/types/InstanceId.ts b/src/types/InstanceId.ts index 77c4969..08c34a5 100644 --- a/src/types/InstanceId.ts +++ b/src/types/InstanceId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The instance id. + */ export type InstanceId = number; diff --git a/src/types/InstanceWithFederationState.ts b/src/types/InstanceWithFederationState.ts index 5d65844..baf27c7 100644 --- a/src/types/InstanceWithFederationState.ts +++ b/src/types/InstanceWithFederationState.ts @@ -2,12 +2,16 @@ import type { InstanceId } from "./InstanceId"; import type { ReadableFederationState } from "./ReadableFederationState"; -export interface InstanceWithFederationState { +export type InstanceWithFederationState = { + /** + * if federation to this instance is or was active, show state of outgoing federation to this + * instance + */ + federation_state?: ReadableFederationState; id: InstanceId; domain: string; published: string; updated?: string; software?: string; version?: string; - federation_state?: ReadableFederationState; -} +}; diff --git a/src/types/Language.ts b/src/types/Language.ts index 5afcc00..e6d3b52 100644 --- a/src/types/Language.ts +++ b/src/types/Language.ts @@ -1,8 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LanguageId } from "./LanguageId"; -export interface Language { - id: LanguageId; - code: string; - name: string; -} +/** + * A language. + */ +export type Language = { id: LanguageId; code: string; name: string }; diff --git a/src/types/LanguageId.ts b/src/types/LanguageId.ts index e484a5e..8699f08 100644 --- a/src/types/LanguageId.ts +++ b/src/types/LanguageId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The language id. + */ export type LanguageId = number; diff --git a/src/types/LemmyErrorType.ts b/src/types/LemmyErrorType.ts index 02c5792..dbedaaa 100644 --- a/src/types/LemmyErrorType.ts +++ b/src/types/LemmyErrorType.ts @@ -1,4 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { FederationError } from "./FederationError"; export type LemmyErrorType = | { error: "report_reason_required" } @@ -14,30 +15,23 @@ export type LemmyErrorType = | { 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: "not_higher_mod" } | { error: "not_higher_admin" } | { error: "site_ban" } | { error: "deleted" } - | { error: "banned_from_community" } | { error: "person_is_blocked" } | { error: "community_is_blocked" } | { error: "instance_is_blocked" } - | { error: "vote_not_allowed" } | { error: "instance_is_private" } | { error: "invalid_password" } | { error: "site_description_length_overflow" } @@ -51,7 +45,6 @@ export type LemmyErrorType = | { 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: "edit_private_message_not_allowed" } @@ -63,23 +56,10 @@ export type LemmyErrorType = | { error: "registration_username_required" } | { error: "email_already_exists" } | { error: "username_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: "no_email_setup" } | { error: "local_site_not_setup" } | { error: "email_smtp_server_needs_a_port" } @@ -116,7 +96,6 @@ export type LemmyErrorType = | { 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" } @@ -130,11 +109,7 @@ export type LemmyErrorType = | { error: "invalid_url" } | { error: "email_send_failed" } | { error: "slurs" } - | { 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: "registration_denied"; message: { reason?: string } } | { error: "site_name_required" } | { error: "site_name_length_overflow" } | { error: "permissive_regex" } @@ -146,20 +121,18 @@ export type LemmyErrorType = | { error: "contradicting_filters" } | { error: "instance_block_already_exists" } | { error: "too_many_items" } - | { error: "community_has_no_followers" } | { error: "ban_expiration_in_past" } | { error: "invalid_unix_time" } | { error: "invalid_bot_action" } | { error: "cant_block_local_instance" } - | { error: "url_without_domain" } - | { error: "inbox_timeout" } + | { error: "unknown"; message: string } + | { error: "url_length_overflow" } | { error: "oauth_authorization_invalid" } | { error: "oauth_login_failed" } | { error: "oauth_registration_closed" } | { error: "couldnt_delete_oauth_provider" } - | { error: "unknown"; message: string } - | { error: "cant_delete_site" } - | { error: "url_length_overflow" } + | { error: "not_found" } + | { error: "community_has_no_followers" } | { error: "post_schedule_time_must_be_in_future" } | { error: "too_many_scheduled_posts" } - | { error: "not_found" }; + | { error: "federation_error"; message: { error?: FederationError } }; diff --git a/src/types/LinkMetadata.ts b/src/types/LinkMetadata.ts index f6a027c..a12bbc0 100644 --- a/src/types/LinkMetadata.ts +++ b/src/types/LinkMetadata.ts @@ -1,9 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DbUrl } from "./DbUrl"; -export interface LinkMetadata { +/** + * Site metadata, from its opengraph tags. + */ +export type LinkMetadata = { + content_type?: string; title?: string; description?: string; - image?: string; - embed_video_url?: string; - content_type?: string; -} + image?: DbUrl; + embed_video_url?: DbUrl; +}; diff --git a/src/types/ListCommentLikes.ts b/src/types/ListCommentLikes.ts index 555b0e3..b048385 100644 --- a/src/types/ListCommentLikes.ts +++ b/src/types/ListCommentLikes.ts @@ -1,8 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface ListCommentLikes { +/** + * List comment likes. Admins-only. + */ +export type ListCommentLikes = { comment_id: CommentId; page?: number; limit?: number; -} +}; diff --git a/src/types/ListCommentLikesResponse.ts b/src/types/ListCommentLikesResponse.ts index a575a2f..e5ad31e 100644 --- a/src/types/ListCommentLikesResponse.ts +++ b/src/types/ListCommentLikesResponse.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { VoteView } from "./VoteView"; -export interface ListCommentLikesResponse { - comment_likes: Array; -} +/** + * The comment likes response + */ +export type ListCommentLikesResponse = { comment_likes: Array }; diff --git a/src/types/ListCommentReports.ts b/src/types/ListCommentReports.ts index 96ca96b..8cb33dc 100644 --- a/src/types/ListCommentReports.ts +++ b/src/types/ListCommentReports.ts @@ -2,10 +2,19 @@ import type { CommentId } from "./CommentId"; import type { CommunityId } from "./CommunityId"; -export interface ListCommentReports { +/** + * List comment reports. + */ +export type ListCommentReports = { comment_id?: CommentId; page?: number; limit?: number; + /** + * Only shows the unresolved reports + */ unresolved_only?: boolean; + /** + * if no community is given, it returns reports for all communities moderated by the auth user + */ community_id?: CommunityId; -} +}; diff --git a/src/types/ListCommentReportsResponse.ts b/src/types/ListCommentReportsResponse.ts index b71846e..7bfbbef 100644 --- a/src/types/ListCommentReportsResponse.ts +++ b/src/types/ListCommentReportsResponse.ts @@ -1,6 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentReportView } from "./CommentReportView"; -export interface ListCommentReportsResponse { +/** + * The comment report list response. + */ +export type ListCommentReportsResponse = { comment_reports: Array; -} +}; diff --git a/src/types/ListCommunities.ts b/src/types/ListCommunities.ts index 83a78f6..4602297 100644 --- a/src/types/ListCommunities.ts +++ b/src/types/ListCommunities.ts @@ -1,11 +1,14 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { CommunitySortType } from "./CommunitySortType"; import type { ListingType } from "./ListingType"; -import type { PostSortType } from "./PostSortType"; -export interface ListCommunities { +/** + * Fetches a list of communities. + */ +export type ListCommunities = { type_?: ListingType; - sort?: PostSortType; + sort?: CommunitySortType; show_nsfw?: boolean; page?: number; limit?: number; -} +}; diff --git a/src/types/ListCommunitiesResponse.ts b/src/types/ListCommunitiesResponse.ts index 509205a..18936a8 100644 --- a/src/types/ListCommunitiesResponse.ts +++ b/src/types/ListCommunitiesResponse.ts @@ -1,6 +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 ListCommunitiesResponse { - communities: Array; -} +/** + * The response for listing communities. + */ +export type ListCommunitiesResponse = { communities: Array }; diff --git a/src/types/ListCustomEmojis.ts b/src/types/ListCustomEmojis.ts index 68b4bfb..246cd06 100644 --- a/src/types/ListCustomEmojis.ts +++ b/src/types/ListCustomEmojis.ts @@ -1,8 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface ListCustomEmojis { +/** + * Fetches a list of custom emojis. + */ +export type ListCustomEmojis = { page?: number; limit?: number; category?: string; ignore_page_limits?: boolean; -} +}; diff --git a/src/types/ListCustomEmojisResponse.ts b/src/types/ListCustomEmojisResponse.ts index 7d76905..c68f116 100644 --- a/src/types/ListCustomEmojisResponse.ts +++ b/src/types/ListCustomEmojisResponse.ts @@ -1,6 +1,9 @@ // 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 { +/** + * A response for custom emojis. + */ +export type ListCustomEmojisResponse = { custom_emojis: Array; -} +}; diff --git a/src/types/ListLoginsResponse.ts b/src/types/ListLoginsResponse.ts index 4a4c705..5b6cc82 100644 --- a/src/types/ListLoginsResponse.ts +++ b/src/types/ListLoginsResponse.ts @@ -1,6 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LoginToken } from "./LoginToken"; -export interface ListLoginsResponse { - logins: Array; -} +export type ListLoginsResponse = { logins: Array }; diff --git a/src/types/ListMedia.ts b/src/types/ListMedia.ts index 1388ab0..cfe3a97 100644 --- a/src/types/ListMedia.ts +++ b/src/types/ListMedia.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface ListMedia { - page?: number; - limit?: number; -} +/** + * Get your user's image / media uploads. + */ +export type ListMedia = { page?: number; limit?: number }; diff --git a/src/types/ListMediaResponse.ts b/src/types/ListMediaResponse.ts index 9b55d44..7a49863 100644 --- a/src/types/ListMediaResponse.ts +++ b/src/types/ListMediaResponse.ts @@ -1,6 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LocalImageView } from "./LocalImageView"; -export interface ListMediaResponse { - images: Array; -} +export type ListMediaResponse = { images: Array }; diff --git a/src/types/ListPostLikes.ts b/src/types/ListPostLikes.ts index 68fb808..68534e3 100644 --- a/src/types/ListPostLikes.ts +++ b/src/types/ListPostLikes.ts @@ -1,8 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface ListPostLikes { - post_id: PostId; - page?: number; - limit?: number; -} +/** + * List post likes. Admins-only. + */ +export type ListPostLikes = { post_id: PostId; page?: number; limit?: number }; diff --git a/src/types/ListPostLikesResponse.ts b/src/types/ListPostLikesResponse.ts index c2ae423..8ce0b5b 100644 --- a/src/types/ListPostLikesResponse.ts +++ b/src/types/ListPostLikesResponse.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { VoteView } from "./VoteView"; -export interface ListPostLikesResponse { - post_likes: Array; -} +/** + * The post likes response + */ +export type ListPostLikesResponse = { post_likes: Array }; diff --git a/src/types/ListPostReports.ts b/src/types/ListPostReports.ts index a83ff95..0964ab9 100644 --- a/src/types/ListPostReports.ts +++ b/src/types/ListPostReports.ts @@ -2,10 +2,19 @@ import type { CommunityId } from "./CommunityId"; import type { PostId } from "./PostId"; -export interface ListPostReports { +/** + * List post reports. + */ +export type ListPostReports = { page?: number; limit?: number; + /** + * Only shows the unresolved reports + */ unresolved_only?: boolean; + /** + * if no community is given, it returns reports for all communities moderated by the auth user + */ community_id?: CommunityId; post_id?: PostId; -} +}; diff --git a/src/types/ListPostReportsResponse.ts b/src/types/ListPostReportsResponse.ts index 51f1955..94e7ca1 100644 --- a/src/types/ListPostReportsResponse.ts +++ b/src/types/ListPostReportsResponse.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostReportView } from "./PostReportView"; -export interface ListPostReportsResponse { - post_reports: Array; -} +/** + * The post reports response. + */ +export type ListPostReportsResponse = { post_reports: Array }; diff --git a/src/types/ListPrivateMessageReports.ts b/src/types/ListPrivateMessageReports.ts index 2455b18..7c43dd0 100644 --- a/src/types/ListPrivateMessageReports.ts +++ b/src/types/ListPrivateMessageReports.ts @@ -1,7 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface ListPrivateMessageReports { +/** + * List private message reports. + */ +export type ListPrivateMessageReports = { page?: number; limit?: number; + /** + * Only shows the unresolved reports + */ unresolved_only?: boolean; -} +}; diff --git a/src/types/ListPrivateMessageReportsResponse.ts b/src/types/ListPrivateMessageReportsResponse.ts index 56969c7..a574280 100644 --- a/src/types/ListPrivateMessageReportsResponse.ts +++ b/src/types/ListPrivateMessageReportsResponse.ts @@ -1,6 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PrivateMessageReportView } from "./PrivateMessageReportView"; -export interface ListPrivateMessageReportsResponse { +/** + * The response for list private message reports. + */ +export type ListPrivateMessageReportsResponse = { private_message_reports: Array; -} +}; diff --git a/src/types/ListRegistrationApplications.ts b/src/types/ListRegistrationApplications.ts index fbb4704..f372a97 100644 --- a/src/types/ListRegistrationApplications.ts +++ b/src/types/ListRegistrationApplications.ts @@ -1,7 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface ListRegistrationApplications { +/** + * Fetches a list of registration applications. + */ +export type ListRegistrationApplications = { + /** + * Only shows the unread applications (IE those without an admin actor) + */ unread_only?: boolean; page?: number; limit?: number; -} +}; diff --git a/src/types/ListRegistrationApplicationsResponse.ts b/src/types/ListRegistrationApplicationsResponse.ts index d41f841..4506170 100644 --- a/src/types/ListRegistrationApplicationsResponse.ts +++ b/src/types/ListRegistrationApplicationsResponse.ts @@ -1,6 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { RegistrationApplicationView } from "./RegistrationApplicationView"; -export interface ListRegistrationApplicationsResponse { +/** + * The list of registration applications. + */ +export type ListRegistrationApplicationsResponse = { registration_applications: Array; -} +}; diff --git a/src/types/ListTaglines.ts b/src/types/ListTaglines.ts index 70f2538..34f7b93 100644 --- a/src/types/ListTaglines.ts +++ b/src/types/ListTaglines.ts @@ -1,6 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface ListTaglines { - page?: number; - limit?: number; -} +/** + * Fetches a list of taglines. + */ +export type ListTaglines = { page?: number; limit?: number }; diff --git a/src/types/ListTaglinesResponse.ts b/src/types/ListTaglinesResponse.ts index 7112239..df0792d 100644 --- a/src/types/ListTaglinesResponse.ts +++ b/src/types/ListTaglinesResponse.ts @@ -1,6 +1,7 @@ // 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; -} +/** + * A response for taglines. + */ +export type ListTaglinesResponse = { taglines: Array }; diff --git a/src/types/ListingType.ts b/src/types/ListingType.ts index 0c9f03e..8a00989 100644 --- a/src/types/ListingType.ts +++ b/src/types/ListingType.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * A listing type for post and comment list fetches. + */ export type ListingType = "All" | "Local" | "Subscribed" | "ModeratorView"; diff --git a/src/types/LocalImage.ts b/src/types/LocalImage.ts index e0f5c4a..fcdec28 100644 --- a/src/types/LocalImage.ts +++ b/src/types/LocalImage.ts @@ -1,9 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LocalUserId } from "./LocalUserId"; -export interface LocalImage { +export type LocalImage = { local_user_id?: LocalUserId; pictrs_alias: string; pictrs_delete_token: string; published: string; -} +}; diff --git a/src/types/LocalImageView.ts b/src/types/LocalImageView.ts index f2741a2..d070584 100644 --- a/src/types/LocalImageView.ts +++ b/src/types/LocalImageView.ts @@ -2,7 +2,7 @@ import type { LocalImage } from "./LocalImage"; import type { Person } from "./Person"; -export interface LocalImageView { - local_image: LocalImage; - person: Person; -} +/** + * A local image view. + */ +export type LocalImageView = { local_image: LocalImage; person: Person }; diff --git a/src/types/LocalSite.ts b/src/types/LocalSite.ts index 285f411..9f719c6 100644 --- a/src/types/LocalSite.ts +++ b/src/types/LocalSite.ts @@ -8,35 +8,111 @@ import type { PostSortType } from "./PostSortType"; import type { RegistrationMode } from "./RegistrationMode"; import type { SiteId } from "./SiteId"; -export interface LocalSite { +/** + * The local site. + */ +export type LocalSite = { id: LocalSiteId; site_id: SiteId; + /** + * True if the site is set up. + */ site_setup: boolean; + /** + * Whether only admins can create communities. + */ community_creation_admin_only: boolean; + /** + * Whether emails are required. + */ require_email_verification: boolean; + /** + * An optional registration application questionnaire in markdown. + */ application_question?: string; + /** + * Whether the instance is private or public. + */ private_instance: boolean; + /** + * The default front-end theme. + */ default_theme: string; default_post_listing_type: ListingType; + /** + * An optional legal disclaimer page. + */ legal_information?: string; + /** + * Whether to hide mod names on the modlog. + */ hide_modlog_mod_names: boolean; + /** + * Whether new applications email admins. + */ application_email_admins: boolean; + /** + * An optional regex to filter words. + */ slur_filter_regex?: string; + /** + * The max actor name length. + */ actor_name_max_length: number; + /** + * Whether federation is enabled. + */ federation_enabled: boolean; + /** + * Whether captcha is enabled. + */ captcha_enabled: boolean; + /** + * The captcha difficulty. + */ captcha_difficulty: string; published: string; updated?: string; registration_mode: RegistrationMode; + /** + * Whether to email admins on new reports. + */ reports_email_admins: boolean; + /** + * Whether to sign outgoing Activitypub fetches with private key of local instance. Some + * Fediverse instances and platforms require this. + */ federation_signed_fetch: boolean; + /** + * Default value for [LocalSite.post_listing_mode] + */ default_post_listing_mode: PostListingMode; + /** + * Default value for [LocalUser.post_sort_type] + */ default_post_sort_type: PostSortType; + /** + * Default value for [LocalUser.comment_sort_type] + */ default_comment_sort_type: CommentSortType; + /** + * Whether or not external auth methods can auto-register users. + */ oauth_registration: boolean; + /** + * What kind of post upvotes your site allows. + */ post_upvotes: FederationMode; + /** + * What kind of post downvotes your site allows. + */ post_downvotes: FederationMode; + /** + * What kind of comment upvotes your site allows. + */ comment_upvotes: FederationMode; + /** + * What kind of comment downvotes your site allows. + */ comment_downvotes: FederationMode; -} +}; diff --git a/src/types/LocalSiteId.ts b/src/types/LocalSiteId.ts index fb89004..4fe976a 100644 --- a/src/types/LocalSiteId.ts +++ b/src/types/LocalSiteId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The local site id. + */ export type LocalSiteId = number; diff --git a/src/types/LocalSiteRateLimit.ts b/src/types/LocalSiteRateLimit.ts index 4c972ae..b5b56d0 100644 --- a/src/types/LocalSiteRateLimit.ts +++ b/src/types/LocalSiteRateLimit.ts @@ -1,7 +1,10 @@ // 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 LocalSiteRateLimit { +/** + * Rate limits for your site. Given in count / length of time. + */ +export type LocalSiteRateLimit = { local_site_id: LocalSiteId; message: number; message_per_second: number; @@ -19,4 +22,4 @@ export interface LocalSiteRateLimit { updated?: string; import_user_settings: number; import_user_settings_per_second: number; -} +}; diff --git a/src/types/LocalSiteUrlBlocklist.ts b/src/types/LocalSiteUrlBlocklist.ts index 063f3d7..f5f7c7c 100644 --- a/src/types/LocalSiteUrlBlocklist.ts +++ b/src/types/LocalSiteUrlBlocklist.ts @@ -1,8 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface LocalSiteUrlBlocklist { +export type LocalSiteUrlBlocklist = { id: number; url: string; published: string; updated?: string; -} +}; diff --git a/src/types/LocalUser.ts b/src/types/LocalUser.ts index 7abd575..d03da9e 100644 --- a/src/types/LocalUser.ts +++ b/src/types/LocalUser.ts @@ -5,30 +5,77 @@ import type { LocalUserId } from "./LocalUserId"; import type { PersonId } from "./PersonId"; import type { PostListingMode } from "./PostListingMode"; import type { PostSortType } from "./PostSortType"; +import type { SensitiveString } from "./SensitiveString"; -export interface LocalUser { +/** + * A local user. + */ +export type LocalUser = { id: LocalUserId; + /** + * The person_id for the local user. + */ person_id: PersonId; - email?: string; + email?: SensitiveString; + /** + * Whether to show NSFW content. + */ show_nsfw: boolean; theme: string; default_post_sort_type: PostSortType; default_listing_type: ListingType; interface_language: string; + /** + * Whether to show avatars. + */ show_avatars: boolean; send_notifications_to_email: boolean; + /** + * Whether to show bot accounts. + */ show_bot_accounts: boolean; + /** + * Whether to show read posts. + */ show_read_posts: boolean; + /** + * Whether their email has been verified. + */ email_verified: boolean; + /** + * Whether their registration application has been accepted. + */ accepted_application: boolean; + /** + * Open links in a new tab. + */ open_links_in_new_tab: boolean; blur_nsfw: boolean; + /** + * Whether infinite scroll is enabled. + */ infinite_scroll_enabled: boolean; + /** + * Whether the person is an admin. + */ admin: boolean; + /** + * A post-view mode that changes how multiple post listings look. + */ post_listing_mode: PostListingMode; totp_2fa_enabled: boolean; + /** + * Whether to allow keyboard navigation (for browsing and interacting with posts and comments). + */ enable_keyboard_navigation: boolean; + /** + * Whether user avatars and inline images in the UI that are gifs should be allowed to play or + * should be paused + */ enable_animated_images: boolean; + /** + * Whether to auto-collapse bot comments. + */ collapse_bot_comments: boolean; default_comment_sort_type: CommentSortType; -} +}; diff --git a/src/types/LocalUserId.ts b/src/types/LocalUserId.ts index f22d50e..501009e 100644 --- a/src/types/LocalUserId.ts +++ b/src/types/LocalUserId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The local user id. + */ export type LocalUserId = number; diff --git a/src/types/LocalUserView.ts b/src/types/LocalUserView.ts index 2dd2381..d6ec19e 100644 --- a/src/types/LocalUserView.ts +++ b/src/types/LocalUserView.ts @@ -4,9 +4,12 @@ import type { LocalUserVoteDisplayMode } from "./LocalUserVoteDisplayMode"; import type { Person } from "./Person"; import type { PersonAggregates } from "./PersonAggregates"; -export interface LocalUserView { +/** + * A local user view. + */ +export type LocalUserView = { local_user: LocalUser; local_user_vote_display_mode: LocalUserVoteDisplayMode; person: Person; counts: PersonAggregates; -} +}; diff --git a/src/types/LocalUserVoteDisplayMode.ts b/src/types/LocalUserVoteDisplayMode.ts index ae93552..683440b 100644 --- a/src/types/LocalUserVoteDisplayMode.ts +++ b/src/types/LocalUserVoteDisplayMode.ts @@ -1,8 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface LocalUserVoteDisplayMode { +/** + * The vote display settings for your user. + */ +export type LocalUserVoteDisplayMode = { score: boolean; upvotes: boolean; downvotes: boolean; upvote_percentage: boolean; -} +}; diff --git a/src/types/LockPost.ts b/src/types/LockPost.ts index 8102b43..4738146 100644 --- a/src/types/LockPost.ts +++ b/src/types/LockPost.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface LockPost { - post_id: PostId; - locked: boolean; -} +/** + * Lock a post (prevent new comments). + */ +export type LockPost = { post_id: PostId; locked: boolean }; diff --git a/src/types/Login.ts b/src/types/Login.ts index 5d74d03..abe6970 100644 --- a/src/types/Login.ts +++ b/src/types/Login.ts @@ -1,7 +1,14 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SensitiveString } from "./SensitiveString"; -export interface Login { - username_or_email: string; - password: string; +/** + * Logging into lemmy. + */ +export type Login = { + username_or_email: SensitiveString; + password: SensitiveString; + /** + * May be required, if totp is enabled for their account. + */ totp_2fa_token?: string; -} +}; diff --git a/src/types/LoginResponse.ts b/src/types/LoginResponse.ts index 79e7a59..f01000a 100644 --- a/src/types/LoginResponse.ts +++ b/src/types/LoginResponse.ts @@ -1,7 +1,21 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SensitiveString } from "./SensitiveString"; -export interface LoginResponse { - jwt?: string; +/** + * A response for your login. + */ +export type LoginResponse = { + /** + * This is None in response to `Register` if email verification is enabled, or the server + * requires registration applications. + */ + jwt?: SensitiveString; + /** + * If registration applications are required, this will return true for a signup response. + */ registration_created: boolean; + /** + * If email verifications are required, this will return true for a signup response. + */ verify_email_sent: boolean; -} +}; diff --git a/src/types/LoginToken.ts b/src/types/LoginToken.ts index 21e0c26..5dc3007 100644 --- a/src/types/LoginToken.ts +++ b/src/types/LoginToken.ts @@ -1,9 +1,19 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { LocalUserId } from "./LocalUserId"; -export interface LoginToken { +/** + * Stores data related to a specific user login session. + */ +export type LoginToken = { user_id: LocalUserId; + /** + * Time of login + */ published: string; + /** + * IP address where login was made from, allows invalidating logins by IP address. + * Could be stored in truncated format, or store derived information for better privacy. + */ ip?: string; user_agent?: string; -} +}; diff --git a/src/types/MarkCommentReplyAsRead.ts b/src/types/MarkCommentReplyAsRead.ts index 0870e1a..407eaf4 100644 --- a/src/types/MarkCommentReplyAsRead.ts +++ b/src/types/MarkCommentReplyAsRead.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentReplyId } from "./CommentReplyId"; -export interface MarkCommentReplyAsRead { +/** + * Mark a comment reply as read. + */ +export type MarkCommentReplyAsRead = { comment_reply_id: CommentReplyId; read: boolean; -} +}; diff --git a/src/types/MarkPersonMentionAsRead.ts b/src/types/MarkPersonMentionAsRead.ts index 24d0b44..98b94c9 100644 --- a/src/types/MarkPersonMentionAsRead.ts +++ b/src/types/MarkPersonMentionAsRead.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonMentionId } from "./PersonMentionId"; -export interface MarkPersonMentionAsRead { +/** + * Mark a person mention as read. + */ +export type MarkPersonMentionAsRead = { person_mention_id: PersonMentionId; read: boolean; -} +}; diff --git a/src/types/MarkPostAsRead.ts b/src/types/MarkPostAsRead.ts index 979997e..bfb8188 100644 --- a/src/types/MarkPostAsRead.ts +++ b/src/types/MarkPostAsRead.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface MarkPostAsRead { - post_ids: Array; - read: boolean; -} +/** + * Mark a post as read. + */ +export type MarkPostAsRead = { post_ids: Array; read: boolean }; diff --git a/src/types/MarkPrivateMessageAsRead.ts b/src/types/MarkPrivateMessageAsRead.ts index a4e721b..3471956 100644 --- a/src/types/MarkPrivateMessageAsRead.ts +++ b/src/types/MarkPrivateMessageAsRead.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PrivateMessageId } from "./PrivateMessageId"; -export interface MarkPrivateMessageAsRead { +/** + * Mark a private message as read. + */ +export type MarkPrivateMessageAsRead = { private_message_id: PrivateMessageId; read: boolean; -} +}; diff --git a/src/types/ModAdd.ts b/src/types/ModAdd.ts index 82cec4b..2ea811f 100644 --- a/src/types/ModAdd.ts +++ b/src/types/ModAdd.ts @@ -1,10 +1,13 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface ModAdd { +/** + * When someone is added as a site moderator. + */ +export type ModAdd = { id: number; mod_person_id: PersonId; other_person_id: PersonId; removed: boolean; when_: string; -} +}; diff --git a/src/types/ModAddCommunity.ts b/src/types/ModAddCommunity.ts index f914d89..2399512 100644 --- a/src/types/ModAddCommunity.ts +++ b/src/types/ModAddCommunity.ts @@ -2,11 +2,14 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -export interface ModAddCommunity { +/** + * When someone is added as a community moderator. + */ +export type ModAddCommunity = { id: number; mod_person_id: PersonId; other_person_id: PersonId; community_id: CommunityId; removed: boolean; when_: string; -} +}; diff --git a/src/types/ModAddCommunityView.ts b/src/types/ModAddCommunityView.ts index c8906b4..7d2860a 100644 --- a/src/types/ModAddCommunityView.ts +++ b/src/types/ModAddCommunityView.ts @@ -3,9 +3,12 @@ import type { Community } from "./Community"; import type { ModAddCommunity } from "./ModAddCommunity"; import type { Person } from "./Person"; -export interface ModAddCommunityView { +/** + * When someone is added as a community moderator. + */ +export type ModAddCommunityView = { mod_add_community: ModAddCommunity; moderator?: Person; community: Community; modded_person: Person; -} +}; diff --git a/src/types/ModAddView.ts b/src/types/ModAddView.ts index 5440c44..83253f6 100644 --- a/src/types/ModAddView.ts +++ b/src/types/ModAddView.ts @@ -2,8 +2,11 @@ import type { ModAdd } from "./ModAdd"; import type { Person } from "./Person"; -export interface ModAddView { +/** + * When someone is added as a site moderator. + */ +export type ModAddView = { mod_add: ModAdd; moderator?: Person; modded_person: Person; -} +}; diff --git a/src/types/ModBan.ts b/src/types/ModBan.ts index 3559595..ffc8918 100644 --- a/src/types/ModBan.ts +++ b/src/types/ModBan.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface ModBan { +/** + * When someone is banned from the site. + */ +export type ModBan = { id: number; mod_person_id: PersonId; other_person_id: PersonId; @@ -9,4 +12,4 @@ export interface ModBan { banned: boolean; expires?: string; when_: string; -} +}; diff --git a/src/types/ModBanFromCommunity.ts b/src/types/ModBanFromCommunity.ts index 068dd4c..64d7174 100644 --- a/src/types/ModBanFromCommunity.ts +++ b/src/types/ModBanFromCommunity.ts @@ -2,7 +2,10 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -export interface ModBanFromCommunity { +/** + * When someone is banned from a community. + */ +export type ModBanFromCommunity = { id: number; mod_person_id: PersonId; other_person_id: PersonId; @@ -11,4 +14,4 @@ export interface ModBanFromCommunity { banned: boolean; expires?: string; when_: string; -} +}; diff --git a/src/types/ModBanFromCommunityView.ts b/src/types/ModBanFromCommunityView.ts index d148ba4..d63784c 100644 --- a/src/types/ModBanFromCommunityView.ts +++ b/src/types/ModBanFromCommunityView.ts @@ -3,9 +3,12 @@ import type { Community } from "./Community"; import type { ModBanFromCommunity } from "./ModBanFromCommunity"; import type { Person } from "./Person"; -export interface ModBanFromCommunityView { +/** + * When someone is banned from a community. + */ +export type ModBanFromCommunityView = { mod_ban_from_community: ModBanFromCommunity; moderator?: Person; community: Community; banned_person: Person; -} +}; diff --git a/src/types/ModBanView.ts b/src/types/ModBanView.ts index 4230448..ddacb59 100644 --- a/src/types/ModBanView.ts +++ b/src/types/ModBanView.ts @@ -2,8 +2,11 @@ import type { ModBan } from "./ModBan"; import type { Person } from "./Person"; -export interface ModBanView { +/** + * When someone is banned from the site. + */ +export type ModBanView = { mod_ban: ModBan; moderator?: Person; banned_person: Person; -} +}; diff --git a/src/types/ModFeaturePost.ts b/src/types/ModFeaturePost.ts index a616f18..65f278e 100644 --- a/src/types/ModFeaturePost.ts +++ b/src/types/ModFeaturePost.ts @@ -2,11 +2,14 @@ import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; -export interface ModFeaturePost { +/** + * When a moderator features a post on a community (pins it to the top). + */ +export type ModFeaturePost = { id: number; mod_person_id: PersonId; post_id: PostId; featured: boolean; when_: string; is_featured_community: boolean; -} +}; diff --git a/src/types/ModFeaturePostView.ts b/src/types/ModFeaturePostView.ts index b10f04a..e8b5078 100644 --- a/src/types/ModFeaturePostView.ts +++ b/src/types/ModFeaturePostView.ts @@ -4,9 +4,12 @@ import type { ModFeaturePost } from "./ModFeaturePost"; import type { Person } from "./Person"; import type { Post } from "./Post"; -export interface ModFeaturePostView { +/** + * When a moderator features a post on a community (pins it to the top). + */ +export type ModFeaturePostView = { mod_feature_post: ModFeaturePost; moderator?: Person; post: Post; community: Community; -} +}; diff --git a/src/types/ModHideCommunity.ts b/src/types/ModHideCommunity.ts index 7642fc8..b361cfc 100644 --- a/src/types/ModHideCommunity.ts +++ b/src/types/ModHideCommunity.ts @@ -2,11 +2,14 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -export interface ModHideCommunity { +/** + * When a community is hidden from public view. + */ +export type ModHideCommunity = { id: number; community_id: CommunityId; mod_person_id: PersonId; when_: string; reason?: string; hidden: boolean; -} +}; diff --git a/src/types/ModHideCommunityView.ts b/src/types/ModHideCommunityView.ts index b158979..e92321b 100644 --- a/src/types/ModHideCommunityView.ts +++ b/src/types/ModHideCommunityView.ts @@ -3,8 +3,11 @@ import type { Community } from "./Community"; import type { ModHideCommunity } from "./ModHideCommunity"; import type { Person } from "./Person"; -export interface ModHideCommunityView { +/** + * When a community is hidden from public view. + */ +export type ModHideCommunityView = { mod_hide_community: ModHideCommunity; admin?: Person; community: Community; -} +}; diff --git a/src/types/ModLockPost.ts b/src/types/ModLockPost.ts index eb83934..32396bc 100644 --- a/src/types/ModLockPost.ts +++ b/src/types/ModLockPost.ts @@ -2,10 +2,13 @@ import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; -export interface ModLockPost { +/** + * When a moderator locks a post (prevents new comments being made). + */ +export type ModLockPost = { id: number; mod_person_id: PersonId; post_id: PostId; locked: boolean; when_: string; -} +}; diff --git a/src/types/ModLockPostView.ts b/src/types/ModLockPostView.ts index 09ac24c..f44bc78 100644 --- a/src/types/ModLockPostView.ts +++ b/src/types/ModLockPostView.ts @@ -4,9 +4,12 @@ import type { ModLockPost } from "./ModLockPost"; import type { Person } from "./Person"; import type { Post } from "./Post"; -export interface ModLockPostView { +/** + * When a moderator locks a post (prevents new comments being made). + */ +export type ModLockPostView = { mod_lock_post: ModLockPost; moderator?: Person; post: Post; community: Community; -} +}; diff --git a/src/types/ModRemoveComment.ts b/src/types/ModRemoveComment.ts index 38d4e87..749b134 100644 --- a/src/types/ModRemoveComment.ts +++ b/src/types/ModRemoveComment.ts @@ -2,11 +2,14 @@ import type { CommentId } from "./CommentId"; import type { PersonId } from "./PersonId"; -export interface ModRemoveComment { +/** + * When a moderator removes a comment. + */ +export type ModRemoveComment = { id: number; mod_person_id: PersonId; comment_id: CommentId; reason?: string; removed: boolean; when_: string; -} +}; diff --git a/src/types/ModRemoveCommentView.ts b/src/types/ModRemoveCommentView.ts index 4e7955c..59a365e 100644 --- a/src/types/ModRemoveCommentView.ts +++ b/src/types/ModRemoveCommentView.ts @@ -5,11 +5,14 @@ import type { ModRemoveComment } from "./ModRemoveComment"; import type { Person } from "./Person"; import type { Post } from "./Post"; -export interface ModRemoveCommentView { +/** + * When a moderator removes a comment. + */ +export type ModRemoveCommentView = { mod_remove_comment: ModRemoveComment; moderator?: Person; comment: Comment; commenter: Person; post: Post; community: Community; -} +}; diff --git a/src/types/ModRemoveCommunity.ts b/src/types/ModRemoveCommunity.ts index 079fab1..bd8358e 100644 --- a/src/types/ModRemoveCommunity.ts +++ b/src/types/ModRemoveCommunity.ts @@ -2,11 +2,14 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -export interface ModRemoveCommunity { +/** + * When a moderator removes a community. + */ +export type ModRemoveCommunity = { id: number; mod_person_id: PersonId; community_id: CommunityId; reason?: string; removed: boolean; when_: string; -} +}; diff --git a/src/types/ModRemoveCommunityView.ts b/src/types/ModRemoveCommunityView.ts index 8219b29..5350d3e 100644 --- a/src/types/ModRemoveCommunityView.ts +++ b/src/types/ModRemoveCommunityView.ts @@ -3,8 +3,11 @@ import type { Community } from "./Community"; import type { ModRemoveCommunity } from "./ModRemoveCommunity"; import type { Person } from "./Person"; -export interface ModRemoveCommunityView { +/** + * When a moderator removes a community. + */ +export type ModRemoveCommunityView = { mod_remove_community: ModRemoveCommunity; moderator?: Person; community: Community; -} +}; diff --git a/src/types/ModRemovePost.ts b/src/types/ModRemovePost.ts index 3ec6080..7adaa6b 100644 --- a/src/types/ModRemovePost.ts +++ b/src/types/ModRemovePost.ts @@ -2,11 +2,14 @@ import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; -export interface ModRemovePost { +/** + * When a moderator removes a post. + */ +export type ModRemovePost = { id: number; mod_person_id: PersonId; post_id: PostId; reason?: string; removed: boolean; when_: string; -} +}; diff --git a/src/types/ModRemovePostView.ts b/src/types/ModRemovePostView.ts index 3c4cb12..128566c 100644 --- a/src/types/ModRemovePostView.ts +++ b/src/types/ModRemovePostView.ts @@ -4,9 +4,12 @@ import type { ModRemovePost } from "./ModRemovePost"; import type { Person } from "./Person"; import type { Post } from "./Post"; -export interface ModRemovePostView { +/** + * When a moderator removes a post. + */ +export type ModRemovePostView = { mod_remove_post: ModRemovePost; moderator?: Person; post: Post; community: Community; -} +}; diff --git a/src/types/ModTransferCommunity.ts b/src/types/ModTransferCommunity.ts index 435236c..78b9887 100644 --- a/src/types/ModTransferCommunity.ts +++ b/src/types/ModTransferCommunity.ts @@ -2,10 +2,13 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -export interface ModTransferCommunity { +/** + * When a moderator transfers a community to a new owner. + */ +export type ModTransferCommunity = { id: number; mod_person_id: PersonId; other_person_id: PersonId; community_id: CommunityId; when_: string; -} +}; diff --git a/src/types/ModTransferCommunityView.ts b/src/types/ModTransferCommunityView.ts index abc472f..2be8158 100644 --- a/src/types/ModTransferCommunityView.ts +++ b/src/types/ModTransferCommunityView.ts @@ -3,9 +3,12 @@ import type { Community } from "./Community"; import type { ModTransferCommunity } from "./ModTransferCommunity"; import type { Person } from "./Person"; -export interface ModTransferCommunityView { +/** + * When a moderator transfers a community to a new owner. + */ +export type ModTransferCommunityView = { mod_transfer_community: ModTransferCommunity; moderator?: Person; community: Community; modded_person: Person; -} +}; diff --git a/src/types/ModlogActionType.ts b/src/types/ModlogActionType.ts index 4742a6c..438c7ca 100644 --- a/src/types/ModlogActionType.ts +++ b/src/types/ModlogActionType.ts @@ -1,5 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * A list of possible types for the various modlog actions. + */ export type ModlogActionType = | "All" | "ModRemovePost" diff --git a/src/types/ModlogListParams.ts b/src/types/ModlogListParams.ts index 8f33b4e..23b2832 100644 --- a/src/types/ModlogListParams.ts +++ b/src/types/ModlogListParams.ts @@ -4,7 +4,10 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; -export interface ModlogListParams { +/** + * Querying / filtering the modlog. + */ +export type ModlogListParams = { community_id?: CommunityId; mod_person_id?: PersonId; other_person_id?: PersonId; @@ -13,4 +16,4 @@ export interface ModlogListParams { page?: number; limit?: number; hide_modlog_names: boolean; -} +}; diff --git a/src/types/MyUserInfo.ts b/src/types/MyUserInfo.ts index 70ec784..3089a4d 100644 --- a/src/types/MyUserInfo.ts +++ b/src/types/MyUserInfo.ts @@ -7,7 +7,10 @@ import type { LanguageId } from "./LanguageId"; import type { LocalUserView } from "./LocalUserView"; import type { Person } from "./Person"; -export interface MyUserInfo { +/** + * Your user info. + */ +export type MyUserInfo = { local_user_view: LocalUserView; follows: Array; moderates: Array; @@ -15,4 +18,4 @@ export interface MyUserInfo { instance_blocks: Array; person_blocks: Array; discussion_languages: Array; -} +}; diff --git a/src/types/OAuthAccount.ts b/src/types/OAuthAccount.ts index 7d0c418..ca3e5a0 100644 --- a/src/types/OAuthAccount.ts +++ b/src/types/OAuthAccount.ts @@ -2,10 +2,13 @@ import type { LocalUserId } from "./LocalUserId"; import type { OAuthProviderId } from "./OAuthProviderId"; -export interface OAuthAccount { +/** + * An auth account method. + */ +export type OAuthAccount = { local_user_id: LocalUserId; oauth_provider_id: OAuthProviderId; oauth_user_id: string; published: string; updated?: string; -} +}; diff --git a/src/types/OAuthProvider.ts b/src/types/OAuthProvider.ts index ffcfa03..fb9cc3b 100644 --- a/src/types/OAuthProvider.ts +++ b/src/types/OAuthProvider.ts @@ -1,19 +1,61 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { OAuthProviderId } from "./OAuthProviderId"; -export interface OAuthProvider { +/** + * oauth provider with client_secret - should never be sent to the client + */ +export type OAuthProvider = { id: OAuthProviderId; + /** + * The OAuth 2.0 provider name displayed to the user on the Login page + */ display_name: string; + /** + * The issuer url of the OAUTH provider. + */ issuer: string; + /** + * The authorization endpoint is used to interact with the resource owner and obtain an + * authorization grant. This is usually provided by the OAUTH provider. + */ authorization_endpoint: string; + /** + * The token endpoint is used by the client to obtain an access token by presenting its + * authorization grant or refresh token. This is usually provided by the OAUTH provider. + */ token_endpoint: string; + /** + * The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the + * authenticated End-User. This is defined in the OIDC specification. + */ userinfo_endpoint: string; + /** + * The OAuth 2.0 claim containing the unique user ID returned by the provider. Usually this + * should be set to "sub". + */ id_claim: string; + /** + * The client_id is provided by the OAuth 2.0 provider and is a unique identifier to this + * service + */ client_id: string; + /** + * Lists the scopes requested from users. Users will have to grant access to the requested scope + * at sign up. + */ scopes: string; + /** + * Automatically sets email as verified on registration + */ auto_verify_email: boolean; + /** + * Allows linking an OAUTH account to an existing user account by matching emails + */ account_linking_enabled: boolean; + /** + * switch to enable or disable an oauth provider + */ enabled: boolean; published: string; updated?: string; -} +}; diff --git a/src/types/OAuthProviderId.ts b/src/types/OAuthProviderId.ts index a688d40..dbfb3ba 100644 --- a/src/types/OAuthProviderId.ts +++ b/src/types/OAuthProviderId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The oauth provider id. + */ export type OAuthProviderId = number; diff --git a/src/types/OpenGraphData.ts b/src/types/OpenGraphData.ts index 2b85655..52e685b 100644 --- a/src/types/OpenGraphData.ts +++ b/src/types/OpenGraphData.ts @@ -1,8 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DbUrl } from "./DbUrl"; -export interface OpenGraphData { +/** + * Site metadata, from its opengraph tags. + */ +export type OpenGraphData = { title?: string; description?: string; - image?: string; - embed_video_url?: string; -} + image?: DbUrl; + embed_video_url?: DbUrl; +}; diff --git a/src/types/PaginationCursor.ts b/src/types/PaginationCursor.ts index 790f62c..0f19b98 100644 --- a/src/types/PaginationCursor.ts +++ b/src/types/PaginationCursor.ts @@ -1,3 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * currently this is just a wrapper around post id, but should be seen as opaque from the client's + * perspective. stringified since we might want to use arbitrary info later, with a P prepended to + * prevent ossification (api users love to make assumptions (e.g. parse stuff that looks like + * numbers as numbers) about apis that aren't part of the spec + */ export type PaginationCursor = string; diff --git a/src/types/PasswordChangeAfterReset.ts b/src/types/PasswordChangeAfterReset.ts index b7e05c9..c7af9eb 100644 --- a/src/types/PasswordChangeAfterReset.ts +++ b/src/types/PasswordChangeAfterReset.ts @@ -1,7 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SensitiveString } from "./SensitiveString"; -export interface PasswordChangeAfterReset { - token: string; - password: string; - password_verify: string; -} +/** + * Change your password after receiving a reset request. + */ +export type PasswordChangeAfterReset = { + token: SensitiveString; + password: SensitiveString; + password_verify: SensitiveString; +}; diff --git a/src/types/PasswordReset.ts b/src/types/PasswordReset.ts index 15261f5..1bc04b4 100644 --- a/src/types/PasswordReset.ts +++ b/src/types/PasswordReset.ts @@ -1,5 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SensitiveString } from "./SensitiveString"; -export interface PasswordReset { - email: string; -} +/** + * Reset your password via email. + */ +export type PasswordReset = { email: SensitiveString }; diff --git a/src/types/Person.ts b/src/types/Person.ts index 6fee0e2..44a8f58 100644 --- a/src/types/Person.ts +++ b/src/types/Person.ts @@ -1,22 +1,59 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DbUrl } from "./DbUrl"; import type { InstanceId } from "./InstanceId"; import type { PersonId } from "./PersonId"; -export interface Person { +/** + * A person. + */ +export type Person = { id: PersonId; name: string; + /** + * A shorter display name. + */ display_name?: string; - avatar?: string; + /** + * A URL for an avatar. + */ + avatar?: DbUrl; + /** + * Whether the person is banned. + */ banned: boolean; published: string; updated?: string; - actor_id: string; + /** + * The federated actor_id. + */ + actor_id: DbUrl; + /** + * An optional bio, in markdown. + */ bio?: string; + /** + * Whether the person is local to our site. + */ local: boolean; - banner?: string; + /** + * A URL for a banner. + */ + banner?: DbUrl; + /** + * Whether the person is deleted. + */ deleted: boolean; + /** + * A matrix id, usually given an @person:matrix.org + */ matrix_user_id?: string; + /** + * Whether the person is a bot account. + */ bot_account: boolean; + /** + * When their ban, if it exists, expires, if at all. + */ ban_expires?: string; instance_id: InstanceId; -} +}; diff --git a/src/types/PersonAggregates.ts b/src/types/PersonAggregates.ts index 06367f7..99fed03 100644 --- a/src/types/PersonAggregates.ts +++ b/src/types/PersonAggregates.ts @@ -1,8 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface PersonAggregates { +/** + * Aggregate data for a person. + */ +export type PersonAggregates = { person_id: PersonId; post_count: number; comment_count: number; -} +}; diff --git a/src/types/PersonId.ts b/src/types/PersonId.ts index b3fe2a6..0760a26 100644 --- a/src/types/PersonId.ts +++ b/src/types/PersonId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The person id. + */ export type PersonId = number; diff --git a/src/types/PersonMention.ts b/src/types/PersonMention.ts index c8841e5..7c9e9c6 100644 --- a/src/types/PersonMention.ts +++ b/src/types/PersonMention.ts @@ -3,10 +3,13 @@ import type { CommentId } from "./CommentId"; import type { PersonId } from "./PersonId"; import type { PersonMentionId } from "./PersonMentionId"; -export interface PersonMention { +/** + * A person mention. + */ +export type PersonMention = { id: PersonMentionId; recipient_id: PersonId; comment_id: CommentId; read: boolean; published: string; -} +}; diff --git a/src/types/PersonMentionId.ts b/src/types/PersonMentionId.ts index 56fe942..4341f87 100644 --- a/src/types/PersonMentionId.ts +++ b/src/types/PersonMentionId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The person mention id. + */ export type PersonMentionId = number; diff --git a/src/types/PersonMentionResponse.ts b/src/types/PersonMentionResponse.ts index ea6ba7f..f097510 100644 --- a/src/types/PersonMentionResponse.ts +++ b/src/types/PersonMentionResponse.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonMentionView } from "./PersonMentionView"; -export interface PersonMentionResponse { - person_mention_view: PersonMentionView; -} +/** + * The response for a person mention action. + */ +export type PersonMentionResponse = { person_mention_view: PersonMentionView }; diff --git a/src/types/PersonMentionView.ts b/src/types/PersonMentionView.ts index ecd7877..83df6ae 100644 --- a/src/types/PersonMentionView.ts +++ b/src/types/PersonMentionView.ts @@ -7,7 +7,10 @@ import type { PersonMention } from "./PersonMention"; import type { Post } from "./Post"; import type { SubscribedType } from "./SubscribedType"; -export interface PersonMentionView { +/** + * A person mention view. + */ +export type PersonMentionView = { person_mention: PersonMention; comment: Comment; creator: Person; @@ -23,4 +26,4 @@ export interface PersonMentionView { saved: boolean; creator_blocked: boolean; my_vote?: number; -} +}; diff --git a/src/types/PersonView.ts b/src/types/PersonView.ts index 5af23b4..3a71ac6 100644 --- a/src/types/PersonView.ts +++ b/src/types/PersonView.ts @@ -2,8 +2,11 @@ import type { Person } from "./Person"; import type { PersonAggregates } from "./PersonAggregates"; -export interface PersonView { +/** + * A person view. + */ +export type PersonView = { person: Person; counts: PersonAggregates; is_admin: boolean; -} +}; diff --git a/src/types/Post.ts b/src/types/Post.ts index 0a659f6..34e9994 100644 --- a/src/types/Post.ts +++ b/src/types/Post.ts @@ -1,32 +1,84 @@ // 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 { DbUrl } from "./DbUrl"; import type { LanguageId } from "./LanguageId"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; -export interface Post { +/** + * A post. + */ +export type Post = { id: PostId; name: string; - url?: string; + /** + * An optional link / url for the post. + */ + url?: DbUrl; + /** + * An optional post body, in markdown. + */ body?: string; creator_id: PersonId; community_id: CommunityId; + /** + * Whether the post is removed. + */ removed: boolean; + /** + * Whether the post is locked. + */ locked: boolean; published: string; updated?: string; + /** + * Whether the post is deleted. + */ deleted: boolean; + /** + * Whether the post is NSFW. + */ nsfw: boolean; + /** + * A title for the link. + */ embed_title?: string; + /** + * A description for the link. + */ embed_description?: string; - thumbnail_url?: string; - ap_id: string; + /** + * A thumbnail picture url. + */ + thumbnail_url?: DbUrl; + /** + * The federated activity id / ap_id. + */ + ap_id: DbUrl; + /** + * Whether the post is local. + */ local: boolean; - embed_video_url?: string; + /** + * A video url for the link. + */ + embed_video_url?: DbUrl; language_id: LanguageId; + /** + * Whether the post is featured to its community. + */ featured_community: boolean; + /** + * Whether the post is featured to its site. + */ featured_local: boolean; url_content_type?: string; + /** + * An optional alt_text, usable for image posts. + */ alt_text?: string; + /** + * Time at which the post will be published. None means publish immediately. + */ scheduled_publish_time?: string; -} +}; diff --git a/src/types/PostAggregates.ts b/src/types/PostAggregates.ts index 8df3ef6..850d694 100644 --- a/src/types/PostAggregates.ts +++ b/src/types/PostAggregates.ts @@ -1,12 +1,18 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface PostAggregates { +/** + * Aggregate data for a post. + */ +export type PostAggregates = { post_id: PostId; comments: number; score: number; upvotes: number; downvotes: number; published: string; + /** + * The time of the newest comment in the post. + */ newest_comment_time: string; -} +}; diff --git a/src/types/PostFeatureType.ts b/src/types/PostFeatureType.ts index ece2002..da48537 100644 --- a/src/types/PostFeatureType.ts +++ b/src/types/PostFeatureType.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The feature type for a post. + */ export type PostFeatureType = "Local" | "Community"; diff --git a/src/types/PostId.ts b/src/types/PostId.ts index b6ba63f..cb0072c 100644 --- a/src/types/PostId.ts +++ b/src/types/PostId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The post id. + */ export type PostId = number; diff --git a/src/types/PostListingMode.ts b/src/types/PostListingMode.ts index b6afd56..4f2bc5a 100644 --- a/src/types/PostListingMode.ts +++ b/src/types/PostListingMode.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * A post-view mode that changes how multiple post listings look. + */ export type PostListingMode = "List" | "Card" | "SmallCard"; diff --git a/src/types/PostReport.ts b/src/types/PostReport.ts index 7204ec0..6d740b8 100644 --- a/src/types/PostReport.ts +++ b/src/types/PostReport.ts @@ -1,18 +1,31 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DbUrl } from "./DbUrl"; import type { PersonId } from "./PersonId"; import type { PostId } from "./PostId"; import type { PostReportId } from "./PostReportId"; -export interface PostReport { +/** + * A post report. + */ +export type PostReport = { id: PostReportId; creator_id: PersonId; post_id: PostId; + /** + * The original post title. + */ original_post_name: string; - original_post_url?: string; + /** + * The original post url. + */ + original_post_url?: DbUrl; + /** + * The original post body. + */ original_post_body?: string; reason: string; resolved: boolean; resolver_id?: PersonId; published: string; updated?: string; -} +}; diff --git a/src/types/PostReportId.ts b/src/types/PostReportId.ts index e0bafa0..7da86ca 100644 --- a/src/types/PostReportId.ts +++ b/src/types/PostReportId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The post report id. + */ export type PostReportId = number; diff --git a/src/types/PostReportResponse.ts b/src/types/PostReportResponse.ts index 538d8c4..9b783f6 100644 --- a/src/types/PostReportResponse.ts +++ b/src/types/PostReportResponse.ts @@ -1,6 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostReportView } from "./PostReportView"; -export interface PostReportResponse { - post_report_view: PostReportView; -} +/** + * The post report response. + */ +export type PostReportResponse = { post_report_view: PostReportView }; diff --git a/src/types/PostReportView.ts b/src/types/PostReportView.ts index 92b224d..028156b 100644 --- a/src/types/PostReportView.ts +++ b/src/types/PostReportView.ts @@ -6,7 +6,10 @@ import type { PostAggregates } from "./PostAggregates"; import type { PostReport } from "./PostReport"; import type { SubscribedType } from "./SubscribedType"; -export interface PostReportView { +/** + * A post report view. + */ +export type PostReportView = { post_report: PostReport; post: Post; community: Community; @@ -24,4 +27,4 @@ export interface PostReportView { unread_comments: number; counts: PostAggregates; resolver?: Person; -} +}; diff --git a/src/types/PostResponse.ts b/src/types/PostResponse.ts index 01a9490..ab01d9d 100644 --- a/src/types/PostResponse.ts +++ b/src/types/PostResponse.ts @@ -1,6 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostView } from "./PostView"; -export interface PostResponse { - post_view: PostView; -} +export type PostResponse = { post_view: PostView }; diff --git a/src/types/PostSortType.ts b/src/types/PostSortType.ts index 9ae6afb..7b874e2 100644 --- a/src/types/PostSortType.ts +++ b/src/types/PostSortType.ts @@ -1,5 +1,8 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The post sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html + */ export type PostSortType = | "Active" | "Hot" diff --git a/src/types/PostView.ts b/src/types/PostView.ts index c66de23..cd8a908 100644 --- a/src/types/PostView.ts +++ b/src/types/PostView.ts @@ -6,7 +6,10 @@ import type { Post } from "./Post"; import type { PostAggregates } from "./PostAggregates"; import type { SubscribedType } from "./SubscribedType"; -export interface PostView { +/** + * A post view. + */ +export type PostView = { post: Post; creator: Person; community: Community; @@ -23,4 +26,4 @@ export interface PostView { creator_blocked: boolean; my_vote?: number; unread_comments: number; -} +}; diff --git a/src/types/PrivateMessage.ts b/src/types/PrivateMessage.ts index 5164afc..d9ae16b 100644 --- a/src/types/PrivateMessage.ts +++ b/src/types/PrivateMessage.ts @@ -1,8 +1,12 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DbUrl } from "./DbUrl"; import type { PersonId } from "./PersonId"; import type { PrivateMessageId } from "./PrivateMessageId"; -export interface PrivateMessage { +/** + * A private message. + */ +export type PrivateMessage = { id: PrivateMessageId; creator_id: PersonId; recipient_id: PersonId; @@ -11,6 +15,6 @@ export interface PrivateMessage { read: boolean; published: string; updated?: string; - ap_id: string; + ap_id: DbUrl; local: boolean; -} +}; diff --git a/src/types/PrivateMessageId.ts b/src/types/PrivateMessageId.ts index 92e6f56..b7b8ce2 100644 --- a/src/types/PrivateMessageId.ts +++ b/src/types/PrivateMessageId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The private message id. + */ export type PrivateMessageId = number; diff --git a/src/types/PrivateMessageReport.ts b/src/types/PrivateMessageReport.ts index 50310d0..09722e0 100644 --- a/src/types/PrivateMessageReport.ts +++ b/src/types/PrivateMessageReport.ts @@ -3,14 +3,20 @@ import type { PersonId } from "./PersonId"; import type { PrivateMessageId } from "./PrivateMessageId"; import type { PrivateMessageReportId } from "./PrivateMessageReportId"; -export interface PrivateMessageReport { +/** + * The private message report. + */ +export type PrivateMessageReport = { id: PrivateMessageReportId; creator_id: PersonId; private_message_id: PrivateMessageId; + /** + * The original text. + */ original_pm_text: string; reason: string; resolved: boolean; resolver_id?: PersonId; published: string; updated?: string; -} +}; diff --git a/src/types/PrivateMessageReportId.ts b/src/types/PrivateMessageReportId.ts index e3d441e..970b56b 100644 --- a/src/types/PrivateMessageReportId.ts +++ b/src/types/PrivateMessageReportId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The private message report id. + */ export type PrivateMessageReportId = number; diff --git a/src/types/PrivateMessageReportResponse.ts b/src/types/PrivateMessageReportResponse.ts index 81e1bcc..4f72c7c 100644 --- a/src/types/PrivateMessageReportResponse.ts +++ b/src/types/PrivateMessageReportResponse.ts @@ -1,6 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PrivateMessageReportView } from "./PrivateMessageReportView"; -export interface PrivateMessageReportResponse { +/** + * A private message report response. + */ +export type PrivateMessageReportResponse = { private_message_report_view: PrivateMessageReportView; -} +}; diff --git a/src/types/PrivateMessageReportView.ts b/src/types/PrivateMessageReportView.ts index 8cf01fe..efe7ff6 100644 --- a/src/types/PrivateMessageReportView.ts +++ b/src/types/PrivateMessageReportView.ts @@ -3,10 +3,13 @@ import type { Person } from "./Person"; import type { PrivateMessage } from "./PrivateMessage"; import type { PrivateMessageReport } from "./PrivateMessageReport"; -export interface PrivateMessageReportView { +/** + * A private message report view. + */ +export type PrivateMessageReportView = { private_message_report: PrivateMessageReport; private_message: PrivateMessage; private_message_creator: Person; creator: Person; resolver?: Person; -} +}; diff --git a/src/types/PrivateMessageResponse.ts b/src/types/PrivateMessageResponse.ts index 91e4a65..6563657 100644 --- a/src/types/PrivateMessageResponse.ts +++ b/src/types/PrivateMessageResponse.ts @@ -1,6 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PrivateMessageView } from "./PrivateMessageView"; -export interface PrivateMessageResponse { +/** + * A single private message response. + */ +export type PrivateMessageResponse = { private_message_view: PrivateMessageView; -} +}; diff --git a/src/types/PrivateMessageView.ts b/src/types/PrivateMessageView.ts index ff64637..c872599 100644 --- a/src/types/PrivateMessageView.ts +++ b/src/types/PrivateMessageView.ts @@ -2,8 +2,11 @@ import type { Person } from "./Person"; import type { PrivateMessage } from "./PrivateMessage"; -export interface PrivateMessageView { +/** + * A private message view. + */ +export type PrivateMessageView = { private_message: PrivateMessage; creator: Person; recipient: Person; -} +}; diff --git a/src/types/PrivateMessagesResponse.ts b/src/types/PrivateMessagesResponse.ts index 3072373..948e412 100644 --- a/src/types/PrivateMessagesResponse.ts +++ b/src/types/PrivateMessagesResponse.ts @@ -1,6 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PrivateMessageView } from "./PrivateMessageView"; -export interface PrivateMessagesResponse { +/** + * The private messages response. + */ +export type PrivateMessagesResponse = { private_messages: Array; -} +}; diff --git a/src/types/PurgeComment.ts b/src/types/PurgeComment.ts index ca17a59..5e32089 100644 --- a/src/types/PurgeComment.ts +++ b/src/types/PurgeComment.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface PurgeComment { - comment_id: CommentId; - reason?: string; -} +/** + * Purges a comment from the database. This will delete all content attached to that comment. + */ +export type PurgeComment = { comment_id: CommentId; reason?: string }; diff --git a/src/types/PurgeCommunity.ts b/src/types/PurgeCommunity.ts index 3233974..0696f2f 100644 --- a/src/types/PurgeCommunity.ts +++ b/src/types/PurgeCommunity.ts @@ -1,7 +1,7 @@ // 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"; -export interface PurgeCommunity { - community_id: CommunityId; - reason?: string; -} +/** + * Purges a community from the database. This will delete all content attached to that community. + */ +export type PurgeCommunity = { community_id: CommunityId; reason?: string }; diff --git a/src/types/PurgePerson.ts b/src/types/PurgePerson.ts index 9e854c1..c62bda1 100644 --- a/src/types/PurgePerson.ts +++ b/src/types/PurgePerson.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PersonId } from "./PersonId"; -export interface PurgePerson { - person_id: PersonId; - reason?: string; -} +/** + * Purges a person from the database. This will delete all content attached to that person. + */ +export type PurgePerson = { person_id: PersonId; reason?: string }; diff --git a/src/types/PurgePost.ts b/src/types/PurgePost.ts index a8f3733..ecb6a57 100644 --- a/src/types/PurgePost.ts +++ b/src/types/PurgePost.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface PurgePost { - post_id: PostId; - reason?: string; -} +/** + * Purges a post from the database. This will delete all content attached to that post. + */ +export type PurgePost = { post_id: PostId; reason?: string }; diff --git a/src/types/ReadableFederationState.ts b/src/types/ReadableFederationState.ts index f8bd37d..d1f4b37 100644 --- a/src/types/ReadableFederationState.ts +++ b/src/types/ReadableFederationState.ts @@ -2,11 +2,23 @@ import type { ActivityId } from "./ActivityId"; import type { InstanceId } from "./InstanceId"; -export interface ReadableFederationState { +export type ReadableFederationState = { + /** + * timestamp of the next retry attempt (null if fail count is 0) + */ + next_retry?: string; instance_id: InstanceId; + /** + * the last successfully sent activity id + */ last_successful_id?: ActivityId; last_successful_published_time?: string; + /** + * how many failed attempts have been made to send the next activity + */ fail_count: number; + /** + * timestamp of the last retry attempt (when the last failing activity was resent) + */ last_retry?: string; - next_retry?: string; -} +}; diff --git a/src/types/Register.ts b/src/types/Register.ts index eeba623..5f51eb7 100644 --- a/src/types/Register.ts +++ b/src/types/Register.ts @@ -1,13 +1,32 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SensitiveString } from "./SensitiveString"; -export interface Register { +/** + * Register / Sign up to lemmy. + */ +export type Register = { username: string; - password: string; - password_verify: string; + password: SensitiveString; + password_verify: SensitiveString; show_nsfw?: boolean; - email?: string; + /** + * email is mandatory if email verification is enabled on the server + */ + email?: SensitiveString; + /** + * The UUID of the captcha item. + */ captcha_uuid?: string; + /** + * Your captcha answer. + */ captcha_answer?: string; + /** + * A form field to trick signup bots. Should be None. + */ honeypot?: string; + /** + * An answer is mandatory if require application is enabled on the server + */ answer?: string; -} +}; diff --git a/src/types/RegistrationApplication.ts b/src/types/RegistrationApplication.ts index 12ce2f2..9a8cfa5 100644 --- a/src/types/RegistrationApplication.ts +++ b/src/types/RegistrationApplication.ts @@ -3,11 +3,14 @@ import type { LocalUserId } from "./LocalUserId"; import type { PersonId } from "./PersonId"; import type { RegistrationApplicationId } from "./RegistrationApplicationId"; -export interface RegistrationApplication { +/** + * A registration application. + */ +export type RegistrationApplication = { id: RegistrationApplicationId; local_user_id: LocalUserId; answer: string; admin_id?: PersonId; deny_reason?: string; published: string; -} +}; diff --git a/src/types/RegistrationApplicationId.ts b/src/types/RegistrationApplicationId.ts index 3734700..1ed9075 100644 --- a/src/types/RegistrationApplicationId.ts +++ b/src/types/RegistrationApplicationId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The registration application id. + */ export type RegistrationApplicationId = number; diff --git a/src/types/RegistrationApplicationResponse.ts b/src/types/RegistrationApplicationResponse.ts index d6c5592..756f92e 100644 --- a/src/types/RegistrationApplicationResponse.ts +++ b/src/types/RegistrationApplicationResponse.ts @@ -1,6 +1,9 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { RegistrationApplicationView } from "./RegistrationApplicationView"; -export interface RegistrationApplicationResponse { +/** + * The response of an action done to a registration application. + */ +export type RegistrationApplicationResponse = { registration_application: RegistrationApplicationView; -} +}; diff --git a/src/types/RegistrationApplicationView.ts b/src/types/RegistrationApplicationView.ts index c267204..15c91dd 100644 --- a/src/types/RegistrationApplicationView.ts +++ b/src/types/RegistrationApplicationView.ts @@ -3,9 +3,12 @@ import type { LocalUser } from "./LocalUser"; import type { Person } from "./Person"; import type { RegistrationApplication } from "./RegistrationApplication"; -export interface RegistrationApplicationView { +/** + * A registration application view. + */ +export type RegistrationApplicationView = { registration_application: RegistrationApplication; creator_local_user: LocalUser; creator: Person; admin?: Person; -} +}; diff --git a/src/types/RegistrationMode.ts b/src/types/RegistrationMode.ts index a5cf75b..1186034 100644 --- a/src/types/RegistrationMode.ts +++ b/src/types/RegistrationMode.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The registration mode for your site. Determines what happens after a user signs up. + */ export type RegistrationMode = "Closed" | "RequireApplication" | "Open"; diff --git a/src/types/RemoveComment.ts b/src/types/RemoveComment.ts index 6869ac6..12c241d 100644 --- a/src/types/RemoveComment.ts +++ b/src/types/RemoveComment.ts @@ -1,8 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface RemoveComment { +/** + * Remove a comment (only doable by mods). + */ +export type RemoveComment = { comment_id: CommentId; removed: boolean; reason?: string; -} +}; diff --git a/src/types/RemoveCommunity.ts b/src/types/RemoveCommunity.ts index 4a1b873..d73dcbb 100644 --- a/src/types/RemoveCommunity.ts +++ b/src/types/RemoveCommunity.ts @@ -1,8 +1,11 @@ // 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"; -export interface RemoveCommunity { +/** + * Remove a community (only doable by moderators). + */ +export type RemoveCommunity = { community_id: CommunityId; removed: boolean; reason?: string; -} +}; diff --git a/src/types/RemovePost.ts b/src/types/RemovePost.ts index 9fef68e..fb20f20 100644 --- a/src/types/RemovePost.ts +++ b/src/types/RemovePost.ts @@ -1,8 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface RemovePost { - post_id: PostId; - removed: boolean; - reason?: string; -} +/** + * Remove a post (only doable by mods). + */ +export type RemovePost = { post_id: PostId; removed: boolean; reason?: string }; diff --git a/src/types/ResolveCommentReport.ts b/src/types/ResolveCommentReport.ts index 0af9bb4..5b343b5 100644 --- a/src/types/ResolveCommentReport.ts +++ b/src/types/ResolveCommentReport.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentReportId } from "./CommentReportId"; -export interface ResolveCommentReport { +/** + * Resolve a comment report (only doable by mods). + */ +export type ResolveCommentReport = { report_id: CommentReportId; resolved: boolean; -} +}; diff --git a/src/types/ResolveObject.ts b/src/types/ResolveObject.ts index 99c3ffc..110ae88 100644 --- a/src/types/ResolveObject.ts +++ b/src/types/ResolveObject.ts @@ -1,5 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface ResolveObject { +/** + * Does an apub fetch for an object. + */ +export type ResolveObject = { + /** + * Can be the full url, or a shortened version like: !fediverse@lemmy.ml + */ q: string; -} +}; diff --git a/src/types/ResolveObjectResponse.ts b/src/types/ResolveObjectResponse.ts index e7b07cc..9a58ab8 100644 --- a/src/types/ResolveObjectResponse.ts +++ b/src/types/ResolveObjectResponse.ts @@ -4,9 +4,12 @@ import type { CommunityView } from "./CommunityView"; import type { PersonView } from "./PersonView"; import type { PostView } from "./PostView"; -export interface ResolveObjectResponse { +/** + * The response of an apub object fetch. + */ +export type ResolveObjectResponse = { comment?: CommentView; post?: PostView; community?: CommunityView; person?: PersonView; -} +}; diff --git a/src/types/ResolvePostReport.ts b/src/types/ResolvePostReport.ts index 20f5016..59f2607 100644 --- a/src/types/ResolvePostReport.ts +++ b/src/types/ResolvePostReport.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostReportId } from "./PostReportId"; -export interface ResolvePostReport { - report_id: PostReportId; - resolved: boolean; -} +/** + * Resolve a post report (mods only). + */ +export type ResolvePostReport = { report_id: PostReportId; resolved: boolean }; diff --git a/src/types/ResolvePrivateMessageReport.ts b/src/types/ResolvePrivateMessageReport.ts index e8833c6..fd50757 100644 --- a/src/types/ResolvePrivateMessageReport.ts +++ b/src/types/ResolvePrivateMessageReport.ts @@ -1,7 +1,10 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PrivateMessageReportId } from "./PrivateMessageReportId"; -export interface ResolvePrivateMessageReport { +/** + * Resolve a private message report. + */ +export type ResolvePrivateMessageReport = { report_id: PrivateMessageReportId; resolved: boolean; -} +}; diff --git a/src/types/SaveComment.ts b/src/types/SaveComment.ts index 81232c2..1989a20 100644 --- a/src/types/SaveComment.ts +++ b/src/types/SaveComment.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { CommentId } from "./CommentId"; -export interface SaveComment { - comment_id: CommentId; - save: boolean; -} +/** + * Save / bookmark a comment. + */ +export type SaveComment = { comment_id: CommentId; save: boolean }; diff --git a/src/types/SavePost.ts b/src/types/SavePost.ts index 9c41edb..508fb76 100644 --- a/src/types/SavePost.ts +++ b/src/types/SavePost.ts @@ -1,7 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { PostId } from "./PostId"; -export interface SavePost { - post_id: PostId; - save: boolean; -} +/** + * Save / bookmark a post. + */ +export type SavePost = { post_id: PostId; save: boolean }; diff --git a/src/types/SaveUserSettings.ts b/src/types/SaveUserSettings.ts index 6d95e00..6488384 100644 --- a/src/types/SaveUserSettings.ts +++ b/src/types/SaveUserSettings.ts @@ -4,35 +4,118 @@ import type { LanguageId } from "./LanguageId"; import type { ListingType } from "./ListingType"; import type { PostListingMode } from "./PostListingMode"; import type { PostSortType } from "./PostSortType"; +import type { SensitiveString } from "./SensitiveString"; -export interface SaveUserSettings { +/** + * Saves settings for your user. + */ +export type SaveUserSettings = { + /** + * Show nsfw posts. + */ show_nsfw?: boolean; + /** + * Blur nsfw posts. + */ blur_nsfw?: boolean; + /** + * Your user's theme. + */ theme?: string; + /** + * The default post listing type, usually "local" + */ default_listing_type?: ListingType; + /** + * A post-view mode that changes how multiple post listings look. + */ post_listing_mode?: PostListingMode; + /** + * The default post sort, usually "active" + */ default_post_sort_type?: PostSortType; + /** + * The default comment sort, usually "hot" + */ default_comment_sort_type?: CommentSortType; + /** + * The language of the lemmy interface + */ interface_language?: string; + /** + * A URL for your avatar. + */ avatar?: string; + /** + * A URL for your banner. + */ banner?: string; + /** + * Your display name, which can contain strange characters, and does not need to be unique. + */ display_name?: string; - email?: string; + /** + * Your email. + */ + email?: SensitiveString; + /** + * Your bio / info, in markdown. + */ bio?: string; + /** + * Your matrix user id. Ex: @my_user:matrix.org + */ matrix_user_id?: string; + /** + * Whether to show or hide avatars. + */ show_avatars?: boolean; + /** + * Sends notifications to your email. + */ send_notifications_to_email?: boolean; + /** + * Whether this account is a bot account. Users can hide these accounts easily if they wish. + */ bot_account?: boolean; + /** + * Whether to show bot accounts. + */ show_bot_accounts?: boolean; + /** + * Whether to show read posts. + */ show_read_posts?: boolean; + /** + * A list of languages you are able to see discussion in. + */ discussion_languages?: Array; + /** + * Open links in a new tab + */ open_links_in_new_tab?: boolean; + /** + * Enable infinite scroll + */ infinite_scroll_enabled?: boolean; + /** + * Whether to allow keyboard navigation (for browsing and interacting with posts and comments). + */ enable_keyboard_navigation?: boolean; + /** + * Whether user avatars or inline images in the UI that are gifs should be allowed to play or + * should be paused + */ enable_animated_images?: boolean; + /** + * Whether to auto-collapse bot comments. + */ collapse_bot_comments?: boolean; + /** + * Some vote display mode settings + */ show_scores?: boolean; show_upvotes?: boolean; show_downvotes?: boolean; show_upvote_percentage?: boolean; -} +}; diff --git a/src/types/Search.ts b/src/types/Search.ts index c19f30c..203590f 100644 --- a/src/types/Search.ts +++ b/src/types/Search.ts @@ -5,7 +5,10 @@ import type { PersonId } from "./PersonId"; import type { PostSortType } from "./PostSortType"; import type { SearchType } from "./SearchType"; -export interface Search { +/** + * Searches the site, given a query string, and some optional filters. + */ +export type Search = { q: string; community_id?: CommunityId; community_name?: string; @@ -20,4 +23,4 @@ export interface Search { saved_only?: boolean; liked_only?: boolean; disliked_only?: boolean; -} +}; diff --git a/src/types/SearchResponse.ts b/src/types/SearchResponse.ts index 6363109..f1be9fe 100644 --- a/src/types/SearchResponse.ts +++ b/src/types/SearchResponse.ts @@ -5,10 +5,13 @@ import type { PersonView } from "./PersonView"; import type { PostView } from "./PostView"; import type { SearchType } from "./SearchType"; -export interface SearchResponse { +/** + * The search response, containing lists of the return type possibilities + */ +export type SearchResponse = { type_: SearchType; comments: Array; posts: Array; communities: Array; users: Array; -} +}; diff --git a/src/types/SearchType.ts b/src/types/SearchType.ts index a000653..2b10138 100644 --- a/src/types/SearchType.ts +++ b/src/types/SearchType.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The type of content returned from a search. + */ export type SearchType = "All" | "Comments" | "Posts" | "Communities" | "Users"; diff --git a/src/types/SensitiveString.ts b/src/types/SensitiveString.ts new file mode 100644 index 0000000..240d921 --- /dev/null +++ b/src/types/SensitiveString.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 SensitiveString = string; diff --git a/src/types/Site.ts b/src/types/Site.ts index d08bb34..c0b86d7 100644 --- a/src/types/Site.ts +++ b/src/types/Site.ts @@ -1,20 +1,49 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DbUrl } from "./DbUrl"; import type { InstanceId } from "./InstanceId"; import type { SiteId } from "./SiteId"; -export interface Site { +/** + * The site. + */ +export type Site = { id: SiteId; name: string; + /** + * A sidebar for the site in markdown. + */ sidebar?: string; published: string; updated?: string; - icon?: string; - banner?: string; + /** + * An icon URL. + */ + icon?: DbUrl; + /** + * A banner url. + */ + banner?: DbUrl; + /** + * A shorter, one-line description of the site. + */ description?: string; - actor_id: string; + /** + * The federated actor_id. + */ + actor_id: DbUrl; + /** + * The time the site was last refreshed. + */ last_refreshed_at: string; - inbox_url: string; + /** + * The site inbox + */ + inbox_url: DbUrl; public_key: string; instance_id: InstanceId; + /** + * If present, nsfw content is visible by default. Should be displayed by frontends/clients + * when the site is first opened by a user. + */ content_warning?: string; -} +}; diff --git a/src/types/SiteAggregates.ts b/src/types/SiteAggregates.ts index 516b9d5..4e01148 100644 --- a/src/types/SiteAggregates.ts +++ b/src/types/SiteAggregates.ts @@ -1,14 +1,29 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { SiteId } from "./SiteId"; -export interface SiteAggregates { +/** + * Aggregate data for a site. + */ +export type SiteAggregates = { site_id: SiteId; users: number; posts: number; comments: number; communities: number; + /** + * The number of users with any activity in the last day. + */ users_active_day: number; + /** + * The number of users with any activity in the last week. + */ users_active_week: number; + /** + * The number of users with any activity in the last month. + */ users_active_month: number; + /** + * The number of users with any activity in the last half year. + */ users_active_half_year: number; -} +}; diff --git a/src/types/SiteId.ts b/src/types/SiteId.ts index e94e53b..6f2800e 100644 --- a/src/types/SiteId.ts +++ b/src/types/SiteId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The site id. + */ export type SiteId = number; diff --git a/src/types/SiteResponse.ts b/src/types/SiteResponse.ts index e2320be..3f241cb 100644 --- a/src/types/SiteResponse.ts +++ b/src/types/SiteResponse.ts @@ -1,7 +1,13 @@ // 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"; -export interface SiteResponse { +/** + * The response for a site. + */ +export type SiteResponse = { site_view: SiteView; + /** + * deprecated, use field `tagline` or /api/v3/tagline/list + */ taglines: Array; -} +}; diff --git a/src/types/SiteView.ts b/src/types/SiteView.ts index 812cf8d..d16f79f 100644 --- a/src/types/SiteView.ts +++ b/src/types/SiteView.ts @@ -4,9 +4,12 @@ import type { LocalSiteRateLimit } from "./LocalSiteRateLimit"; import type { Site } from "./Site"; import type { SiteAggregates } from "./SiteAggregates"; -export interface SiteView { +/** + * A site view. + */ +export type SiteView = { site: Site; local_site: LocalSite; local_site_rate_limit: LocalSiteRateLimit; counts: SiteAggregates; -} +}; diff --git a/src/types/SubscribedType.ts b/src/types/SubscribedType.ts index 285eea2..aa40dd8 100644 --- a/src/types/SubscribedType.ts +++ b/src/types/SubscribedType.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * A type / status for a community subscribe. + */ export type SubscribedType = "Subscribed" | "NotSubscribed" | "Pending"; diff --git a/src/types/SuccessResponse.ts b/src/types/SuccessResponse.ts index 7e6bd26..a52239f 100644 --- a/src/types/SuccessResponse.ts +++ b/src/types/SuccessResponse.ts @@ -1,5 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface SuccessResponse { - success: boolean; -} +/** + * Saves settings for your user. + */ +export type SuccessResponse = { success: boolean }; diff --git a/src/types/Tagline.ts b/src/types/Tagline.ts index 508f313..a331423 100644 --- a/src/types/Tagline.ts +++ b/src/types/Tagline.ts @@ -1,8 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface Tagline { +/** + * A tagline, shown at the top of your site. + */ +export type Tagline = { id: number; content: string; published: string; updated?: string; -} +}; diff --git a/src/types/TaglineId.ts b/src/types/TaglineId.ts index fa2615d..ba69f51 100644 --- a/src/types/TaglineId.ts +++ b/src/types/TaglineId.ts @@ -1,3 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +/** + * The tagline id. + */ export type TaglineId = number; diff --git a/src/types/TaglineResponse.ts b/src/types/TaglineResponse.ts index bfbfef0..668d6fa 100644 --- a/src/types/TaglineResponse.ts +++ b/src/types/TaglineResponse.ts @@ -1,6 +1,4 @@ // 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; -} +export type TaglineResponse = { tagline: Tagline }; diff --git a/src/types/TransferCommunity.ts b/src/types/TransferCommunity.ts index e60c95d..de55a9d 100644 --- a/src/types/TransferCommunity.ts +++ b/src/types/TransferCommunity.ts @@ -2,7 +2,10 @@ import type { CommunityId } from "./CommunityId"; import type { PersonId } from "./PersonId"; -export interface TransferCommunity { +/** + * Transfer a community to a new owner. + */ +export type TransferCommunity = { community_id: CommunityId; person_id: PersonId; -} +}; diff --git a/src/types/UpdateTagline.ts b/src/types/UpdateTagline.ts index 20309b2..080bfe8 100644 --- a/src/types/UpdateTagline.ts +++ b/src/types/UpdateTagline.ts @@ -1,7 +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; -} +/** + * Update a tagline + */ +export type UpdateTagline = { id: TaglineId; content: string }; diff --git a/src/types/UpdateTotp.ts b/src/types/UpdateTotp.ts index ccdd36a..800c532 100644 --- a/src/types/UpdateTotp.ts +++ b/src/types/UpdateTotp.ts @@ -1,6 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface UpdateTotp { - totp_token: string; - enabled: boolean; -} +export type UpdateTotp = { totp_token: string; enabled: boolean }; diff --git a/src/types/UpdateTotpResponse.ts b/src/types/UpdateTotpResponse.ts index b347849..a2bbae1 100644 --- a/src/types/UpdateTotpResponse.ts +++ b/src/types/UpdateTotpResponse.ts @@ -1,5 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface UpdateTotpResponse { - enabled: boolean; -} +export type UpdateTotpResponse = { enabled: boolean }; diff --git a/src/types/VerifyEmail.ts b/src/types/VerifyEmail.ts index 8528605..8cf4d7c 100644 --- a/src/types/VerifyEmail.ts +++ b/src/types/VerifyEmail.ts @@ -1,5 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export interface VerifyEmail { - token: string; -} +/** + * Verify your email. + */ +export type VerifyEmail = { token: string }; diff --git a/src/types/VoteView.ts b/src/types/VoteView.ts index 22d8ac8..4293357 100644 --- a/src/types/VoteView.ts +++ b/src/types/VoteView.ts @@ -1,8 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Person } from "./Person"; -export interface VoteView { +/** + * A vote view for checking a post or comments votes. + */ +export type VoteView = { creator: Person; creator_banned_from_community: boolean; score: number; -} +};