Upgrading to use ts-rs 10.0.0 (#394)

* Upgrading to use ts-ns 10.0.0

* Adding no_comments_only
This commit is contained in:
Dessalines 2024-11-07 12:07:49 -05:00 committed by GitHub
parent 90686d2118
commit c1545659b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
275 changed files with 2109 additions and 660 deletions

View file

@ -9,10 +9,10 @@ rm -rf **/bindings
popd popd
# First re-generate the types by running cargo test on lemmy # First re-generate the types by running cargo test on lemmy
pushd ../lemmy/scripts pushd ../lemmy
./test.sh cargo test --workspace export_bindings
cd ../crates cd crates
# Copy them over to the types folder # Copy them over to the types folder
cp api_common/bindings/* ../../lemmy-js-client/src/types/ cp api_common/bindings/* ../../lemmy-js-client/src/types/

View file

@ -53,6 +53,7 @@ export { CommunityFollowerView } from "./types/CommunityFollowerView";
export { CommunityId } from "./types/CommunityId"; export { CommunityId } from "./types/CommunityId";
export { CommunityModeratorView } from "./types/CommunityModeratorView"; export { CommunityModeratorView } from "./types/CommunityModeratorView";
export { CommunityResponse } from "./types/CommunityResponse"; export { CommunityResponse } from "./types/CommunityResponse";
export { CommunitySortType } from "./types/CommunitySortType";
export { CommunityView } from "./types/CommunityView"; export { CommunityView } from "./types/CommunityView";
export { CommunityVisibility } from "./types/CommunityVisibility"; export { CommunityVisibility } from "./types/CommunityVisibility";
export { CreateComment } from "./types/CreateComment"; export { CreateComment } from "./types/CreateComment";
@ -73,6 +74,7 @@ export { CustomEmojiId } from "./types/CustomEmojiId";
export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword"; export { CustomEmojiKeyword } from "./types/CustomEmojiKeyword";
export { CustomEmojiResponse } from "./types/CustomEmojiResponse"; export { CustomEmojiResponse } from "./types/CustomEmojiResponse";
export { CustomEmojiView } from "./types/CustomEmojiView"; export { CustomEmojiView } from "./types/CustomEmojiView";
export { DbUrl } from "./types/DbUrl";
export { DeleteAccount } from "./types/DeleteAccount"; export { DeleteAccount } from "./types/DeleteAccount";
export { DeleteComment } from "./types/DeleteComment"; export { DeleteComment } from "./types/DeleteComment";
export { DeleteCommunity } from "./types/DeleteCommunity"; export { DeleteCommunity } from "./types/DeleteCommunity";
@ -91,6 +93,7 @@ export { EditPrivateMessage } from "./types/EditPrivateMessage";
export { EditSite } from "./types/EditSite"; export { EditSite } from "./types/EditSite";
export { FeaturePost } from "./types/FeaturePost"; export { FeaturePost } from "./types/FeaturePost";
export { FederatedInstances } from "./types/FederatedInstances"; export { FederatedInstances } from "./types/FederatedInstances";
export { FederationError } from "./types/FederationError";
export { FederationMode } from "./types/FederationMode"; export { FederationMode } from "./types/FederationMode";
export { FollowCommunity } from "./types/FollowCommunity"; export { FollowCommunity } from "./types/FollowCommunity";
export { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse"; export { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
@ -260,6 +263,7 @@ export { SaveUserSettings } from "./types/SaveUserSettings";
export { Search } from "./types/Search"; export { Search } from "./types/Search";
export { SearchResponse } from "./types/SearchResponse"; export { SearchResponse } from "./types/SearchResponse";
export { SearchType } from "./types/SearchType"; export { SearchType } from "./types/SearchType";
export { SensitiveString } from "./types/SensitiveString";
export { Site } from "./types/Site"; export { Site } from "./types/Site";
export { SiteAggregates } from "./types/SiteAggregates"; export { SiteAggregates } from "./types/SiteAggregates";
export { SiteId } from "./types/SiteId"; export { SiteId } from "./types/SiteId";

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface AddAdmin { /**
person_id: PersonId; * Adds an admin to a site.
added: boolean; */
} export type AddAdmin = { person_id: PersonId; added: boolean };

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonView } from "./PersonView"; import type { PersonView } from "./PersonView";
export interface AddAdminResponse { /**
admins: Array<PersonView>; * The response of current admins.
} */
export type AddAdminResponse = { admins: Array<PersonView> };

View file

@ -2,8 +2,11 @@
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface AddModToCommunity { /**
* Add a moderator to a community.
*/
export type AddModToCommunity = {
community_id: CommunityId; community_id: CommunityId;
person_id: PersonId; person_id: PersonId;
added: boolean; added: boolean;
} };

View file

@ -1,6 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommunityModeratorView } from "./CommunityModeratorView"; import type { CommunityModeratorView } from "./CommunityModeratorView";
export interface AddModToCommunityResponse { /**
* The response of adding a moderator to a community.
*/
export type AddModToCommunityResponse = {
moderators: Array<CommunityModeratorView>; moderators: Array<CommunityModeratorView>;
} };

View file

@ -2,10 +2,13 @@
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
export interface AdminPurgeComment { /**
* When an admin purges a comment.
*/
export type AdminPurgeComment = {
id: number; id: number;
admin_person_id: PersonId; admin_person_id: PersonId;
post_id: PostId; post_id: PostId;
reason?: string; reason?: string;
when_: string; when_: string;
} };

View file

@ -3,8 +3,11 @@ import type { AdminPurgeComment } from "./AdminPurgeComment";
import type { Person } from "./Person"; import type { Person } from "./Person";
import type { Post } from "./Post"; import type { Post } from "./Post";
export interface AdminPurgeCommentView { /**
* When an admin purges a comment.
*/
export type AdminPurgeCommentView = {
admin_purge_comment: AdminPurgeComment; admin_purge_comment: AdminPurgeComment;
admin?: Person; admin?: Person;
post: Post; post: Post;
} };

View file

@ -1,9 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface AdminPurgeCommunity { /**
* When an admin purges a community.
*/
export type AdminPurgeCommunity = {
id: number; id: number;
admin_person_id: PersonId; admin_person_id: PersonId;
reason?: string; reason?: string;
when_: string; when_: string;
} };

View file

@ -2,7 +2,10 @@
import type { AdminPurgeCommunity } from "./AdminPurgeCommunity"; import type { AdminPurgeCommunity } from "./AdminPurgeCommunity";
import type { Person } from "./Person"; import type { Person } from "./Person";
export interface AdminPurgeCommunityView { /**
* When an admin purges a community.
*/
export type AdminPurgeCommunityView = {
admin_purge_community: AdminPurgeCommunity; admin_purge_community: AdminPurgeCommunity;
admin?: Person; admin?: Person;
} };

View file

@ -1,9 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface AdminPurgePerson { /**
* When an admin purges a person.
*/
export type AdminPurgePerson = {
id: number; id: number;
admin_person_id: PersonId; admin_person_id: PersonId;
reason?: string; reason?: string;
when_: string; when_: string;
} };

View file

@ -2,7 +2,10 @@
import type { AdminPurgePerson } from "./AdminPurgePerson"; import type { AdminPurgePerson } from "./AdminPurgePerson";
import type { Person } from "./Person"; import type { Person } from "./Person";
export interface AdminPurgePersonView { /**
* When an admin purges a person.
*/
export type AdminPurgePersonView = {
admin_purge_person: AdminPurgePerson; admin_purge_person: AdminPurgePerson;
admin?: Person; admin?: Person;
} };

View file

@ -2,10 +2,13 @@
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface AdminPurgePost { /**
* When an admin purges a post.
*/
export type AdminPurgePost = {
id: number; id: number;
admin_person_id: PersonId; admin_person_id: PersonId;
community_id: CommunityId; community_id: CommunityId;
reason?: string; reason?: string;
when_: string; when_: string;
} };

View file

@ -3,8 +3,11 @@ import type { AdminPurgePost } from "./AdminPurgePost";
import type { Community } from "./Community"; import type { Community } from "./Community";
import type { Person } from "./Person"; import type { Person } from "./Person";
export interface AdminPurgePostView { /**
* When an admin purges a post.
*/
export type AdminPurgePostView = {
admin_purge_post: AdminPurgePost; admin_purge_post: AdminPurgePost;
admin?: Person; admin?: Person;
community: Community; community: Community;
} };

View file

@ -1,8 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { RegistrationApplicationId } from "./RegistrationApplicationId"; import type { RegistrationApplicationId } from "./RegistrationApplicationId";
export interface ApproveRegistrationApplication { /**
* Approves a registration application.
*/
export type ApproveRegistrationApplication = {
id: RegistrationApplicationId; id: RegistrationApplicationId;
approve: boolean; approve: boolean;
deny_reason?: string; deny_reason?: string;
} };

View file

@ -1,10 +1,20 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { OAuthProviderId } from "./OAuthProviderId";
export interface AuthenticateWithOauth { /**
* Logging in with an OAuth 2.0 authorization
*/
export type AuthenticateWithOauth = {
code: string; code: string;
oauth_provider_id: string; oauth_provider_id: OAuthProviderId;
redirect_uri: string; redirect_uri: string;
show_nsfw?: boolean; show_nsfw?: boolean;
/**
* Username is mandatory at registration time
*/
username?: string; username?: string;
/**
* An answer is mandatory if require application is enabled on the server
*/
answer?: string; answer?: string;
} };

View file

@ -2,11 +2,23 @@
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface BanFromCommunity { /**
* Ban a user from a community.
*/
export type BanFromCommunity = {
community_id: CommunityId; community_id: CommunityId;
person_id: PersonId; person_id: PersonId;
ban: boolean; ban: boolean;
/**
* Optionally remove or restore all their data. Useful for new troll accounts.
* If ban is true, then this means remove. If ban is false, it means restore.
*/
remove_or_restore_data?: boolean; remove_or_restore_data?: boolean;
reason?: string; reason?: string;
/**
* A time that the ban will expire, in unix epoch seconds.
*
* An i64 unix timestamp is used for a simpler API client implementation.
*/
expires?: number; expires?: number;
} };

View file

@ -1,7 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonView } from "./PersonView"; import type { PersonView } from "./PersonView";
export interface BanFromCommunityResponse { /**
* The response for banning a user from a community.
*/
export type BanFromCommunityResponse = {
person_view: PersonView; person_view: PersonView;
banned: boolean; banned: boolean;
} };

View file

@ -1,10 +1,22 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface BanPerson { /**
* Ban a person from the site.
*/
export type BanPerson = {
person_id: PersonId; person_id: PersonId;
ban: boolean; ban: boolean;
/**
* Optionally remove or restore all their data. Useful for new troll accounts.
* If ban is true, then this means remove. If ban is false, it means restore.
*/
remove_or_restore_data?: boolean; remove_or_restore_data?: boolean;
reason?: string; reason?: string;
/**
* A time that the ban will expire, in unix epoch seconds.
*
* An i64 unix timestamp is used for a simpler API client implementation.
*/
expires?: number; expires?: number;
} };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonView } from "./PersonView"; import type { PersonView } from "./PersonView";
export interface BanPersonResponse { /**
person_view: PersonView; * A response for a banned person.
banned: boolean; */
} export type BanPersonResponse = { person_view: PersonView; banned: boolean };

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonView } from "./PersonView"; import type { PersonView } from "./PersonView";
export interface BannedPersonsResponse { /**
banned: Array<PersonView>; * The list of banned persons.
} */
export type BannedPersonsResponse = { banned: Array<PersonView> };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
export interface BlockCommunity { /**
community_id: CommunityId; * Block a community.
block: boolean; */
} export type BlockCommunity = { community_id: CommunityId; block: boolean };

View file

@ -1,7 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommunityView } from "./CommunityView"; import type { CommunityView } from "./CommunityView";
export interface BlockCommunityResponse { /**
* The block community response.
*/
export type BlockCommunityResponse = {
community_view: CommunityView; community_view: CommunityView;
blocked: boolean; blocked: boolean;
} };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { InstanceId } from "./InstanceId"; import type { InstanceId } from "./InstanceId";
export interface BlockInstance { /**
instance_id: InstanceId; * Block an instance as user
block: boolean; */
} export type BlockInstance = { instance_id: InstanceId; block: boolean };

View file

@ -1,5 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface BlockInstanceResponse { export type BlockInstanceResponse = { blocked: boolean };
blocked: boolean;
}

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface BlockPerson { /**
person_id: PersonId; * Block a person.
block: boolean; */
} export type BlockPerson = { person_id: PersonId; block: boolean };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonView } from "./PersonView"; import type { PersonView } from "./PersonView";
export interface BlockPersonResponse { /**
person_view: PersonView; * The response for a person block.
blocked: boolean; */
} export type BlockPersonResponse = { person_view: PersonView; blocked: boolean };

View file

@ -1,7 +1,19 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface CaptchaResponse { /**
* A captcha response.
*/
export type CaptchaResponse = {
/**
* A Base64 encoded png
*/
png: string; png: string;
/**
* A Base64 encoded wav audio
*/
wav: string; wav: string;
/**
* The UUID for the captcha item.
*/
uuid: string; uuid: string;
} };

View file

@ -1,7 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { SensitiveString } from "./SensitiveString";
export interface ChangePassword { /**
new_password: string; * Changes your account password.
new_password_verify: string; */
old_password: string; export type ChangePassword = {
} new_password: SensitiveString;
new_password_verify: SensitiveString;
old_password: SensitiveString;
};

View file

@ -1,21 +1,44 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId"; import type { CommentId } from "./CommentId";
import type { DbUrl } from "./DbUrl";
import type { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
export interface Comment { /**
* A comment.
*/
export type Comment = {
id: CommentId; id: CommentId;
creator_id: PersonId; creator_id: PersonId;
post_id: PostId; post_id: PostId;
content: string; content: string;
/**
* Whether the comment has been removed.
*/
removed: boolean; removed: boolean;
published: string; published: string;
updated?: string; updated?: string;
/**
* Whether the comment has been deleted by its creator.
*/
deleted: boolean; deleted: boolean;
ap_id: string; /**
* The federated activity id / ap_id.
*/
ap_id: DbUrl;
/**
* Whether the comment is local.
*/
local: boolean; local: boolean;
/**
* The path / tree location of a comment, separated by dots, ending with the comment's id. Ex:
* 0.24.27
*/
path: string; path: string;
/**
* Whether the comment has been distinguished(speaking officially) by a mod.
*/
distinguished: boolean; distinguished: boolean;
language_id: LanguageId; language_id: LanguageId;
} };

View file

@ -1,11 +1,17 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId"; import type { CommentId } from "./CommentId";
export interface CommentAggregates { /**
* Aggregate data for a comment.
*/
export type CommentAggregates = {
comment_id: CommentId; comment_id: CommentId;
score: number; score: number;
upvotes: number; upvotes: number;
downvotes: number; downvotes: number;
published: string; published: string;
/**
* The total number of children in this comment branch.
*/
child_count: number; child_count: number;
} };

View file

@ -1,3 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* The comment id.
*/
export type CommentId = number; export type CommentId = number;

View file

@ -3,10 +3,13 @@ import type { CommentId } from "./CommentId";
import type { CommentReplyId } from "./CommentReplyId"; import type { CommentReplyId } from "./CommentReplyId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface CommentReply { /**
* A comment reply.
*/
export type CommentReply = {
id: CommentReplyId; id: CommentReplyId;
recipient_id: PersonId; recipient_id: PersonId;
comment_id: CommentId; comment_id: CommentId;
read: boolean; read: boolean;
published: string; published: string;
} };

View file

