mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-12-23 11:21:27 +00:00
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:
parent
90686d2118
commit
c1545659b2
275 changed files with 2109 additions and 660 deletions
|
@ -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/
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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> };
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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>;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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> };
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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>;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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>;
|
||||
}
|
||||
};
|
||||
|
|
27
src/types/CommunitySortType.ts
Normal file
27
src/types/CommunitySortType.ts
Normal 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";
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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>;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CustomEmojiId } from "./CustomEmojiId";
|
||||
|
||||
export interface CustomEmojiKeyword {
|
||||
/**
|
||||
* A custom keyword for an emoji.
|
||||
*/
|
||||
export type CustomEmojiKeyword = {
|
||||
custom_emoji_id: CustomEmojiId;
|
||||
keyword: string;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CustomEmojiView } from "./CustomEmojiView";
|
||||
|
||||
export interface CustomEmojiResponse {
|
||||
custom_emoji: CustomEmojiView;
|
||||
}
|
||||
/**
|
||||
* A response for a custom emoji.
|
||||
*/
|
||||
export type CustomEmojiResponse = { custom_emoji: CustomEmojiView };
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
import type { CustomEmoji } from "./CustomEmoji";
|
||||
import type { CustomEmojiKeyword } from "./CustomEmojiKeyword";
|
||||
|
||||
export interface CustomEmojiView {
|
||||
/**
|
||||
* A custom emoji view.
|
||||
*/
|
||||
export type CustomEmojiView = {
|
||||
custom_emoji: CustomEmoji;
|
||||
keywords: Array<CustomEmojiKeyword>;
|
||||
}
|
||||
};
|
||||
|
|
3
src/types/DbUrl.ts
Normal file
3
src/types/DbUrl.ts
Normal 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;
|
|
@ -1,6 +1,10 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { SensitiveString } from "./SensitiveString";
|
||||
|
||||
export interface DeleteAccount {
|
||||
password: string;
|
||||
/**
|
||||
* Delete your account.
|
||||
*/
|
||||
export type DeleteAccount = {
|
||||
password: SensitiveString;
|
||||
delete_content: boolean;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CommentId } from "./CommentId";
|
||||
|
||||
export interface DeleteComment {
|
||||
comment_id: CommentId;
|
||||
deleted: boolean;
|
||||
}
|
||||
/**
|
||||
* Delete your own comment.
|
||||
*/
|
||||
export type DeleteComment = { comment_id: CommentId; deleted: boolean };
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
|
||||
export interface DeleteCommunity {
|
||||
community_id: CommunityId;
|
||||
deleted: boolean;
|
||||
}
|
||||
/**
|
||||
* Delete your own community.
|
||||
*/
|
||||
export type DeleteCommunity = { community_id: CommunityId; deleted: boolean };
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CustomEmojiId } from "./CustomEmojiId";
|
||||
|
||||
export interface DeleteCustomEmoji {
|
||||
id: CustomEmojiId;
|
||||
}
|
||||
/**
|
||||
* Delete a custom emoji.
|
||||
*/
|
||||
export type DeleteCustomEmoji = { id: CustomEmojiId };
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { OAuthProviderId } from "./OAuthProviderId";
|
||||
|
||||
export interface DeleteOAuthProvider {
|
||||
id: OAuthProviderId;
|
||||
}
|
||||
/**
|
||||
* Delete an external auth method.
|
||||
*/
|
||||
export type DeleteOAuthProvider = { id: OAuthProviderId };
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { PostId } from "./PostId";
|
||||
|
||||
export interface DeletePost {
|
||||
post_id: PostId;
|
||||
deleted: boolean;
|
||||
}
|
||||
/**
|
||||
* Delete a post.
|
||||
*/
|
||||
export type DeletePost = { post_id: PostId; deleted: boolean };
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { PrivateMessageId } from "./PrivateMessageId";
|
||||
|
||||
export interface DeletePrivateMessage {
|
||||
/**
|
||||
* Delete a private message.
|
||||
*/
|
||||
export type DeletePrivateMessage = {
|
||||
private_message_id: PrivateMessageId;
|
||||
deleted: boolean;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { TaglineId } from "./TaglineId";
|
||||
|
||||
export interface DeleteTagline {
|
||||
id: TaglineId;
|
||||
}
|
||||
/**
|
||||
* Delete a tagline
|
||||
*/
|
||||
export type DeleteTagline = { id: TaglineId };
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CommentId } from "./CommentId";
|
||||
|
||||
export interface DistinguishComment {
|
||||
/**
|
||||
* Distinguish a comment (IE speak as moderator).
|
||||
*/
|
||||
export type DistinguishComment = {
|
||||
comment_id: CommentId;
|
||||
distinguished: boolean;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,8 +2,11 @@
|
|||
import type { CommentId } from "./CommentId";
|
||||
import type { LanguageId } from "./LanguageId";
|
||||
|
||||
export interface EditComment {
|
||||
/**
|
||||
* Edit a comment.
|
||||
*/
|
||||
export type EditComment = {
|
||||
comment_id: CommentId;
|
||||
content?: string;
|
||||
language_id?: LanguageId;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,14 +3,39 @@ import type { CommunityId } from "./CommunityId";
|
|||
import type { CommunityVisibility } from "./CommunityVisibility";
|
||||
import type { LanguageId } from "./LanguageId";
|
||||
|
||||
export interface EditCommunity {
|
||||
/**
|
||||
* Edit a community.
|
||||
*/
|
||||
export type EditCommunity = {
|
||||
community_id: CommunityId;
|
||||
/**
|
||||
* A longer title.
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* A sidebar for the community in markdown.
|
||||
*/
|
||||
sidebar?: string;
|
||||
/**
|
||||
* A shorter, one line description of your community.
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* An icon URL.
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* A banner URL.
|
||||
*/
|
||||
banner?: string;
|
||||
/**
|
||||
* Whether its an NSFW community.
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Whether to restrict posting only to moderators.
|
||||
*/
|
||||
posting_restricted_to_mods?: boolean;
|
||||
discussion_languages?: Array<LanguageId>;
|
||||
visibility?: CommunityVisibility;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CustomEmojiId } from "./CustomEmojiId";
|
||||
|
||||
export interface EditCustomEmoji {
|
||||
/**
|
||||
* Edit a custom emoji.
|
||||
*/
|
||||
export type EditCustomEmoji = {
|
||||
id: CustomEmojiId;
|
||||
category: string;
|
||||
image_url: string;
|
||||
alt_text: string;
|
||||
keywords: Array<string>;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { OAuthProviderId } from "./OAuthProviderId";
|
||||
|
||||
export interface EditOAuthProvider {
|
||||
/**
|
||||
* Edit an external auth method.
|
||||
*/
|
||||
export type EditOAuthProvider = {
|
||||
id: OAuthProviderId;
|
||||
display_name?: string;
|
||||
authorization_endpoint?: string;
|
||||
|
@ -13,4 +16,4 @@ export interface EditOAuthProvider {
|
|||
auto_verify_email?: boolean;
|
||||
account_linking_enabled?: boolean;
|
||||
enabled?: boolean;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,14 +2,29 @@
|
|||
import type { LanguageId } from "./LanguageId";
|
||||
import type { PostId } from "./PostId";
|
||||
|
||||
export interface EditPost {
|
||||
/**
|
||||
* Edit a post.
|
||||
*/
|
||||
export type EditPost = {
|
||||
post_id: PostId;
|
||||
name?: string;
|
||||
url?: string;
|
||||
/**
|
||||
* An optional body for the post in markdown.
|
||||
*/
|
||||
body?: string;
|
||||
/**
|
||||
* An optional alt_text, usable for image posts.
|
||||
*/
|
||||
alt_text?: string;
|
||||
nsfw?: boolean;
|
||||
language_id?: LanguageId;
|
||||
/**
|
||||
* Instead of fetching a thumbnail, use a custom one.
|
||||
*/
|
||||
custom_thumbnail?: string;
|
||||
/**
|
||||
* Time when this post should be scheduled. Null means publish immediately.
|
||||
*/
|
||||
scheduled_publish_time?: number;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { PrivateMessageId } from "./PrivateMessageId";
|
||||
|
||||
export interface EditPrivateMessage {
|
||||
/**
|
||||
* Edit a private message.
|
||||
*/
|
||||
export type EditPrivateMessage = {
|
||||
private_message_id: PrivateMessageId;
|
||||
content: string;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -7,53 +7,177 @@ import type { PostListingMode } from "./PostListingMode";
|
|||
import type { PostSortType } from "./PostSortType";
|
||||
import type { RegistrationMode } from "./RegistrationMode";
|
||||
|
||||
export interface EditSite {
|
||||
/**
|
||||
* Edits a site.
|
||||
*/
|
||||
export type EditSite = {
|
||||
name?: string;
|
||||
/**
|
||||
* A sidebar for the site, in markdown.
|
||||
*/
|
||||
sidebar?: string;
|
||||
/**
|
||||
* A shorter, one line description of your site.
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* A url for your site's icon.
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* A url for your site's banner.
|
||||
*/
|
||||
banner?: string;
|
||||
/**
|
||||
* Whether to enable NSFW.
|
||||
*/
|
||||
enable_nsfw?: boolean;
|
||||
/**
|
||||
* Limits community creation to admins only.
|
||||
*/
|
||||
community_creation_admin_only?: boolean;
|
||||
/**
|
||||
* Whether to require email verification.
|
||||
*/
|
||||
require_email_verification?: boolean;
|
||||
/**
|
||||
* Your application question form. This is in markdown, and can be many questions.
|
||||
*/
|
||||
application_question?: string;
|
||||
/**
|
||||
* Whether your instance is public, or private.
|
||||
*/
|
||||
private_instance?: boolean;
|
||||
/**
|
||||
* The default theme. Usually "browser"
|
||||
*/
|
||||
default_theme?: string;
|
||||
/**
|
||||
* The default post listing type, usually "local"
|
||||
*/
|
||||
default_post_listing_type?: ListingType;
|
||||
/**
|
||||
* Default value for listing mode, usually "list"
|
||||
*/
|
||||
default_post_listing_mode?: PostListingMode;
|
||||
/**
|
||||
* The default post sort, usually "active"
|
||||
*/
|
||||
default_post_sort_type?: PostSortType;
|
||||
/**
|
||||
* The default comment sort, usually "hot"
|
||||
*/
|
||||
default_comment_sort_type?: CommentSortType;
|
||||
/**
|
||||
* An optional page of legal information
|
||||
*/
|
||||
legal_information?: string;
|
||||
/**
|
||||
* Whether to email admins when receiving a new application.
|
||||
*/
|
||||
application_email_admins?: boolean;
|
||||
/**
|
||||
* Whether to hide moderator names from the modlog.
|
||||
*/
|
||||
hide_modlog_mod_names?: boolean;
|
||||
/**
|
||||
* A list of allowed discussion languages.
|
||||
*/
|
||||
discussion_languages?: Array<LanguageId>;
|
||||
/**
|
||||
* A regex string of items to filter.
|
||||
*/
|
||||
slur_filter_regex?: string;
|
||||
/**
|
||||
* The max length of actor names.
|
||||
*/
|
||||
actor_name_max_length?: number;
|
||||
/**
|
||||
* The number of messages allowed in a given time frame.
|
||||
*/
|
||||
rate_limit_message?: number;
|
||||
rate_limit_message_per_second?: number;
|
||||
/**
|
||||
* The number of posts allowed in a given time frame.
|
||||
*/
|
||||
rate_limit_post?: number;
|
||||
rate_limit_post_per_second?: number;
|
||||
/**
|
||||
* The number of registrations allowed in a given time frame.
|
||||
*/
|
||||
rate_limit_register?: number;
|
||||
rate_limit_register_per_second?: number;
|
||||
/**
|
||||
* The number of image uploads allowed in a given time frame.
|
||||
*/
|
||||
rate_limit_image?: number;
|
||||
rate_limit_image_per_second?: number;
|
||||
/**
|
||||
* The number of comments allowed in a given time frame.
|
||||
*/
|
||||
rate_limit_comment?: number;
|
||||
rate_limit_comment_per_second?: number;
|
||||
/**
|
||||
* The number of searches allowed in a given time frame.
|
||||
*/
|
||||
rate_limit_search?: number;
|
||||
rate_limit_search_per_second?: number;
|
||||
/**
|
||||
* Whether to enable federation.
|
||||
*/
|
||||
federation_enabled?: boolean;
|
||||
/**
|
||||
* Enables federation debugging.
|
||||
*/
|
||||
federation_debug?: boolean;
|
||||
/**
|
||||
* Whether to enable captchas for signups.
|
||||
*/
|
||||
captcha_enabled?: boolean;
|
||||
/**
|
||||
* The captcha difficulty. Can be easy, medium, or hard
|
||||
*/
|
||||
captcha_difficulty?: string;
|
||||
/**
|
||||
* A list of allowed instances. If none are set, federation is open.
|
||||
*/
|
||||
allowed_instances?: Array<string>;
|
||||
/**
|
||||
* A list of blocked instances.
|
||||
*/
|
||||
blocked_instances?: Array<string>;
|
||||
/**
|
||||
* A list of blocked URLs
|
||||
*/
|
||||
blocked_urls?: Array<string>;
|
||||
registration_mode?: RegistrationMode;
|
||||
/**
|
||||
* Whether to email admins for new reports.
|
||||
*/
|
||||
reports_email_admins?: boolean;
|
||||
/**
|
||||
* If present, nsfw content is visible by default. Should be displayed by frontends/clients
|
||||
* when the site is first opened by a user.
|
||||
*/
|
||||
content_warning?: string;
|
||||
/**
|
||||
* Whether or not external auth methods can auto-register users.
|
||||
*/
|
||||
oauth_registration?: boolean;
|
||||
/**
|
||||
* What kind of post upvotes your site allows.
|
||||
*/
|
||||
post_upvotes?: FederationMode;
|
||||
/**
|
||||
* What kind of post downvotes your site allows.
|
||||
*/
|
||||
post_downvotes?: FederationMode;
|
||||
/**
|
||||
* What kind of comment upvotes your site allows.
|
||||
*/
|
||||
comment_upvotes?: FederationMode;
|
||||
/**
|
||||
* What kind of comment downvotes your site allows.
|
||||
*/
|
||||
comment_downvotes?: FederationMode;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,8 +2,11 @@
|
|||
import type { PostFeatureType } from "./PostFeatureType";
|
||||
import type { PostId } from "./PostId";
|
||||
|
||||
export interface FeaturePost {
|
||||
/**
|
||||
* Feature a post (stickies / pins to the top).
|
||||
*/
|
||||
export type FeaturePost = {
|
||||
post_id: PostId;
|
||||
featured: boolean;
|
||||
feature_type: PostFeatureType;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { InstanceWithFederationState } from "./InstanceWithFederationState";
|
||||
|
||||
export interface FederatedInstances {
|
||||
/**
|
||||
* A list of federated instances.
|
||||
*/
|
||||
export type FederatedInstances = {
|
||||
linked: Array<InstanceWithFederationState>;
|
||||
allowed: Array<InstanceWithFederationState>;
|
||||
blocked: Array<InstanceWithFederationState>;
|
||||
}
|
||||
};
|
||||
|
|
27
src/types/FederationError.ts
Normal file
27
src/types/FederationError.ts
Normal 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";
|
|
@ -1,3 +1,6 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
/**
|
||||
* The federation mode for an item
|
||||
*/
|
||||
export type FederationMode = "All" | "Local" | "Disable";
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
|
||||
export interface FollowCommunity {
|
||||
community_id: CommunityId;
|
||||
follow: boolean;
|
||||
}
|
||||
/**
|
||||
* Follow / subscribe to a community.
|
||||
*/
|
||||
export type FollowCommunity = { community_id: CommunityId; follow: boolean };
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { SensitiveString } from "./SensitiveString";
|
||||
|
||||
export interface GenerateTotpSecretResponse {
|
||||
totp_secret_url: string;
|
||||
}
|
||||
export type GenerateTotpSecretResponse = { totp_secret_url: SensitiveString };
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CaptchaResponse } from "./CaptchaResponse";
|
||||
|
||||
export interface GetCaptchaResponse {
|
||||
/**
|
||||
* A wrapper for the captcha response.
|
||||
*/
|
||||
export type GetCaptchaResponse = {
|
||||
/**
|
||||
* Will be None if captchas are disabled.
|
||||
*/
|
||||
ok?: CaptchaResponse;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CommentId } from "./CommentId";
|
||||
|
||||
export interface GetComment {
|
||||
id: CommentId;
|
||||
}
|
||||
/**
|
||||
* Fetch an individual comment.
|
||||
*/
|
||||
export type GetComment = { id: CommentId };
|
||||
|
|
|
@ -5,7 +5,10 @@ import type { CommunityId } from "./CommunityId";
|
|||
import type { ListingType } from "./ListingType";
|
||||
import type { PostId } from "./PostId";
|
||||
|
||||
export interface GetComments {
|
||||
/**
|
||||
* Get a list of comments.
|
||||
*/
|
||||
export type GetComments = {
|
||||
type_?: ListingType;
|
||||
sort?: CommentSortType;
|
||||
max_depth?: number;
|
||||
|
@ -18,4 +21,4 @@ export interface GetComments {
|
|||
saved_only?: boolean;
|
||||
liked_only?: boolean;
|
||||
disliked_only?: boolean;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CommentView } from "./CommentView";
|
||||
|
||||
export interface GetCommentsResponse {
|
||||
comments: Array<CommentView>;
|
||||
}
|
||||
/**
|
||||
* The comment list response.
|
||||
*/
|
||||
export type GetCommentsResponse = { comments: Array<CommentView> };
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { CommunityId } from "./CommunityId";
|
||||
|
||||
export interface GetCommunity {
|
||||
/**
|
||||
* Get a community. Must provide either an id, or a name.
|
||||
*/
|
||||
export type GetCommunity = {
|
||||
id?: CommunityId;
|
||||
/**
|
||||
* Example: star_trek , or star_trek@xyz.tld
|
||||
*/
|
||||
name?: string;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -4,9 +4,12 @@ import type { CommunityView } from "./CommunityView";
|
|||
import type { LanguageId } from "./LanguageId";
|
||||
import type { Site } from "./Site";
|
||||
|
||||
export interface GetCommunityResponse {
|
||||
/**
|
||||
* The community response.
|
||||
*/
|
||||
export type GetCommunityResponse = {
|
||||
community_view: CommunityView;
|
||||
site?: Site;
|
||||
moderators: Array<CommunityModeratorView>;
|
||||
discussion_languages: Array<LanguageId>;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { FederatedInstances } from "./FederatedInstances";
|
||||
|
||||
export interface GetFederatedInstancesResponse {
|
||||
/**
|
||||
* A response of federated instances.
|
||||
*/
|
||||
export type GetFederatedInstancesResponse = {
|
||||
/**
|
||||
* Optional, because federation may be disabled.
|
||||
*/
|
||||
federated_instances?: FederatedInstances;
|
||||
}
|
||||
};
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue