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
# First re-generate the types by running cargo test on lemmy
pushd ../lemmy/scripts
./test.sh
pushd ../lemmy
cargo test --workspace export_bindings
cd ../crates
cd crates
# Copy them over to the types folder
cp api_common/bindings/* ../../lemmy-js-client/src/types/

View file

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

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.
import type { PersonId } from "./PersonId";
export interface AddAdmin {
person_id: PersonId;
added: boolean;
}
/**
* Adds an admin to a site.
*/
export type AddAdmin = { person_id: PersonId; added: boolean };

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.
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 { PersonId } from "./PersonId";
export interface AddModToCommunity {
/**
* Add a moderator to a community.
*/
export type AddModToCommunity = {
community_id: CommunityId;
person_id: PersonId;
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.
import type { CommunityModeratorView } from "./CommunityModeratorView";
export interface AddModToCommunityResponse {
/**
* The response of adding a moderator to a community.
*/
export type AddModToCommunityResponse = {
moderators: Array<CommunityModeratorView>;
}
};

View file

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

View file

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

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.
import type { PersonId } from "./PersonId";
export interface AdminPurgeCommunity {
/**
* When an admin purges a community.
*/
export type AdminPurgeCommunity = {
id: number;
admin_person_id: PersonId;
reason?: string;
when_: string;
}
};

View file

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

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.
import type { PersonId } from "./PersonId";
export interface AdminPurgePerson {
/**
* When an admin purges a person.
*/
export type AdminPurgePerson = {
id: number;
admin_person_id: PersonId;
reason?: string;
when_: string;
}
};

View file

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

View file

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

View file

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

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.
import type { RegistrationApplicationId } from "./RegistrationApplicationId";
export interface ApproveRegistrationApplication {
/**
* Approves a registration application.
*/
export type ApproveRegistrationApplication = {
id: RegistrationApplicationId;
approve: boolean;
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.
import type { OAuthProviderId } from "./OAuthProviderId";
export interface AuthenticateWithOauth {
/**
* Logging in with an OAuth 2.0 authorization
*/
export type AuthenticateWithOauth = {
code: string;
oauth_provider_id: string;
oauth_provider_id: OAuthProviderId;
redirect_uri: string;
show_nsfw?: boolean;
/**
* Username is mandatory at registration time
*/
username?: string;
/**
* An answer is mandatory if require application is enabled on the server
*/
answer?: string;
}
};

View file

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

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.
import type { PersonView } from "./PersonView";
export interface BanFromCommunityResponse {
/**
* The response for banning a user from a community.
*/
export type BanFromCommunityResponse = {
person_view: PersonView;
banned: boolean;
}
};

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.
import type { PersonId } from "./PersonId";
export interface BanPerson {
/**
* Ban a person from the site.
*/
export type BanPerson = {
person_id: PersonId;
ban: boolean;
/**
* Optionally remove or restore all their data. Useful for new troll accounts.
* If ban is true, then this means remove. If ban is false, it means restore.
*/
remove_or_restore_data?: boolean;
reason?: string;
/**
* A time that the ban will expire, in unix epoch seconds.
*
* An i64 unix timestamp is used for a simpler API client implementation.
*/
expires?: number;
}
};

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.
import type { PersonView } from "./PersonView";
export interface BanPersonResponse {
person_view: PersonView;
banned: boolean;
}
/**
* A response for a banned person.
*/
export type BanPersonResponse = { person_view: PersonView; banned: boolean };

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.
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.
import type { CommunityId } from "./CommunityId";
export interface BlockCommunity {
community_id: CommunityId;
block: boolean;
}
/**
* Block a community.
*/
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.
import type { CommunityView } from "./CommunityView";
export interface BlockCommunityResponse {
/**
* The block community response.
*/
export type BlockCommunityResponse = {
community_view: CommunityView;
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.
import type { InstanceId } from "./InstanceId";
export interface BlockInstance {
instance_id: InstanceId;
block: boolean;
}
/**
* Block an instance as user
*/
export type BlockInstance = { instance_id: InstanceId; block: boolean };

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.
export interface BlockInstanceResponse {
blocked: boolean;
}
export type BlockInstanceResponse = { 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.
import type { PersonId } from "./PersonId";
export interface BlockPerson {
person_id: PersonId;
block: boolean;
}
/**
* Block a person.
*/
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.
import type { PersonView } from "./PersonView";
export interface BlockPersonResponse {
person_view: PersonView;
blocked: boolean;
}
/**
* The response for a person block.
*/
export type BlockPersonResponse = { person_view: PersonView; blocked: boolean };

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.
export interface CaptchaResponse {
/**
* A captcha response.
*/
export type CaptchaResponse = {
/**
* A Base64 encoded png
*/
png: string;
/**
* A Base64 encoded wav audio
*/
wav: string;
/**
* The UUID for the captcha item.
*/
uuid: string;
}
};

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.
import type { SensitiveString } from "./SensitiveString";
export interface ChangePassword {
new_password: string;
new_password_verify: string;
old_password: string;
}
/**
* Changes your account password.
*/
export type ChangePassword = {
new_password: SensitiveString;
new_password_verify: SensitiveString;
old_password: SensitiveString;
};

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.
import type { CommentId } from "./CommentId";
import type { DbUrl } from "./DbUrl";
import type { LanguageId } from "./LanguageId";
import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId";
export interface Comment {
/**
* A comment.
*/
export type Comment = {
id: CommentId;
creator_id: PersonId;
post_id: PostId;
content: string;
/**
* Whether the comment has been removed.
*/
removed: boolean;
published: string;
updated?: string;
/**
* Whether the comment has been deleted by its creator.
*/
deleted: boolean;
ap_id: string;
/**
* The federated activity id / ap_id.
*/
ap_id: DbUrl;
/**
* Whether the comment is local.
*/
local: boolean;
/**
* The path / tree location of a comment, separated by dots, ending with the comment's id. Ex:
* 0.24.27
*/
path: string;
/**
* Whether the comment has been distinguished(speaking officially) by a mod.
*/
distinguished: boolean;
language_id: LanguageId;
}
};

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.
import type { CommentId } from "./CommentId";
export interface CommentAggregates {
/**
* Aggregate data for a comment.
*/
export type CommentAggregates = {
comment_id: CommentId;
score: number;
upvotes: number;
downvotes: number;
published: string;
/**
* The total number of children in this comment branch.
*/
child_count: number;
}
};

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.
/**
* The comment id.
*/
export type CommentId = number;

View file

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

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.
/**
* The comment reply id.
*/
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.
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 { SubscribedType } from "./SubscribedType";
export interface CommentReplyView {
/**
* A comment reply view.
*/
export type CommentReplyView = {
comment_reply: CommentReply;
comment: Comment;
creator: Person;
@ -23,4 +26,4 @@ export interface CommentReplyView {
saved: boolean;
creator_blocked: boolean;
my_vote?: number;
}
};

View file

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

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.
/**
* The comment report id.
*/
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.
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 { SubscribedType } from "./SubscribedType";
export interface CommentReportView {
/**
* A comment report view.
*/
export type CommentReportView = {
comment_report: CommentReport;
comment: Comment;
post: Post;
@ -23,4 +26,4 @@ export interface CommentReportView {
saved: boolean;
my_vote?: number;
resolver?: Person;
}
};

View file

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

View file

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

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.
import type { CommunityId } from "./CommunityId";
import type { CommunityVisibility } from "./CommunityVisibility";
import type { DbUrl } from "./DbUrl";
import type { InstanceId } from "./InstanceId";
export interface Community {
/**
* A community.
*/
export type Community = {
id: CommunityId;
name: string;
/**
* A longer title, that can contain other characters, and doesn't have to be unique.
*/
title: string;
description?: string;
/**
* A sidebar for the community in markdown.
*/
sidebar?: string;
/**
* Whether the community is removed by a mod.
*/
removed: boolean;
published: string;
updated?: string;
/**
* Whether the community has been deleted by its creator.
*/
deleted: boolean;
/**
* Whether its an NSFW community.
*/
nsfw: boolean;
actor_id: string;
/**
* The federated actor_id.
*/
actor_id: DbUrl;
/**
* Whether the community is local.
*/
local: boolean;
icon?: string;
banner?: string;
/**
* A URL for an icon.
*/
icon?: DbUrl;
/**
* A URL for a banner.
*/
banner?: DbUrl;
/**
* Whether the community is hidden.
*/
hidden: boolean;
/**
* Whether posting is restricted to mods only.
*/
posting_restricted_to_mods: boolean;
instance_id: InstanceId;
visibility: CommunityVisibility;
}
/**
* A shorter, one-line description of the site.
*/
description?: string;
};

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.
import type { CommunityId } from "./CommunityId";
export interface CommunityAggregates {
/**
* Aggregate data for a community.
*/
export type CommunityAggregates = {
community_id: CommunityId;
subscribers: number;
posts: number;
comments: number;
published: string;
/**
* The number of users with any activity in the last day.
*/
users_active_day: number;
/**
* The number of users with any activity in the last week.
*/
users_active_week: number;
/**
* The number of users with any activity in the last month.
*/
users_active_month: number;
/**
* The number of users with any activity in the last year.
*/
users_active_half_year: number;
subscribers_local: number;
}
};

View file

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

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.
/**
* The community id.
*/
export type CommunityId = number;

View file

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

View file

@ -2,7 +2,10 @@
import type { CommunityView } from "./CommunityView";
import type { LanguageId } from "./LanguageId";
export interface CommunityResponse {
/**
* A simple community response.
*/
export type CommunityResponse = {
community_view: CommunityView;
discussion_languages: Array<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 { SubscribedType } from "./SubscribedType";
export interface CommunityView {
/**
* A community view.
*/
export type CommunityView = {
community: Community;
subscribed: SubscribedType;
blocked: boolean;
counts: CommunityAggregates;
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.
/**
* Defines who can browse and interact with content in a community.
*
* TODO: Also use this to define private communities
*/
export type CommunityVisibility = "Public" | "LocalOnly";

View file

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

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.
import type { CommentId } from "./CommentId";
export interface CreateCommentLike {
/**
* Like a comment.
*/
export type CreateCommentLike = {
comment_id: CommentId;
/**
* Must be -1, 0, or 1 .
*/
score: number;
}
};

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.
import type { CommentId } from "./CommentId";
export interface CreateCommentReport {
comment_id: CommentId;
reason: string;
}
/**
* Report a comment.
*/
export type CreateCommentReport = { comment_id: CommentId; reason: string };

View file

@ -2,14 +2,42 @@
import type { CommunityVisibility } from "./CommunityVisibility";
import type { LanguageId } from "./LanguageId";
export interface CreateCommunity {
/**
* Create a community.
*/
export type CreateCommunity = {
/**
* The unique name.
*/
name: string;
/**
* A longer title.
*/
title: string;
/**
* A sidebar for the community in markdown.
*/
sidebar?: string;
/**
* A shorter, one line description of your community.
*/
description?: string;
/**
* An icon URL.
*/
icon?: string;
/**
* A banner URL.
*/
banner?: string;
/**
* Whether its an NSFW community.
*/
nsfw?: boolean;
/**
* Whether to restrict posting only to moderators.
*/
posting_restricted_to_mods?: boolean;
discussion_languages?: Array<LanguageId>;
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.
export interface CreateCustomEmoji {
/**
* Create a custom emoji.
*/
export type CreateCustomEmoji = {
category: string;
shortcode: string;
image_url: string;
alt_text: 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.
export interface CreateOAuthProvider {
/**
* Create an external auth method.
*/
export type CreateOAuthProvider = {
display_name: string;
issuer: string;
authorization_endpoint: string;
@ -13,4 +16,4 @@ export interface CreateOAuthProvider {
auto_verify_email?: boolean;
account_linking_enabled?: boolean;
enabled?: boolean;
}
};

View file

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

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.
import type { PostId } from "./PostId";
export interface CreatePostLike {
/**
* Like a post.
*/
export type CreatePostLike = {
post_id: PostId;
/**
* Score must be -1, 0, or 1.
*/
score: number;
}
};

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.
import type { PostId } from "./PostId";
export interface CreatePostReport {
post_id: PostId;
reason: string;
}
/**
* Create a post report.
*/
export type CreatePostReport = { post_id: PostId; reason: string };

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.
import type { PersonId } from "./PersonId";
export interface CreatePrivateMessage {
content: string;
recipient_id: PersonId;
}
/**
* Create a private message.
*/
export type CreatePrivateMessage = { content: string; recipient_id: PersonId };

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.
import type { PrivateMessageId } from "./PrivateMessageId";
export interface CreatePrivateMessageReport {
/**
* Create a report for a private message.
*/
export type CreatePrivateMessageReport = {
private_message_id: PrivateMessageId;
reason: string;
}
};

View file

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

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.
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.
import type { CustomEmojiId } from "./CustomEmojiId";
import type { DbUrl } from "./DbUrl";
export interface CustomEmoji {
/**
* A custom emoji.
*/
export type CustomEmoji = {
id: CustomEmojiId;
shortcode: string;
image_url: string;
image_url: DbUrl;
alt_text: string;
category: string;
published: string;
updated?: string;
}
};

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.
/**
* The custom emoji id.
*/
export type CustomEmojiId = number;