├── .husky ├── .gitignore └── pre-commit ├── .github └── CODEOWNERS ├── .prettierrc.json ├── pnpm-workspace.yaml ├── .gitignore ├── scripts ├── deploy.sh ├── generate_changelog.sh └── copy_generated_types_from_lemmy.sh ├── src ├── types │ ├── DbUrl.ts │ ├── ActivityId.ts │ ├── ModlogId.ts │ ├── NotificationId.ts │ ├── SensitiveString.ts │ ├── MultiCommunityId.ts │ ├── DeleteImageParams.ts │ ├── PostId.ts │ ├── SiteId.ts │ ├── UpdateTotpResponse.ts │ ├── PersonId.ts │ ├── TagId.ts │ ├── UpdateTotp.ts │ ├── CommentId.ts │ ├── InstanceId.ts │ ├── LanguageId.ts │ ├── TaglineId.ts │ ├── CommunityId.ts │ ├── ImageGetParams.ts │ ├── LocalSiteId.ts │ ├── LocalUserId.ts │ ├── CustomEmojiId.ts │ ├── PostReportId.ts │ ├── UploadImageResponse.ts │ ├── VerifyEmail.ts │ ├── CommentReportId.ts │ ├── CreateTagline.ts │ ├── FederationAllowList.ts │ ├── OAuthProviderId.ts │ ├── PrivateMessageId.ts │ ├── CommunityReportId.ts │ ├── PostResponse.ts │ ├── SearchSortType.ts │ ├── TaglineResponse.ts │ ├── GetSiteMetadata.ts │ ├── PluginMetadata.ts │ ├── PostFeatureType.ts │ ├── PrivateMessageReportId.ts │ ├── FederationMode.ts │ ├── ImageProxyParams.ts │ ├── ListCustomEmojis.ts │ ├── PublicOAuthProvider.ts │ ├── GetFederatedInstancesKind.ts │ ├── RegistrationApplicationId.ts │ ├── SuccessResponse.ts │ ├── CreateMultiCommunity.ts │ ├── LikeType.ts │ ├── ListLoginsResponse.ts │ ├── AdminAllowInstanceParams.ts │ ├── CommunityFollowerState.ts │ ├── FederationBlockList.ts │ ├── DeleteTagline.ts │ ├── PersonContentType.ts │ ├── DeletePost.ts │ ├── GetComment.ts │ ├── GetMultiCommunity.ts │ ├── LocalSiteUrlBlocklist.ts │ ├── SavePost.ts │ ├── DeleteCommunityTag.ts │ ├── HidePost.ts │ ├── PostListingMode.ts │ ├── SiteResponse.ts │ ├── VoteShow.ts │ ├── AddAdmin.ts │ ├── BlockPerson.ts │ ├── GenerateTotpSecretResponse.ts │ ├── Language.ts │ ├── MarkPostAsRead.ts │ ├── MultiCommunityListingType.ts │ ├── UpdateTagline.ts │ ├── CommentResponse.ts │ ├── TagsView.ts │ ├── DeleteCustomEmoji.ts │ ├── SaveComment.ts │ ├── AddAdminResponse.ts │ ├── BlockCommunity.ts │ ├── DeleteComment.ts │ ├── LockPost.ts │ ├── MultiCommunityResponse.ts │ ├── PasswordReset.ts │ ├── MarkManyPostsAsRead.ts │ ├── CreatePrivateMessage.ts │ ├── DeleteCommunity.ts │ ├── DeleteOAuthProvider.ts │ ├── FollowMultiCommunity.ts │ ├── GetSiteMetadataResponse.ts │ ├── PersonResponse.ts │ ├── PostReportResponse.ts │ ├── RegistrationMode.ts │ ├── RemovePost.ts │ ├── GetRandomCommunity.ts │ ├── PostNotificationsMode.ts │ ├── AdminListUsers.ts │ ├── CustomEmojiResponse.ts │ ├── FollowCommunity.ts │ ├── GetRegistrationApplication.ts │ ├── ListPersonRead.ts │ ├── ListTaglines.ts │ ├── ReportType.ts │ ├── ListMedia.ts │ ├── MultiCommunitySortType.ts │ ├── ResolvePostReport.ts │ ├── ImageDetails.ts │ ├── CommentReportResponse.ts │ ├── ListingType.ts │ ├── PurgePost.ts │ ├── ResendVerificationEmail.ts │ ├── CommentSortType.ts │ ├── DeleteAccount.ts │ ├── NotePerson.ts │ ├── SearchType.ts │ ├── ListPersonHidden.ts │ ├── PurgePerson.ts │ ├── ResolveObject.ts │ ├── CommunityFollowerView.ts │ ├── CreateCommunityReport.ts │ ├── CreatePostReport.ts │ ├── GetPost.ts │ ├── ListCustomEmojisResponse.ts │ ├── NotificationType.ts │ ├── NotificationView.ts │ ├── UpdateMultiCommunity.ts │ ├── CommunityNotificationsMode.ts │ ├── CustomEmojiKeyword.ts │ ├── NotificationDataType.ts │ ├── PostCommentCombinedView.ts │ ├── PurgeComment.ts │ ├── UpdateCommunityTag.ts │ ├── CommunityReportResponse.ts │ ├── DistinguishComment.ts │ ├── EditPrivateMessage.ts │ ├── MarkNotificationAsRead.ts │ ├── PrivateMessageResponse.ts │ ├── RemoveComment.ts │ ├── UserBlockInstancePersonsParams.ts │ ├── CreateCommentReport.ts │ ├── DeletePrivateMessage.ts │ ├── HideCommunity.ts │ ├── MultiCommunityEntry.ts │ ├── ResolveCommunityReport.ts │ ├── PurgeCommunity.ts │ ├── CommunityIdQuery.ts │ ├── CommunityVisibility.ts │ ├── LockComment.ts │ ├── ResolveCommentReport.ts │ ├── Tagline.ts │ ├── UserBlockInstanceCommunitiesParams.ts │ ├── CommunityModeratorView.ts │ ├── CreateOrDeleteMultiCommunityEntry.ts │ ├── RemoveCommunity.ts │ ├── AddModToCommunityResponse.ts │ ├── CreatePrivateMessageReport.ts │ ├── ModEditPost.ts │ ├── ApproveCommunityPendingFollower.ts │ ├── CreateCustomEmoji.ts │ ├── EditComment.ts │ ├── ResolvePrivateMessageReport.ts │ ├── CreateCommunityTag.ts │ ├── GetCaptchaResponse.ts │ ├── GetMultiCommunityResponse.ts │ ├── PrivateMessageReportResponse.ts │ ├── TransferCommunity.ts │ ├── CreatePostLike.ts │ ├── Modlog.ts │ ├── CustomEmojiView.ts │ ├── ListPostLikes.ts │ ├── LocalUserView.ts │ ├── AddModToCommunity.ts │ ├── GetCommunity.ts │ ├── PrivateMessageView.ts │ ├── CommunityResponse.ts │ ├── CreateCommentLike.ts │ ├── FeaturePost.ts │ ├── LocalImageView.ts │ ├── UpdatePostNotifications.ts │ ├── ApproveRegistrationApplication.ts │ ├── ListCommentLikes.ts │ ├── PasswordChangeAfterReset.ts │ ├── RegistrationApplicationResponse.ts │ ├── PersonView.ts │ ├── CaptchaResponse.ts │ ├── ListCommunityPendingFollows.ts │ ├── ListPersonSaved.ts │ ├── MultiCommunityView.ts │ ├── GetFederatedInstances.ts │ ├── GetPersonDetails.ts │ ├── PaginationCursor.ts │ ├── PostSortType.ts │ ├── AdminBlockInstanceParams.ts │ ├── CreateComment.ts │ ├── PendingFollow.ts │ ├── PostOrCommentOrPrivateMessage.ts │ ├── LocalImage.ts │ ├── EditCustomEmoji.ts │ ├── PendingFollowerView.ts │ ├── UpdateCommunityNotifications.ts │ ├── VoteView.ts │ ├── MultiCommunityFollow.ts │ ├── CommentActions.ts │ ├── CustomEmoji.ts │ ├── OAuthAccount.ts │ ├── OpenGraphData.ts │ ├── CommunityView.ts │ ├── LinkMetadata.ts │ ├── ListRegistrationApplications.ts │ ├── SiteView.ts │ ├── ListNotifications.ts │ ├── ListPersonLiked.ts │ ├── GetPostResponse.ts │ ├── ChangePassword.ts │ ├── RegistrationApplicationView.ts │ ├── NotificationData.ts │ ├── CommunitySortType.ts │ ├── InstanceActions.ts │ ├── PagedResponse.ts │ ├── GetCommunityResponse.ts │ ├── UnreadCountsResponse.ts │ ├── CreateOAuthProvider.ts │ ├── ExportDataResponse.ts │ ├── PrivateMessage.ts │ ├── RegistrationApplication.ts │ ├── GetPersonDetailsResponse.ts │ ├── FederatedInstanceView.ts │ ├── ModlogView.ts │ ├── LoginToken.ts │ ├── ReportCombinedView.ts │ ├── EditOAuthProvider.ts │ ├── CommentReport.ts │ ├── SearchCombinedView.ts │ ├── PersonActions.ts │ ├── ListPersonContent.ts │ ├── PrivateMessageReportView.ts │ ├── Instance.ts │ ├── Login.ts │ ├── Tag.ts │ ├── ListCommunities.ts │ ├── FederationQueueState.ts │ ├── CommunityReportView.ts │ ├── MultiCommunity.ts │ ├── PrivateMessageReport.ts │ ├── CommentSlimView.ts │ ├── BanPerson.ts │ ├── LoginResponse.ts │ ├── ListMultiCommunities.ts │ ├── ModlogKind.ts │ ├── Notification.ts │ ├── AuthenticateWithOauth.ts │ ├── CommunityReport.ts │ ├── InstanceWithFederationState.ts │ ├── BanFromCommunity.ts │ ├── ReadableFederationState.ts │ ├── PostReport.ts │ ├── EditPost.ts │ ├── CommunityActions.ts │ ├── LocalSiteRateLimit.ts │ ├── GetComments.ts │ ├── EditCommunity.ts │ ├── PostActions.ts │ ├── CreatePost.ts │ ├── Register.ts │ ├── PostReportView.ts │ ├── SearchResponse.ts │ ├── UntranslatedError.ts │ ├── CreateCommunity.ts │ ├── PostView.ts │ ├── CommentView.ts │ ├── MyUserInfo.ts │ ├── CommentReportView.ts │ ├── ListReports.ts │ ├── UserSettingsBackup.ts │ ├── Person.ts │ ├── GetModlog.ts │ ├── Site.ts │ ├── Search.ts │ ├── GetSiteResponse.ts │ ├── GetPosts.ts │ ├── Comment.ts │ ├── OAuthProvider.ts │ ├── Community.ts │ ├── CreateSite.ts │ ├── Post.ts │ ├── LocalUser.ts │ ├── AllLemmyErrors.ts │ ├── SaveUserSettings.ts │ ├── LocalSite.ts │ ├── LemmyErrorType.ts │ └── EditSite.ts └── other_types.ts ├── renovate.json ├── tsconfig.json ├── putTypesInIndex.js ├── tsoa.json ├── eslint.config.mjs ├── .woodpecker.yml ├── package.json ├── README.md └── cliff.toml /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | pnpm lint-staged 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @dessalines @SleeplessOne1917 2 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "semi": true 4 | } 5 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | onlyBuiltDependencies: 2 | - core-js 3 | - protobufjs 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | package 3 | node_modules 4 | docs 5 | tsoa_build 6 | redoc-static.html 7 | -------------------------------------------------------------------------------- /scripts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | new_tag="$1" 4 | 5 | pnpm version $new_tag 6 | git push 7 | git tag $new_tag 8 | git push origin $new_tag 9 | -------------------------------------------------------------------------------- /scripts/generate_changelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | # Adding to CHANGELOG.md 5 | git cliff --output CHANGELOG.md 6 | prettier -w CHANGELOG.md 7 | -------------------------------------------------------------------------------- /src/types/DbUrl.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type DbUrl = string; 4 | -------------------------------------------------------------------------------- /src/types/ActivityId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type ActivityId = number; 4 | -------------------------------------------------------------------------------- /src/types/ModlogId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type ModlogId = number; 4 | -------------------------------------------------------------------------------- /src/types/NotificationId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type NotificationId = number; 4 | -------------------------------------------------------------------------------- /src/types/SensitiveString.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type SensitiveString = string; 4 | -------------------------------------------------------------------------------- /src/types/MultiCommunityId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type MultiCommunityId = number; 4 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:recommended"], 4 | "schedule": ["every weekend"], 5 | "automerge": true 6 | } 7 | -------------------------------------------------------------------------------- /src/types/DeleteImageParams.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type DeleteImageParams = { filename: string }; 4 | -------------------------------------------------------------------------------- /src/types/PostId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The post id. 5 | */ 6 | export type PostId = number; 7 | -------------------------------------------------------------------------------- /src/types/SiteId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The site id. 5 | */ 6 | export type SiteId = number; 7 | -------------------------------------------------------------------------------- /src/types/UpdateTotpResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type UpdateTotpResponse = { enabled: boolean }; 4 | -------------------------------------------------------------------------------- /src/types/PersonId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The person id. 5 | */ 6 | export type PersonId = number; 7 | -------------------------------------------------------------------------------- /src/types/TagId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The internal tag id. 5 | */ 6 | export type TagId = number; 7 | -------------------------------------------------------------------------------- /src/types/UpdateTotp.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type UpdateTotp = { totp_token: string; enabled: boolean }; 4 | -------------------------------------------------------------------------------- /src/types/CommentId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The comment id. 5 | */ 6 | export type CommentId = number; 7 | -------------------------------------------------------------------------------- /src/types/InstanceId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The instance id. 5 | */ 6 | export type InstanceId = number; 7 | -------------------------------------------------------------------------------- /src/types/LanguageId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The language id. 5 | */ 6 | export type LanguageId = number; 7 | -------------------------------------------------------------------------------- /src/types/TaglineId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The tagline id. 5 | */ 6 | export type TaglineId = number; 7 | -------------------------------------------------------------------------------- /src/types/CommunityId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The community id. 5 | */ 6 | export type CommunityId = number; 7 | -------------------------------------------------------------------------------- /src/types/ImageGetParams.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type ImageGetParams = { file_type?: string; max_size?: number }; 4 | -------------------------------------------------------------------------------- /src/types/LocalSiteId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The local site id. 5 | */ 6 | export type LocalSiteId = number; 7 | -------------------------------------------------------------------------------- /src/types/LocalUserId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The local user id. 5 | */ 6 | export type LocalUserId = number; 7 | -------------------------------------------------------------------------------- /src/types/CustomEmojiId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The custom emoji id. 5 | */ 6 | export type CustomEmojiId = number; 7 | -------------------------------------------------------------------------------- /src/types/PostReportId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The post report id. 5 | */ 6 | export type PostReportId = number; 7 | -------------------------------------------------------------------------------- /src/types/UploadImageResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type UploadImageResponse = { image_url: string; filename: string }; 4 | -------------------------------------------------------------------------------- /src/types/VerifyEmail.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Verify your email. 5 | */ 6 | export type VerifyEmail = { token: string }; 7 | -------------------------------------------------------------------------------- /src/types/CommentReportId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The comment report id. 5 | */ 6 | export type CommentReportId = number; 7 | -------------------------------------------------------------------------------- /src/types/CreateTagline.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Create a tagline 5 | */ 6 | export type CreateTagline = { content: string }; 7 | -------------------------------------------------------------------------------- /src/types/FederationAllowList.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type FederationAllowList = { published_at: string; updated_at?: string }; 4 | -------------------------------------------------------------------------------- /src/types/OAuthProviderId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The oauth provider id. 5 | */ 6 | export type OAuthProviderId = number; 7 | -------------------------------------------------------------------------------- /src/types/PrivateMessageId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The private message id. 5 | */ 6 | export type PrivateMessageId = number; 7 | -------------------------------------------------------------------------------- /src/types/CommunityReportId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The community report id. 5 | */ 6 | export type CommunityReportId = number; 7 | -------------------------------------------------------------------------------- /src/types/PostResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostView } from "./PostView"; 3 | 4 | export type PostResponse = { post_view: PostView }; 5 | -------------------------------------------------------------------------------- /src/types/SearchSortType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The search sort types. 5 | */ 6 | export type SearchSortType = "new" | "top" | "old"; 7 | -------------------------------------------------------------------------------- /src/types/TaglineResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Tagline } from "./Tagline"; 3 | 4 | export type TaglineResponse = { tagline: Tagline }; 5 | -------------------------------------------------------------------------------- /src/types/GetSiteMetadata.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Get metadata for a given site. 5 | */ 6 | export type GetSiteMetadata = { url: string }; 7 | -------------------------------------------------------------------------------- /src/types/PluginMetadata.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type PluginMetadata = { 4 | name: string; 5 | url?: string; 6 | description?: string; 7 | }; 8 | -------------------------------------------------------------------------------- /src/types/PostFeatureType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The feature type for a post. 5 | */ 6 | export type PostFeatureType = "local" | "community"; 7 | -------------------------------------------------------------------------------- /src/types/PrivateMessageReportId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The private message report id. 5 | */ 6 | export type PrivateMessageReportId = number; 7 | -------------------------------------------------------------------------------- /src/types/FederationMode.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The federation mode for an item 5 | */ 6 | export type FederationMode = "all" | "local" | "disable"; 7 | -------------------------------------------------------------------------------- /src/types/ImageProxyParams.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type ImageProxyParams = { 4 | url: string; 5 | file_type?: string; 6 | max_size?: number; 7 | }; 8 | -------------------------------------------------------------------------------- /src/types/ListCustomEmojis.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Fetches a list of custom emojis. 5 | */ 6 | export type ListCustomEmojis = { category?: string }; 7 | -------------------------------------------------------------------------------- /src/types/PublicOAuthProvider.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { OAuthProvider } from "./OAuthProvider"; 3 | 4 | export type PublicOAuthProvider = OAuthProvider; 5 | -------------------------------------------------------------------------------- /src/types/GetFederatedInstancesKind.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type GetFederatedInstancesKind = 4 | | "all" 5 | | "linked" 6 | | "allowed" 7 | | "blocked"; 8 | -------------------------------------------------------------------------------- /src/types/RegistrationApplicationId.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The registration application id. 5 | */ 6 | export type RegistrationApplicationId = number; 7 | -------------------------------------------------------------------------------- /src/types/SuccessResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * A response that completes successfully. 5 | */ 6 | export type SuccessResponse = { success: boolean }; 7 | -------------------------------------------------------------------------------- /src/types/CreateMultiCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type CreateMultiCommunity = { 4 | name: string; 5 | title?: string; 6 | description?: string; 7 | }; 8 | -------------------------------------------------------------------------------- /src/types/LikeType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The like_type for a persons liked content. 5 | */ 6 | export type LikeType = "all" | "liked_only" | "disliked_only"; 7 | -------------------------------------------------------------------------------- /src/types/ListLoginsResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LoginToken } from "./LoginToken"; 3 | 4 | export type ListLoginsResponse = { logins: Array }; 5 | -------------------------------------------------------------------------------- /src/types/AdminAllowInstanceParams.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type AdminAllowInstanceParams = { 4 | instance: string; 5 | allow: boolean; 6 | reason: string; 7 | }; 8 | -------------------------------------------------------------------------------- /src/types/CommunityFollowerState.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type CommunityFollowerState = 4 | | "accepted" 5 | | "pending" 6 | | "approval_required" 7 | | "denied"; 8 | -------------------------------------------------------------------------------- /src/types/FederationBlockList.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type FederationBlockList = { 4 | published_at: string; 5 | updated_at?: string; 6 | expires_at?: string; 7 | }; 8 | -------------------------------------------------------------------------------- /src/types/DeleteTagline.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { TaglineId } from "./TaglineId"; 3 | 4 | /** 5 | * Delete a tagline 6 | */ 7 | export type DeleteTagline = { id: TaglineId }; 8 | -------------------------------------------------------------------------------- /src/types/PersonContentType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * A list of possible types for a person's content. 5 | */ 6 | export type PersonContentType = "all" | "comments" | "posts"; 7 | -------------------------------------------------------------------------------- /src/types/DeletePost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Delete a post. 6 | */ 7 | export type DeletePost = { post_id: PostId; deleted: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/GetComment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | 4 | /** 5 | * Fetch an individual comment. 6 | */ 7 | export type GetComment = { id: CommentId }; 8 | -------------------------------------------------------------------------------- /src/types/GetMultiCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { MultiCommunityId } from "./MultiCommunityId"; 3 | 4 | export type GetMultiCommunity = { id?: MultiCommunityId; name?: string }; 5 | -------------------------------------------------------------------------------- /src/types/LocalSiteUrlBlocklist.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type LocalSiteUrlBlocklist = { 4 | id: number; 5 | url: string; 6 | published_at: string; 7 | updated_at?: string; 8 | }; 9 | -------------------------------------------------------------------------------- /src/types/SavePost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Save / bookmark a post. 6 | */ 7 | export type SavePost = { post_id: PostId; save: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/DeleteCommunityTag.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { TagId } from "./TagId"; 3 | 4 | /** 5 | * Delete a community tag. 6 | */ 7 | export type DeleteCommunityTag = { tag_id: TagId }; 8 | -------------------------------------------------------------------------------- /src/types/HidePost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Hide a post from list views 6 | */ 7 | export type HidePost = { post_id: PostId; hide: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/PostListingMode.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * A post-view mode that changes how multiple post listings look. 5 | */ 6 | export type PostListingMode = "list" | "card" | "small_card"; 7 | -------------------------------------------------------------------------------- /src/types/SiteResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SiteView } from "./SiteView"; 3 | 4 | /** 5 | * The response for a site. 6 | */ 7 | export type SiteResponse = { site_view: SiteView }; 8 | -------------------------------------------------------------------------------- /src/types/VoteShow.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Lets you show votes for others only, show all votes, or hide all votes. 5 | */ 6 | export type VoteShow = "show" | "show_for_others" | "hide"; 7 | -------------------------------------------------------------------------------- /src/types/AddAdmin.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | 4 | /** 5 | * Adds an admin to a site. 6 | */ 7 | export type AddAdmin = { person_id: PersonId; added: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/BlockPerson.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | 4 | /** 5 | * Block a person. 6 | */ 7 | export type BlockPerson = { person_id: PersonId; block: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/GenerateTotpSecretResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SensitiveString } from "./SensitiveString"; 3 | 4 | export type GenerateTotpSecretResponse = { totp_secret_url: SensitiveString }; 5 | -------------------------------------------------------------------------------- /src/types/Language.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LanguageId } from "./LanguageId"; 3 | 4 | /** 5 | * A language. 6 | */ 7 | export type Language = { id: LanguageId; code: string; name: string }; 8 | -------------------------------------------------------------------------------- /src/types/MarkPostAsRead.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Mark a post as read. 6 | */ 7 | export type MarkPostAsRead = { post_id: PostId; read: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/MultiCommunityListingType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * A listing type for multi-community fetches. 5 | */ 6 | export type MultiCommunityListingType = "all" | "local" | "subscribed"; 7 | -------------------------------------------------------------------------------- /src/types/UpdateTagline.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { TaglineId } from "./TaglineId"; 3 | 4 | /** 5 | * Update a tagline 6 | */ 7 | export type UpdateTagline = { id: TaglineId; content: string }; 8 | -------------------------------------------------------------------------------- /src/types/CommentResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentView } from "./CommentView"; 3 | 4 | /** 5 | * A comment response. 6 | */ 7 | export type CommentResponse = { comment_view: CommentView }; 8 | -------------------------------------------------------------------------------- /src/types/TagsView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Tag } from "./Tag"; 3 | 4 | /** 5 | * We wrap this in a struct so we can implement FromSqlRow for it 6 | */ 7 | export type TagsView = Array; 8 | -------------------------------------------------------------------------------- /src/types/DeleteCustomEmoji.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CustomEmojiId } from "./CustomEmojiId"; 3 | 4 | /** 5 | * Delete a custom emoji. 6 | */ 7 | export type DeleteCustomEmoji = { id: CustomEmojiId }; 8 | -------------------------------------------------------------------------------- /src/types/SaveComment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | 4 | /** 5 | * Save / bookmark a comment. 6 | */ 7 | export type SaveComment = { comment_id: CommentId; save: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/AddAdminResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonView } from "./PersonView"; 3 | 4 | /** 5 | * The response of current admins. 6 | */ 7 | export type AddAdminResponse = { admins: Array }; 8 | -------------------------------------------------------------------------------- /src/types/BlockCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Block a community. 6 | */ 7 | export type BlockCommunity = { community_id: CommunityId; block: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/DeleteComment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | 4 | /** 5 | * Delete your own comment. 6 | */ 7 | export type DeleteComment = { comment_id: CommentId; deleted: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/LockPost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Lock a post (prevent new comments). 6 | */ 7 | export type LockPost = { post_id: PostId; locked: boolean; reason: string }; 8 | -------------------------------------------------------------------------------- /src/types/MultiCommunityResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { MultiCommunityView } from "./MultiCommunityView"; 3 | 4 | export type MultiCommunityResponse = { 5 | multi_community_view: MultiCommunityView; 6 | }; 7 | -------------------------------------------------------------------------------- /src/types/PasswordReset.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SensitiveString } from "./SensitiveString"; 3 | 4 | /** 5 | * Reset your password via email. 6 | */ 7 | export type PasswordReset = { email: SensitiveString }; 8 | -------------------------------------------------------------------------------- /src/types/MarkManyPostsAsRead.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Mark several posts as read. 6 | */ 7 | export type MarkManyPostsAsRead = { post_ids: Array; read: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/CreatePrivateMessage.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | 4 | /** 5 | * Create a private message. 6 | */ 7 | export type CreatePrivateMessage = { content: string; recipient_id: PersonId }; 8 | -------------------------------------------------------------------------------- /src/types/DeleteCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Delete your own community. 6 | */ 7 | export type DeleteCommunity = { community_id: CommunityId; deleted: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/DeleteOAuthProvider.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { OAuthProviderId } from "./OAuthProviderId"; 3 | 4 | /** 5 | * Delete an external auth method. 6 | */ 7 | export type DeleteOAuthProvider = { id: OAuthProviderId }; 8 | -------------------------------------------------------------------------------- /src/types/FollowMultiCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { MultiCommunityId } from "./MultiCommunityId"; 3 | 4 | export type FollowMultiCommunity = { 5 | multi_community_id: MultiCommunityId; 6 | follow: boolean; 7 | }; 8 | -------------------------------------------------------------------------------- /src/types/GetSiteMetadataResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LinkMetadata } from "./LinkMetadata"; 3 | 4 | /** 5 | * The site metadata response. 6 | */ 7 | export type GetSiteMetadataResponse = { metadata: LinkMetadata }; 8 | -------------------------------------------------------------------------------- /src/types/PersonResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonView } from "./PersonView"; 3 | 4 | /** 5 | * A person response for actions done to a person. 6 | */ 7 | export type PersonResponse = { person_view: PersonView }; 8 | -------------------------------------------------------------------------------- /src/types/PostReportResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostReportView } from "./PostReportView"; 3 | 4 | /** 5 | * The post report response. 6 | */ 7 | export type PostReportResponse = { post_report_view: PostReportView }; 8 | -------------------------------------------------------------------------------- /src/types/RegistrationMode.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The registration mode for your site. Determines what happens after a user signs up. 5 | */ 6 | export type RegistrationMode = "closed" | "require_application" | "open"; 7 | -------------------------------------------------------------------------------- /src/types/RemovePost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Remove a post (only doable by mods). 6 | */ 7 | export type RemovePost = { post_id: PostId; removed: boolean; reason: string }; 8 | -------------------------------------------------------------------------------- /src/types/GetRandomCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { ListingType } from "./ListingType"; 3 | 4 | /** 5 | * Fetches a random community 6 | */ 7 | export type GetRandomCommunity = { type_?: ListingType; show_nsfw?: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/PostNotificationsMode.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Available settings for post notifications 5 | */ 6 | export type PostNotificationsMode = 7 | | "all_comments" 8 | | "replies_and_mentions" 9 | | "mute"; 10 | -------------------------------------------------------------------------------- /src/types/AdminListUsers.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | 4 | export type AdminListUsers = { 5 | banned_only?: boolean; 6 | page_cursor?: PaginationCursor; 7 | limit?: number; 8 | }; 9 | -------------------------------------------------------------------------------- /src/types/CustomEmojiResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CustomEmojiView } from "./CustomEmojiView"; 3 | 4 | /** 5 | * A response for a custom emoji. 6 | */ 7 | export type CustomEmojiResponse = { custom_emoji: CustomEmojiView }; 8 | -------------------------------------------------------------------------------- /src/types/FollowCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Follow / subscribe to a community. 6 | */ 7 | export type FollowCommunity = { community_id: CommunityId; follow: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/GetRegistrationApplication.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | 4 | /** 5 | * Gets a registration application for a person 6 | */ 7 | export type GetRegistrationApplication = { person_id: PersonId }; 8 | -------------------------------------------------------------------------------- /src/types/ListPersonRead.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | 4 | /** 5 | * Gets your read posts. 6 | */ 7 | export type ListPersonRead = { page_cursor?: PaginationCursor; limit?: number }; 8 | -------------------------------------------------------------------------------- /src/types/ListTaglines.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | 4 | /** 5 | * Fetches a list of taglines. 6 | */ 7 | export type ListTaglines = { page_cursor?: PaginationCursor; limit?: number }; 8 | -------------------------------------------------------------------------------- /src/types/ReportType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * A list of possible types for reports. 5 | */ 6 | export type ReportType = 7 | | "all" 8 | | "posts" 9 | | "comments" 10 | | "private_messages" 11 | | "communities"; 12 | -------------------------------------------------------------------------------- /src/types/ListMedia.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | 4 | /** 5 | * Get your user's image / media uploads. 6 | */ 7 | export type ListMedia = { page_cursor?: PaginationCursor; limit?: number }; 8 | -------------------------------------------------------------------------------- /src/types/MultiCommunitySortType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type MultiCommunitySortType = 4 | | "new" 5 | | "old" 6 | | "name_asc" 7 | | "name_desc" 8 | | "communities" 9 | | "subscribers" 10 | | "subscribers_local"; 11 | -------------------------------------------------------------------------------- /src/types/ResolvePostReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostReportId } from "./PostReportId"; 3 | 4 | /** 5 | * Resolve a post report (mods only). 6 | */ 7 | export type ResolvePostReport = { report_id: PostReportId; resolved: boolean }; 8 | -------------------------------------------------------------------------------- /src/types/ImageDetails.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { DbUrl } from "./DbUrl"; 3 | 4 | export type ImageDetails = { 5 | link: DbUrl; 6 | width: number; 7 | height: number; 8 | content_type: string; 9 | blurhash?: string; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/CommentReportResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentReportView } from "./CommentReportView"; 3 | 4 | /** 5 | * The comment report response. 6 | */ 7 | export type CommentReportResponse = { comment_report_view: CommentReportView }; 8 | -------------------------------------------------------------------------------- /src/types/ListingType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * A listing type for post and comment list fetches. 5 | */ 6 | export type ListingType = 7 | | "all" 8 | | "local" 9 | | "subscribed" 10 | | "moderator_view" 11 | | "suggested"; 12 | -------------------------------------------------------------------------------- /src/types/PurgePost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Purges a post from the database. This will delete all content attached to that post. 6 | */ 7 | export type PurgePost = { post_id: PostId; reason: string }; 8 | -------------------------------------------------------------------------------- /src/types/ResendVerificationEmail.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SensitiveString } from "./SensitiveString"; 3 | 4 | /** 5 | * Make a request to resend your verification email. 6 | */ 7 | export type ResendVerificationEmail = { email: SensitiveString }; 8 | -------------------------------------------------------------------------------- /src/types/CommentSortType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html 5 | */ 6 | export type CommentSortType = "hot" | "top" | "new" | "old" | "controversial"; 7 | -------------------------------------------------------------------------------- /src/types/DeleteAccount.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SensitiveString } from "./SensitiveString"; 3 | 4 | /** 5 | * Delete your account. 6 | */ 7 | export type DeleteAccount = { 8 | password: SensitiveString; 9 | delete_content: boolean; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/NotePerson.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | 4 | /** 5 | * Make a note for a person. 6 | * 7 | * An empty string deletes the note. 8 | */ 9 | export type NotePerson = { person_id: PersonId; note: string }; 10 | -------------------------------------------------------------------------------- /src/types/SearchType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The type of content returned from a search. 5 | */ 6 | export type SearchType = 7 | | "all" 8 | | "comments" 9 | | "posts" 10 | | "communities" 11 | | "users" 12 | | "multi_communities"; 13 | -------------------------------------------------------------------------------- /src/types/ListPersonHidden.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | 4 | /** 5 | * Gets your hidden posts. 6 | */ 7 | export type ListPersonHidden = { 8 | page_cursor?: PaginationCursor; 9 | limit?: number; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/PurgePerson.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | 4 | /** 5 | * Purges a person from the database. This will delete all content attached to that person. 6 | */ 7 | export type PurgePerson = { person_id: PersonId; reason: string }; 8 | -------------------------------------------------------------------------------- /src/types/ResolveObject.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Does an apub fetch for an object. 5 | */ 6 | export type ResolveObject = { 7 | /** 8 | * Can be the full url, or a shortened version like: !fediverse@lemmy.ml 9 | */ 10 | q: string; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/CommunityFollowerView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Community } from "./Community"; 3 | import type { Person } from "./Person"; 4 | 5 | /** 6 | * A community follower. 7 | */ 8 | export type CommunityFollowerView = { community: Community; follower: Person }; 9 | -------------------------------------------------------------------------------- /src/types/CreateCommunityReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Create a report for a community. 6 | */ 7 | export type CreateCommunityReport = { 8 | community_id: CommunityId; 9 | reason: string; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/CreatePostReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Create a post report. 6 | */ 7 | export type CreatePostReport = { 8 | post_id: PostId; 9 | reason: string; 10 | violates_instance_rules?: boolean; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/GetPost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | import type { PostId } from "./PostId"; 4 | 5 | /** 6 | * Get a post. Needs either the post id, or comment_id. 7 | */ 8 | export type GetPost = { id?: PostId; comment_id?: CommentId }; 9 | -------------------------------------------------------------------------------- /src/types/ListCustomEmojisResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CustomEmojiView } from "./CustomEmojiView"; 3 | 4 | /** 5 | * A response for custom emojis. 6 | */ 7 | export type ListCustomEmojisResponse = { 8 | custom_emojis: Array; 9 | }; 10 | -------------------------------------------------------------------------------- /src/types/NotificationType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Types of notifications which can be received in inbox 5 | */ 6 | export type NotificationType = 7 | | "mention" 8 | | "reply" 9 | | "subscribed" 10 | | "private_message" 11 | | "mod_action"; 12 | -------------------------------------------------------------------------------- /src/types/NotificationView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Notification } from "./Notification"; 3 | import type { NotificationData } from "./NotificationData"; 4 | 5 | export type NotificationView = { 6 | notification: Notification; 7 | data: NotificationData; 8 | }; 9 | -------------------------------------------------------------------------------- /src/types/UpdateMultiCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { MultiCommunityId } from "./MultiCommunityId"; 3 | 4 | export type UpdateMultiCommunity = { 5 | id: MultiCommunityId; 6 | title?: string; 7 | description?: string; 8 | deleted?: boolean; 9 | }; 10 | -------------------------------------------------------------------------------- /src/types/CommunityNotificationsMode.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Available settings for community notifications 5 | */ 6 | export type CommunityNotificationsMode = 7 | | "all_posts_and_comments" 8 | | "all_posts" 9 | | "replies_and_mentions" 10 | | "mute"; 11 | -------------------------------------------------------------------------------- /src/types/CustomEmojiKeyword.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CustomEmojiId } from "./CustomEmojiId"; 3 | 4 | /** 5 | * A custom keyword for an emoji. 6 | */ 7 | export type CustomEmojiKeyword = { 8 | custom_emoji_id: CustomEmojiId; 9 | keyword: string; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/NotificationDataType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * A list of possible types for the inbox. 5 | */ 6 | export type NotificationDataType = 7 | | "all" 8 | | "reply" 9 | | "mention" 10 | | "private_message" 11 | | "subscribed" 12 | | "mod_action"; 13 | -------------------------------------------------------------------------------- /src/types/PostCommentCombinedView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentView } from "./CommentView"; 3 | import type { PostView } from "./PostView"; 4 | 5 | export type PostCommentCombinedView = 6 | | ({ type_: "post" } & PostView) 7 | | ({ type_: "comment" } & CommentView); 8 | -------------------------------------------------------------------------------- /src/types/PurgeComment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | 4 | /** 5 | * Purges a comment from the database. This will delete all content attached to that comment. 6 | */ 7 | export type PurgeComment = { comment_id: CommentId; reason: string }; 8 | -------------------------------------------------------------------------------- /src/types/UpdateCommunityTag.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { TagId } from "./TagId"; 3 | 4 | /** 5 | * Make changes to a community tag 6 | */ 7 | export type UpdateCommunityTag = { 8 | tag_id: TagId; 9 | display_name?: string; 10 | description?: string; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/CommunityReportResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityReportView } from "./CommunityReportView"; 3 | 4 | /** 5 | * A community report response. 6 | */ 7 | export type CommunityReportResponse = { 8 | community_report_view: CommunityReportView; 9 | }; 10 | -------------------------------------------------------------------------------- /src/types/DistinguishComment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | 4 | /** 5 | * Distinguish a comment (IE speak as moderator). 6 | */ 7 | export type DistinguishComment = { 8 | comment_id: CommentId; 9 | distinguished: boolean; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/EditPrivateMessage.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PrivateMessageId } from "./PrivateMessageId"; 3 | 4 | /** 5 | * Edit a private message. 6 | */ 7 | export type EditPrivateMessage = { 8 | private_message_id: PrivateMessageId; 9 | content: string; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/MarkNotificationAsRead.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { NotificationId } from "./NotificationId"; 3 | 4 | /** 5 | * Mark a comment reply as read. 6 | */ 7 | export type MarkNotificationAsRead = { 8 | notification_id: NotificationId; 9 | read: boolean; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/PrivateMessageResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PrivateMessageView } from "./PrivateMessageView"; 3 | 4 | /** 5 | * A single private message response. 6 | */ 7 | export type PrivateMessageResponse = { 8 | private_message_view: PrivateMessageView; 9 | }; 10 | -------------------------------------------------------------------------------- /src/types/RemoveComment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | 4 | /** 5 | * Remove a comment (only doable by mods). 6 | */ 7 | export type RemoveComment = { 8 | comment_id: CommentId; 9 | removed: boolean; 10 | reason: string; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/UserBlockInstancePersonsParams.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { InstanceId } from "./InstanceId"; 3 | 4 | /** 5 | * Block an instance's persons. 6 | */ 7 | export type UserBlockInstancePersonsParams = { 8 | instance_id: InstanceId; 9 | block: boolean; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/CreateCommentReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | 4 | /** 5 | * Report a comment. 6 | */ 7 | export type CreateCommentReport = { 8 | comment_id: CommentId; 9 | reason: string; 10 | violates_instance_rules?: boolean; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/DeletePrivateMessage.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PrivateMessageId } from "./PrivateMessageId"; 3 | 4 | /** 5 | * Delete a private message. 6 | */ 7 | export type DeletePrivateMessage = { 8 | private_message_id: PrivateMessageId; 9 | deleted: boolean; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/HideCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Hide a community from the main view. 6 | */ 7 | export type HideCommunity = { 8 | community_id: CommunityId; 9 | hidden: boolean; 10 | reason: string; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/MultiCommunityEntry.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { MultiCommunityId } from "./MultiCommunityId"; 4 | 5 | export type MultiCommunityEntry = { 6 | multi_community_id: MultiCommunityId; 7 | community_id: CommunityId; 8 | }; 9 | -------------------------------------------------------------------------------- /src/types/ResolveCommunityReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityReportId } from "./CommunityReportId"; 3 | 4 | /** 5 | * Resolve a community report. 6 | */ 7 | export type ResolveCommunityReport = { 8 | report_id: CommunityReportId; 9 | resolved: boolean; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/PurgeCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Purges a community from the database. This will delete all content attached to that community. 6 | */ 7 | export type PurgeCommunity = { community_id: CommunityId; reason: string }; 8 | -------------------------------------------------------------------------------- /src/types/CommunityIdQuery.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Parameter for setting community icon or banner. Can't use POST data here as it already contains 6 | * the image data. 7 | */ 8 | export type CommunityIdQuery = { id: CommunityId }; 9 | -------------------------------------------------------------------------------- /src/types/CommunityVisibility.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Defines who can browse and interact with content in a community. 5 | */ 6 | export type CommunityVisibility = 7 | | "public" 8 | | "unlisted" 9 | | "local_only_public" 10 | | "local_only_private" 11 | | "private"; 12 | -------------------------------------------------------------------------------- /src/types/LockComment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | 4 | /** 5 | * Locks a comment and its children, IE prevents new replies. 6 | */ 7 | export type LockComment = { 8 | comment_id: CommentId; 9 | locked: boolean; 10 | reason: string; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/ResolveCommentReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentReportId } from "./CommentReportId"; 3 | 4 | /** 5 | * Resolve a comment report (only doable by mods). 6 | */ 7 | export type ResolveCommentReport = { 8 | report_id: CommentReportId; 9 | resolved: boolean; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/Tagline.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { TaglineId } from "./TaglineId"; 3 | 4 | /** 5 | * A tagline, shown at the top of your site. 6 | */ 7 | export type Tagline = { 8 | id: TaglineId; 9 | content: string; 10 | published_at: string; 11 | updated_at?: string; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/UserBlockInstanceCommunitiesParams.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { InstanceId } from "./InstanceId"; 3 | 4 | /** 5 | * Block an instance's communities. 6 | */ 7 | export type UserBlockInstanceCommunitiesParams = { 8 | instance_id: InstanceId; 9 | block: boolean; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/CommunityModeratorView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Community } from "./Community"; 3 | import type { Person } from "./Person"; 4 | 5 | /** 6 | * A community moderator. 7 | */ 8 | export type CommunityModeratorView = { 9 | community: Community; 10 | moderator: Person; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/CreateOrDeleteMultiCommunityEntry.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { MultiCommunityId } from "./MultiCommunityId"; 4 | 5 | export type CreateOrDeleteMultiCommunityEntry = { 6 | id: MultiCommunityId; 7 | community_id: CommunityId; 8 | }; 9 | -------------------------------------------------------------------------------- /src/types/RemoveCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Remove a community (only doable by moderators). 6 | */ 7 | export type RemoveCommunity = { 8 | community_id: CommunityId; 9 | removed: boolean; 10 | reason: string; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/AddModToCommunityResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityModeratorView } from "./CommunityModeratorView"; 3 | 4 | /** 5 | * The response of adding a moderator to a community. 6 | */ 7 | export type AddModToCommunityResponse = { 8 | moderators: Array; 9 | }; 10 | -------------------------------------------------------------------------------- /src/types/CreatePrivateMessageReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PrivateMessageId } from "./PrivateMessageId"; 3 | 4 | /** 5 | * Create a report for a private message. 6 | */ 7 | export type CreatePrivateMessageReport = { 8 | private_message_id: PrivateMessageId; 9 | reason: string; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/ModEditPost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | import type { TagId } from "./TagId"; 4 | 5 | /** 6 | * Mods can change some metadata for posts 7 | */ 8 | export type ModEditPost = { 9 | post_id: PostId; 10 | nsfw?: boolean; 11 | tags?: Array; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/ApproveCommunityPendingFollower.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { PersonId } from "./PersonId"; 4 | 5 | export type ApproveCommunityPendingFollower = { 6 | community_id: CommunityId; 7 | follower_id: PersonId; 8 | approve: boolean; 9 | }; 10 | -------------------------------------------------------------------------------- /src/types/CreateCustomEmoji.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { DbUrl } from "./DbUrl"; 3 | 4 | /** 5 | * Create a custom emoji. 6 | */ 7 | export type CreateCustomEmoji = { 8 | category: string; 9 | shortcode: string; 10 | image_url: DbUrl; 11 | alt_text: string; 12 | keywords: Array; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/EditComment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | import type { LanguageId } from "./LanguageId"; 4 | 5 | /** 6 | * Edit a comment. 7 | */ 8 | export type EditComment = { 9 | comment_id: CommentId; 10 | content?: string; 11 | language_id?: LanguageId; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/ResolvePrivateMessageReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PrivateMessageReportId } from "./PrivateMessageReportId"; 3 | 4 | /** 5 | * Resolve a private message report. 6 | */ 7 | export type ResolvePrivateMessageReport = { 8 | report_id: PrivateMessageReportId; 9 | resolved: boolean; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/CreateCommunityTag.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Create a tag for a community. 6 | */ 7 | export type CreateCommunityTag = { 8 | community_id: CommunityId; 9 | name: string; 10 | display_name?: string; 11 | description?: string; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/GetCaptchaResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CaptchaResponse } from "./CaptchaResponse"; 3 | 4 | /** 5 | * A wrapper for the captcha response. 6 | */ 7 | export type GetCaptchaResponse = { 8 | /** 9 | * Will be None if captchas are disabled. 10 | */ 11 | ok?: CaptchaResponse; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/GetMultiCommunityResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityView } from "./CommunityView"; 3 | import type { MultiCommunityView } from "./MultiCommunityView"; 4 | 5 | export type GetMultiCommunityResponse = { 6 | multi_community_view: MultiCommunityView; 7 | communities: Array; 8 | }; 9 | -------------------------------------------------------------------------------- /src/types/PrivateMessageReportResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PrivateMessageReportView } from "./PrivateMessageReportView"; 3 | 4 | /** 5 | * A private message report response. 6 | */ 7 | export type PrivateMessageReportResponse = { 8 | private_message_report_view: PrivateMessageReportView; 9 | }; 10 | -------------------------------------------------------------------------------- /src/types/TransferCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { PersonId } from "./PersonId"; 4 | 5 | /** 6 | * Transfer a community to a new owner. 7 | */ 8 | export type TransferCommunity = { 9 | community_id: CommunityId; 10 | person_id: PersonId; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/CreatePostLike.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | 4 | /** 5 | * Like a post. 6 | */ 7 | export type CreatePostLike = { 8 | post_id: PostId; 9 | /** 10 | * True means Upvote, False means Downvote, and None means remove vote. 11 | */ 12 | is_upvote?: boolean; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/Modlog.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { ModlogId } from "./ModlogId"; 3 | import type { ModlogKind } from "./ModlogKind"; 4 | 5 | export type Modlog = { 6 | id: ModlogId; 7 | kind: ModlogKind; 8 | is_revert: boolean; 9 | reason?: string; 10 | expires_at?: string; 11 | published_at: string; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/CustomEmojiView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CustomEmoji } from "./CustomEmoji"; 3 | import type { CustomEmojiKeyword } from "./CustomEmojiKeyword"; 4 | 5 | /** 6 | * A custom emoji view. 7 | */ 8 | export type CustomEmojiView = { 9 | custom_emoji: CustomEmoji; 10 | keywords: Array; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/ListPostLikes.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | import type { PostId } from "./PostId"; 4 | 5 | /** 6 | * List post likes. Admins-only. 7 | */ 8 | export type ListPostLikes = { 9 | post_id: PostId; 10 | page_cursor?: PaginationCursor; 11 | limit?: number; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/LocalUserView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LocalUser } from "./LocalUser"; 3 | import type { Person } from "./Person"; 4 | 5 | /** 6 | * A local user view. 7 | */ 8 | export type LocalUserView = { 9 | local_user: LocalUser; 10 | person: Person; 11 | banned: boolean; 12 | ban_expires_at?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/AddModToCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { PersonId } from "./PersonId"; 4 | 5 | /** 6 | * Add a moderator to a community. 7 | */ 8 | export type AddModToCommunity = { 9 | community_id: CommunityId; 10 | person_id: PersonId; 11 | added: boolean; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/GetCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | 4 | /** 5 | * Get a community. Must provide either an id, or a name. 6 | */ 7 | export type GetCommunity = { 8 | id?: CommunityId; 9 | /** 10 | * Example: star_trek , or star_trek@xyz.tld 11 | */ 12 | name?: string; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/PrivateMessageView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Person } from "./Person"; 3 | import type { PrivateMessage } from "./PrivateMessage"; 4 | 5 | /** 6 | * A private message view. 7 | */ 8 | export type PrivateMessageView = { 9 | private_message: PrivateMessage; 10 | creator: Person; 11 | recipient: Person; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/CommunityResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityView } from "./CommunityView"; 3 | import type { LanguageId } from "./LanguageId"; 4 | 5 | /** 6 | * A simple community response. 7 | */ 8 | export type CommunityResponse = { 9 | community_view: CommunityView; 10 | discussion_languages: Array; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/CreateCommentLike.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | 4 | /** 5 | * Like a comment. 6 | */ 7 | export type CreateCommentLike = { 8 | comment_id: CommentId; 9 | /** 10 | * True means Upvote, False means Downvote, and None means remove vote. 11 | */ 12 | is_upvote?: boolean; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/FeaturePost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostFeatureType } from "./PostFeatureType"; 3 | import type { PostId } from "./PostId"; 4 | 5 | /** 6 | * Feature a post (stickies / pins to the top). 7 | */ 8 | export type FeaturePost = { 9 | post_id: PostId; 10 | featured: boolean; 11 | feature_type: PostFeatureType; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/LocalImageView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LocalImage } from "./LocalImage"; 3 | import type { Person } from "./Person"; 4 | import type { Post } from "./Post"; 5 | 6 | /** 7 | * A local image view. 8 | */ 9 | export type LocalImageView = { 10 | local_image: LocalImage; 11 | person: Person; 12 | post?: Post; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/UpdatePostNotifications.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostId } from "./PostId"; 3 | import type { PostNotificationsMode } from "./PostNotificationsMode"; 4 | 5 | /** 6 | * Change notification settings for a post 7 | */ 8 | export type UpdatePostNotifications = { 9 | post_id: PostId; 10 | mode: PostNotificationsMode; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/ApproveRegistrationApplication.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { RegistrationApplicationId } from "./RegistrationApplicationId"; 3 | 4 | /** 5 | * Approves a registration application. 6 | */ 7 | export type ApproveRegistrationApplication = { 8 | id: RegistrationApplicationId; 9 | approve: boolean; 10 | deny_reason?: string; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/ListCommentLikes.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | import type { PaginationCursor } from "./PaginationCursor"; 4 | 5 | /** 6 | * List comment likes. Admins-only. 7 | */ 8 | export type ListCommentLikes = { 9 | comment_id: CommentId; 10 | page_cursor?: PaginationCursor; 11 | limit?: number; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/PasswordChangeAfterReset.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SensitiveString } from "./SensitiveString"; 3 | 4 | /** 5 | * Change your password after receiving a reset request. 6 | */ 7 | export type PasswordChangeAfterReset = { 8 | token: SensitiveString; 9 | password: SensitiveString; 10 | password_verify: SensitiveString; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/RegistrationApplicationResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { RegistrationApplicationView } from "./RegistrationApplicationView"; 3 | 4 | /** 5 | * The response of an action done to a registration application. 6 | */ 7 | export type RegistrationApplicationResponse = { 8 | registration_application: RegistrationApplicationView; 9 | }; 10 | -------------------------------------------------------------------------------- /src/types/PersonView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Person } from "./Person"; 3 | import type { PersonActions } from "./PersonActions"; 4 | 5 | /** 6 | * A person view. 7 | */ 8 | export type PersonView = { 9 | person: Person; 10 | is_admin: boolean; 11 | person_actions?: PersonActions; 12 | banned: boolean; 13 | ban_expires_at?: string; 14 | }; 15 | -------------------------------------------------------------------------------- /src/types/CaptchaResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * A captcha response. 5 | */ 6 | export type CaptchaResponse = { 7 | /** 8 | * A Base64 encoded png 9 | */ 10 | png: string; 11 | /** 12 | * A Base64 encoded wav audio 13 | */ 14 | wav: string; 15 | /** 16 | * The UUID for the captcha item. 17 | */ 18 | uuid: string; 19 | }; 20 | -------------------------------------------------------------------------------- /src/types/ListCommunityPendingFollows.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | 4 | export type ListCommunityPendingFollows = { 5 | /** 6 | * Only shows the unapproved applications 7 | */ 8 | unread_only?: boolean; 9 | all_communities?: boolean; 10 | page_cursor?: PaginationCursor; 11 | limit?: number; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/ListPersonSaved.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | import type { PersonContentType } from "./PersonContentType"; 4 | 5 | /** 6 | * Gets your saved posts and comments 7 | */ 8 | export type ListPersonSaved = { 9 | type_?: PersonContentType; 10 | page_cursor?: PaginationCursor; 11 | limit?: number; 12 | }; 13 | -------------------------------------------------------------------------------- /src/types/MultiCommunityView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityFollowerState } from "./CommunityFollowerState"; 3 | import type { MultiCommunity } from "./MultiCommunity"; 4 | import type { Person } from "./Person"; 5 | 6 | export type MultiCommunityView = { 7 | multi: MultiCommunity; 8 | follow_state?: CommunityFollowerState; 9 | owner: Person; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/GetFederatedInstances.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { GetFederatedInstancesKind } from "./GetFederatedInstancesKind"; 3 | import type { PaginationCursor } from "./PaginationCursor"; 4 | 5 | export type GetFederatedInstances = { 6 | domain_filter?: string; 7 | kind: GetFederatedInstancesKind; 8 | page_cursor?: PaginationCursor; 9 | limit?: number; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/GetPersonDetails.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | 4 | /** 5 | * Gets a person's details. 6 | * 7 | * Either person_id, or username are required. 8 | */ 9 | export type GetPersonDetails = { 10 | person_id?: PersonId; 11 | /** 12 | * Example: dessalines , or dessalines@xyz.tld 13 | */ 14 | username?: string; 15 | }; 16 | -------------------------------------------------------------------------------- /src/types/PaginationCursor.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * To get the next or previous page, pass this string unchanged as `page_cursor` in a new request 5 | * to the same endpoint. 6 | * 7 | * Do not attempt to parse or modify the cursor string. The format is internal and may change in 8 | * minor Lemmy versions. 9 | */ 10 | export type PaginationCursor = string; 11 | -------------------------------------------------------------------------------- /src/types/PostSortType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The post sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html 5 | */ 6 | export type PostSortType = 7 | | "active" 8 | | "hot" 9 | | "new" 10 | | "old" 11 | | "top" 12 | | "most_comments" 13 | | "new_comments" 14 | | "controversial" 15 | | "scaled"; 16 | -------------------------------------------------------------------------------- /src/types/AdminBlockInstanceParams.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type AdminBlockInstanceParams = { 4 | instance: string; 5 | block: boolean; 6 | reason: string; 7 | /** 8 | * A time that the block will expire, in unix epoch seconds. 9 | * 10 | * An i64 unix timestamp is used for a simpler API client implementation. 11 | */ 12 | expires_at?: number; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/CreateComment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | import type { LanguageId } from "./LanguageId"; 4 | import type { PostId } from "./PostId"; 5 | 6 | /** 7 | * Create a comment. 8 | */ 9 | export type CreateComment = { 10 | content: string; 11 | post_id: PostId; 12 | parent_id?: CommentId; 13 | language_id?: LanguageId; 14 | }; 15 | -------------------------------------------------------------------------------- /src/types/PendingFollow.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Community } from "./Community"; 3 | import type { CommunityFollowerState } from "./CommunityFollowerState"; 4 | import type { Person } from "./Person"; 5 | 6 | export type PendingFollow = { 7 | person: Person; 8 | community: Community; 9 | is_new_instance: boolean; 10 | follow_state?: CommunityFollowerState; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/PostOrCommentOrPrivateMessage.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Comment } from "./Comment"; 3 | import type { Post } from "./Post"; 4 | import type { PrivateMessage } from "./PrivateMessage"; 5 | 6 | export type PostOrCommentOrPrivateMessage = 7 | | ({ type_: "post" } & Post) 8 | | ({ type_: "comment" } & Comment) 9 | | ({ type_: "private_message" } & PrivateMessage); 10 | -------------------------------------------------------------------------------- /src/types/LocalImage.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | import type { PostId } from "./PostId"; 4 | 5 | export type LocalImage = { 6 | pictrs_alias: string; 7 | published_at: string; 8 | person_id?: PersonId; 9 | /** 10 | * This means the image is an auto-generated thumbnail, for a post. 11 | */ 12 | thumbnail_for_post_id?: PostId; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/EditCustomEmoji.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CustomEmojiId } from "./CustomEmojiId"; 3 | import type { DbUrl } from "./DbUrl"; 4 | 5 | /** 6 | * Edit a custom emoji. 7 | */ 8 | export type EditCustomEmoji = { 9 | id: CustomEmojiId; 10 | category?: string; 11 | shortcode?: string; 12 | image_url?: DbUrl; 13 | alt_text?: string; 14 | keywords?: Array; 15 | }; 16 | -------------------------------------------------------------------------------- /src/types/PendingFollowerView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Community } from "./Community"; 3 | import type { CommunityFollowerState } from "./CommunityFollowerState"; 4 | import type { Person } from "./Person"; 5 | 6 | export type PendingFollowerView = { 7 | person: Person; 8 | community: Community; 9 | is_new_instance: boolean; 10 | follow_state?: CommunityFollowerState; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/UpdateCommunityNotifications.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { CommunityNotificationsMode } from "./CommunityNotificationsMode"; 4 | 5 | /** 6 | * Change notification settings for a community 7 | */ 8 | export type UpdateCommunityNotifications = { 9 | community_id: CommunityId; 10 | mode: CommunityNotificationsMode; 11 | }; 12 | -------------------------------------------------------------------------------- /src/types/VoteView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Person } from "./Person"; 3 | 4 | /** 5 | * A vote view for checking a post or comments votes. 6 | */ 7 | export type VoteView = { 8 | creator: Person; 9 | creator_banned: boolean; 10 | creator_banned_from_community: boolean; 11 | /** 12 | * True means Upvote, False means Downvote. 13 | */ 14 | is_upvote: boolean; 15 | }; 16 | -------------------------------------------------------------------------------- /src/types/MultiCommunityFollow.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityFollowerState } from "./CommunityFollowerState"; 3 | import type { MultiCommunityId } from "./MultiCommunityId"; 4 | import type { PersonId } from "./PersonId"; 5 | 6 | export type MultiCommunityFollow = { 7 | multi_community_id: MultiCommunityId; 8 | person_id: PersonId; 9 | follow_state: CommunityFollowerState; 10 | }; 11 | -------------------------------------------------------------------------------- /src/types/CommentActions.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type CommentActions = { 4 | /** 5 | * When the comment was upvoted or downvoted. 6 | */ 7 | voted_at?: string; 8 | /** 9 | * When the comment was saved. 10 | */ 11 | saved_at?: string; 12 | /** 13 | * True if upvoted, false if downvoted. Upvote is greater than downvote. 14 | */ 15 | vote_is_upvote?: boolean; 16 | }; 17 | -------------------------------------------------------------------------------- /src/types/CustomEmoji.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CustomEmojiId } from "./CustomEmojiId"; 3 | import type { DbUrl } from "./DbUrl"; 4 | 5 | /** 6 | * A custom emoji. 7 | */ 8 | export type CustomEmoji = { 9 | id: CustomEmojiId; 10 | shortcode: string; 11 | image_url: DbUrl; 12 | alt_text: string; 13 | category: string; 14 | published_at: string; 15 | updated_at?: string; 16 | }; 17 | -------------------------------------------------------------------------------- /src/types/OAuthAccount.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LocalUserId } from "./LocalUserId"; 3 | import type { OAuthProviderId } from "./OAuthProviderId"; 4 | 5 | /** 6 | * An auth account method. 7 | */ 8 | export type OAuthAccount = { 9 | local_user_id: LocalUserId; 10 | oauth_provider_id: OAuthProviderId; 11 | oauth_user_id: string; 12 | published_at: string; 13 | updated_at?: string; 14 | }; 15 | -------------------------------------------------------------------------------- /src/types/OpenGraphData.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { DbUrl } from "./DbUrl"; 3 | 4 | /** 5 | * Site metadata, from its opengraph tags. 6 | */ 7 | export type OpenGraphData = { 8 | title?: string; 9 | description?: string; 10 | image?: DbUrl; 11 | image_width?: number; 12 | image_height?: number; 13 | embed_video_url?: DbUrl; 14 | video_width?: number; 15 | video_height?: number; 16 | }; 17 | -------------------------------------------------------------------------------- /src/types/CommunityView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Community } from "./Community"; 3 | import type { CommunityActions } from "./CommunityActions"; 4 | import type { TagsView } from "./TagsView"; 5 | 6 | /** 7 | * A community view. 8 | */ 9 | export type CommunityView = { 10 | community: Community; 11 | community_actions?: CommunityActions; 12 | can_mod: boolean; 13 | post_tags: TagsView; 14 | }; 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "declarationDir": "./dist", 5 | "module": "CommonJS", 6 | "noImplicitAny": true, 7 | "lib": ["es2017", "es7", "es6", "dom"], 8 | "outDir": "./dist", 9 | "target": "ES2020", 10 | "experimentalDecorators": true, 11 | "strictNullChecks": true, 12 | "moduleResolution": "Node", 13 | "esModuleInterop": true 14 | }, 15 | "include": ["src/**/*"], 16 | "exclude": ["node_modules", "dist"] 17 | } 18 | -------------------------------------------------------------------------------- /src/types/LinkMetadata.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { DbUrl } from "./DbUrl"; 3 | 4 | /** 5 | * Site metadata, from its opengraph tags. 6 | */ 7 | export type LinkMetadata = { 8 | content_type?: string; 9 | title?: string; 10 | description?: string; 11 | image?: DbUrl; 12 | image_width?: number; 13 | image_height?: number; 14 | embed_video_url?: DbUrl; 15 | video_width?: number; 16 | video_height?: number; 17 | }; 18 | -------------------------------------------------------------------------------- /src/types/ListRegistrationApplications.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | 4 | /** 5 | * Fetches a list of registration applications. 6 | */ 7 | export type ListRegistrationApplications = { 8 | /** 9 | * Only shows the unread applications (IE those without an admin actor) 10 | */ 11 | unread_only?: boolean; 12 | page_cursor?: PaginationCursor; 13 | limit?: number; 14 | }; 15 | -------------------------------------------------------------------------------- /src/types/SiteView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Instance } from "./Instance"; 3 | import type { LocalSite } from "./LocalSite"; 4 | import type { LocalSiteRateLimit } from "./LocalSiteRateLimit"; 5 | import type { Site } from "./Site"; 6 | 7 | /** 8 | * A site view. 9 | */ 10 | export type SiteView = { 11 | site: Site; 12 | local_site: LocalSite; 13 | local_site_rate_limit: LocalSiteRateLimit; 14 | instance: Instance; 15 | }; 16 | -------------------------------------------------------------------------------- /src/types/ListNotifications.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { NotificationDataType } from "./NotificationDataType"; 3 | import type { PaginationCursor } from "./PaginationCursor"; 4 | 5 | /** 6 | * Get your inbox (replies, comment mentions, post mentions, and messages) 7 | */ 8 | export type ListNotifications = { 9 | type_?: NotificationDataType; 10 | unread_only?: boolean; 11 | page_cursor?: PaginationCursor; 12 | limit?: number; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/ListPersonLiked.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LikeType } from "./LikeType"; 3 | import type { PaginationCursor } from "./PaginationCursor"; 4 | import type { PersonContentType } from "./PersonContentType"; 5 | 6 | /** 7 | * Gets your liked / disliked posts 8 | */ 9 | export type ListPersonLiked = { 10 | type_?: PersonContentType; 11 | like_type?: LikeType; 12 | page_cursor?: PaginationCursor; 13 | limit?: number; 14 | }; 15 | -------------------------------------------------------------------------------- /src/types/GetPostResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityView } from "./CommunityView"; 3 | import type { PostView } from "./PostView"; 4 | 5 | /** 6 | * The post response. 7 | */ 8 | export type GetPostResponse = { 9 | post_view: PostView; 10 | community_view: CommunityView; 11 | /** 12 | * A list of cross-posts, or other times / communities this link has been posted to. 13 | */ 14 | cross_posts: Array; 15 | }; 16 | -------------------------------------------------------------------------------- /src/types/ChangePassword.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SensitiveString } from "./SensitiveString"; 3 | 4 | /** 5 | * Changes your account password. 6 | */ 7 | export type ChangePassword = { 8 | new_password: SensitiveString; 9 | new_password_verify: SensitiveString; 10 | old_password: SensitiveString; 11 | /** 12 | * If this is true the login is valid forever, otherwise it expires after one week. 13 | */ 14 | stay_logged_in?: boolean; 15 | }; 16 | -------------------------------------------------------------------------------- /src/types/RegistrationApplicationView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LocalUser } from "./LocalUser"; 3 | import type { Person } from "./Person"; 4 | import type { RegistrationApplication } from "./RegistrationApplication"; 5 | 6 | /** 7 | * A registration application view. 8 | */ 9 | export type RegistrationApplicationView = { 10 | registration_application: RegistrationApplication; 11 | creator_local_user: LocalUser; 12 | creator: Person; 13 | admin?: Person; 14 | }; 15 | -------------------------------------------------------------------------------- /src/types/NotificationData.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentView } from "./CommentView"; 3 | import type { ModlogView } from "./ModlogView"; 4 | import type { PostView } from "./PostView"; 5 | import type { PrivateMessageView } from "./PrivateMessageView"; 6 | 7 | export type NotificationData = 8 | | ({ type_: "comment" } & CommentView) 9 | | ({ type_: "post" } & PostView) 10 | | ({ type_: "private_message" } & PrivateMessageView) 11 | | ({ type_: "mod_action" } & ModlogView); 12 | -------------------------------------------------------------------------------- /src/types/CommunitySortType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * The community sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html 5 | */ 6 | export type CommunitySortType = 7 | | "active_six_months" 8 | | "active_monthly" 9 | | "active_weekly" 10 | | "active_daily" 11 | | "hot" 12 | | "new" 13 | | "old" 14 | | "name_asc" 15 | | "name_desc" 16 | | "comments" 17 | | "posts" 18 | | "subscribers" 19 | | "subscribers_local"; 20 | -------------------------------------------------------------------------------- /src/types/InstanceActions.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type InstanceActions = { 4 | /** 5 | * When the instance's communities were blocked. 6 | */ 7 | blocked_communities_at?: string; 8 | /** 9 | * When this user received a site ban. 10 | */ 11 | received_ban_at?: string; 12 | /** 13 | * When their ban expires. 14 | */ 15 | ban_expires_at?: string; 16 | /** 17 | * When the instance's persons were blocked. 18 | */ 19 | blocked_persons_at?: string; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/PagedResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | 4 | /** 5 | * This response contains only a single page of items. To get the next page, take the 6 | * cursor string from `next_page` and pass it to the same API endpoint via `page_cursor` 7 | * parameter. For going to the previous page, use `prev_page` instead. 8 | */ 9 | export type PagedResponse = { 10 | items: Array; 11 | next_page?: PaginationCursor; 12 | prev_page?: PaginationCursor; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/GetCommunityResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityModeratorView } from "./CommunityModeratorView"; 3 | import type { CommunityView } from "./CommunityView"; 4 | import type { LanguageId } from "./LanguageId"; 5 | import type { Site } from "./Site"; 6 | 7 | /** 8 | * The community response. 9 | */ 10 | export type GetCommunityResponse = { 11 | community_view: CommunityView; 12 | site?: Site; 13 | moderators: Array; 14 | discussion_languages: Array; 15 | }; 16 | -------------------------------------------------------------------------------- /src/types/UnreadCountsResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Contains the amount of unread items of various types. For normal users this means the number of 5 | * unread notifications, mods and admins get additional unread counts for reports, registration 6 | * applications and pending follows to private communities. 7 | */ 8 | export type UnreadCountsResponse = { 9 | notification_count: number; 10 | report_count?: number; 11 | pending_follow_count?: number; 12 | registration_application_count?: number; 13 | }; 14 | -------------------------------------------------------------------------------- /src/types/CreateOAuthProvider.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * Create an external auth method. 5 | */ 6 | export type CreateOAuthProvider = { 7 | display_name: string; 8 | issuer: string; 9 | authorization_endpoint: string; 10 | token_endpoint: string; 11 | userinfo_endpoint: string; 12 | id_claim: string; 13 | client_id: string; 14 | client_secret: string; 15 | scopes: string; 16 | auto_verify_email?: boolean; 17 | account_linking_enabled?: boolean; 18 | use_pkce?: boolean; 19 | enabled?: boolean; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/ExportDataResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostOrCommentOrPrivateMessage } from "./PostOrCommentOrPrivateMessage"; 3 | import type { UserSettingsBackup } from "./UserSettingsBackup"; 4 | 5 | /** 6 | * Your exported data. 7 | */ 8 | export type ExportDataResponse = { 9 | notifications: Array; 10 | content: Array; 11 | read_posts: Array; 12 | liked: Array; 13 | moderates: Array; 14 | settings: UserSettingsBackup; 15 | }; 16 | -------------------------------------------------------------------------------- /src/types/PrivateMessage.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { DbUrl } from "./DbUrl"; 3 | import type { PersonId } from "./PersonId"; 4 | import type { PrivateMessageId } from "./PrivateMessageId"; 5 | 6 | /** 7 | * A private message. 8 | */ 9 | export type PrivateMessage = { 10 | id: PrivateMessageId; 11 | creator_id: PersonId; 12 | recipient_id: PersonId; 13 | content: string; 14 | deleted: boolean; 15 | published_at: string; 16 | updated_at?: string; 17 | ap_id: DbUrl; 18 | local: boolean; 19 | removed: boolean; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/RegistrationApplication.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LocalUserId } from "./LocalUserId"; 3 | import type { PersonId } from "./PersonId"; 4 | import type { RegistrationApplicationId } from "./RegistrationApplicationId"; 5 | 6 | /** 7 | * A registration application. 8 | */ 9 | export type RegistrationApplication = { 10 | id: RegistrationApplicationId; 11 | local_user_id: LocalUserId; 12 | answer: string; 13 | admin_id?: PersonId; 14 | deny_reason?: string; 15 | published_at: string; 16 | updated_at?: string; 17 | }; 18 | -------------------------------------------------------------------------------- /src/types/GetPersonDetailsResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityModeratorView } from "./CommunityModeratorView"; 3 | import type { MultiCommunityView } from "./MultiCommunityView"; 4 | import type { PersonView } from "./PersonView"; 5 | import type { Site } from "./Site"; 6 | 7 | /** 8 | * A person's details response. 9 | */ 10 | export type GetPersonDetailsResponse = { 11 | person_view: PersonView; 12 | site?: Site; 13 | moderates: Array; 14 | multi_communities_created: Array; 15 | }; 16 | -------------------------------------------------------------------------------- /src/types/FederatedInstanceView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { FederationAllowList } from "./FederationAllowList"; 3 | import type { FederationBlockList } from "./FederationBlockList"; 4 | import type { FederationQueueState } from "./FederationQueueState"; 5 | import type { Instance } from "./Instance"; 6 | import type { Site } from "./Site"; 7 | 8 | export type FederatedInstanceView = { 9 | instance: Instance; 10 | site?: Site; 11 | queue_state?: FederationQueueState; 12 | blocked?: FederationBlockList; 13 | allowed?: FederationAllowList; 14 | }; 15 | -------------------------------------------------------------------------------- /src/types/ModlogView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Comment } from "./Comment"; 3 | import type { Community } from "./Community"; 4 | import type { Instance } from "./Instance"; 5 | import type { Modlog } from "./Modlog"; 6 | import type { Person } from "./Person"; 7 | import type { Post } from "./Post"; 8 | 9 | export type ModlogView = { 10 | modlog: Modlog; 11 | moderator?: Person; 12 | target_person?: Person; 13 | target_instance?: Instance; 14 | target_community?: Community; 15 | target_post?: Post; 16 | target_comment?: Comment; 17 | }; 18 | -------------------------------------------------------------------------------- /src/types/LoginToken.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LocalUserId } from "./LocalUserId"; 3 | 4 | /** 5 | * Stores data related to a specific user login session. 6 | */ 7 | export type LoginToken = { 8 | user_id: LocalUserId; 9 | /** 10 | * Time of login 11 | */ 12 | published_at: string; 13 | /** 14 | * IP address where login was made from, allows invalidating logins by IP address. 15 | * Could be stored in truncated format, or store derived information for better privacy. 16 | */ 17 | ip?: string; 18 | user_agent?: string; 19 | }; 20 | -------------------------------------------------------------------------------- /src/types/ReportCombinedView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentReportView } from "./CommentReportView"; 3 | import type { CommunityReportView } from "./CommunityReportView"; 4 | import type { PostReportView } from "./PostReportView"; 5 | import type { PrivateMessageReportView } from "./PrivateMessageReportView"; 6 | 7 | export type ReportCombinedView = 8 | | ({ type_: "post" } & PostReportView) 9 | | ({ type_: "comment" } & CommentReportView) 10 | | ({ type_: "private_message" } & PrivateMessageReportView) 11 | | ({ type_: "community" } & CommunityReportView); 12 | -------------------------------------------------------------------------------- /src/types/EditOAuthProvider.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { OAuthProviderId } from "./OAuthProviderId"; 3 | 4 | /** 5 | * Edit an external auth method. 6 | */ 7 | export type EditOAuthProvider = { 8 | id: OAuthProviderId; 9 | display_name?: string; 10 | authorization_endpoint?: string; 11 | token_endpoint?: string; 12 | userinfo_endpoint?: string; 13 | id_claim?: string; 14 | client_secret?: string; 15 | scopes?: string; 16 | auto_verify_email?: boolean; 17 | account_linking_enabled?: boolean; 18 | use_pkce?: boolean; 19 | enabled?: boolean; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/CommentReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | import type { CommentReportId } from "./CommentReportId"; 4 | import type { PersonId } from "./PersonId"; 5 | 6 | /** 7 | * A comment report. 8 | */ 9 | export type CommentReport = { 10 | id: CommentReportId; 11 | creator_id: PersonId; 12 | comment_id: CommentId; 13 | original_comment_text: string; 14 | reason: string; 15 | resolved: boolean; 16 | resolver_id?: PersonId; 17 | published_at: string; 18 | updated_at?: string; 19 | violates_instance_rules: boolean; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/SearchCombinedView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentView } from "./CommentView"; 3 | import type { CommunityView } from "./CommunityView"; 4 | import type { MultiCommunityView } from "./MultiCommunityView"; 5 | import type { PersonView } from "./PersonView"; 6 | import type { PostView } from "./PostView"; 7 | 8 | export type SearchCombinedView = 9 | | ({ type_: "post" } & PostView) 10 | | ({ type_: "comment" } & CommentView) 11 | | ({ type_: "community" } & CommunityView) 12 | | ({ type_: "person" } & PersonView) 13 | | ({ type_: "multi_community" } & MultiCommunityView); 14 | -------------------------------------------------------------------------------- /src/types/PersonActions.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | export type PersonActions = { 4 | /** 5 | * When the person was blocked. 6 | */ 7 | blocked_at?: string; 8 | /** 9 | * When the person was noted. 10 | */ 11 | noted_at?: string; 12 | /** 13 | * A note about the person. 14 | */ 15 | note?: string; 16 | /** 17 | * When the person was voted on. 18 | */ 19 | voted_at?: string; 20 | /** 21 | * A total of upvotes given to this person 22 | */ 23 | upvotes?: number; 24 | /** 25 | * A total of downvotes given to this person 26 | */ 27 | downvotes?: number; 28 | }; 29 | -------------------------------------------------------------------------------- /src/types/ListPersonContent.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | import type { PersonContentType } from "./PersonContentType"; 4 | import type { PersonId } from "./PersonId"; 5 | 6 | /** 7 | * Gets a person's content (posts and comments) 8 | * 9 | * Either person_id, or username are required. 10 | */ 11 | export type ListPersonContent = { 12 | type_?: PersonContentType; 13 | person_id?: PersonId; 14 | /** 15 | * Example: dessalines , or dessalines@xyz.tld 16 | */ 17 | username?: string; 18 | page_cursor?: PaginationCursor; 19 | limit?: number; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/PrivateMessageReportView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Person } from "./Person"; 3 | import type { PrivateMessage } from "./PrivateMessage"; 4 | import type { PrivateMessageReport } from "./PrivateMessageReport"; 5 | 6 | /** 7 | * A private message report view. 8 | */ 9 | export type PrivateMessageReportView = { 10 | private_message_report: PrivateMessageReport; 11 | private_message: PrivateMessage; 12 | creator: Person; 13 | private_message_creator: Person; 14 | resolver?: Person; 15 | creator_is_admin: boolean; 16 | creator_banned: boolean; 17 | creator_ban_expires_at?: string; 18 | }; 19 | -------------------------------------------------------------------------------- /src/types/Instance.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { InstanceId } from "./InstanceId"; 3 | 4 | /** 5 | * Basic data about a Fediverse instance which is available for every known domain. Additional 6 | * data may be available in [[Site]]. 7 | */ 8 | export type Instance = { 9 | id: InstanceId; 10 | domain: string; 11 | published_at: string; 12 | /** 13 | * When the instance was updated. 14 | */ 15 | updated_at?: string; 16 | /** 17 | * The software of the instance. 18 | */ 19 | software?: string; 20 | /** 21 | * The version of the instance's software. 22 | */ 23 | version?: string; 24 | }; 25 | -------------------------------------------------------------------------------- /src/types/Login.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SensitiveString } from "./SensitiveString"; 3 | 4 | /** 5 | * Logging into lemmy. 6 | * 7 | * Note: Banned users can still log in, to be able to do certain things like delete 8 | * their account. 9 | */ 10 | export type Login = { 11 | username_or_email: SensitiveString; 12 | password: SensitiveString; 13 | /** 14 | * May be required, if totp is enabled for their account. 15 | */ 16 | totp_2fa_token?: string; 17 | /** 18 | * If this is true the login is valid forever, otherwise it expires after one week. 19 | */ 20 | stay_logged_in?: boolean; 21 | }; 22 | -------------------------------------------------------------------------------- /src/types/Tag.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { DbUrl } from "./DbUrl"; 4 | import type { TagId } from "./TagId"; 5 | 6 | /** 7 | * A tag that is created by community moderators, and assigned to posts by the creator 8 | * or by mods. 9 | */ 10 | export type Tag = { 11 | id: TagId; 12 | ap_id: DbUrl; 13 | name: string; 14 | display_name?: string; 15 | description?: string; 16 | /** 17 | * The community that this tag belongs to 18 | */ 19 | community_id: CommunityId; 20 | published_at: string; 21 | updated_at?: string; 22 | deleted: boolean; 23 | }; 24 | -------------------------------------------------------------------------------- /src/types/ListCommunities.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunitySortType } from "./CommunitySortType"; 3 | import type { ListingType } from "./ListingType"; 4 | import type { PaginationCursor } from "./PaginationCursor"; 5 | 6 | /** 7 | * Fetches a list of communities. 8 | */ 9 | export type ListCommunities = { 10 | type_?: ListingType; 11 | sort?: CommunitySortType; 12 | /** 13 | * Filter to within a given time range, in seconds. 14 | * IE 60 would give results for the past minute. 15 | */ 16 | time_range_seconds?: number; 17 | show_nsfw?: boolean; 18 | page_cursor?: PaginationCursor; 19 | limit?: number; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/FederationQueueState.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { ActivityId } from "./ActivityId"; 3 | import type { InstanceId } from "./InstanceId"; 4 | 5 | export type FederationQueueState = { 6 | instance_id: InstanceId; 7 | /** 8 | * the last successfully sent activity id 9 | */ 10 | last_successful_id?: ActivityId; 11 | last_successful_published_time_at?: string; 12 | /** 13 | * how many failed attempts have been made to send the next activity 14 | */ 15 | fail_count: number; 16 | /** 17 | * timestamp of the last retry attempt (when the last failing activity was resent) 18 | */ 19 | last_retry_at?: string; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/CommunityReportView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Community } from "./Community"; 3 | import type { CommunityReport } from "./CommunityReport"; 4 | import type { Person } from "./Person"; 5 | 6 | /** 7 | * A community report view. 8 | */ 9 | export type CommunityReportView = { 10 | community_report: CommunityReport; 11 | community: Community; 12 | creator: Person; 13 | resolver?: Person; 14 | creator_is_admin: boolean; 15 | creator_is_moderator: boolean; 16 | creator_banned: boolean; 17 | creator_ban_expires_at?: string; 18 | creator_banned_from_community: boolean; 19 | creator_community_ban_expires_at?: string; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/MultiCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { DbUrl } from "./DbUrl"; 3 | import type { InstanceId } from "./InstanceId"; 4 | import type { MultiCommunityId } from "./MultiCommunityId"; 5 | import type { PersonId } from "./PersonId"; 6 | 7 | export type MultiCommunity = { 8 | id: MultiCommunityId; 9 | creator_id: PersonId; 10 | instance_id: InstanceId; 11 | name: string; 12 | title?: string; 13 | description?: string; 14 | local: boolean; 15 | deleted: boolean; 16 | ap_id: DbUrl; 17 | published_at: string; 18 | updated_at?: string; 19 | subscribers: number; 20 | subscribers_local: number; 21 | communities: number; 22 | }; 23 | -------------------------------------------------------------------------------- /src/types/PrivateMessageReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | import type { PrivateMessageId } from "./PrivateMessageId"; 4 | import type { PrivateMessageReportId } from "./PrivateMessageReportId"; 5 | 6 | /** 7 | * The private message report. 8 | */ 9 | export type PrivateMessageReport = { 10 | id: PrivateMessageReportId; 11 | creator_id: PersonId; 12 | private_message_id: PrivateMessageId; 13 | /** 14 | * The original text. 15 | */ 16 | original_pm_text: string; 17 | reason: string; 18 | resolved: boolean; 19 | resolver_id?: PersonId; 20 | published_at: string; 21 | updated_at?: string; 22 | }; 23 | -------------------------------------------------------------------------------- /src/types/CommentSlimView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Comment } from "./Comment"; 3 | import type { CommentActions } from "./CommentActions"; 4 | import type { Person } from "./Person"; 5 | import type { PersonActions } from "./PersonActions"; 6 | 7 | /** 8 | * A slimmer comment view, without the post, or community. 9 | */ 10 | export type CommentSlimView = { 11 | comment: Comment; 12 | creator: Person; 13 | comment_actions?: CommentActions; 14 | person_actions?: PersonActions; 15 | creator_is_admin: boolean; 16 | can_mod: boolean; 17 | creator_banned: boolean; 18 | creator_is_moderator: boolean; 19 | creator_banned_from_community: boolean; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/BanPerson.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PersonId } from "./PersonId"; 3 | 4 | /** 5 | * Ban a person from the site. 6 | */ 7 | export type BanPerson = { 8 | person_id: PersonId; 9 | ban: boolean; 10 | /** 11 | * Optionally remove or restore all their data. Useful for new troll accounts. 12 | * If ban is true, then this means remove. If ban is false, it means restore. 13 | */ 14 | remove_or_restore_data?: boolean; 15 | reason: string; 16 | /** 17 | * A time that the ban will expire, in unix epoch seconds. 18 | * 19 | * An i64 unix timestamp is used for a simpler API client implementation. 20 | */ 21 | expires_at?: number; 22 | }; 23 | -------------------------------------------------------------------------------- /src/types/LoginResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SensitiveString } from "./SensitiveString"; 3 | 4 | /** 5 | * A response for your login. 6 | */ 7 | export type LoginResponse = { 8 | /** 9 | * This is None in response to `Register` if email verification is enabled, or the server 10 | * requires registration applications. 11 | */ 12 | jwt?: SensitiveString; 13 | /** 14 | * If registration applications are required, this will return true for a signup response. 15 | */ 16 | registration_created: boolean; 17 | /** 18 | * If email verifications are required, this will return true for a signup response. 19 | */ 20 | verify_email_sent: boolean; 21 | }; 22 | -------------------------------------------------------------------------------- /src/types/ListMultiCommunities.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { MultiCommunityListingType } from "./MultiCommunityListingType"; 3 | import type { MultiCommunitySortType } from "./MultiCommunitySortType"; 4 | import type { PaginationCursor } from "./PaginationCursor"; 5 | import type { PersonId } from "./PersonId"; 6 | 7 | export type ListMultiCommunities = { 8 | type_?: MultiCommunityListingType; 9 | sort?: MultiCommunitySortType; 10 | creator_id?: PersonId; 11 | /** 12 | * Filter to within a given time range, in seconds. 13 | * IE 60 would give results for the past minute. 14 | */ 15 | time_range_seconds?: number; 16 | page_cursor?: PaginationCursor; 17 | limit?: number; 18 | }; 19 | -------------------------------------------------------------------------------- /src/types/ModlogKind.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * A list of possible types for the various modlog actions. 5 | */ 6 | export type ModlogKind = 7 | | "admin_add" 8 | | "admin_ban" 9 | | "admin_allow_instance" 10 | | "admin_block_instance" 11 | | "admin_purge_comment" 12 | | "admin_purge_community" 13 | | "admin_purge_person" 14 | | "admin_purge_post" 15 | | "mod_add_to_community" 16 | | "mod_ban_from_community" 17 | | "admin_feature_post_site" 18 | | "mod_feature_post_community" 19 | | "mod_change_community_visibility" 20 | | "mod_lock_post" 21 | | "mod_remove_comment" 22 | | "admin_remove_community" 23 | | "mod_remove_post" 24 | | "mod_transfer_community" 25 | | "mod_lock_comment"; 26 | -------------------------------------------------------------------------------- /src/types/Notification.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | import type { ModlogId } from "./ModlogId"; 4 | import type { NotificationId } from "./NotificationId"; 5 | import type { NotificationType } from "./NotificationType"; 6 | import type { PersonId } from "./PersonId"; 7 | import type { PostId } from "./PostId"; 8 | import type { PrivateMessageId } from "./PrivateMessageId"; 9 | 10 | export type Notification = { 11 | id: NotificationId; 12 | recipient_id: PersonId; 13 | comment_id?: CommentId; 14 | read: boolean; 15 | published_at: string; 16 | kind: NotificationType; 17 | post_id?: PostId; 18 | private_message_id?: PrivateMessageId; 19 | modlog_id?: ModlogId; 20 | }; 21 | -------------------------------------------------------------------------------- /src/types/AuthenticateWithOauth.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { OAuthProviderId } from "./OAuthProviderId"; 3 | 4 | /** 5 | * Logging in with an OAuth 2.0 authorization 6 | */ 7 | export type AuthenticateWithOauth = { 8 | code: string; 9 | oauth_provider_id: OAuthProviderId; 10 | redirect_uri: string; 11 | show_nsfw?: boolean; 12 | /** 13 | * Username is mandatory at registration time 14 | */ 15 | username?: string; 16 | /** 17 | * An answer is mandatory if require application is enabled on the server 18 | */ 19 | answer?: string; 20 | pkce_code_verifier?: string; 21 | /** 22 | * If this is true the login is valid forever, otherwise it expires after one week. 23 | */ 24 | stay_logged_in?: boolean; 25 | }; 26 | -------------------------------------------------------------------------------- /src/types/CommunityReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { CommunityReportId } from "./CommunityReportId"; 4 | import type { PersonId } from "./PersonId"; 5 | 6 | /** 7 | * A comment report. 8 | */ 9 | export type CommunityReport = { 10 | id: CommunityReportId; 11 | creator_id: PersonId; 12 | community_id: CommunityId; 13 | original_community_name: string; 14 | original_community_title: string; 15 | original_community_description?: string; 16 | original_community_sidebar?: string; 17 | original_community_icon?: string; 18 | original_community_banner?: string; 19 | reason: string; 20 | resolved: boolean; 21 | resolver_id?: PersonId; 22 | published_at: string; 23 | updated_at?: string; 24 | }; 25 | -------------------------------------------------------------------------------- /src/types/InstanceWithFederationState.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { InstanceId } from "./InstanceId"; 3 | import type { ReadableFederationState } from "./ReadableFederationState"; 4 | 5 | export type InstanceWithFederationState = { 6 | /** 7 | * if federation to this instance is or was active, show state of outgoing federation to this 8 | * instance 9 | */ 10 | federation_state?: ReadableFederationState; 11 | id: InstanceId; 12 | domain: string; 13 | published_at: string; 14 | /** 15 | * When the instance was updated. 16 | */ 17 | updated_at?: string; 18 | /** 19 | * The software of the instance. 20 | */ 21 | software?: string; 22 | /** 23 | * The version of the instance's software. 24 | */ 25 | version?: string; 26 | }; 27 | -------------------------------------------------------------------------------- /src/types/BanFromCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { PersonId } from "./PersonId"; 4 | 5 | /** 6 | * Ban a user from a community. 7 | */ 8 | export type BanFromCommunity = { 9 | community_id: CommunityId; 10 | person_id: PersonId; 11 | ban: boolean; 12 | /** 13 | * Optionally remove or restore all their data. Useful for new troll accounts. 14 | * If ban is true, then this means remove. If ban is false, it means restore. 15 | */ 16 | remove_or_restore_data?: boolean; 17 | reason: string; 18 | /** 19 | * A time that the ban will expire, in unix epoch seconds. 20 | * 21 | * An i64 unix timestamp is used for a simpler API client implementation. 22 | */ 23 | expires_at?: number; 24 | }; 25 | -------------------------------------------------------------------------------- /src/types/ReadableFederationState.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { ActivityId } from "./ActivityId"; 3 | import type { InstanceId } from "./InstanceId"; 4 | 5 | export type ReadableFederationState = { 6 | /** 7 | * timestamp of the next retry attempt (null if fail count is 0) 8 | */ 9 | next_retry_at?: string; 10 | instance_id: InstanceId; 11 | /** 12 | * the last successfully sent activity id 13 | */ 14 | last_successful_id?: ActivityId; 15 | last_successful_published_time_at?: string; 16 | /** 17 | * how many failed attempts have been made to send the next activity 18 | */ 19 | fail_count: number; 20 | /** 21 | * timestamp of the last retry attempt (when the last failing activity was resent) 22 | */ 23 | last_retry_at?: string; 24 | }; 25 | -------------------------------------------------------------------------------- /src/types/PostReport.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { DbUrl } from "./DbUrl"; 3 | import type { PersonId } from "./PersonId"; 4 | import type { PostId } from "./PostId"; 5 | import type { PostReportId } from "./PostReportId"; 6 | 7 | /** 8 | * A post report. 9 | */ 10 | export type PostReport = { 11 | id: PostReportId; 12 | creator_id: PersonId; 13 | post_id: PostId; 14 | /** 15 | * The original post title. 16 | */ 17 | original_post_name: string; 18 | /** 19 | * The original post url. 20 | */ 21 | original_post_url?: DbUrl; 22 | /** 23 | * The original post body. 24 | */ 25 | original_post_body?: string; 26 | reason: string; 27 | resolved: boolean; 28 | resolver_id?: PersonId; 29 | published_at: string; 30 | updated_at?: string; 31 | violates_instance_rules: boolean; 32 | }; 33 | -------------------------------------------------------------------------------- /src/types/EditPost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LanguageId } from "./LanguageId"; 3 | import type { PostId } from "./PostId"; 4 | import type { TagId } from "./TagId"; 5 | 6 | /** 7 | * Edit a post. 8 | */ 9 | export type EditPost = { 10 | post_id: PostId; 11 | name?: string; 12 | url?: string; 13 | /** 14 | * An optional body for the post in markdown. 15 | */ 16 | body?: string; 17 | /** 18 | * An optional alt_text, usable for image posts. 19 | */ 20 | alt_text?: string; 21 | nsfw?: boolean; 22 | language_id?: LanguageId; 23 | /** 24 | * Instead of fetching a thumbnail, use a custom one. 25 | */ 26 | custom_thumbnail?: string; 27 | /** 28 | * Time when this post should be scheduled. Null means publish immediately. 29 | */ 30 | scheduled_publish_time_at?: number; 31 | tags?: Array; 32 | }; 33 | -------------------------------------------------------------------------------- /src/types/CommunityActions.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityFollowerState } from "./CommunityFollowerState"; 3 | import type { CommunityNotificationsMode } from "./CommunityNotificationsMode"; 4 | 5 | export type CommunityActions = { 6 | /** 7 | * When the community was followed. 8 | */ 9 | followed_at?: string; 10 | /** 11 | * When the community was blocked. 12 | */ 13 | blocked_at?: string; 14 | /** 15 | * When this user became a moderator. 16 | */ 17 | became_moderator_at?: string; 18 | /** 19 | * When this user received a ban. 20 | */ 21 | received_ban_at?: string; 22 | /** 23 | * When their ban expires. 24 | */ 25 | ban_expires_at?: string; 26 | /** 27 | * The state of the community follow. 28 | */ 29 | follow_state?: CommunityFollowerState; 30 | notifications?: CommunityNotificationsMode; 31 | }; 32 | -------------------------------------------------------------------------------- /src/types/LocalSiteRateLimit.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LocalSiteId } from "./LocalSiteId"; 3 | 4 | /** 5 | * Rate limits for your site. Given in count / length of time. 6 | */ 7 | export type LocalSiteRateLimit = { 8 | local_site_id: LocalSiteId; 9 | message_max_requests: number; 10 | message_interval_seconds: number; 11 | post_max_requests: number; 12 | post_interval_seconds: number; 13 | register_max_requests: number; 14 | register_interval_seconds: number; 15 | image_max_requests: number; 16 | image_interval_seconds: number; 17 | comment_max_requests: number; 18 | comment_interval_seconds: number; 19 | search_max_requests: number; 20 | search_interval_seconds: number; 21 | published_at: string; 22 | updated_at?: string; 23 | import_user_settings_max_requests: number; 24 | import_user_settings_interval_seconds: number; 25 | }; 26 | -------------------------------------------------------------------------------- /src/types/GetComments.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | import type { CommentSortType } from "./CommentSortType"; 4 | import type { CommunityId } from "./CommunityId"; 5 | import type { ListingType } from "./ListingType"; 6 | import type { PaginationCursor } from "./PaginationCursor"; 7 | import type { PostId } from "./PostId"; 8 | 9 | /** 10 | * Get a list of comments. 11 | */ 12 | export type GetComments = { 13 | type_?: ListingType; 14 | sort?: CommentSortType; 15 | /** 16 | * Filter to within a given time range, in seconds. 17 | * IE 60 would give results for the past minute. 18 | */ 19 | time_range_seconds?: number; 20 | max_depth?: number; 21 | page_cursor?: PaginationCursor; 22 | limit?: number; 23 | community_id?: CommunityId; 24 | community_name?: string; 25 | post_id?: PostId; 26 | parent_id?: CommentId; 27 | }; 28 | -------------------------------------------------------------------------------- /src/types/EditCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { CommunityVisibility } from "./CommunityVisibility"; 4 | import type { LanguageId } from "./LanguageId"; 5 | 6 | /** 7 | * Edit a community. 8 | */ 9 | export type EditCommunity = { 10 | community_id: CommunityId; 11 | /** 12 | * A longer title. 13 | */ 14 | title?: string; 15 | /** 16 | * A sidebar for the community in markdown. 17 | */ 18 | sidebar?: string; 19 | /** 20 | * A shorter, one line description of your community. 21 | */ 22 | description?: string; 23 | /** 24 | * Whether its an NSFW community. 25 | */ 26 | nsfw?: boolean; 27 | /** 28 | * Whether to restrict posting only to moderators. 29 | */ 30 | posting_restricted_to_mods?: boolean; 31 | discussion_languages?: Array; 32 | visibility?: CommunityVisibility; 33 | }; 34 | -------------------------------------------------------------------------------- /src/types/PostActions.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PostNotificationsMode } from "./PostNotificationsMode"; 3 | 4 | export type PostActions = { 5 | /** 6 | * When the post was read. 7 | */ 8 | read_at?: string; 9 | /** 10 | * When was the last time you read the comments. 11 | */ 12 | read_comments_at?: string; 13 | /** 14 | * When the post was saved. 15 | */ 16 | saved_at?: string; 17 | /** 18 | * When the post was upvoted or downvoted. 19 | */ 20 | voted_at?: string; 21 | /** 22 | * When the post was hidden. 23 | */ 24 | hidden_at?: string; 25 | /** 26 | * The number of comments you read last. Subtract this from total comments to get an unread 27 | * count. 28 | */ 29 | read_comments_amount?: number; 30 | /** 31 | * True if upvoted, false if downvoted. Upvote is greater than downvote. 32 | */ 33 | vote_is_upvote?: boolean; 34 | notifications?: PostNotificationsMode; 35 | }; 36 | -------------------------------------------------------------------------------- /src/types/CreatePost.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { LanguageId } from "./LanguageId"; 4 | import type { TagId } from "./TagId"; 5 | 6 | /** 7 | * Create a post. 8 | */ 9 | export type CreatePost = { 10 | name: string; 11 | community_id: CommunityId; 12 | url?: string; 13 | /** 14 | * An optional body for the post in markdown. 15 | */ 16 | body?: string; 17 | /** 18 | * An optional alt_text, usable for image posts. 19 | */ 20 | alt_text?: string; 21 | /** 22 | * A honeypot to catch bots. Should be None. 23 | */ 24 | honeypot?: string; 25 | nsfw?: boolean; 26 | language_id?: LanguageId; 27 | /** 28 | * Instead of fetching a thumbnail, use a custom one. 29 | */ 30 | custom_thumbnail?: string; 31 | tags?: Array; 32 | /** 33 | * Time when this post should be scheduled. Null means publish immediately. 34 | */ 35 | scheduled_publish_time_at?: number; 36 | }; 37 | -------------------------------------------------------------------------------- /src/types/Register.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { SensitiveString } from "./SensitiveString"; 3 | 4 | /** 5 | * Register / Sign up to lemmy. 6 | */ 7 | export type Register = { 8 | username: string; 9 | password: SensitiveString; 10 | password_verify: SensitiveString; 11 | show_nsfw?: boolean; 12 | /** 13 | * email is mandatory if email verification is enabled on the server 14 | */ 15 | email?: SensitiveString; 16 | /** 17 | * The UUID of the captcha item. 18 | */ 19 | captcha_uuid?: string; 20 | /** 21 | * Your captcha answer. 22 | */ 23 | captcha_answer?: string; 24 | /** 25 | * A form field to trick signup bots. Should be None. 26 | */ 27 | honeypot?: string; 28 | /** 29 | * An answer is mandatory if require application is enabled on the server 30 | */ 31 | answer?: string; 32 | /** 33 | * If this is true the login is valid forever, otherwise it expires after one week. 34 | */ 35 | stay_logged_in?: boolean; 36 | }; 37 | -------------------------------------------------------------------------------- /src/types/PostReportView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Community } from "./Community"; 3 | import type { CommunityActions } from "./CommunityActions"; 4 | import type { Person } from "./Person"; 5 | import type { PersonActions } from "./PersonActions"; 6 | import type { Post } from "./Post"; 7 | import type { PostActions } from "./PostActions"; 8 | import type { PostReport } from "./PostReport"; 9 | 10 | /** 11 | * A post report view. 12 | */ 13 | export type PostReportView = { 14 | post_report: PostReport; 15 | post: Post; 16 | community: Community; 17 | creator: Person; 18 | post_creator: Person; 19 | community_actions?: CommunityActions; 20 | post_actions?: PostActions; 21 | person_actions?: PersonActions; 22 | resolver?: Person; 23 | creator_is_admin: boolean; 24 | creator_is_moderator: boolean; 25 | creator_banned: boolean; 26 | creator_ban_expires_at?: string; 27 | creator_banned_from_community: boolean; 28 | creator_community_ban_expires_at?: string; 29 | }; 30 | -------------------------------------------------------------------------------- /src/types/SearchResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { PaginationCursor } from "./PaginationCursor"; 3 | import type { SearchCombinedView } from "./SearchCombinedView"; 4 | 5 | /** 6 | * The search response, containing lists of the return type possibilities 7 | */ 8 | export type SearchResponse = { 9 | /** 10 | * If `Search.q` contains an ActivityPub ID (eg `https://lemmy.world/comment/1`) or an 11 | * identifier (eg `!fediverse@lemmy.ml`) then this field contains the resolved object. 12 | * It should always be shown above other search results. 13 | */ 14 | resolve?: SearchCombinedView; 15 | /** 16 | * Items which contain the search string in post body, comment text, community sidebar etc. 17 | * This is always empty when calling `/api/v4/resolve_object` 18 | */ 19 | search: Array; 20 | /** 21 | * the pagination cursor to use to fetch the next page 22 | */ 23 | next_page?: PaginationCursor; 24 | prev_page?: PaginationCursor; 25 | }; 26 | -------------------------------------------------------------------------------- /src/types/UntranslatedError.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | 3 | /** 4 | * These errors are only used for federation or internally and dont need to be translated. 5 | */ 6 | export type UntranslatedError = 7 | | "InvalidCommunity" 8 | | "CannotCreatePostOrCommentInDeletedOrRemovedCommunity" 9 | | "CannotReceivePage" 10 | | "OnlyLocalAdminCanRemoveCommunity" 11 | | "OnlyLocalAdminCanRestoreCommunity" 12 | | "PostIsLocked" 13 | | { PersonIsBannedFromSite: string } 14 | | "InvalidVoteValue" 15 | | "PageDoesNotSpecifyCreator" 16 | | "FederationDisabled" 17 | | { DomainBlocked: string } 18 | | { DomainNotInAllowList: string } 19 | | "FederationDisabledByStrictAllowList" 20 | | "ContradictingFilters" 21 | | "UrlWithoutDomain" 22 | | "InboxTimeout" 23 | | "CantDeleteSite" 24 | | "ObjectIsNotPublic" 25 | | "ObjectIsNotPrivate" 26 | | { InvalidFollow: string } 27 | | "PurgeInvalidImageUrl" 28 | | "Unreachable" 29 | | "CouldntSendWebmention" 30 | | { CommunityHasNoFollowers: string }; 31 | -------------------------------------------------------------------------------- /src/types/CreateCommunity.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityVisibility } from "./CommunityVisibility"; 3 | import type { LanguageId } from "./LanguageId"; 4 | 5 | /** 6 | * Create a community. 7 | */ 8 | export type CreateCommunity = { 9 | /** 10 | * The unique name. 11 | */ 12 | name: string; 13 | /** 14 | * A longer title. 15 | */ 16 | title: string; 17 | /** 18 | * A sidebar for the community in markdown. 19 | */ 20 | sidebar?: string; 21 | /** 22 | * A shorter, one line description of your community. 23 | */ 24 | description?: string; 25 | /** 26 | * An icon URL. 27 | */ 28 | icon?: string; 29 | /** 30 | * A banner URL. 31 | */ 32 | banner?: string; 33 | /** 34 | * Whether its an NSFW community. 35 | */ 36 | nsfw?: boolean; 37 | /** 38 | * Whether to restrict posting only to moderators. 39 | */ 40 | posting_restricted_to_mods?: boolean; 41 | discussion_languages?: Array; 42 | visibility?: CommunityVisibility; 43 | }; 44 | -------------------------------------------------------------------------------- /src/types/PostView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Community } from "./Community"; 3 | import type { CommunityActions } from "./CommunityActions"; 4 | import type { ImageDetails } from "./ImageDetails"; 5 | import type { Person } from "./Person"; 6 | import type { PersonActions } from "./PersonActions"; 7 | import type { Post } from "./Post"; 8 | import type { PostActions } from "./PostActions"; 9 | import type { TagsView } from "./TagsView"; 10 | 11 | /** 12 | * A post view. 13 | */ 14 | export type PostView = { 15 | post: Post; 16 | creator: Person; 17 | community: Community; 18 | image_details?: ImageDetails; 19 | community_actions?: CommunityActions; 20 | person_actions?: PersonActions; 21 | post_actions?: PostActions; 22 | creator_is_admin: boolean; 23 | tags: TagsView; 24 | can_mod: boolean; 25 | creator_banned: boolean; 26 | creator_ban_expires_at?: string; 27 | creator_is_moderator: boolean; 28 | creator_banned_from_community: boolean; 29 | creator_community_ban_expires_at?: string; 30 | }; 31 | -------------------------------------------------------------------------------- /src/types/CommentView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Comment } from "./Comment"; 3 | import type { CommentActions } from "./CommentActions"; 4 | import type { Community } from "./Community"; 5 | import type { CommunityActions } from "./CommunityActions"; 6 | import type { Person } from "./Person"; 7 | import type { PersonActions } from "./PersonActions"; 8 | import type { Post } from "./Post"; 9 | import type { TagsView } from "./TagsView"; 10 | 11 | /** 12 | * A comment view. 13 | */ 14 | export type CommentView = { 15 | comment: Comment; 16 | creator: Person; 17 | post: Post; 18 | community: Community; 19 | community_actions?: CommunityActions; 20 | comment_actions?: CommentActions; 21 | person_actions?: PersonActions; 22 | creator_is_admin: boolean; 23 | post_tags: TagsView; 24 | can_mod: boolean; 25 | creator_banned: boolean; 26 | creator_ban_expires_at?: string; 27 | creator_is_moderator: boolean; 28 | creator_banned_from_community: boolean; 29 | creator_community_ban_expires_at?: string; 30 | }; 31 | -------------------------------------------------------------------------------- /src/types/MyUserInfo.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Community } from "./Community"; 3 | import type { CommunityFollowerView } from "./CommunityFollowerView"; 4 | import type { CommunityModeratorView } from "./CommunityModeratorView"; 5 | import type { Instance } from "./Instance"; 6 | import type { LanguageId } from "./LanguageId"; 7 | import type { LocalUserView } from "./LocalUserView"; 8 | import type { MultiCommunityView } from "./MultiCommunityView"; 9 | import type { Person } from "./Person"; 10 | 11 | /** 12 | * Your user info. 13 | */ 14 | export type MyUserInfo = { 15 | local_user_view: LocalUserView; 16 | follows: Array; 17 | moderates: Array; 18 | multi_community_follows: Array; 19 | community_blocks: Array; 20 | instance_communities_blocks: Array; 21 | instance_persons_blocks: Array; 22 | person_blocks: Array; 23 | keyword_blocks: Array; 24 | discussion_languages: Array; 25 | }; 26 | -------------------------------------------------------------------------------- /src/types/CommentReportView.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Comment } from "./Comment"; 3 | import type { CommentActions } from "./CommentActions"; 4 | import type { CommentReport } from "./CommentReport"; 5 | import type { Community } from "./Community"; 6 | import type { CommunityActions } from "./CommunityActions"; 7 | import type { Person } from "./Person"; 8 | import type { PersonActions } from "./PersonActions"; 9 | import type { Post } from "./Post"; 10 | 11 | /** 12 | * A comment report view. 13 | */ 14 | export type CommentReportView = { 15 | comment_report: CommentReport; 16 | comment: Comment; 17 | post: Post; 18 | community: Community; 19 | creator: Person; 20 | comment_creator: Person; 21 | comment_actions?: CommentActions; 22 | resolver?: Person; 23 | person_actions?: PersonActions; 24 | community_actions?: CommunityActions; 25 | creator_is_admin: boolean; 26 | creator_is_moderator: boolean; 27 | creator_banned: boolean; 28 | creator_ban_expires_at?: string; 29 | creator_banned_from_community: boolean; 30 | creator_community_ban_expires_at?: string; 31 | }; 32 | -------------------------------------------------------------------------------- /putTypesInIndex.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs/promises"); 2 | const path = require("path"); 3 | 4 | const exportRegex = /export\s+(?:enum|interface|type|const)\s+([A-Za-z0-9_]+)/g; 5 | 6 | const baseExports = [ 7 | 'export * from "./http";', 8 | 'export {UploadImage} from "./other_types";', 9 | ]; 10 | 11 | async function putTypesInIndex() { 12 | const typeFiles = await fs.readdir(path.resolve("./src/types")); 13 | const exports = [...baseExports]; 14 | for (const filename of typeFiles) { 15 | const localExports = []; 16 | const fileText = await fs.readFile(path.resolve(`./src/types/${filename}`)); 17 | for ( 18 | let match = exportRegex.exec(fileText); 19 | match; 20 | match = exportRegex.exec(fileText) 21 | ) { 22 | localExports.push(match[1]); 23 | } 24 | 25 | const spacer = localExports.length > 1 ? "\n" : " "; 26 | 27 | exports.push( 28 | `export {${spacer}${localExports.join( 29 | ",\n", 30 | )}${spacer}} from "./types/${filename.replace(/\..+/, "")}";`, 31 | ); 32 | } 33 | 34 | fs.writeFile(path.resolve("./src/index.ts"), exports.join("\n"), { 35 | flag: "w", 36 | }); 37 | } 38 | 39 | putTypesInIndex(); 40 | -------------------------------------------------------------------------------- /src/types/ListReports.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { PaginationCursor } from "./PaginationCursor"; 4 | import type { PostId } from "./PostId"; 5 | import type { ReportType } from "./ReportType"; 6 | 7 | /** 8 | * List reports. 9 | */ 10 | export type ListReports = { 11 | /** 12 | * Only shows the unresolved reports 13 | */ 14 | unresolved_only?: boolean; 15 | /** 16 | * Filter the type of report. 17 | */ 18 | type_?: ReportType; 19 | /** 20 | * Filter by the post id. Can return either comment or post reports. 21 | */ 22 | post_id?: PostId; 23 | /** 24 | * if no community is given, it returns reports for all communities moderated by the auth user 25 | */ 26 | community_id?: CommunityId; 27 | page_cursor?: PaginationCursor; 28 | limit?: number; 29 | /** 30 | * Only for admins: also show reports with `violates_instance_rules=false` 31 | */ 32 | show_community_rule_violations?: boolean; 33 | /** 34 | * If true, view all your created reports. Works for non-admins/mods also. 35 | */ 36 | my_reports_only?: boolean; 37 | }; 38 | -------------------------------------------------------------------------------- /src/types/UserSettingsBackup.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { LocalUser } from "./LocalUser"; 3 | 4 | /** 5 | * Backup of user data. This struct should never be changed so that the data can be used as a 6 | * long-term backup in case the instance goes down unexpectedly. All fields are optional to allow 7 | * importing partial backups. 8 | * 9 | * This data should not be parsed by apps/clients, but directly downloaded as a file. 10 | * 11 | * Be careful with any changes to this struct, to avoid breaking changes which could prevent 12 | * importing older backups. 13 | */ 14 | export type UserSettingsBackup = { 15 | display_name?: string; 16 | bio?: string; 17 | avatar?: string; 18 | banner?: string; 19 | matrix_id?: string; 20 | bot_account?: boolean; 21 | settings?: LocalUser; 22 | followed_communities: Array; 23 | saved_posts: Array; 24 | saved_comments: Array; 25 | blocked_communities: Array; 26 | blocked_users: Array; 27 | blocked_instances_communities: Array; 28 | blocked_instances_persons: Array; 29 | blocking_keywords: Array; 30 | discussion_languages: Array; 31 | }; 32 | -------------------------------------------------------------------------------- /src/types/Person.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { DbUrl } from "./DbUrl"; 3 | import type { InstanceId } from "./InstanceId"; 4 | import type { PersonId } from "./PersonId"; 5 | 6 | /** 7 | * A person. 8 | */ 9 | export type Person = { 10 | id: PersonId; 11 | name: string; 12 | /** 13 | * A shorter display name. 14 | */ 15 | display_name?: string; 16 | /** 17 | * A URL for an avatar. 18 | */ 19 | avatar?: DbUrl; 20 | published_at: string; 21 | updated_at?: string; 22 | /** 23 | * The federated ap_id. 24 | */ 25 | ap_id: DbUrl; 26 | /** 27 | * An optional bio, in markdown. 28 | */ 29 | bio?: string; 30 | /** 31 | * Whether the person is local to our site. 32 | */ 33 | local: boolean; 34 | /** 35 | * A URL for a banner. 36 | */ 37 | banner?: DbUrl; 38 | /** 39 | * Whether the person is deleted. 40 | */ 41 | deleted: boolean; 42 | /** 43 | * A matrix id, usually given an @person:matrix.org 44 | */ 45 | matrix_user_id?: string; 46 | /** 47 | * Whether the person is a bot account. 48 | */ 49 | bot_account: boolean; 50 | instance_id: InstanceId; 51 | post_count: number; 52 | comment_count: number; 53 | }; 54 | -------------------------------------------------------------------------------- /tsoa.json: -------------------------------------------------------------------------------- 1 | { 2 | "entryFile": "src/http.ts", 3 | "noImplicitAdditionalProperties": "throw-on-extras", 4 | "controllerPathGlobs": [ 5 | "src/http.ts" 6 | ], 7 | "spec": { 8 | "outputDirectory": "tsoa_build", 9 | "specVersion": 3, 10 | "securityDefinitions": { 11 | "bearerAuth": { 12 | "type": "http", 13 | "scheme": "bearer", 14 | "bearerFormat": "JWT" 15 | } 16 | }, 17 | "spec": { 18 | "servers": [ 19 | { 20 | "url": "https://voyager.lemmy.ml", 21 | "description": "Lemmy Voyager: Testing environment" 22 | }, 23 | { 24 | "url": "https://ds9.lemmy.ml", 25 | "description": "Lemmy ds9: Testing environment" 26 | }, 27 | { 28 | "url": "https://enterprise.lemmy.ml", 29 | "description": "Lemmy Enterprise: Testing environment" 30 | }, 31 | { 32 | "url": "http://localhost:8536", 33 | "description": "Local testing environment" 34 | }, 35 | { 36 | "url": "https://lemmy.ml", 37 | "description": "Lemmy.ml" 38 | }, 39 | { 40 | "url": "https://lemmy.world", 41 | "description": "Lemmy.world" 42 | } 43 | ] 44 | } 45 | }, 46 | "routes": { 47 | "routesDir": "tsoa_build" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/types/GetModlog.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | import type { CommunityId } from "./CommunityId"; 4 | import type { ListingType } from "./ListingType"; 5 | import type { ModlogKind } from "./ModlogKind"; 6 | import type { PaginationCursor } from "./PaginationCursor"; 7 | import type { PersonId } from "./PersonId"; 8 | import type { PostId } from "./PostId"; 9 | 10 | /** 11 | * Fetches the modlog. 12 | */ 13 | export type GetModlog = { 14 | /** 15 | * Filter by the moderator. 16 | */ 17 | mod_person_id?: PersonId; 18 | /** 19 | * Filter by the community. 20 | */ 21 | community_id?: CommunityId; 22 | /** 23 | * Filter by the modlog action type. 24 | */ 25 | type_?: ModlogKind; 26 | /** 27 | * Filter by listing type. When not using All, it will remove the non-community modlog entries, 28 | * such as site bans, instance blocks, adding an admin, etc. 29 | */ 30 | listing_type?: ListingType; 31 | /** 32 | * Filter by the other / modded person. 33 | */ 34 | other_person_id?: PersonId; 35 | /** 36 | * Filter by post. Will include comments of that post. 37 | */ 38 | post_id?: PostId; 39 | /** 40 | * Filter by comment. 41 | */ 42 | comment_id?: CommentId; 43 | page_cursor?: PaginationCursor; 44 | limit?: number; 45 | }; 46 | -------------------------------------------------------------------------------- /src/types/Site.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { DbUrl } from "./DbUrl"; 3 | import type { InstanceId } from "./InstanceId"; 4 | import type { SiteId } from "./SiteId"; 5 | 6 | /** 7 | * Additional data for federated instances. This may be missing for other platforms which are not 8 | * fully compatible. Basic data is guaranteed to be available via [[Instance]]. 9 | */ 10 | export type Site = { 11 | id: SiteId; 12 | name: string; 13 | /** 14 | * A sidebar for the site in markdown. 15 | */ 16 | sidebar?: string; 17 | published_at: string; 18 | updated_at?: string; 19 | /** 20 | * An icon URL. 21 | */ 22 | icon?: DbUrl; 23 | /** 24 | * A banner url. 25 | */ 26 | banner?: DbUrl; 27 | /** 28 | * A shorter, one-line description of the site. 29 | */ 30 | description?: string; 31 | /** 32 | * The federated ap_id. 33 | */ 34 | ap_id: DbUrl; 35 | /** 36 | * The time the site was last refreshed. 37 | */ 38 | last_refreshed_at: string; 39 | /** 40 | * The site inbox 41 | */ 42 | inbox_url: DbUrl; 43 | public_key: string; 44 | instance_id: InstanceId; 45 | /** 46 | * If present, nsfw content is visible by default. Should be displayed by frontends/clients 47 | * when the site is first opened by a user. 48 | */ 49 | content_warning?: string; 50 | }; 51 | -------------------------------------------------------------------------------- /src/types/Search.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { ListingType } from "./ListingType"; 4 | import type { PaginationCursor } from "./PaginationCursor"; 5 | import type { PersonId } from "./PersonId"; 6 | import type { SearchSortType } from "./SearchSortType"; 7 | import type { SearchType } from "./SearchType"; 8 | 9 | /** 10 | * Searches the site, given a search term, and some optional filters. 11 | */ 12 | export type Search = { 13 | /** 14 | * The search query. Can be a plain text, or an object ID which will be resolved 15 | * (eg `https://lemmy.world/comment/1` or `!fediverse@lemmy.ml`). 16 | */ 17 | q: string; 18 | community_id?: CommunityId; 19 | community_name?: string; 20 | creator_id?: PersonId; 21 | type_?: SearchType; 22 | sort?: SearchSortType; 23 | /** 24 | * Filter to within a given time range, in seconds. 25 | * IE 60 would give results for the past minute. 26 | */ 27 | time_range_seconds?: number; 28 | listing_type?: ListingType; 29 | title_only?: boolean; 30 | post_url_only?: boolean; 31 | liked_only?: boolean; 32 | disliked_only?: boolean; 33 | /** 34 | * If true, then show the nsfw posts (even if your user setting is to hide them) 35 | */ 36 | show_nsfw?: boolean; 37 | page_cursor?: PaginationCursor; 38 | limit?: number; 39 | }; 40 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import pluginJs from "@eslint/js"; 2 | import tseslint from "typescript-eslint"; 3 | 4 | export default [ 5 | pluginJs.configs.recommended, 6 | ...tseslint.configs.recommended, 7 | { 8 | languageOptions: { 9 | parser: tseslint.parser, 10 | }, 11 | }, 12 | // For some reason this has to be in its own block 13 | { 14 | ignores: ["putTypesInIndex.js", "dist/*", "docs/*"], 15 | }, 16 | { 17 | files: ["src/**/*"], 18 | rules: { 19 | "@typescript-eslint/no-empty-interface": 0, 20 | "@typescript-eslint/no-empty-function": 0, 21 | "@typescript-eslint/ban-ts-comment": 0, 22 | "@typescript-eslint/no-explicit-any": 0, 23 | "@typescript-eslint/explicit-module-boundary-types": 0, 24 | "@typescript-eslint/no-empty-object-type": 0, 25 | "arrow-body-style": 0, 26 | curly: 0, 27 | "eol-last": 0, 28 | eqeqeq: 0, 29 | "func-style": 0, 30 | "import/no-duplicates": 0, 31 | "max-statements": 0, 32 | "max-params": 0, 33 | "new-cap": 0, 34 | "no-console": 0, 35 | "no-duplicate-imports": 0, 36 | "no-extra-parens": 0, 37 | "no-return-assign": 0, 38 | "no-throw-literal": 1, 39 | "no-trailing-spaces": 0, 40 | "no-unused-expressions": 0, 41 | "no-useless-constructor": 0, 42 | "no-useless-escape": 0, 43 | "no-var": 0, 44 | "prefer-const": 0, 45 | "prefer-rest-params": 0, 46 | "quote-props": 0, 47 | "unicorn/filename-case": 0, 48 | }, 49 | }, 50 | ]; 51 | -------------------------------------------------------------------------------- /src/types/GetSiteResponse.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { Language } from "./Language"; 3 | import type { LanguageId } from "./LanguageId"; 4 | import type { LocalSiteUrlBlocklist } from "./LocalSiteUrlBlocklist"; 5 | import type { OAuthProvider } from "./OAuthProvider"; 6 | import type { PersonView } from "./PersonView"; 7 | import type { PluginMetadata } from "./PluginMetadata"; 8 | import type { PublicOAuthProvider } from "./PublicOAuthProvider"; 9 | import type { SiteView } from "./SiteView"; 10 | import type { Tagline } from "./Tagline"; 11 | 12 | /** 13 | * An expanded response for a site. 14 | */ 15 | export type GetSiteResponse = { 16 | site_view: SiteView; 17 | admins: Array; 18 | version: string; 19 | all_languages: Array; 20 | discussion_languages: Array; 21 | /** 22 | * If the site has any taglines, a random one is included here for displaying 23 | */ 24 | tagline?: Tagline; 25 | /** 26 | * A list of external auth methods your site supports. 27 | */ 28 | oauth_providers: Array; 29 | admin_oauth_providers: Array; 30 | blocked_urls: Array; 31 | image_upload_disabled: boolean; 32 | active_plugins: Array; 33 | /** 34 | * The number of seconds between the last application published, and approved / denied time. 35 | * 36 | * Useful for estimating when your application will be approved. 37 | */ 38 | last_application_duration_seconds?: number; 39 | }; 40 | -------------------------------------------------------------------------------- /scripts/copy_generated_types_from_lemmy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" 5 | 6 | cd "$CWD/../" 7 | 8 | # Remove the old types 9 | rm -rf src/types/* 10 | 11 | # Remove the old bindings 12 | pushd ../lemmy/crates 13 | find . -name bindings -type d -exec rm -rf {} \; || true 14 | popd 15 | 16 | # First re-generate the types by running cargo test on lemmy 17 | pushd ../lemmy 18 | 19 | # Export the ts-rs bindings 20 | cargo test --workspace export_bindings --features ts-rs 21 | 22 | pushd crates 23 | 24 | # Copy them over to the types folder 25 | find . -type f -name "*.ts" -exec cp {} ../../lemmy-js-client/src/types/ \; 26 | 27 | popd 28 | popd 29 | 30 | # Make sure that all fields use `?` and not `| null` 31 | CONTAINS_NULL=$(grep -nr --include=\*.ts ' | null' src/ || true) 32 | 33 | if [ -n "$CONTAINS_NULL" ]; then 34 | echo -e "Error: missing derive attribute 'ts(optional_fields)':" 35 | echo "$CONTAINS_NULL" 36 | exit 1 37 | fi 38 | 39 | # Change all the bigints to numbers 40 | find src/types -type f -name '*.ts' -exec sed -i 's/bigint/number/g' {} + 41 | 42 | # on MacOS: 43 | # find src/types -type f -name '*.ts' -exec sed -i '' -e 's/bigint/number/g' {} \; 44 | 45 | # Parse LemmyErrorType and convert it to array. 46 | pnpm prettier -w src/types/LemmyErrorType.ts 47 | ALL_ERRORS=$(cat src/types/LemmyErrorType.ts | perl -nle 'm/\{ \s*error:\s*"(.*?)" \}/; print $1' | sed '/^[[:space:]]*$/d' | sed 's/^/"/;s/$/"/' | tr '\n' ',') 48 | echo "export const AllLemmyErrors = [$ALL_ERRORS];" >src/types/AllLemmyErrors.ts 49 | 50 | node putTypesInIndex.js 51 | 52 | pnpm prettier -w src 53 | -------------------------------------------------------------------------------- /src/types/GetPosts.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { ListingType } from "./ListingType"; 4 | import type { MultiCommunityId } from "./MultiCommunityId"; 5 | import type { PaginationCursor } from "./PaginationCursor"; 6 | import type { PostSortType } from "./PostSortType"; 7 | 8 | /** 9 | * Get a list of posts. 10 | */ 11 | export type GetPosts = { 12 | type_?: ListingType; 13 | sort?: PostSortType; 14 | /** 15 | * Filter to within a given time range, in seconds. 16 | * IE 60 would give results for the past minute. 17 | * Use Zero to override the local_site and local_user time_range. 18 | */ 19 | time_range_seconds?: number; 20 | community_id?: CommunityId; 21 | community_name?: string; 22 | multi_community_id?: MultiCommunityId; 23 | multi_community_name?: string; 24 | show_hidden?: boolean; 25 | /** 26 | * If true, then show the read posts (even if your user setting is to hide them) 27 | */ 28 | show_read?: boolean; 29 | /** 30 | * If true, then show the nsfw posts (even if your user setting is to hide them) 31 | */ 32 | show_nsfw?: boolean; 33 | /** 34 | * If false, then show posts with media attached (even if your user setting is to hide them) 35 | */ 36 | hide_media?: boolean; 37 | /** 38 | * Whether to automatically mark fetched posts as read. 39 | */ 40 | mark_as_read?: boolean; 41 | /** 42 | * If true, then only show posts with no comments 43 | */ 44 | no_comments_only?: boolean; 45 | page_cursor?: PaginationCursor; 46 | limit?: number; 47 | }; 48 | -------------------------------------------------------------------------------- /.woodpecker.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | - &install_pnpm "npm i -f -g corepack@latest && corepack enable pnpm" 3 | 4 | steps: 5 | install: 6 | image: node:alpine 7 | commands: 8 | - *install_pnpm 9 | - pnpm i 10 | when: 11 | - event: pull_request 12 | 13 | tsoa: 14 | image: node:alpine 15 | commands: 16 | - *install_pnpm 17 | - pnpm tsoa 18 | when: 19 | - event: pull_request 20 | 21 | lint: 22 | image: node:alpine 23 | commands: 24 | - *install_pnpm 25 | - pnpm lint 26 | when: 27 | - event: pull_request 28 | 29 | npm_publish: 30 | image: node:alpine 31 | environment: 32 | NPM_TOKEN: 33 | from_secret: npm_token 34 | commands: 35 | - *install_pnpm 36 | - pnpm i 37 | - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc 38 | - echo "email = tyhou13@gmx.com" >> ~/.npmrc 39 | - npm publish --tag latest 40 | when: 41 | - event: tag 42 | 43 | notify_success: 44 | image: alpine:3 45 | commands: 46 | - apk add curl 47 | - "curl -H'Title: ✔️ ${CI_REPO_NAME}/${CI_COMMIT_SOURCE_BRANCH}' -d'${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci" 48 | when: 49 | - event: pull_request 50 | status: [success] 51 | 52 | notify_failure: 53 | image: alpine:3 54 | commands: 55 | - apk add curl 56 | - "curl -H'Title: ❌ ${CI_REPO_NAME}/${CI_COMMIT_SOURCE_BRANCH}' -d'${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci" 57 | when: 58 | - event: pull_request 59 | status: [failure] 60 | 61 | notify_on_tag_deploy: 62 | image: alpine:3 63 | commands: 64 | - apk add curl 65 | - "curl -H'Title: ${CI_REPO_NAME}:${CI_COMMIT_TAG} deployed' -d'${CI_PIPELINE_URL}' ntfy.sh/lemmy_drone_ci" 66 | when: 67 | event: tag 68 | -------------------------------------------------------------------------------- /src/types/Comment.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentId } from "./CommentId"; 3 | import type { DbUrl } from "./DbUrl"; 4 | import type { LanguageId } from "./LanguageId"; 5 | import type { PersonId } from "./PersonId"; 6 | import type { PostId } from "./PostId"; 7 | 8 | /** 9 | * A comment. 10 | */ 11 | export type Comment = { 12 | id: CommentId; 13 | creator_id: PersonId; 14 | post_id: PostId; 15 | content: string; 16 | /** 17 | * Whether the comment has been removed. 18 | */ 19 | removed: boolean; 20 | published_at: string; 21 | updated_at?: string; 22 | /** 23 | * Whether the comment has been deleted by its creator. 24 | */ 25 | deleted: boolean; 26 | /** 27 | * The federated activity id / ap_id. 28 | */ 29 | ap_id: DbUrl; 30 | /** 31 | * Whether the comment is local. 32 | */ 33 | local: boolean; 34 | /** 35 | * The path / tree location of a comment, separated by dots, ending with the comment's id. Ex: 36 | * 0.24.27 37 | */ 38 | path: string; 39 | /** 40 | * Whether the comment has been distinguished(speaking officially) by a mod. 41 | */ 42 | distinguished: boolean; 43 | language_id: LanguageId; 44 | score: number; 45 | upvotes: number; 46 | downvotes: number; 47 | /** 48 | * The total number of children in this comment branch. 49 | */ 50 | child_count: number; 51 | report_count: number; 52 | unresolved_report_count: number; 53 | /** 54 | * If a local user comments in a remote community, the comment is hidden until it is confirmed 55 | * accepted by the community (by receiving it back via federation). 56 | */ 57 | federation_pending: boolean; 58 | /** 59 | * Whether the comment is locked. 60 | */ 61 | locked: boolean; 62 | }; 63 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lemmy-js-client", 3 | "description": "A javascript / typescript client for Lemmy", 4 | "version": "1.0.0-merge-count-endpoints.4", 5 | "author": "Dessalines", 6 | "license": "AGPL-3.0", 7 | "main": "./dist/index.js", 8 | "files": [ 9 | "/dist" 10 | ], 11 | "scripts": { 12 | "build": "tsc", 13 | "docs": "typedoc src/index.ts", 14 | "lint": "tsc --noEmit && eslint --report-unused-disable-directives && prettier --check src", 15 | "prepare": "pnpm run build && husky", 16 | "tsoa": "tsoa spec-and-routes && tsc && redocly build-docs tsoa_build/swagger.json" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/LemmyNet/lemmy-js-client.git" 21 | }, 22 | "dependencies": { 23 | "@tsoa/runtime": "^6.6.0" 24 | }, 25 | "devDependencies": { 26 | "@eslint/js": "^9.20.0", 27 | "@redocly/cli": "^2.0.0", 28 | "@types/node": "^24.0.0", 29 | "@typescript-eslint/eslint-plugin": "^8.7.0", 30 | "@typescript-eslint/parser": "^8.7.0", 31 | "ajv": "^8.17.1", 32 | "eslint": "^9.11.1", 33 | "eslint-plugin-prettier": "^5.2.1", 34 | "husky": "^9.1.4", 35 | "joi": "^18.0.0", 36 | "lint-staged": "^16.0.0", 37 | "prettier": "^3.3.3", 38 | "prettier-plugin-import-sort": "^0.0.7", 39 | "prettier-plugin-organize-imports": "^4.0.0", 40 | "prettier-plugin-packagejson": "^2.5.1", 41 | "sortpack": "^4.0.0", 42 | "tsoa": "^6.6.0", 43 | "typedoc": "^0.28.0", 44 | "typescript": "^5.5.4", 45 | "typescript-eslint": "^8.7.0" 46 | }, 47 | "packageManager": "pnpm@10.26.1", 48 | "types": "./dist/index.d.ts", 49 | "lint-staged": { 50 | "*.{ts,tsx,js}": [ 51 | "prettier --write", 52 | "eslint --fix" 53 | ], 54 | "package.json": [ 55 | "sortpack" 56 | ] 57 | }, 58 | "importSort": { 59 | ".js, .jsx, .ts, .tsx": { 60 | "style": "module", 61 | "parser": "typescript" 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | ![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/LemmyNet/lemmy-js-client.svg) 4 | [![GitHub issues](https://img.shields.io/github/issues-raw/LemmyNet/lemmy-js-client.svg)](https://github.com/LemmyNet/lemmy-js-client/issues) 5 | [![License](https://img.shields.io/github/license/LemmyNet/lemmy-js-client.svg)](LICENSE) 6 | ![GitHub stars](https://img.shields.io/github/stars/LemmyNet/lemmy-js-client?style=social) 7 | 8 |
9 | 10 | # lemmy-js-client 11 | 12 | A javascript / typescript http client and type system for [Lemmy](https://github.com/LemmyNet/lemmy). 13 | 14 | ## Installation 15 | 16 | `pnpm install lemmy-js-client` 17 | 18 | ## Usage 19 | 20 | ### HTTP Client 21 | 22 | [LemmyHttp docs](https://join-lemmy.org/docs/contributors/04-api.html) 23 | 24 | ```ts 25 | import { LemmyHttp, Login } from "lemmy-js-client"; 26 | 27 | // Build the client 28 | const baseUrl = "https://lemmy.ml"; 29 | const client: LemmyHttp = new LemmyHttp(baseUrl); 30 | 31 | // Build the login form 32 | const loginForm: Login = { 33 | username_or_email: "my_name", 34 | password: "my_pass", 35 | }; 36 | 37 | // Login and set the client headers with your jwt 38 | const { jwt } = await client.login(loginForm); 39 | client.setHeaders({ Authorization: `Bearer ${jwt}` }); 40 | 41 | // Fetch top posts for the day 42 | const getPostsForm: GetPosts = { 43 | sort: "TopDay", 44 | type_: "Local", 45 | }; 46 | const posts = await client.getPosts(getPostsForm); 47 | ``` 48 | 49 | ## Development 50 | 51 | Use `pnpm add` to develop and test changes locally: 52 | 53 | `pnpm add path/to/lemmy-js-client` 54 | 55 | Alternatively, use `yalc publish` and `yalc add lemmy-js-client` 56 | 57 | ## Generating typescript types from lemmy structs 58 | 59 | Run `./scripts/copy_generated_types_from_lemmy.sh` 60 | 61 | ## OpenAPI 62 | 63 | To generate OpenAPI docs, run `pnpm tsoa` 64 | 65 | This creates two files: 66 | 67 | - `redoc-static.html` - A static html rendering of the OpenAPI docs. 68 | - `tsoa_build/swagger.json` - An OpenAPI / Swagger json file. 69 | 70 | To contribute, check out the [tsoa docs](https://tsoa-community.github.io/docs/). 71 | -------------------------------------------------------------------------------- /src/types/OAuthProvider.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { OAuthProviderId } from "./OAuthProviderId"; 3 | 4 | /** 5 | * oauth provider with client_secret - should never be sent to the client 6 | */ 7 | export type OAuthProvider = { 8 | id: OAuthProviderId; 9 | /** 10 | * The OAuth 2.0 provider name displayed to the user on the Login page 11 | */ 12 | display_name: string; 13 | /** 14 | * The issuer url of the OAUTH provider. 15 | */ 16 | issuer: string; 17 | /** 18 | * The authorization endpoint is used to interact with the resource owner and obtain an 19 | * authorization grant. This is usually provided by the OAUTH provider. 20 | */ 21 | authorization_endpoint: string; 22 | /** 23 | * The token endpoint is used by the client to obtain an access token by presenting its 24 | * authorization grant or refresh token. This is usually provided by the OAUTH provider. 25 | */ 26 | token_endpoint: string; 27 | /** 28 | * The UserInfo Endpoint is an OAuth 2.0 Protected Resource that returns Claims about the 29 | * authenticated End-User. This is defined in the OIDC specification. 30 | */ 31 | userinfo_endpoint: string; 32 | /** 33 | * The OAuth 2.0 claim containing the unique user ID returned by the provider. Usually this 34 | * should be set to "sub". 35 | */ 36 | id_claim: string; 37 | /** 38 | * The client_id is provided by the OAuth 2.0 provider and is a unique identifier to this 39 | * service 40 | */ 41 | client_id: string; 42 | /** 43 | * Lists the scopes requested from users. Users will have to grant access to the requested scope 44 | * at sign up. 45 | */ 46 | scopes: string; 47 | /** 48 | * Automatically sets email as verified on registration 49 | */ 50 | auto_verify_email: boolean; 51 | /** 52 | * Allows linking an OAUTH account to an existing user account by matching emails 53 | */ 54 | account_linking_enabled: boolean; 55 | /** 56 | * switch to enable or disable an oauth provider 57 | */ 58 | enabled: boolean; 59 | published_at: string; 60 | updated_at?: string; 61 | /** 62 | * switch to enable or disable PKCE 63 | */ 64 | use_pkce: boolean; 65 | }; 66 | -------------------------------------------------------------------------------- /src/types/Community.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { CommunityVisibility } from "./CommunityVisibility"; 4 | import type { DbUrl } from "./DbUrl"; 5 | import type { InstanceId } from "./InstanceId"; 6 | 7 | /** 8 | * A community. 9 | */ 10 | export type Community = { 11 | id: CommunityId; 12 | name: string; 13 | /** 14 | * A longer title, that can contain other characters, and doesn't have to be unique. 15 | */ 16 | title: string; 17 | /** 18 | * A sidebar for the community in markdown. 19 | */ 20 | sidebar?: string; 21 | /** 22 | * Whether the community is removed by a mod. 23 | */ 24 | removed: boolean; 25 | published_at: string; 26 | updated_at?: string; 27 | /** 28 | * Whether the community has been deleted by its creator. 29 | */ 30 | deleted: boolean; 31 | /** 32 | * Whether its an NSFW community. 33 | */ 34 | nsfw: boolean; 35 | /** 36 | * The federated ap_id. 37 | */ 38 | ap_id: DbUrl; 39 | /** 40 | * Whether the community is local. 41 | */ 42 | local: boolean; 43 | /** 44 | * A URL for an icon. 45 | */ 46 | icon?: DbUrl; 47 | /** 48 | * A URL for a banner. 49 | */ 50 | banner?: DbUrl; 51 | /** 52 | * Whether posting is restricted to mods only. 53 | */ 54 | posting_restricted_to_mods: boolean; 55 | instance_id: InstanceId; 56 | visibility: CommunityVisibility; 57 | /** 58 | * A shorter, one-line description of the site. 59 | */ 60 | description?: string; 61 | subscribers: number; 62 | posts: number; 63 | comments: number; 64 | /** 65 | * The number of users with any activity in the last day. 66 | */ 67 | users_active_day: number; 68 | /** 69 | * The number of users with any activity in the last week. 70 | */ 71 | users_active_week: number; 72 | /** 73 | * The number of users with any activity in the last month. 74 | */ 75 | users_active_month: number; 76 | /** 77 | * The number of users with any activity in the last year. 78 | */ 79 | users_active_half_year: number; 80 | subscribers_local: number; 81 | report_count: number; 82 | unresolved_report_count: number; 83 | local_removed: boolean; 84 | }; 85 | -------------------------------------------------------------------------------- /src/types/CreateSite.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentSortType } from "./CommentSortType"; 3 | import type { FederationMode } from "./FederationMode"; 4 | import type { LanguageId } from "./LanguageId"; 5 | import type { ListingType } from "./ListingType"; 6 | import type { MultiCommunityId } from "./MultiCommunityId"; 7 | import type { PostListingMode } from "./PostListingMode"; 8 | import type { PostSortType } from "./PostSortType"; 9 | import type { RegistrationMode } from "./RegistrationMode"; 10 | 11 | /** 12 | * Creates a site. Should be done after first running lemmy. 13 | */ 14 | export type CreateSite = { 15 | name: string; 16 | sidebar?: string; 17 | description?: string; 18 | community_creation_admin_only?: boolean; 19 | require_email_verification?: boolean; 20 | application_question?: string; 21 | private_instance?: boolean; 22 | default_theme?: string; 23 | default_post_listing_type?: ListingType; 24 | default_post_listing_mode?: PostListingMode; 25 | default_post_sort_type?: PostSortType; 26 | default_post_time_range_seconds?: number; 27 | default_comment_sort_type?: CommentSortType; 28 | legal_information?: string; 29 | application_email_admins?: boolean; 30 | discussion_languages?: Array; 31 | slur_filter_regex?: string; 32 | rate_limit_message_max_requests?: number; 33 | rate_limit_message_interval_seconds?: number; 34 | rate_limit_post_max_requests?: number; 35 | rate_limit_post_interval_seconds?: number; 36 | rate_limit_register_max_requests?: number; 37 | rate_limit_register_interval_seconds?: number; 38 | rate_limit_image_max_requests?: number; 39 | rate_limit_image_interval_seconds?: number; 40 | rate_limit_comment_max_requests?: number; 41 | rate_limit_comment_interval_seconds?: number; 42 | rate_limit_search_max_requests?: number; 43 | rate_limit_search_interval_seconds?: number; 44 | rate_limit_import_user_settings_max_requests?: number; 45 | rate_limit_import_user_settings_interval_seconds?: number; 46 | federation_enabled?: boolean; 47 | captcha_enabled?: boolean; 48 | captcha_difficulty?: string; 49 | registration_mode?: RegistrationMode; 50 | oauth_registration?: boolean; 51 | content_warning?: string; 52 | post_upvotes?: FederationMode; 53 | post_downvotes?: FederationMode; 54 | comment_upvotes?: FederationMode; 55 | comment_downvotes?: FederationMode; 56 | disallow_nsfw_content?: boolean; 57 | disable_email_notifications?: boolean; 58 | suggested_communities?: MultiCommunityId; 59 | }; 60 | -------------------------------------------------------------------------------- /src/types/Post.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommunityId } from "./CommunityId"; 3 | import type { DbUrl } from "./DbUrl"; 4 | import type { LanguageId } from "./LanguageId"; 5 | import type { PersonId } from "./PersonId"; 6 | import type { PostId } from "./PostId"; 7 | 8 | /** 9 | * A post. 10 | */ 11 | export type Post = { 12 | id: PostId; 13 | name: string; 14 | /** 15 | * An optional link / url for the post. 16 | */ 17 | url?: DbUrl; 18 | /** 19 | * An optional post body, in markdown. 20 | */ 21 | body?: string; 22 | creator_id: PersonId; 23 | community_id: CommunityId; 24 | /** 25 | * Whether the post is removed. 26 | */ 27 | removed: boolean; 28 | /** 29 | * Whether the post is locked. 30 | */ 31 | locked: boolean; 32 | published_at: string; 33 | updated_at?: string; 34 | /** 35 | * Whether the post is deleted. 36 | */ 37 | deleted: boolean; 38 | /** 39 | * Whether the post is NSFW. 40 | */ 41 | nsfw: boolean; 42 | /** 43 | * A title for the link. 44 | */ 45 | embed_title?: string; 46 | /** 47 | * A description for the link. 48 | */ 49 | embed_description?: string; 50 | /** 51 | * A thumbnail picture url. 52 | */ 53 | thumbnail_url?: DbUrl; 54 | /** 55 | * The federated activity id / ap_id. 56 | */ 57 | ap_id: DbUrl; 58 | /** 59 | * Whether the post is local. 60 | */ 61 | local: boolean; 62 | /** 63 | * A video url for the link. 64 | */ 65 | embed_video_url?: DbUrl; 66 | language_id: LanguageId; 67 | /** 68 | * Whether the post is featured to its community. 69 | */ 70 | featured_community: boolean; 71 | /** 72 | * Whether the post is featured to its site. 73 | */ 74 | featured_local: boolean; 75 | url_content_type?: string; 76 | /** 77 | * An optional alt_text, usable for image posts. 78 | */ 79 | alt_text?: string; 80 | /** 81 | * Time at which the post will be published. None means publish immediately. 82 | */ 83 | scheduled_publish_time_at?: string; 84 | /** 85 | * The time of the newest comment in the post, if the post has any comments. 86 | */ 87 | newest_comment_time_at?: string; 88 | comments: number; 89 | score: number; 90 | upvotes: number; 91 | downvotes: number; 92 | report_count: number; 93 | unresolved_report_count: number; 94 | /** 95 | * If a local user posts in a remote community, the comment is hidden until it is confirmed 96 | * accepted by the community (by receiving it back via federation). 97 | */ 98 | federation_pending: boolean; 99 | embed_video_width?: number; 100 | embed_video_height?: number; 101 | }; 102 | -------------------------------------------------------------------------------- /cliff.toml: -------------------------------------------------------------------------------- 1 | # git-cliff ~ configuration file 2 | # https://git-cliff.org/docs/configuration 3 | 4 | [remote.github] 5 | owner = "LemmyNet" 6 | repo = "lemmy-js-client" 7 | # token = "" 8 | 9 | [changelog] 10 | # template for the changelog body 11 | # https://keats.github.io/tera/docs/#introduction 12 | body = """ 13 | ## What's Changed 14 | 15 | {%- if version %} in {{ version }}{%- endif -%} 16 | {% for commit in commits %} 17 | {% if commit.remote.pr_title -%} 18 | {%- set commit_message = commit.remote.pr_title -%} 19 | {%- else -%} 20 | {%- set commit_message = commit.message -%} 21 | {%- endif -%} 22 | * {{ commit_message | split(pat="\n") | first | trim }}\ 23 | {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} 24 | {% if commit.remote.pr_number %} in \ 25 | [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ 26 | {%- endif %} 27 | {%- endfor -%} 28 | 29 | {%- if github -%} 30 | {% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} 31 | {% raw %}\n{% endraw -%} 32 | ## New Contributors 33 | {%- endif %}\ 34 | {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} 35 | * @{{ contributor.username }} made their first contribution 36 | {%- if contributor.pr_number %} in \ 37 | [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ 38 | {%- endif %} 39 | {%- endfor -%} 40 | {%- endif -%} 41 | 42 | {% if version %} 43 | {% if previous.version %} 44 | **Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }} 45 | {% endif %} 46 | {% else -%} 47 | {% raw %}\n{% endraw %} 48 | {% endif %} 49 | 50 | {%- macro remote_url() -%} 51 | https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} 52 | {%- endmacro -%} 53 | """ 54 | # remove the leading and trailing whitespace from the template 55 | trim = true 56 | # template for the changelog footer 57 | footer = """ 58 | 59 | """ 60 | # postprocessors 61 | postprocessors = [] 62 | 63 | [git] 64 | # parse the commits based on https://www.conventionalcommits.org 65 | conventional_commits = false 66 | # filter out the commits that are not conventional 67 | filter_unconventional = true 68 | # process each line of a commit as an individual commit 69 | split_commits = false 70 | # regex for preprocessing the commit messages 71 | commit_preprocessors = [ 72 | # remove issue numbers from commits 73 | { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, 74 | ] 75 | commit_parsers = [ 76 | { field = "author.name", pattern = "renovate", skip = true }, 77 | { field = "message", pattern = "Upping version", skip = true }, 78 | ] 79 | # filter out the commits that are not matched by commit parsers 80 | filter_commits = false 81 | # sort the tags topologically 82 | topo_order = false 83 | # sort the commits inside sections by oldest/newest order 84 | sort_commits = "newest" 85 | -------------------------------------------------------------------------------- /src/types/LocalUser.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentSortType } from "./CommentSortType"; 3 | import type { ListingType } from "./ListingType"; 4 | import type { LocalUserId } from "./LocalUserId"; 5 | import type { PersonId } from "./PersonId"; 6 | import type { PostListingMode } from "./PostListingMode"; 7 | import type { PostSortType } from "./PostSortType"; 8 | import type { SensitiveString } from "./SensitiveString"; 9 | import type { VoteShow } from "./VoteShow"; 10 | 11 | /** 12 | * A local user. 13 | */ 14 | export type LocalUser = { 15 | id: LocalUserId; 16 | /** 17 | * The person_id for the local user. 18 | */ 19 | person_id: PersonId; 20 | email?: SensitiveString; 21 | /** 22 | * Whether to show NSFW content. 23 | */ 24 | show_nsfw: boolean; 25 | theme: string; 26 | default_post_sort_type: PostSortType; 27 | default_listing_type: ListingType; 28 | interface_language: string; 29 | /** 30 | * Whether to show avatars. 31 | */ 32 | show_avatars: boolean; 33 | send_notifications_to_email: boolean; 34 | /** 35 | * Whether to show bot accounts. 36 | */ 37 | show_bot_accounts: boolean; 38 | /** 39 | * Whether to show read posts. 40 | */ 41 | show_read_posts: boolean; 42 | /** 43 | * Whether their email has been verified. 44 | */ 45 | email_verified: boolean; 46 | /** 47 | * Whether their registration application has been accepted. 48 | */ 49 | accepted_application: boolean; 50 | /** 51 | * Open links in a new tab. 52 | */ 53 | open_links_in_new_tab: boolean; 54 | blur_nsfw: boolean; 55 | /** 56 | * Whether infinite scroll is enabled. 57 | */ 58 | infinite_scroll_enabled: boolean; 59 | /** 60 | * Whether the person is an admin. 61 | */ 62 | admin: boolean; 63 | /** 64 | * A post-view mode that changes how multiple post listings look. 65 | */ 66 | post_listing_mode: PostListingMode; 67 | totp_2fa_enabled: boolean; 68 | /** 69 | * Whether user avatars and inline images in the UI that are gifs should be allowed to play or 70 | * should be paused 71 | */ 72 | enable_animated_images: boolean; 73 | /** 74 | * Whether to auto-collapse bot comments. 75 | */ 76 | collapse_bot_comments: boolean; 77 | /** 78 | * The last time a donation request was shown to this user. If this is more than a year ago, 79 | * a new notification request should be shown. 80 | */ 81 | last_donation_notification_at: string; 82 | /** 83 | * Whether a user can send / receive private messages 84 | */ 85 | enable_private_messages: boolean; 86 | default_comment_sort_type: CommentSortType; 87 | /** 88 | * Whether to automatically mark fetched posts as read. 89 | */ 90 | auto_mark_fetched_posts_as_read: boolean; 91 | /** 92 | * Whether to hide posts containing images/videos 93 | */ 94 | hide_media: boolean; 95 | /** 96 | * A default time range limit to apply to post sorts, in seconds. 97 | */ 98 | default_post_time_range_seconds?: number; 99 | show_score: boolean; 100 | show_upvotes: boolean; 101 | show_downvotes: VoteShow; 102 | show_upvote_percentage: boolean; 103 | show_person_votes: boolean; 104 | default_items_per_page: number; 105 | }; 106 | -------------------------------------------------------------------------------- /src/types/AllLemmyErrors.ts: -------------------------------------------------------------------------------- 1 | export const AllLemmyErrors = [ 2 | "block_keyword_too_short", 3 | "block_keyword_too_long", 4 | "couldnt_update", 5 | "couldnt_create", 6 | "report_reason_required", 7 | "report_too_long", 8 | "not_a_moderator", 9 | "not_an_admin", 10 | "cant_block_yourself", 11 | "cant_note_yourself", 12 | "cant_block_admin", 13 | "passwords_do_not_match", 14 | "email_not_verified", 15 | "email_required", 16 | "cannot_leave_admin", 17 | "cannot_leave_mod", 18 | "cannot_leave_mod", 19 | "cannot_leave_mod", 20 | "pictrs_api_key_not_provided", 21 | "pictrs_api_key_not_provided", 22 | "no_content_type_header", 23 | "not_an_image_type", 24 | "image_upload_disabled", 25 | "not_a_mod_or_admin", 26 | "not_top_mod", 27 | "not_logged_in", 28 | "not_higher_mod", 29 | "not_higher_admin", 30 | "site_ban", 31 | "deleted", 32 | "person_is_blocked", 33 | "community_is_blocked", 34 | "instance_is_blocked", 35 | "instance_is_private", 36 | "invalid_password", 37 | "site_description_length_overflow", 38 | "honeypot_failed", 39 | "registration_application_is_pending", 40 | "locked", 41 | "max_comment_depth_reached", 42 | "no_comment_edit_allowed", 43 | "only_admins_can_create_communities", 44 | "already_exists", 45 | "language_not_allowed", 46 | "no_post_edit_allowed", 47 | "nsfw_not_allowed", 48 | "edit_private_message_not_allowed", 49 | "application_question_required", 50 | "invalid_default_post_listing_type", 51 | "registration_closed", 52 | "registration_application_answer_required", 53 | "registration_username_required", 54 | "email_already_taken", 55 | "username_already_taken", 56 | "person_is_banned_from_community", 57 | "no_id_given", 58 | "incorrect_login", 59 | "no_email_setup", 60 | "local_site_not_setup", 61 | "local_site_not_setup", 62 | "invalid_name", 63 | "invalid_code_verifier", 64 | "invalid_display_name", 65 | "invalid_matrix_id", 66 | "invalid_post_title", 67 | "invalid_body_field", 68 | "bio_length_overflow", 69 | "alt_text_length_overflow", 70 | "couldnt_parse_totp_secret", 71 | "couldnt_generate_totp", 72 | "missing_totp_token", 73 | "missing_totp_secret", 74 | "incorrect_totp_token", 75 | "totp_already_enabled", 76 | "blocked_url", 77 | "invalid_url", 78 | "email_send_failed", 79 | "slurs", 80 | "slurs", 81 | "site_name_required", 82 | "site_name_length_overflow", 83 | "permissive_regex", 84 | "invalid_regex", 85 | "captcha_incorrect", 86 | "couldnt_create_audio_captcha", 87 | "couldnt_create_image_captcha", 88 | "invalid_url_scheme", 89 | "contradicting_filters", 90 | "too_many_items", 91 | "ban_expiration_in_past", 92 | "invalid_unix_time", 93 | "invalid_bot_action", 94 | "tag_not_in_community", 95 | "cant_block_local_instance", 96 | "cant_block_local_instance", 97 | "url_length_overflow", 98 | "oauth_authorization_invalid", 99 | "oauth_login_failed", 100 | "oauth_registration_closed", 101 | "not_found", 102 | "post_schedule_time_must_be_in_future", 103 | "too_many_scheduled_posts", 104 | "cannot_combine_federation_blocklist_and_allowlist", 105 | "cannot_combine_federation_blocklist_and_allowlist", 106 | "couldnt_parse_pagination_token", 107 | "couldnt_parse_pagination_token", 108 | "invalid_fetch_limit", 109 | "email_notifications_disabled", 110 | "multi_community_update_wrong_user", 111 | "cannot_combine_community_id_and_multi_community_id", 112 | "multi_community_entry_limit_reached", 113 | "too_many_requests", 114 | ]; 115 | -------------------------------------------------------------------------------- /src/types/SaveUserSettings.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentSortType } from "./CommentSortType"; 3 | import type { LanguageId } from "./LanguageId"; 4 | import type { ListingType } from "./ListingType"; 5 | import type { PostListingMode } from "./PostListingMode"; 6 | import type { PostSortType } from "./PostSortType"; 7 | import type { SensitiveString } from "./SensitiveString"; 8 | import type { VoteShow } from "./VoteShow"; 9 | 10 | /** 11 | * Saves settings for your user. 12 | */ 13 | export type SaveUserSettings = { 14 | /** 15 | * Show nsfw posts. 16 | */ 17 | show_nsfw?: boolean; 18 | /** 19 | * Blur nsfw posts. 20 | */ 21 | blur_nsfw?: boolean; 22 | /** 23 | * Your user's theme. 24 | */ 25 | theme?: string; 26 | /** 27 | * The default post listing type, usually "local" 28 | */ 29 | default_listing_type?: ListingType; 30 | /** 31 | * A post-view mode that changes how multiple post listings look. 32 | */ 33 | post_listing_mode?: PostListingMode; 34 | /** 35 | * The default post sort, usually "active" 36 | */ 37 | default_post_sort_type?: PostSortType; 38 | /** 39 | * A default time range limit to apply to post sorts, in seconds. 0 means none. 40 | */ 41 | default_post_time_range_seconds?: number; 42 | /** 43 | * A default fetch limit for number of items returned. 44 | */ 45 | default_items_per_page?: number; 46 | /** 47 | * The default comment sort, usually "hot" 48 | */ 49 | default_comment_sort_type?: CommentSortType; 50 | /** 51 | * The language of the lemmy interface 52 | */ 53 | interface_language?: string; 54 | /** 55 | * Your display name, which can contain strange characters, and does not need to be unique. 56 | */ 57 | display_name?: string; 58 | /** 59 | * Your email. 60 | */ 61 | email?: SensitiveString; 62 | /** 63 | * Your bio / info, in markdown. 64 | */ 65 | bio?: string; 66 | /** 67 | * Your matrix user id. Ex: @my_user:matrix.org 68 | */ 69 | matrix_user_id?: string; 70 | /** 71 | * Whether to show or hide avatars. 72 | */ 73 | show_avatars?: boolean; 74 | /** 75 | * Sends notifications to your email. 76 | */ 77 | send_notifications_to_email?: boolean; 78 | /** 79 | * Whether this account is a bot account. Users can hide these accounts easily if they wish. 80 | */ 81 | bot_account?: boolean; 82 | /** 83 | * Whether to show bot accounts. 84 | */ 85 | show_bot_accounts?: boolean; 86 | /** 87 | * Whether to show read posts. 88 | */ 89 | show_read_posts?: boolean; 90 | /** 91 | * A list of languages you are able to see discussion in. 92 | */ 93 | discussion_languages?: Array; 94 | blocking_keywords?: Array; 95 | /** 96 | * Open links in a new tab 97 | */ 98 | open_links_in_new_tab?: boolean; 99 | /** 100 | * Enable infinite scroll 101 | */ 102 | infinite_scroll_enabled?: boolean; 103 | /** 104 | * Whether user avatars or inline images in the UI that are gifs should be allowed to play or 105 | * should be paused 106 | */ 107 | enable_animated_images?: boolean; 108 | /** 109 | * Whether a user can send / receive private messages 110 | */ 111 | enable_private_messages?: boolean; 112 | /** 113 | * Whether to auto-collapse bot comments. 114 | */ 115 | collapse_bot_comments?: boolean; 116 | /** 117 | * Some vote display mode settings 118 | */ 119 | show_score?: boolean; 120 | show_upvotes?: boolean; 121 | show_downvotes?: VoteShow; 122 | show_upvote_percentage?: boolean; 123 | /** 124 | * Whether to automatically mark fetched posts as read. 125 | */ 126 | auto_mark_fetched_posts_as_read?: boolean; 127 | /** 128 | * Whether to hide posts containing images/videos. 129 | */ 130 | hide_media?: boolean; 131 | /** 132 | * Whether to show vote totals given to others. 133 | */ 134 | show_person_votes?: boolean; 135 | }; 136 | -------------------------------------------------------------------------------- /src/other_types.ts: -------------------------------------------------------------------------------- 1 | import { AdminListUsers } from "./types/AdminListUsers"; 2 | import { CommunityIdQuery } from "./types/CommunityIdQuery"; 3 | import { DeleteImageParams } from "./types/DeleteImageParams"; 4 | import { GetComment } from "./types/GetComment"; 5 | import { GetComments } from "./types/GetComments"; 6 | import { GetCommunity } from "./types/GetCommunity"; 7 | import { GetModlog } from "./types/GetModlog"; 8 | import { GetMultiCommunity } from "./types/GetMultiCommunity"; 9 | import { GetPersonDetails } from "./types/GetPersonDetails"; 10 | import { GetPost } from "./types/GetPost"; 11 | import { GetPosts } from "./types/GetPosts"; 12 | import { GetRandomCommunity } from "./types/GetRandomCommunity"; 13 | import { GetRegistrationApplication } from "./types/GetRegistrationApplication"; 14 | import { GetSiteMetadata } from "./types/GetSiteMetadata"; 15 | import { ListCommentLikes } from "./types/ListCommentLikes"; 16 | import { ListCommunities } from "./types/ListCommunities"; 17 | import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows"; 18 | import { ListCustomEmojis } from "./types/ListCustomEmojis"; 19 | import { ListNotifications } from "./types/ListNotifications"; 20 | import { ListMedia } from "./types/ListMedia"; 21 | import { ListMultiCommunities } from "./types/ListMultiCommunities"; 22 | import { ListPersonContent } from "./types/ListPersonContent"; 23 | import { ListPersonHidden } from "./types/ListPersonHidden"; 24 | import { ListPersonLiked } from "./types/ListPersonLiked"; 25 | import { ListPersonRead } from "./types/ListPersonRead"; 26 | import { ListPersonSaved } from "./types/ListPersonSaved"; 27 | import { ListPostLikes } from "./types/ListPostLikes"; 28 | import { ListRegistrationApplications } from "./types/ListRegistrationApplications"; 29 | import { ListReports } from "./types/ListReports"; 30 | import { ListTaglines } from "./types/ListTaglines"; 31 | import { ResolveObject } from "./types/ResolveObject"; 32 | import { Search } from "./types/Search"; 33 | import { GetFederatedInstances } from "./types/GetFederatedInstances"; 34 | 35 | export const VERSION = "v4"; 36 | 37 | export interface UploadImage { 38 | image: File | Buffer; 39 | } 40 | 41 | // tsoa doesn't currently support types in GET queries, so these need to be extended. 42 | // https://github.com/lukeautry/tsoa/issues/1743 43 | export interface ListMediaI extends ListMedia {} 44 | export interface GetModlogI extends GetModlog {} 45 | export interface SearchI extends Search {} 46 | export interface ResolveObjectI extends ResolveObject {} 47 | export interface GetCommunityI extends GetCommunity {} 48 | export interface ListCommunitiesI extends ListCommunities {} 49 | export interface ListCommunityPendingFollowsI extends ListCommunityPendingFollows {} 50 | export interface GetRandomCommunityI extends GetRandomCommunity {} 51 | export interface GetPostI extends GetPost {} 52 | export interface GetPostsI extends GetPosts {} 53 | export interface ListPostLikesI extends ListPostLikes {} 54 | export interface GetSiteMetadataI extends GetSiteMetadata {} 55 | export interface ListCommentLikesI extends ListCommentLikes {} 56 | export interface GetCommentsI extends GetComments {} 57 | export interface GetCommentI extends GetComment {} 58 | export interface GetPersonDetailsI extends GetPersonDetails {} 59 | export interface ListPersonContentI extends ListPersonContent {} 60 | export interface ListNotificationsI extends ListNotifications {} 61 | export interface ListPersonSavedI extends ListPersonSaved {} 62 | export interface ListPersonReadI extends ListPersonRead {} 63 | export interface ListPersonHiddenI extends ListPersonHidden {} 64 | export interface ListPersonLikedI extends ListPersonLiked {} 65 | export interface ListRegistrationApplicationsI extends ListRegistrationApplications {} 66 | export interface GetRegistrationApplicationI extends GetRegistrationApplication {} 67 | export interface ListCustomEmojisI extends ListCustomEmojis {} 68 | export interface ListTaglinesI extends ListTaglines {} 69 | export interface ListReportsI extends ListReports {} 70 | export interface DeleteImageParamsI extends DeleteImageParams {} 71 | export interface AdminListUsersI extends AdminListUsers {} 72 | export interface CommunityIdQueryI extends CommunityIdQuery {} 73 | export interface ListMultiCommunitiesI extends ListMultiCommunities {} 74 | export interface GetMultiCommunityI extends GetMultiCommunity {} 75 | export interface GetFederatedInstancesI extends GetFederatedInstances {} 76 | -------------------------------------------------------------------------------- /src/types/LocalSite.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentSortType } from "./CommentSortType"; 3 | import type { FederationMode } from "./FederationMode"; 4 | import type { ListingType } from "./ListingType"; 5 | import type { LocalSiteId } from "./LocalSiteId"; 6 | import type { MultiCommunityId } from "./MultiCommunityId"; 7 | import type { PostListingMode } from "./PostListingMode"; 8 | import type { PostSortType } from "./PostSortType"; 9 | import type { RegistrationMode } from "./RegistrationMode"; 10 | import type { SiteId } from "./SiteId"; 11 | 12 | /** 13 | * The local site. 14 | */ 15 | export type LocalSite = { 16 | id: LocalSiteId; 17 | site_id: SiteId; 18 | /** 19 | * True if the site is set up. 20 | */ 21 | site_setup: boolean; 22 | /** 23 | * Whether only admins can create communities. 24 | */ 25 | community_creation_admin_only: boolean; 26 | /** 27 | * Whether emails are required. 28 | */ 29 | require_email_verification: boolean; 30 | /** 31 | * An optional registration application questionnaire in markdown. 32 | */ 33 | application_question?: string; 34 | /** 35 | * Whether the instance is private or public. 36 | */ 37 | private_instance: boolean; 38 | /** 39 | * The default front-end theme. 40 | */ 41 | default_theme: string; 42 | default_post_listing_type: ListingType; 43 | /** 44 | * An optional legal disclaimer page. 45 | */ 46 | legal_information?: string; 47 | /** 48 | * Whether new applications email admins. 49 | */ 50 | application_email_admins: boolean; 51 | /** 52 | * An optional regex to filter words. 53 | */ 54 | slur_filter_regex?: string; 55 | /** 56 | * Whether federation is enabled. 57 | */ 58 | federation_enabled: boolean; 59 | /** 60 | * Whether captcha is enabled. 61 | */ 62 | captcha_enabled: boolean; 63 | /** 64 | * The captcha difficulty. 65 | */ 66 | captcha_difficulty: string; 67 | published_at: string; 68 | updated_at?: string; 69 | registration_mode: RegistrationMode; 70 | /** 71 | * Whether to email admins on new reports. 72 | */ 73 | reports_email_admins: boolean; 74 | /** 75 | * Whether to sign outgoing Activitypub fetches with private key of local instance. Some 76 | * Fediverse instances and platforms require this. 77 | */ 78 | federation_signed_fetch: boolean; 79 | /** 80 | * Default value for [LocalSite.post_listing_mode] 81 | */ 82 | default_post_listing_mode: PostListingMode; 83 | /** 84 | * Default value for [LocalUser.post_sort_type] 85 | */ 86 | default_post_sort_type: PostSortType; 87 | /** 88 | * Default value for [LocalUser.comment_sort_type] 89 | */ 90 | default_comment_sort_type: CommentSortType; 91 | /** 92 | * Whether or not external auth methods can auto-register users. 93 | */ 94 | oauth_registration: boolean; 95 | /** 96 | * What kind of post upvotes your site allows. 97 | */ 98 | post_upvotes: FederationMode; 99 | /** 100 | * What kind of post downvotes your site allows. 101 | */ 102 | post_downvotes: FederationMode; 103 | /** 104 | * What kind of comment upvotes your site allows. 105 | */ 106 | comment_upvotes: FederationMode; 107 | /** 108 | * What kind of comment downvotes your site allows. 109 | */ 110 | comment_downvotes: FederationMode; 111 | /** 112 | * A default time range limit to apply to post sorts, in seconds. 113 | */ 114 | default_post_time_range_seconds?: number; 115 | /** 116 | * Block NSFW content being created 117 | */ 118 | disallow_nsfw_content: boolean; 119 | users: number; 120 | posts: number; 121 | comments: number; 122 | communities: number; 123 | /** 124 | * The number of users with any activity in the last day. 125 | */ 126 | users_active_day: number; 127 | /** 128 | * The number of users with any activity in the last week. 129 | */ 130 | users_active_week: number; 131 | /** 132 | * The number of users with any activity in the last month. 133 | */ 134 | users_active_month: number; 135 | /** 136 | * The number of users with any activity in the last half year. 137 | */ 138 | users_active_half_year: number; 139 | /** 140 | * Dont send email notifications to users for new replies, mentions etc 141 | */ 142 | disable_email_notifications: boolean; 143 | suggested_communities?: MultiCommunityId; 144 | default_items_per_page: number; 145 | }; 146 | -------------------------------------------------------------------------------- /src/types/LemmyErrorType.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { UntranslatedError } from "./UntranslatedError"; 3 | 4 | /** 5 | * Errors used in the API, all of these are translated in lemmy-ui. 6 | */ 7 | export type LemmyErrorType = 8 | | { error: "block_keyword_too_short" } 9 | | { error: "block_keyword_too_long" } 10 | | { error: "couldnt_update" } 11 | | { error: "couldnt_create" } 12 | | { error: "report_reason_required" } 13 | | { error: "report_too_long" } 14 | | { error: "not_a_moderator" } 15 | | { error: "not_an_admin" } 16 | | { error: "cant_block_yourself" } 17 | | { error: "cant_note_yourself" } 18 | | { error: "cant_block_admin" } 19 | | { error: "passwords_do_not_match" } 20 | | { error: "email_not_verified" } 21 | | { error: "email_required" } 22 | | { error: "cannot_leave_admin" } 23 | | { error: "cannot_leave_mod" } 24 | | { error: "pictrs_response_error"; message: string } 25 | | { error: "pictrs_purge_response_error"; message: string } 26 | | { error: "pictrs_api_key_not_provided" } 27 | | { error: "pictrs_invalid_image_upload"; message: string } 28 | | { error: "no_content_type_header" } 29 | | { error: "not_an_image_type" } 30 | | { error: "image_upload_disabled" } 31 | | { error: "not_a_mod_or_admin" } 32 | | { error: "not_top_mod" } 33 | | { error: "not_logged_in" } 34 | | { error: "not_higher_mod" } 35 | | { error: "not_higher_admin" } 36 | | { error: "site_ban" } 37 | | { error: "deleted" } 38 | | { error: "person_is_blocked" } 39 | | { error: "community_is_blocked" } 40 | | { error: "instance_is_blocked" } 41 | | { error: "instance_is_private" } 42 | | { error: "invalid_password" } 43 | | { error: "site_description_length_overflow" } 44 | | { error: "honeypot_failed" } 45 | | { error: "registration_application_is_pending" } 46 | | { error: "locked" } 47 | | { error: "max_comment_depth_reached" } 48 | | { error: "no_comment_edit_allowed" } 49 | | { error: "only_admins_can_create_communities" } 50 | | { error: "already_exists" } 51 | | { error: "language_not_allowed" } 52 | | { error: "no_post_edit_allowed" } 53 | | { error: "nsfw_not_allowed" } 54 | | { error: "edit_private_message_not_allowed" } 55 | | { error: "application_question_required" } 56 | | { error: "invalid_default_post_listing_type" } 57 | | { error: "registration_closed" } 58 | | { error: "registration_application_answer_required" } 59 | | { error: "registration_username_required" } 60 | | { error: "email_already_taken" } 61 | | { error: "username_already_taken" } 62 | | { error: "person_is_banned_from_community" } 63 | | { error: "no_id_given" } 64 | | { error: "incorrect_login" } 65 | | { error: "no_email_setup" } 66 | | { error: "local_site_not_setup" } 67 | | { error: "invalid_email_address"; message: string } 68 | | { error: "invalid_name" } 69 | | { error: "invalid_code_verifier" } 70 | | { error: "invalid_display_name" } 71 | | { error: "invalid_matrix_id" } 72 | | { error: "invalid_post_title" } 73 | | { error: "invalid_body_field" } 74 | | { error: "bio_length_overflow" } 75 | | { error: "alt_text_length_overflow" } 76 | | { error: "couldnt_parse_totp_secret" } 77 | | { error: "couldnt_generate_totp" } 78 | | { error: "missing_totp_token" } 79 | | { error: "missing_totp_secret" } 80 | | { error: "incorrect_totp_token" } 81 | | { error: "totp_already_enabled" } 82 | | { error: "blocked_url" } 83 | | { error: "invalid_url" } 84 | | { error: "email_send_failed" } 85 | | { error: "slurs" } 86 | | { error: "registration_denied"; message: { reason?: string } } 87 | | { error: "site_name_required" } 88 | | { error: "site_name_length_overflow" } 89 | | { error: "permissive_regex" } 90 | | { error: "invalid_regex" } 91 | | { error: "captcha_incorrect" } 92 | | { error: "couldnt_create_audio_captcha" } 93 | | { error: "couldnt_create_image_captcha" } 94 | | { error: "invalid_url_scheme" } 95 | | { error: "contradicting_filters" } 96 | | { error: "too_many_items" } 97 | | { error: "ban_expiration_in_past" } 98 | | { error: "invalid_unix_time" } 99 | | { error: "invalid_bot_action" } 100 | | { error: "tag_not_in_community" } 101 | | { error: "cant_block_local_instance" } 102 | | { error: "unknown"; message: string } 103 | | { error: "url_length_overflow" } 104 | | { error: "oauth_authorization_invalid" } 105 | | { error: "oauth_login_failed" } 106 | | { error: "oauth_registration_closed" } 107 | | { error: "not_found" } 108 | | { error: "post_schedule_time_must_be_in_future" } 109 | | { error: "too_many_scheduled_posts" } 110 | | { error: "cannot_combine_federation_blocklist_and_allowlist" } 111 | | { error: "untranslated_error"; message: { error?: UntranslatedError } } 112 | | { error: "couldnt_parse_pagination_token" } 113 | | { error: "plugin_error"; message: string } 114 | | { error: "invalid_fetch_limit" } 115 | | { error: "email_notifications_disabled" } 116 | | { error: "multi_community_update_wrong_user" } 117 | | { error: "cannot_combine_community_id_and_multi_community_id" } 118 | | { error: "multi_community_entry_limit_reached" } 119 | | { error: "too_many_requests" }; 120 | -------------------------------------------------------------------------------- /src/types/EditSite.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. 2 | import type { CommentSortType } from "./CommentSortType"; 3 | import type { FederationMode } from "./FederationMode"; 4 | import type { LanguageId } from "./LanguageId"; 5 | import type { ListingType } from "./ListingType"; 6 | import type { MultiCommunityId } from "./MultiCommunityId"; 7 | import type { PostListingMode } from "./PostListingMode"; 8 | import type { PostSortType } from "./PostSortType"; 9 | import type { RegistrationMode } from "./RegistrationMode"; 10 | 11 | /** 12 | * Edits a site. 13 | */ 14 | export type EditSite = { 15 | name?: string; 16 | /** 17 | * A sidebar for the site, in markdown. 18 | */ 19 | sidebar?: string; 20 | /** 21 | * A shorter, one line description of your site. 22 | */ 23 | description?: string; 24 | /** 25 | * Limits community creation to admins only. 26 | */ 27 | community_creation_admin_only?: boolean; 28 | /** 29 | * Whether to require email verification. 30 | */ 31 | require_email_verification?: boolean; 32 | /** 33 | * Your application question form. This is in markdown, and can be many questions. 34 | */ 35 | application_question?: string; 36 | /** 37 | * Whether your instance is public, or private. 38 | */ 39 | private_instance?: boolean; 40 | /** 41 | * The default theme. Usually "browser" 42 | */ 43 | default_theme?: string; 44 | /** 45 | * The default post listing type, usually "local" 46 | */ 47 | default_post_listing_type?: ListingType; 48 | /** 49 | * Default value for listing mode, usually "list" 50 | */ 51 | default_post_listing_mode?: PostListingMode; 52 | /** 53 | * The default post sort, usually "active" 54 | */ 55 | default_post_sort_type?: PostSortType; 56 | /** 57 | * A default time range limit to apply to post sorts, in seconds. 0 means none. 58 | */ 59 | default_post_time_range_seconds?: number; 60 | /** 61 | * A default fetch limit for number of items returned. 62 | */ 63 | default_items_per_page?: number; 64 | /** 65 | * The default comment sort, usually "hot" 66 | */ 67 | default_comment_sort_type?: CommentSortType; 68 | /** 69 | * An optional page of legal information 70 | */ 71 | legal_information?: string; 72 | /** 73 | * Whether to email admins when receiving a new application. 74 | */ 75 | application_email_admins?: boolean; 76 | /** 77 | * A list of allowed discussion languages. 78 | */ 79 | discussion_languages?: Array; 80 | /** 81 | * A regex string of items to filter. 82 | */ 83 | slur_filter_regex?: string; 84 | /** 85 | * The number of messages allowed in a given time frame. 86 | */ 87 | rate_limit_message_max_requests?: number; 88 | rate_limit_message_interval_seconds?: number; 89 | /** 90 | * The number of posts allowed in a given time frame. 91 | */ 92 | rate_limit_post_max_requests?: number; 93 | rate_limit_post_interval_seconds?: number; 94 | /** 95 | * The number of registrations allowed in a given time frame. 96 | */ 97 | rate_limit_register_max_requests?: number; 98 | rate_limit_register_interval_seconds?: number; 99 | /** 100 | * The number of image uploads allowed in a given time frame. 101 | */ 102 | rate_limit_image_max_requests?: number; 103 | rate_limit_image_interval_seconds?: number; 104 | /** 105 | * The number of comments allowed in a given time frame. 106 | */ 107 | rate_limit_comment_max_requests?: number; 108 | rate_limit_comment_interval_seconds?: number; 109 | /** 110 | * The number of searches allowed in a given time frame. 111 | */ 112 | rate_limit_search_max_requests?: number; 113 | rate_limit_search_interval_seconds?: number; 114 | /** 115 | * The number of settings imports or exports allowed in a given time frame. 116 | */ 117 | rate_limit_import_user_settings_max_requests?: number; 118 | rate_limit_import_user_settings_interval_seconds?: number; 119 | /** 120 | * Whether to enable federation. 121 | */ 122 | federation_enabled?: boolean; 123 | /** 124 | * Whether to enable captchas for signups. 125 | */ 126 | captcha_enabled?: boolean; 127 | /** 128 | * The captcha difficulty. Can be easy, medium, or hard 129 | */ 130 | captcha_difficulty?: string; 131 | /** 132 | * A list of blocked URLs 133 | */ 134 | blocked_urls?: Array; 135 | registration_mode?: RegistrationMode; 136 | /** 137 | * Whether to email admins for new reports. 138 | */ 139 | reports_email_admins?: boolean; 140 | /** 141 | * If present, nsfw content is visible by default. Should be displayed by frontends/clients 142 | * when the site is first opened by a user. 143 | */ 144 | content_warning?: string; 145 | /** 146 | * Whether or not external auth methods can auto-register users. 147 | */ 148 | oauth_registration?: boolean; 149 | /** 150 | * What kind of post upvotes your site allows. 151 | */ 152 | post_upvotes?: FederationMode; 153 | /** 154 | * What kind of post downvotes your site allows. 155 | */ 156 | post_downvotes?: FederationMode; 157 | /** 158 | * What kind of comment upvotes your site allows. 159 | */ 160 | comment_upvotes?: FederationMode; 161 | /** 162 | * What kind of comment downvotes your site allows. 163 | */ 164 | comment_downvotes?: FederationMode; 165 | /** 166 | * Block NSFW content being created 167 | */ 168 | disallow_nsfw_content?: boolean; 169 | /** 170 | * Dont send email notifications to users for new replies, mentions etc 171 | */ 172 | disable_email_notifications?: boolean; 173 | /** 174 | * A multicommunity with suggested communities which is shown on the homepage 175 | */ 176 | suggested_communities?: MultiCommunityId; 177 | }; 178 | --------------------------------------------------------------------------------