@ -1,3 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* The comment reply id.
*/
export type CommentReplyId = number; export type CommentReplyId = number;

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentReplyView } from "./CommentReplyView"; import type { CommentReplyView } from "./CommentReplyView";
export interface CommentReplyResponse { /**
comment_reply_view: CommentReplyView; * The response for a comment reply action.
} */
export type CommentReplyResponse = { comment_reply_view: CommentReplyView };

View file

@ -7,7 +7,10 @@ import type { Person } from "./Person";
import type { Post } from "./Post"; import type { Post } from "./Post";
import type { SubscribedType } from "./SubscribedType"; import type { SubscribedType } from "./SubscribedType";
export interface CommentReplyView { /**
* A comment reply view.
*/
export type CommentReplyView = {
comment_reply: CommentReply; comment_reply: CommentReply;
comment: Comment; comment: Comment;
creator: Person; creator: Person;
@ -23,4 +26,4 @@ export interface CommentReplyView {
saved: boolean; saved: boolean;
creator_blocked: boolean; creator_blocked: boolean;
my_vote?: number; my_vote?: number;
} };

View file

@ -3,7 +3,10 @@ import type { CommentId } from "./CommentId";
import type { CommentReportId } from "./CommentReportId"; import type { CommentReportId } from "./CommentReportId";
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface CommentReport { /**
* A comment report.
*/
export type CommentReport = {
id: CommentReportId; id: CommentReportId;
creator_id: PersonId; creator_id: PersonId;
comment_id: CommentId; comment_id: CommentId;
@ -13,4 +16,4 @@ export interface CommentReport {
resolver_id?: PersonId; resolver_id?: PersonId;
published: string; published: string;
updated?: string; updated?: string;
} };

View file

@ -1,3 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* The comment report id.
*/
export type CommentReportId = number; export type CommentReportId = number;

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentReportView } from "./CommentReportView"; import type { CommentReportView } from "./CommentReportView";
export interface CommentReportResponse { /**
comment_report_view: CommentReportView; * The comment report response.
} */
export type CommentReportResponse = { comment_report_view: CommentReportView };

View file

@ -7,7 +7,10 @@ import type { Person } from "./Person";
import type { Post } from "./Post"; import type { Post } from "./Post";
import type { SubscribedType } from "./SubscribedType"; import type { SubscribedType } from "./SubscribedType";
export interface CommentReportView { /**
* A comment report view.
*/
export type CommentReportView = {
comment_report: CommentReport; comment_report: CommentReport;
comment: Comment; comment: Comment;
post: Post; post: Post;
@ -23,4 +26,4 @@ export interface CommentReportView {
saved: boolean; saved: boolean;
my_vote?: number; my_vote?: number;
resolver?: Person; resolver?: Person;
} };

View file

@ -2,7 +2,10 @@
import type { CommentView } from "./CommentView"; import type { CommentView } from "./CommentView";
import type { LocalUserId } from "./LocalUserId"; import type { LocalUserId } from "./LocalUserId";
export interface CommentResponse { /**
* A comment response.
*/
export type CommentResponse = {
comment_view: CommentView; comment_view: CommentView;
recipient_ids: Array<LocalUserId>; recipient_ids: Array<LocalUserId>;
} };

View file

@ -1,3 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* The comment sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
*/
export type CommentSortType = "Hot" | "Top" | "New" | "Old" | "Controversial"; export type CommentSortType = "Hot" | "Top" | "New" | "Old" | "Controversial";

View file

@ -6,7 +6,10 @@ import type { Person } from "./Person";
import type { Post } from "./Post"; import type { Post } from "./Post";
import type { SubscribedType } from "./SubscribedType"; import type { SubscribedType } from "./SubscribedType";
export interface CommentView { /**
* A comment view.
*/
export type CommentView = {
comment: Comment; comment: Comment;
creator: Person; creator: Person;
post: Post; post: Post;
@ -20,4 +23,4 @@ export interface CommentView {
saved: boolean; saved: boolean;
creator_blocked: boolean; creator_blocked: boolean;
my_vote?: number; my_vote?: number;
} };

View file

@ -1,24 +1,65 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
import type { CommunityVisibility } from "./CommunityVisibility"; import type { CommunityVisibility } from "./CommunityVisibility";
import type { DbUrl } from "./DbUrl";
import type { InstanceId } from "./InstanceId"; import type { InstanceId } from "./InstanceId";
export interface Community { /**
* A community.
*/
export type Community = {
id: CommunityId; id: CommunityId;
name: string; name: string;
/**
* A longer title, that can contain other characters, and doesn't have to be unique.
*/
title: string; title: string;
description?: string; /**
* A sidebar for the community in markdown.
*/
sidebar?: string;
/**
* Whether the community is removed by a mod.
*/
removed: boolean; removed: boolean;
published: string; published: string;
updated?: string; updated?: string;
/**
* Whether the community has been deleted by its creator.
*/
deleted: boolean; deleted: boolean;
/**
* Whether its an NSFW community.
*/
nsfw: boolean; nsfw: boolean;
actor_id: string; /**
* The federated actor_id.
*/
actor_id: DbUrl;
/**
* Whether the community is local.
*/
local: boolean; local: boolean;
icon?: string; /**
banner?: string; * A URL for an icon.
*/
icon?: DbUrl;
/**
* A URL for a banner.
*/
banner?: DbUrl;
/**
* Whether the community is hidden.
*/
hidden: boolean; hidden: boolean;
/**
* Whether posting is restricted to mods only.
*/
posting_restricted_to_mods: boolean; posting_restricted_to_mods: boolean;
instance_id: InstanceId; instance_id: InstanceId;
visibility: CommunityVisibility; visibility: CommunityVisibility;
} /**
* A shorter, one-line description of the site.
*/
description?: string;
};

View file

@ -1,15 +1,30 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
export interface CommunityAggregates { /**
* Aggregate data for a community.
*/
export type CommunityAggregates = {
community_id: CommunityId; community_id: CommunityId;
subscribers: number; subscribers: number;
posts: number; posts: number;
comments: number; comments: number;
published: string; published: string;
/**
* The number of users with any activity in the last day.
*/
users_active_day: number; users_active_day: number;
/**
* The number of users with any activity in the last week.
*/
users_active_week: number; users_active_week: number;
/**
* The number of users with any activity in the last month.
*/
users_active_month: number; users_active_month: number;
/**
* The number of users with any activity in the last year.
*/
users_active_half_year: number; users_active_half_year: number;
subscribers_local: number; subscribers_local: number;
} };

View file

@ -2,7 +2,7 @@
import type { Community } from "./Community"; import type { Community } from "./Community";
import type { Person } from "./Person"; import type { Person } from "./Person";
export interface CommunityFollowerView { /**
community: Community; * A community follower.
follower: Person; */
} export type CommunityFollowerView = { community: Community; follower: Person };

View file

@ -1,3 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* The community id.
*/
export type CommunityId = number; export type CommunityId = number;

View file

@ -2,7 +2,10 @@
import type { Community } from "./Community"; import type { Community } from "./Community";
import type { Person } from "./Person"; import type { Person } from "./Person";
export interface CommunityModeratorView { /**
* A community moderator.
*/
export type CommunityModeratorView = {
community: Community; community: Community;
moderator: Person; moderator: Person;
} };

View file

@ -2,7 +2,10 @@
import type { CommunityView } from "./CommunityView"; import type { CommunityView } from "./CommunityView";
import type { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
export interface CommunityResponse { /**
* A simple community response.
*/
export type CommunityResponse = {
community_view: CommunityView; community_view: CommunityView;
discussion_languages: Array<LanguageId>; discussion_languages: Array<LanguageId>;
} };

View file

@ -0,0 +1,27 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* The community sort types. See here for descriptions: https://join-lemmy.org/docs/en/users/03-votes-and-ranking.html
*/
export type CommunitySortType =
| "Active"
| "Hot"
| "New"
| "Old"
| "TopDay"
| "TopWeek"
| "TopMonth"
| "TopYear"
| "TopAll"
| "MostComments"
| "NewComments"
| "TopHour"
| "TopSixHour"
| "TopTwelveHour"
| "TopThreeMonths"
| "TopSixMonths"
| "TopNineMonths"
| "Controversial"
| "Scaled"
| "NameAsc"
| "NameDesc";

View file

@ -3,10 +3,13 @@ import type { Community } from "./Community";
import type { CommunityAggregates } from "./CommunityAggregates"; import type { CommunityAggregates } from "./CommunityAggregates";
import type { SubscribedType } from "./SubscribedType"; import type { SubscribedType } from "./SubscribedType";
export interface CommunityView { /**
* A community view.
*/
export type CommunityView = {
community: Community; community: Community;
subscribed: SubscribedType; subscribed: SubscribedType;
blocked: boolean; blocked: boolean;
counts: CommunityAggregates; counts: CommunityAggregates;
banned_from_community: boolean; banned_from_community: boolean;
} };

View file

@ -1,3 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* Defines who can browse and interact with content in a community.
*
* TODO: Also use this to define private communities
*/
export type CommunityVisibility = "Public" | "LocalOnly"; export type CommunityVisibility = "Public" | "LocalOnly";

View file

@ -3,9 +3,12 @@ import type { CommentId } from "./CommentId";
import type { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
export interface CreateComment { /**
* Create a comment.
*/
export type CreateComment = {
content: string; content: string;
post_id: PostId; post_id: PostId;
parent_id?: CommentId; parent_id?: CommentId;
language_id?: LanguageId; language_id?: LanguageId;
} };

View file

@ -1,7 +1,13 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId"; import type { CommentId } from "./CommentId";
export interface CreateCommentLike { /**
* Like a comment.
*/
export type CreateCommentLike = {
comment_id: CommentId; comment_id: CommentId;
/**
* Must be -1, 0, or 1 .
*/
score: number; score: number;
} };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId"; import type { CommentId } from "./CommentId";
export interface CreateCommentReport { /**
comment_id: CommentId; * Report a comment.
reason: string; */
} export type CreateCommentReport = { comment_id: CommentId; reason: string };

View file

@ -2,14 +2,42 @@
import type { CommunityVisibility } from "./CommunityVisibility"; import type { CommunityVisibility } from "./CommunityVisibility";
import type { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
export interface CreateCommunity { /**
* Create a community.
*/
export type CreateCommunity = {
/**
* The unique name.
*/
name: string; name: string;
/**
* A longer title.
*/
title: string; title: string;
/**
* A sidebar for the community in markdown.
*/
sidebar?: string;
/**
* A shorter, one line description of your community.
*/
description?: string; description?: string;
/**
* An icon URL.
*/
icon?: string; icon?: string;
/**
* A banner URL.
*/
banner?: string; banner?: string;
/**
* Whether its an NSFW community.
*/
nsfw?: boolean; nsfw?: boolean;
/**
* Whether to restrict posting only to moderators.
*/
posting_restricted_to_mods?: boolean; posting_restricted_to_mods?: boolean;
discussion_languages?: Array<LanguageId>; discussion_languages?: Array<LanguageId>;
visibility?: CommunityVisibility; visibility?: CommunityVisibility;
} };

View file

@ -1,9 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface CreateCustomEmoji { /**
* Create a custom emoji.
*/
export type CreateCustomEmoji = {
category: string; category: string;
shortcode: string; shortcode: string;
image_url: string; image_url: string;
alt_text: string; alt_text: string;
keywords: Array<string>; keywords: Array<string>;
} };

View file

@ -1,6 +1,9 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface CreateOAuthProvider { /**
* Create an external auth method.
*/
export type CreateOAuthProvider = {
display_name: string; display_name: string;
issuer: string; issuer: string;
authorization_endpoint: string; authorization_endpoint: string;
@ -13,4 +16,4 @@ export interface CreateOAuthProvider {
auto_verify_email?: boolean; auto_verify_email?: boolean;
account_linking_enabled?: boolean; account_linking_enabled?: boolean;
enabled?: boolean; enabled?: boolean;
} };

View file

@ -2,15 +2,33 @@
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
import type { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
export interface CreatePost { /**
* Create a post.
*/
export type CreatePost = {
name: string; name: string;
community_id: CommunityId; community_id: CommunityId;
url?: string; url?: string;
/**
* An optional body for the post in markdown.
*/
body?: string; body?: string;
/**
* An optional alt_text, usable for image posts.
*/
alt_text?: string; alt_text?: string;
/**
* A honeypot to catch bots. Should be None.
*/
honeypot?: string; honeypot?: string;
nsfw?: boolean; nsfw?: boolean;
language_id?: LanguageId; language_id?: LanguageId;
/**
* Instead of fetching a thumbnail, use a custom one.
*/
custom_thumbnail?: string; custom_thumbnail?: string;
/**
* Time when this post should be scheduled. Null means publish immediately.
*/
scheduled_publish_time?: number; scheduled_publish_time?: number;
} };

View file

@ -1,7 +1,13 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
export interface CreatePostLike { /**
* Like a post.
*/
export type CreatePostLike = {
post_id: PostId; post_id: PostId;
/**
* Score must be -1, 0, or 1.
*/
score: number; score: number;
} };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
export interface CreatePostReport { /**
post_id: PostId; * Create a post report.
reason: string; */
} export type CreatePostReport = { post_id: PostId; reason: string };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId"; import type { PersonId } from "./PersonId";
export interface CreatePrivateMessage { /**
content: string; * Create a private message.
recipient_id: PersonId; */
} export type CreatePrivateMessage = { content: string; recipient_id: PersonId };

View file

@ -1,7 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PrivateMessageId } from "./PrivateMessageId"; import type { PrivateMessageId } from "./PrivateMessageId";
export interface CreatePrivateMessageReport { /**
* Create a report for a private message.
*/
export type CreatePrivateMessageReport = {
private_message_id: PrivateMessageId; private_message_id: PrivateMessageId;
reason: string; reason: string;
} };

View file

@ -7,7 +7,10 @@ import type { PostListingMode } from "./PostListingMode";
import type { PostSortType } from "./PostSortType"; import type { PostSortType } from "./PostSortType";
import type { RegistrationMode } from "./RegistrationMode"; import type { RegistrationMode } from "./RegistrationMode";
export interface CreateSite { /**
* Creates a site. Should be done after first running lemmy.
*/
export type CreateSite = {
name: string; name: string;
sidebar?: string; sidebar?: string;
description?: string; description?: string;
@ -54,4 +57,4 @@ export interface CreateSite {
post_downvotes?: FederationMode; post_downvotes?: FederationMode;
comment_upvotes?: FederationMode; comment_upvotes?: FederationMode;
comment_downvotes?: FederationMode; comment_downvotes?: FederationMode;
} };

View file

@ -1,5 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface CreateTagline { /**
content: string; * Create a tagline
} */
export type CreateTagline = { content: string };

View file

@ -1,12 +1,16 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CustomEmojiId } from "./CustomEmojiId"; import type { CustomEmojiId } from "./CustomEmojiId";
import type { DbUrl } from "./DbUrl";
export interface CustomEmoji { /**
* A custom emoji.
*/
export type CustomEmoji = {
id: CustomEmojiId; id: CustomEmojiId;
shortcode: string; shortcode: string;
image_url: string; image_url: DbUrl;
alt_text: string; alt_text: string;
category: string; category: string;
published: string; published: string;
updated?: string; updated?: string;
} };

View file

@ -1,3 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* The custom emoji id.
*/
export type CustomEmojiId = number; export type CustomEmojiId = number;

View file

@ -1,7 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CustomEmojiId } from "./CustomEmojiId"; import type { CustomEmojiId } from "./CustomEmojiId";
export interface CustomEmojiKeyword { /**
* A custom keyword for an emoji.
*/
export type CustomEmojiKeyword = {
custom_emoji_id: CustomEmojiId; custom_emoji_id: CustomEmojiId;
keyword: string; keyword: string;
} };

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CustomEmojiView } from "./CustomEmojiView"; import type { CustomEmojiView } from "./CustomEmojiView";
export interface CustomEmojiResponse { /**
custom_emoji: CustomEmojiView; * A response for a custom emoji.
} */
export type CustomEmojiResponse = { custom_emoji: CustomEmojiView };

View file

@ -2,7 +2,10 @@
import type { CustomEmoji } from "./CustomEmoji"; import type { CustomEmoji } from "./CustomEmoji";
import type { CustomEmojiKeyword } from "./CustomEmojiKeyword"; import type { CustomEmojiKeyword } from "./CustomEmojiKeyword";
export interface CustomEmojiView { /**
* A custom emoji view.
*/
export type CustomEmojiView = {
custom_emoji: CustomEmoji; custom_emoji: CustomEmoji;
keywords: Array<CustomEmojiKeyword>; keywords: Array<CustomEmojiKeyword>;
} };

3
src/types/DbUrl.ts Normal file
View file

@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type DbUrl = string;

View file

@ -1,6 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { SensitiveString } from "./SensitiveString";
export interface DeleteAccount { /**
password: string; * Delete your account.
*/
export type DeleteAccount = {
password: SensitiveString;
delete_content: boolean; delete_content: boolean;
} };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId"; import type { CommentId } from "./CommentId";
export interface DeleteComment { /**
comment_id: CommentId; * Delete your own comment.
deleted: boolean; */
} export type DeleteComment = { comment_id: CommentId; deleted: boolean };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
export interface DeleteCommunity { /**
community_id: CommunityId; * Delete your own community.
deleted: boolean; */
} export type DeleteCommunity = { community_id: CommunityId; deleted: boolean };

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CustomEmojiId } from "./CustomEmojiId"; import type { CustomEmojiId } from "./CustomEmojiId";
export interface DeleteCustomEmoji { /**
id: CustomEmojiId; * Delete a custom emoji.
} */
export type DeleteCustomEmoji = { id: CustomEmojiId };

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { OAuthProviderId } from "./OAuthProviderId"; import type { OAuthProviderId } from "./OAuthProviderId";
export interface DeleteOAuthProvider { /**
id: OAuthProviderId; * Delete an external auth method.
} */
export type DeleteOAuthProvider = { id: OAuthProviderId };

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
export interface DeletePost { /**
post_id: PostId; * Delete a post.
deleted: boolean; */
} export type DeletePost = { post_id: PostId; deleted: boolean };

View file

@ -1,7 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PrivateMessageId } from "./PrivateMessageId"; import type { PrivateMessageId } from "./PrivateMessageId";
export interface DeletePrivateMessage { /**
* Delete a private message.
*/
export type DeletePrivateMessage = {
private_message_id: PrivateMessageId; private_message_id: PrivateMessageId;
deleted: boolean; deleted: boolean;
} };

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { TaglineId } from "./TaglineId"; import type { TaglineId } from "./TaglineId";
export interface DeleteTagline { /**
id: TaglineId; * Delete a tagline
} */
export type DeleteTagline = { id: TaglineId };

View file

@ -1,7 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId"; import type { CommentId } from "./CommentId";
export interface DistinguishComment { /**
* Distinguish a comment (IE speak as moderator).
*/
export type DistinguishComment = {
comment_id: CommentId; comment_id: CommentId;
distinguished: boolean; distinguished: boolean;
} };

View file

@ -2,8 +2,11 @@
import type { CommentId } from "./CommentId"; import type { CommentId } from "./CommentId";
import type { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
export interface EditComment { /**
* Edit a comment.
*/
export type EditComment = {
comment_id: CommentId; comment_id: CommentId;
content?: string; content?: string;
language_id?: LanguageId; language_id?: LanguageId;
} };

View file

@ -3,14 +3,39 @@ import type { CommunityId } from "./CommunityId";
import type { CommunityVisibility } from "./CommunityVisibility"; import type { CommunityVisibility } from "./CommunityVisibility";
import type { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
export interface EditCommunity { /**
* Edit a community.
*/
export type EditCommunity = {
community_id: CommunityId; community_id: CommunityId;
/**
* A longer title.
*/
title?: string; title?: string;
/**
* A sidebar for the community in markdown.
*/
sidebar?: string;
/**
* A shorter, one line description of your community.
*/
description?: string; description?: string;
/**
* An icon URL.
*/
icon?: string; icon?: string;
/**
* A banner URL.
*/
banner?: string; banner?: string;
/**
* Whether its an NSFW community.
*/
nsfw?: boolean; nsfw?: boolean;
/**
* Whether to restrict posting only to moderators.
*/
posting_restricted_to_mods?: boolean; posting_restricted_to_mods?: boolean;
discussion_languages?: Array<LanguageId>; discussion_languages?: Array<LanguageId>;
visibility?: CommunityVisibility; visibility?: CommunityVisibility;
} };

View file

@ -1,10 +1,13 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CustomEmojiId } from "./CustomEmojiId"; import type { CustomEmojiId } from "./CustomEmojiId";
export interface EditCustomEmoji { /**
* Edit a custom emoji.
*/
export type EditCustomEmoji = {
id: CustomEmojiId; id: CustomEmojiId;
category: string; category: string;
image_url: string; image_url: string;
alt_text: string; alt_text: string;
keywords: Array<string>; keywords: Array<string>;
} };

View file

@ -1,7 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { OAuthProviderId } from "./OAuthProviderId"; import type { OAuthProviderId } from "./OAuthProviderId";
export interface EditOAuthProvider { /**
* Edit an external auth method.
*/
export type EditOAuthProvider = {
id: OAuthProviderId; id: OAuthProviderId;
display_name?: string; display_name?: string;
authorization_endpoint?: string; authorization_endpoint?: string;
@ -13,4 +16,4 @@ export interface EditOAuthProvider {
auto_verify_email?: boolean; auto_verify_email?: boolean;
account_linking_enabled?: boolean; account_linking_enabled?: boolean;
enabled?: boolean; enabled?: boolean;
} };

View file

@ -2,14 +2,29 @@
import type { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
export interface EditPost { /**
* Edit a post.
*/
export type EditPost = {
post_id: PostId; post_id: PostId;
name?: string; name?: string;
url?: string; url?: string;
/**
* An optional body for the post in markdown.
*/
body?: string; body?: string;
/**
* An optional alt_text, usable for image posts.
*/
alt_text?: string; alt_text?: string;
nsfw?: boolean; nsfw?: boolean;
language_id?: LanguageId; language_id?: LanguageId;
/**
* Instead of fetching a thumbnail, use a custom one.
*/
custom_thumbnail?: string; custom_thumbnail?: string;
/**
* Time when this post should be scheduled. Null means publish immediately.
*/
scheduled_publish_time?: number; scheduled_publish_time?: number;
} };

View file

@ -1,7 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PrivateMessageId } from "./PrivateMessageId"; import type { PrivateMessageId } from "./PrivateMessageId";
export interface EditPrivateMessage { /**
* Edit a private message.
*/
export type EditPrivateMessage = {
private_message_id: PrivateMessageId; private_message_id: PrivateMessageId;
content: string; content: string;
} };

View file

@ -7,53 +7,177 @@ import type { PostListingMode } from "./PostListingMode";
import type { PostSortType } from "./PostSortType"; import type { PostSortType } from "./PostSortType";
import type { RegistrationMode } from "./RegistrationMode"; import type { RegistrationMode } from "./RegistrationMode";
export interface EditSite { /**
* Edits a site.
*/
export type EditSite = {
name?: string; name?: string;
/**
* A sidebar for the site, in markdown.
*/
sidebar?: string; sidebar?: string;
/**
* A shorter, one line description of your site.
*/
description?: string; description?: string;
/**
* A url for your site's icon.
*/
icon?: string; icon?: string;
/**
* A url for your site's banner.
*/
banner?: string; banner?: string;
/**
* Whether to enable NSFW.
*/
enable_nsfw?: boolean; enable_nsfw?: boolean;
/**
* Limits community creation to admins only.
*/
community_creation_admin_only?: boolean; community_creation_admin_only?: boolean;
/**
* Whether to require email verification.
*/
require_email_verification?: boolean; require_email_verification?: boolean;
/**
* Your application question form. This is in markdown, and can be many questions.
*/
application_question?: string; application_question?: string;
/**
* Whether your instance is public, or private.
*/
private_instance?: boolean; private_instance?: boolean;
/**
* The default theme. Usually "browser"
*/
default_theme?: string; default_theme?: string;
/**
* The default post listing type, usually "local"
*/
default_post_listing_type?: ListingType; default_post_listing_type?: ListingType;
/**
* Default value for listing mode, usually "list"
*/
default_post_listing_mode?: PostListingMode; default_post_listing_mode?: PostListingMode;
/**
* The default post sort, usually "active"
*/
default_post_sort_type?: PostSortType; default_post_sort_type?: PostSortType;
/**
* The default comment sort, usually "hot"
*/
default_comment_sort_type?: CommentSortType; default_comment_sort_type?: CommentSortType;
/**
* An optional page of legal information
*/
legal_information?: string; legal_information?: string;
/**
* Whether to email admins when receiving a new application.
*/
application_email_admins?: boolean; application_email_admins?: boolean;
/**
* Whether to hide moderator names from the modlog.
*/
hide_modlog_mod_names?: boolean; hide_modlog_mod_names?: boolean;
/**
* A list of allowed discussion languages.
*/
discussion_languages?: Array<LanguageId>; discussion_languages?: Array<LanguageId>;
/**
* A regex string of items to filter.
*/
slur_filter_regex?: string; slur_filter_regex?: string;
/**
* The max length of actor names.
*/
actor_name_max_length?: number; actor_name_max_length?: number;
/**
* The number of messages allowed in a given time frame.
*/
rate_limit_message?: number; rate_limit_message?: number;
rate_limit_message_per_second?: number; rate_limit_message_per_second?: number;
/**
* The number of posts allowed in a given time frame.
*/
rate_limit_post?: number; rate_limit_post?: number;
rate_limit_post_per_second?: number; rate_limit_post_per_second?: number;
/**
* The number of registrations allowed in a given time frame.
*/
rate_limit_register?: number; rate_limit_register?: number;
rate_limit_register_per_second?: number; rate_limit_register_per_second?: number;
/**
* The number of image uploads allowed in a given time frame.
*/
rate_limit_image?: number; rate_limit_image?: number;
rate_limit_image_per_second?: number; rate_limit_image_per_second?: number;
/**
* The number of comments allowed in a given time frame.
*/
rate_limit_comment?: number; rate_limit_comment?: number;
rate_limit_comment_per_second?: number; rate_limit_comment_per_second?: number;
/**
* The number of searches allowed in a given time frame.
*/
rate_limit_search?: number; rate_limit_search?: number;
rate_limit_search_per_second?: number; rate_limit_search_per_second?: number;
/**
* Whether to enable federation.
*/
federation_enabled?: boolean; federation_enabled?: boolean;
/**
* Enables federation debugging.
*/
federation_debug?: boolean; federation_debug?: boolean;
/**
* Whether to enable captchas for signups.
*/
captcha_enabled?: boolean; captcha_enabled?: boolean;
/**
* The captcha difficulty. Can be easy, medium, or hard
*/
captcha_difficulty?: string; captcha_difficulty?: string;
/**
* A list of allowed instances. If none are set, federation is open.
*/
allowed_instances?: Array<string>; allowed_instances?: Array<string>;
/**
* A list of blocked instances.
*/
blocked_instances?: Array<string>; blocked_instances?: Array<string>;
/**
* A list of blocked URLs
*/
blocked_urls?: Array<string>; blocked_urls?: Array<string>;
registration_mode?: RegistrationMode; registration_mode?: RegistrationMode;
/**
* Whether to email admins for new reports.
*/
reports_email_admins?: boolean; reports_email_admins?: boolean;
/**
* If present, nsfw content is visible by default. Should be displayed by frontends/clients
* when the site is first opened by a user.
*/
content_warning?: string; content_warning?: string;
/**
* Whether or not external auth methods can auto-register users.
*/
oauth_registration?: boolean; oauth_registration?: boolean;
/**
* What kind of post upvotes your site allows.
*/
post_upvotes?: FederationMode; post_upvotes?: FederationMode;
/**
* What kind of post downvotes your site allows.
*/
post_downvotes?: FederationMode; post_downvotes?: FederationMode;
/**
* What kind of comment upvotes your site allows.
*/
comment_upvotes?: FederationMode; comment_upvotes?: FederationMode;
/**
* What kind of comment downvotes your site allows.
*/
comment_downvotes?: FederationMode; comment_downvotes?: FederationMode;
} };

View file

@ -2,8 +2,11 @@
import type { PostFeatureType } from "./PostFeatureType"; import type { PostFeatureType } from "./PostFeatureType";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
export interface FeaturePost { /**
* Feature a post (stickies / pins to the top).
*/
export type FeaturePost = {
post_id: PostId; post_id: PostId;
featured: boolean; featured: boolean;
feature_type: PostFeatureType; feature_type: PostFeatureType;
} };

View file

@ -1,8 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { InstanceWithFederationState } from "./InstanceWithFederationState"; import type { InstanceWithFederationState } from "./InstanceWithFederationState";
export interface FederatedInstances { /**
* A list of federated instances.
*/
export type FederatedInstances = {
linked: Array<InstanceWithFederationState>; linked: Array<InstanceWithFederationState>;
allowed: Array<InstanceWithFederationState>; allowed: Array<InstanceWithFederationState>;
blocked: Array<InstanceWithFederationState>; blocked: Array<InstanceWithFederationState>;
} };

View file

@ -0,0 +1,27 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* Federation related errors, these dont need to be translated.
*/
export type FederationError =
| "CouldntFindActivity"
| "InvalidCommunity"
| "CannotCreatePostOrCommentInDeletedOrRemovedCommunity"
| "CannotReceivePage"
| "OnlyLocalAdminCanRemoveCommunity"
| "OnlyLocalAdminCanRestoreCommunity"
| "PostIsLocked"
| { PersonIsBannedFromSite: string }
| "InvalidVoteValue"
| "PageDoesNotSpecifyCreator"
| "CouldntGetComments"
| "CouldntGetPosts"
| "FederationDisabled"
| { DomainBlocked: string }
| { DomainNotInAllowList: string }
| "FederationDisabledByStrictAllowList"
| "ContradictingFilters"
| "UrlWithoutDomain"
| "InboxTimeout"
| "CantDeleteSite"
| "ObjectIsNotPublic";

View file

@ -1,3 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* The federation mode for an item
*/
export type FederationMode = "All" | "Local" | "Disable"; export type FederationMode = "All" | "Local" | "Disable";

View file

@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
export interface FollowCommunity { /**
community_id: CommunityId; * Follow / subscribe to a community.
follow: boolean; */
} export type FollowCommunity = { community_id: CommunityId; follow: boolean };

View file

@ -1,5 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { SensitiveString } from "./SensitiveString";
export interface GenerateTotpSecretResponse { export type GenerateTotpSecretResponse = { totp_secret_url: SensitiveString };
totp_secret_url: string;
}

View file

@ -1,6 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CaptchaResponse } from "./CaptchaResponse"; import type { CaptchaResponse } from "./CaptchaResponse";
export interface GetCaptchaResponse { /**
* A wrapper for the captcha response.
*/
export type GetCaptchaResponse = {
/**
* Will be None if captchas are disabled.
*/
ok?: CaptchaResponse; ok?: CaptchaResponse;
} };

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId"; import type { CommentId } from "./CommentId";
export interface GetComment { /**
id: CommentId; * Fetch an individual comment.
} */
export type GetComment = { id: CommentId };

View file

@ -5,7 +5,10 @@ import type { CommunityId } from "./CommunityId";
import type { ListingType } from "./ListingType"; import type { ListingType } from "./ListingType";
import type { PostId } from "./PostId"; import type { PostId } from "./PostId";
export interface GetComments { /**
* Get a list of comments.
*/
export type GetComments = {
type_?: ListingType; type_?: ListingType;
sort?: CommentSortType; sort?: CommentSortType;
max_depth?: number; max_depth?: number;
@ -18,4 +21,4 @@ export interface GetComments {
saved_only?: boolean; saved_only?: boolean;
liked_only?: boolean; liked_only?: boolean;
disliked_only?: boolean; disliked_only?: boolean;
} };

View file

@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentView } from "./CommentView"; import type { CommentView } from "./CommentView";
export interface GetCommentsResponse { /**
comments: Array<CommentView>; * The comment list response.
} */
export type GetCommentsResponse = { comments: Array<CommentView> };

View file

@ -1,7 +1,13 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
export interface GetCommunity { /**
* Get a community. Must provide either an id, or a name.
*/
export type GetCommunity = {
id?: CommunityId; id?: CommunityId;
/**
* Example: star_trek , or star_trek@xyz.tld
*/
name?: string; name?: string;
} };

View file

@ -4,9 +4,12 @@ import type { CommunityView } from "./CommunityView";
import type { LanguageId } from "./LanguageId"; import type { LanguageId } from "./LanguageId";
import type { Site } from "./Site"; import type { Site } from "./Site";
export interface GetCommunityResponse { /**
* The community response.
*/
export type GetCommunityResponse = {
community_view: CommunityView; community_view: CommunityView;
site?: Site; site?: Site;
moderators: Array<CommunityModeratorView>; moderators: Array<CommunityModeratorView>;
discussion_languages: Array<LanguageId>; discussion_languages: Array<LanguageId>;
} };

View file

@ -1,6 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { FederatedInstances } from "./FederatedInstances"; import type { FederatedInstances } from "./FederatedInstances";
export interface GetFederatedInstancesResponse { /**
* A response of federated instances.
*/
export type GetFederatedInstancesResponse = {
/**
* Optional, because federation may be disabled.
*/
federated_instances?: FederatedInstances; federated_instances?: FederatedInstances;
} };

Some files were not shown because too many files have changed in this diff Show more