Adding bindings from rust. Fixes #113 (#114)

* Adding bindings from rust. Fixes #113

* v0.17.2-rc.7

* v0.17.2-rc.8

* v0.17.2-rc.9

* Trying encode 1

* v0.17.2-rc.10

* Nixing encode

* Switching to old comment GetPost.

* v0.17.2-rc.11
This commit is contained in:
Dessalines 2023-05-02 17:15:36 -04:00 committed by GitHub
parent cfc1dcf0f4
commit 0078d575b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
266 changed files with 2766 additions and 2541 deletions

View file

@ -0,0 +1,14 @@
#!/bin/bash
# First re-generate the types by running cargo test on lemmy
cd ../lemmy/scripts
./test.sh
cd ../crates
# Copy them over to the types folder
cp api_common/bindings/* ../../lemmy-js-client/src/types/
cp db_schema/bindings/* ../../lemmy-js-client/src/types/
cp db_views/bindings/* ../../lemmy-js-client/src/types/
cp db_views_actor/bindings/* ../../lemmy-js-client/src/types/
cp db_views_moderator/bindings/* ../../lemmy-js-client/src/types/

View file

@ -1,6 +1,6 @@
{ {
"name": "lemmy-js-client", "name": "lemmy-js-client",
"version": "0.17.2-rc.6", "version": "0.17.2-rc.11",
"description": "A javascript / typescript client for Lemmy", "description": "A javascript / typescript client for Lemmy",
"repository": "https://github.com/LemmyNet/lemmy-js-client", "repository": "https://github.com/LemmyNet/lemmy-js-client",
"license": "AGPL-3.0", "license": "AGPL-3.0",

View file

@ -1,145 +1,132 @@
import fetch from "cross-fetch"; import fetch from "cross-fetch";
import FormData from "form-data"; import FormData from "form-data";
import { AddAdmin } from "./types/AddAdmin";
import { import { AddAdminResponse } from "./types/AddAdminResponse";
CommentReportResponse, import { AddModToCommunity } from "./types/AddModToCommunity";
CommentResponse, import { AddModToCommunityResponse } from "./types/AddModToCommunityResponse";
CreateComment, import { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
CreateCommentLike, import { BanFromCommunity } from "./types/BanFromCommunity";
CreateCommentReport, import { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
DeleteComment, import { BannedPersonsResponse } from "./types/BannedPersonsResponse";
EditComment, import { BanPerson } from "./types/BanPerson";
GetComment, import { BanPersonResponse } from "./types/BanPersonResponse";
GetComments, import { BlockCommunity } from "./types/BlockCommunity";
GetCommentsResponse, import { BlockCommunityResponse } from "./types/BlockCommunityResponse";
ListCommentReports, import { BlockPerson } from "./types/BlockPerson";
ListCommentReportsResponse, import { BlockPersonResponse } from "./types/BlockPersonResponse";
RemoveComment, import { ChangePassword } from "./types/ChangePassword";
ResolveCommentReport, import { CommentReportResponse } from "./types/CommentReportResponse";
SaveComment, import { CommentResponse } from "./types/CommentResponse";
} from "./interfaces/api/comment"; import { CommunityResponse } from "./types/CommunityResponse";
import { import { CreateComment } from "./types/CreateComment";
AddModToCommunity, import { CreateCommentLike } from "./types/CreateCommentLike";
AddModToCommunityResponse, import { CreateCommentReport } from "./types/CreateCommentReport";
BanFromCommunity, import { CreateCommunity } from "./types/CreateCommunity";
BanFromCommunityResponse, import { CreateCustomEmoji } from "./types/CreateCustomEmoji";
BlockCommunity, import { CreatePost } from "./types/CreatePost";
BlockCommunityResponse, import { CreatePostLike } from "./types/CreatePostLike";
CommunityResponse, import { CreatePostReport } from "./types/CreatePostReport";
CreateCommunity, import { CreatePrivateMessage } from "./types/CreatePrivateMessage";
DeleteCommunity, import { CreatePrivateMessageReport } from "./types/CreatePrivateMessageReport";
EditCommunity, import { CreateSite } from "./types/CreateSite";
FollowCommunity, import { DeleteAccount } from "./types/DeleteAccount";
GetCommunity, import { DeleteAccountResponse } from "./types/DeleteAccountResponse";
GetCommunityResponse, import { DeleteComment } from "./types/DeleteComment";
ListCommunities, import { DeleteCommunity } from "./types/DeleteCommunity";
ListCommunitiesResponse, import { DeleteCustomEmoji } from "./types/DeleteCustomEmoji";
RemoveCommunity, import { DeletePost } from "./types/DeletePost";
TransferCommunity, import { DeletePrivateMessage } from "./types/DeletePrivateMessage";
} from "./interfaces/api/community"; import { EditComment } from "./types/EditComment";
import { import { EditCommunity } from "./types/EditCommunity";
CreateCustomEmoji, import { EditCustomEmoji } from "./types/EditCustomEmoji";
DeleteCustomEmoji, import { EditPost } from "./types/EditPost";
EditCustomEmoji, import { EditPrivateMessage } from "./types/EditPrivateMessage";
} from "./interfaces/api/custom_emoji"; import { EditSite } from "./types/EditSite";
import { import { FeaturePost } from "./types/FeaturePost";
AddAdmin, import { FollowCommunity } from "./types/FollowCommunity";
AddAdminResponse, import { GetBannedPersons } from "./types/GetBannedPersons";
BannedPersonsResponse, import { GetCaptchaResponse } from "./types/GetCaptchaResponse";
BanPerson, import { GetComment } from "./types/GetComment";
BanPersonResponse, import { GetComments } from "./types/GetComments";
BlockPerson, import { GetCommentsResponse } from "./types/GetCommentsResponse";
BlockPersonResponse, import { GetCommunity } from "./types/GetCommunity";
ChangePassword, import { GetCommunityResponse } from "./types/GetCommunityResponse";
CreatePrivateMessage, import { GetModlog } from "./types/GetModlog";
CreatePrivateMessageReport, import { GetModlogResponse } from "./types/GetModlogResponse";
DeleteAccount, import { GetPersonDetails } from "./types/GetPersonDetails";
DeleteAccountResponse, import { GetPersonDetailsResponse } from "./types/GetPersonDetailsResponse";
DeletePrivateMessage, import { GetPersonMentions } from "./types/GetPersonMentions";
EditPrivateMessage, import { GetPersonMentionsResponse } from "./types/GetPersonMentionsResponse";
GetBannedPersons, import { GetPost } from "./types/GetPost";
GetCaptchaResponse, import { GetPostResponse } from "./types/GetPostResponse";
GetPersonDetails, import { GetPosts } from "./types/GetPosts";
GetPersonDetailsResponse, import { GetPostsResponse } from "./types/GetPostsResponse";
GetPersonMentions, import { GetPrivateMessages } from "./types/GetPrivateMessages";
GetPersonMentionsResponse, import { GetReplies } from "./types/GetReplies";
GetPrivateMessages, import { GetRepliesResponse } from "./types/GetRepliesResponse";
GetReplies, import { GetReportCount } from "./types/GetReportCount";
GetRepliesResponse, import { GetReportCountResponse } from "./types/GetReportCountResponse";
GetReportCount, import { GetSite } from "./types/GetSite";
GetReportCountResponse, import { GetSiteMetadata } from "./types/GetSiteMetadata";
GetUnreadCount, import { GetSiteMetadataResponse } from "./types/GetSiteMetadataResponse";
GetUnreadCountResponse, import { GetSiteResponse } from "./types/GetSiteResponse";
ListPrivateMessageReports, import { GetUnreadCount } from "./types/GetUnreadCount";
ListPrivateMessageReportsResponse, import { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
Login, import { GetUnreadRegistrationApplicationCount } from "./types/GetUnreadRegistrationApplicationCount";
LoginResponse, import { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
MarkAllAsRead, import { LeaveAdmin } from "./types/LeaveAdmin";
MarkCommentReplyAsRead, import { ListCommentReports } from "./types/ListCommentReports";
MarkPersonMentionAsRead, import { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
MarkPrivateMessageAsRead, import { ListCommunities } from "./types/ListCommunities";
PasswordChange, import { ListCommunitiesResponse } from "./types/ListCommunitiesResponse";
PasswordReset, import { ListPostReports } from "./types/ListPostReports";
PasswordResetResponse, import { ListPostReportsResponse } from "./types/ListPostReportsResponse";
PersonMentionResponse, import { ListPrivateMessageReports } from "./types/ListPrivateMessageReports";
PrivateMessageReportResponse, import { ListPrivateMessageReportsResponse } from "./types/ListPrivateMessageReportsResponse";
PrivateMessageResponse, import { ListRegistrationApplications } from "./types/ListRegistrationApplications";
PrivateMessagesResponse, import { ListRegistrationApplicationsResponse } from "./types/ListRegistrationApplicationsResponse";
Register, import { LockPost } from "./types/LockPost";
ResolvePrivateMessageReport, import { Login } from "./types/Login";
SaveUserSettings, import { LoginResponse } from "./types/LoginResponse";
VerifyEmail, import { MarkAllAsRead } from "./types/MarkAllAsRead";
VerifyEmailResponse, import { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
} from "./interfaces/api/person"; import { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
import { import { MarkPostAsRead } from "./types/MarkPostAsRead";
CreatePost, import { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
CreatePostLike, import { UploadImage, UploadImageResponse, VERSION } from "./types/others";
CreatePostReport, import { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
DeletePost, import { PasswordReset } from "./types/PasswordReset";
EditPost, import { PasswordResetResponse } from "./types/PasswordResetResponse";
FeaturePost, import { PersonMentionResponse } from "./types/PersonMentionResponse";
GetPost, import { PostReportResponse } from "./types/PostReportResponse";
GetPostResponse, import { PostResponse } from "./types/PostResponse";
GetPosts, import { PrivateMessageReportResponse } from "./types/PrivateMessageReportResponse";
GetPostsResponse, import { PrivateMessageResponse } from "./types/PrivateMessageResponse";
GetSiteMetadata, import { PrivateMessagesResponse } from "./types/PrivateMessagesResponse";
GetSiteMetadataResponse, import { PurgeComment } from "./types/PurgeComment";
ListPostReports, import { PurgeCommunity } from "./types/PurgeCommunity";
ListPostReportsResponse, import { PurgeItemResponse } from "./types/PurgeItemResponse";
LockPost, import { PurgePerson } from "./types/PurgePerson";
MarkPostAsRead, import { PurgePost } from "./types/PurgePost";
PostReportResponse, import { Register } from "./types/Register";
PostResponse, import { RegistrationApplicationResponse } from "./types/RegistrationApplicationResponse";
RemovePost, import { RemoveComment } from "./types/RemoveComment";
ResolvePostReport, import { RemoveCommunity } from "./types/RemoveCommunity";
SavePost, import { RemovePost } from "./types/RemovePost";
} from "./interfaces/api/post"; import { ResolveCommentReport } from "./types/ResolveCommentReport";
import { import { ResolveObject } from "./types/ResolveObject";
ApproveRegistrationApplication, import { ResolveObjectResponse } from "./types/ResolveObjectResponse";
CreateSite, import { ResolvePostReport } from "./types/ResolvePostReport";
EditSite, import { ResolvePrivateMessageReport } from "./types/ResolvePrivateMessageReport";
GetModlog, import { SaveComment } from "./types/SaveComment";
GetModlogResponse, import { SavePost } from "./types/SavePost";
GetSite, import { SaveUserSettings } from "./types/SaveUserSettings";
GetSiteResponse, import { Search } from "./types/Search";
GetUnreadRegistrationApplicationCount, import { SearchResponse } from "./types/SearchResponse";
GetUnreadRegistrationApplicationCountResponse, import { SiteResponse } from "./types/SiteResponse";
LeaveAdmin, import { TransferCommunity } from "./types/TransferCommunity";
ListRegistrationApplications, import { VerifyEmail } from "./types/VerifyEmail";
ListRegistrationApplicationsResponse, import { VerifyEmailResponse } from "./types/VerifyEmailResponse";
PurgeComment,
PurgeCommunity,
PurgeItemResponse,
PurgePerson,
PurgePost,
RegistrationApplicationResponse,
ResolveObject,
ResolveObjectResponse,
Search,
SearchResponse,
SiteResponse,
} from "./interfaces/api/site";
import { UploadImage, UploadImageResponse, VERSION } from "./interfaces/others";
enum HttpType { enum HttpType {
Get = "GET", Get = "GET",
@ -988,8 +975,8 @@ export class LemmyHttp {
* *
* `HTTP.POST /user/password_change` * `HTTP.POST /user/password_change`
*/ */
passwordChange(form: PasswordChange) { passwordChangeAfterReset(form: PasswordChangeAfterReset) {
return this.wrapper<PasswordChange, LoginResponse>( return this.wrapper<PasswordChangeAfterReset, LoginResponse>(
HttpType.Post, HttpType.Post,
"/user/password_change", "/user/password_change",
form form

View file

@ -1,3 +1,2 @@
export * from "./http"; export * from "./http";
export * from "./interfaces";
export * from "./websocket"; export * from "./websocket";

View file

@ -1,97 +0,0 @@
/**
* Aggregate data for a person.
*/
export interface PersonAggregates {
id: number;
person_id: number;
post_count: number;
post_score: number;
comment_count: number;
comment_score: number;
}
/**
* Aggregate data for your site.
*/
export interface SiteAggregates {
id: number;
site_id: number;
users: number;
posts: number;
comments: number;
communities: number;
/**
* Active users per day.
*/
users_active_day: number;
/**
* Active users per week.
*/
users_active_week: number;
/**
* Active users per month.
*/
users_active_month: number;
/**
* Active users per year.
*/
users_active_half_year: number;
}
/**
* Aggregate data for your post.
*/
export interface PostAggregates {
id: number;
post_id: number;
comments: number;
score: number;
upvotes: number;
downvotes: number;
/**
* Newest comment time, limited to 2 days, to prevent necrobumping.
*/
newest_comment_time_necro: string;
newest_comment_time: string;
featured_community: boolean;
featured_local: boolean;
}
/**
* Aggregate data for your community.
*/
export interface CommunityAggregates {
id: number;
community_id: number;
subscribers: number;
posts: number;
comments: number;
/**
* Active users per day.
*/
users_active_day: number;
/**
* Active users per week.
*/
users_active_week: number;
/**
* Active users per month.
*/
users_active_month: number;
/**
* Active users per year.
*/
users_active_half_year: number;
}
/**
* Aggregate data for your comment.
*/
export interface CommentAggregates {
id: number;
comment_id: number;
score: number;
upvotes: number;
downvotes: number;
child_count: number;
}

View file

@ -1,136 +0,0 @@
import { CommentSortType, ListingType } from "../others";
import { CommentReportView, CommentView } from "../views";
export interface CreateComment {
content: string;
parent_id?: number;
language_id?: number;
post_id: number;
/**
* An optional front end ID, to tell which is comment is coming back.
*/
form_id?: string;
auth: string;
}
export interface EditComment {
comment_id: number;
content?: string;
/**
* "Distinguishes" a comment, or speak officially. Only doable by community mods or admins.
*/
distinguished?: boolean;
language_id?: number;
/**
* An optional front end ID, to tell which is comment is coming back.
*/
form_id?: string;
auth: string;
}
/**
* Only the creator can delete the comment.
*/
export interface DeleteComment {
comment_id: number;
deleted: boolean;
auth: string;
}
/**
* Only a mod or admin can remove the comment.
*/
export interface RemoveComment {
comment_id: number;
removed: boolean;
reason?: string;
auth: string;
}
export interface SaveComment {
comment_id: number;
save: boolean;
auth: string;
}
export interface CommentResponse {
comment_view: CommentView;
recipient_ids: number[];
/**
* An optional front end ID, to tell which is comment is coming back.
*/
form_id?: string;
}
export interface CreateCommentLike {
comment_id: number;
score: number;
auth: string;
}
/**
* Comment listing types are `All, Subscribed, Community`
*
* You can use either `community_id` or `community_name` as an id.
* To get posts for a federated community by name, use `name@instance.tld` .
*/
export interface GetComments {
type_?: ListingType;
sort?: CommentSortType;
max_depth?: number;
page?: number;
limit?: number;
community_id?: number;
community_name?: string;
post_id?: number;
parent_id?: number;
saved_only?: boolean;
auth?: string;
}
export interface GetCommentsResponse {
comments: CommentView[];
}
export interface GetComment {
id: number;
auth?: string;
}
export interface CreateCommentReport {
comment_id: number;
reason: string;
auth: string;
}
export interface CommentReportResponse {
comment_report_view: CommentReportView;
}
export interface ResolveCommentReport {
report_id: number;
/**
* Either resolve or unresolve a report.
*/
resolved: boolean;
auth: string;
}
export interface ListCommentReports {
page?: number;
limit?: number;
/**
* if no community is given, it returns reports for all communities moderated by the auth user.
*/
community_id?: number;
/**
* Only shows the unresolved reports.
*/
unresolved_only?: boolean;
auth: string;
}
export interface ListCommentReportsResponse {
comment_reports: CommentReportView[];
}

View file

@ -1,143 +0,0 @@
import { ListingType, SortType } from "../others";
import { Site } from "../source";
import { CommunityModeratorView, CommunityView, PersonView } from "../views";
/**
* You can use either `id` or `name` as an id.
*
* To get a federated community by name, use `name@instance.tld` .
*/
export interface GetCommunity {
id?: number;
name?: string;
auth?: string;
}
export interface GetCommunityResponse {
community_view: CommunityView;
site?: Site;
moderators: CommunityModeratorView[];
online: number;
discussion_languages: number[];
default_post_language?: number;
}
export interface CreateCommunity {
name: string;
title: string;
description?: string;
icon?: string;
banner?: string;
nsfw?: boolean;
posting_restricted_to_mods?: boolean;
discussion_languages?: number[];
auth: string;
}
export interface CommunityResponse {
community_view: CommunityView;
discussion_languages: number[];
}
export interface ListCommunities {
type_?: ListingType;
sort?: SortType;
page?: number;
limit?: number;
auth?: string;
}
export interface ListCommunitiesResponse {
communities: CommunityView[];
}
export interface BanFromCommunity {
community_id: number;
person_id: number;
ban: boolean;
/**
* Removes/Restores their comments and posts for that community.
*/
remove_data?: boolean;
reason?: string;
/**
* The expire time in Unix seconds
*/
expires?: number;
auth: string;
}
export interface BanFromCommunityResponse {
person_view: PersonView;
banned: boolean;
}
export interface AddModToCommunity {
community_id: number;
person_id: number;
added: boolean;
auth: string;
}
export interface AddModToCommunityResponse {
moderators: CommunityModeratorView[];
}
/**
* Only mods can edit a community.
*/
export interface EditCommunity {
community_id: number;
title?: string;
description?: string;
icon?: string;
banner?: string;
nsfw?: boolean;
posting_restricted_to_mods?: boolean;
discussion_languages?: number[];
auth: string;
}
export interface DeleteCommunity {
community_id: number;
deleted: boolean;
auth: string;
}
/**
* Only admins can remove a community.
*/
export interface RemoveCommunity {
community_id: number;
removed: boolean;
reason?: string;
/**
* The expire time in Unix seconds
*/
expires?: number;
auth: string;
}
export interface FollowCommunity {
community_id: number;
follow: boolean;
auth: string;
}
export interface TransferCommunity {
community_id: number;
person_id: number;
auth: string;
}
export interface BlockCommunity {
community_id: number;
block: boolean;
auth: string;
}
export interface BlockCommunityResponse {
community_view: CommunityView;
blocked: boolean;
}

View file

@ -1,53 +0,0 @@
import { CustomEmojiView } from "../views";
export class CreateCustomEmoji {
category: string;
shortcode: string;
image_url: string;
alt_text: string;
keywords: string[];
auth: string;
constructor(init: CreateCustomEmoji) {
Object.assign(this, init);
}
}
export class EditCustomEmoji {
id: number;
category: string;
image_url: string;
alt_text: string;
keywords: string[];
auth: string;
constructor(init: EditCustomEmoji) {
Object.assign(this, init);
}
}
export class DeleteCustomEmoji {
id: number;
auth: string;
constructor(init: DeleteCustomEmoji) {
Object.assign(this, init);
}
}
export class DeleteCustomEmojiResponse {
id: number;
success: boolean;
constructor(init: DeleteCustomEmojiResponse) {
Object.assign(this, init);
}
}
export class CustomEmojiResponse {
custom_emoji: CustomEmojiView;
constructor(init: CustomEmojiResponse) {
Object.assign(this, init);
}
}

View file

@ -1,7 +0,0 @@
export * from "./comment";
export * from "./community";
export * from "./custom_emoji";
export * from "./person";
export * from "./post";
export * from "./site";
export * from "./websocket";

View file

@ -1,378 +0,0 @@
import { CommentSortType, ListingType, SortType } from "../others";
import {
CommentReplyView,
CommentView,
CommunityModeratorView,
PersonMentionView,
PersonView,
PostView,
PrivateMessageReportView,
PrivateMessageView,
} from "../views";
export interface Login {
username_or_email: string;
password: string;
/**
* If your user has 2fa set up, they must provide the token, otherwise you will receive the error "missing_totp_token"
*/
totp_2fa_token?: string;
}
/**
* Register a new user.
*
* Only the first user to register will be able to be the admin.
*/
export interface Register {
username: string;
/**
* Email is mandatory if email verification is enabled on the server
*/
email?: string;
password: string;
password_verify: string;
show_nsfw: boolean;
/**
* Captcha is only checked if these are enabled in the server.
*/
captcha_uuid?: string;
captcha_answer?: string;
honeypot?: string;
/**
* An answer is mandatory if require application is enabled on the server
*/
answer?: string;
}
export interface GetCaptcha {}
export interface GetCaptchaResponse {
/**
* Will be undefined if captchas are disabled.
*/
ok?: CaptchaResponse;
}
export interface CaptchaResponse {
/**
* A Base64 encoded png.
*/
png: string;
/**
* A Base64 encoded wav file.
*/
wav?: string;
/**
* A UUID to match the one given on request.
*/
uuid: string;
}
export interface SaveUserSettings {
show_nsfw?: boolean;
/**
* Default for this is `browser`.
*/
theme?: string;
/**
* The [[SortType]].
*
* The Sort types from above, zero indexed as a number
*/
default_sort_type?: SortType;
/**
* The [[ListingType]].
*
* Post listing types are `All, Subscribed, Community`
*/
default_listing_type?: ListingType;
interface_language?: string;
avatar?: string;
banner?: string;
display_name?: string;
email?: string;
bio?: string;
matrix_user_id?: string;
show_avatars?: boolean;
show_scores?: boolean;
send_notifications_to_email?: boolean;
bot_account?: boolean;
show_bot_accounts?: boolean;
show_read_posts?: boolean;
show_new_post_notifs?: boolean;
discussion_languages?: number[];
/**
* If this is set to true, lemmy will generate or regenerate a 2-factor (totp) authentication secret.
* You can then use the `totp_2fa_url` from [[LocalUserSettings]] to set up your authenticator app.
*
* If this is set to false, it will remove 2-factor for your account.
*
* If this is undefined, it leaves your 2-factor setup as is.
*/
generate_totp_2fa?: boolean;
auth: string;
}
export interface ChangePassword {
new_password: string;
new_password_verify: string;
old_password: string;
auth: string;
}
/**
* The `jwt` string should be stored and used anywhere `auth` is called for.
*/
export interface LoginResponse {
/**
* This is None in response to `Register` if email verification is enabled, or the server requires registration applications.
*/
jwt?: string;
verify_email_sent: boolean;
registration_created: boolean;
}
export interface GetPersonDetails {
person_id?: number;
/**
* To get details for a federated user, use `person@instance.tld`.
*/
username?: string;
sort?: SortType;
page?: number;
limit?: number;
community_id?: number;
saved_only?: boolean;
auth?: string;
}
export interface GetPersonDetailsResponse {
person_view: PersonView;
comments: CommentView[];
posts: PostView[];
moderates: CommunityModeratorView[];
}
export interface GetRepliesResponse {
replies: CommentReplyView[];
}
export interface GetPersonMentionsResponse {
mentions: PersonMentionView[];
}
export interface MarkAllAsRead {
auth: string;
}
export interface AddAdmin {
person_id: number;
added: boolean;
auth: string;
}
export interface AddAdminResponse {
admins: PersonView[];
}
export interface BanPerson {
person_id: number;
ban: boolean;
/**
* Removes/Restores their comments, posts, and communities
*/
remove_data?: boolean;
reason?: string;
/**
* The expire time in Unix seconds
*/
expires?: number;
auth: string;
}
export interface BanPersonResponse {
person_view: PersonView;
banned: boolean;
}
export interface GetReplies {
sort?: CommentSortType;
page?: number;
limit?: number;
unread_only?: boolean;
auth: string;
}
export interface GetPersonMentions {
sort?: CommentSortType;
page?: number;
limit?: number;
unread_only?: boolean;
auth: string;
}
export interface MarkPersonMentionAsRead {
person_mention_id: number;
read: boolean;
auth: string;
}
export interface PersonMentionResponse {
person_mention_view: PersonMentionView;
}
export interface MarkCommentReplyAsRead {
comment_reply_id: number;
read: boolean;
auth: string;
}
export interface CommentReplyResponse {
comment_reply_view: CommentReplyView;
}
/**
* Permanently deletes your posts and comments
*/
export interface DeleteAccount {
password: string;
auth: string;
}
export interface DeleteAccountResponse {}
export interface PasswordReset {
email: string;
}
export interface PasswordResetResponse {}
export interface PasswordChange {
token: string;
password: string;
password_verify: string;
}
export interface CreatePrivateMessage {
content: string;
recipient_id: number;
auth: string;
}
export interface EditPrivateMessage {
private_message_id: number;
content: string;
auth: string;
}
export interface DeletePrivateMessage {
private_message_id: number;
deleted: boolean;
auth: string;
}
export interface MarkPrivateMessageAsRead {
private_message_id: number;
read: boolean;
auth: string;
}
export interface GetPrivateMessages {
unread_only?: boolean;
page?: number;
limit?: number;
auth: string;
}
export interface PrivateMessagesResponse {
private_messages: PrivateMessageView[];
}
export interface PrivateMessageResponse {
private_message_view: PrivateMessageView;
}
export interface CreatePrivateMessageReport {
private_message_id: number;
reason: string;
auth: string;
}
export interface PrivateMessageReportResponse {
private_message_report_view: PrivateMessageReportView;
}
export interface ResolvePrivateMessageReport {
report_id: number;
resolved: boolean;
auth: string;
}
export interface ListPrivateMessageReports {
page?: number;
limit?: number;
/// Only shows the unresolved reports
unresolved_only?: boolean;
auth: string;
}
export interface ListPrivateMessageReportsResponse {
private_message_reports: PrivateMessageReportView[];
}
export interface GetReportCount {
/**
* If a community is supplied, returns the report count for only that community, otherwise returns the report count for all communities the user moderates.
*/
community_id?: number;
auth: string;
}
export interface GetReportCountResponse {
community_id?: number;
comment_reports: number;
post_reports: number;
private_message_reports?: number;
}
export interface GetUnreadCount {
auth: string;
}
export interface GetUnreadCountResponse {
replies: number;
mentions: number;
private_messages: number;
}
export interface VerifyEmail {
token: string;
}
export interface VerifyEmailResponse {}
export interface BlockPerson {
person_id: number;
block: boolean;
auth: string;
}
export interface BlockPersonResponse {
person_view: PersonView;
blocked: boolean;
}
export interface GetBannedPersons {
auth: string;
}
export interface BannedPersonsResponse {
banned: PersonView[];
}

View file

@ -1,173 +0,0 @@
import {
ListingType,
PostFeatureType,
SiteMetadata,
SortType,
} from "../others";
import {
CommunityModeratorView,
CommunityView,
PostReportView,
PostView,
} from "../views";
export interface CreatePost {
name: string;
url?: string;
body?: string;
nsfw?: boolean;
language_id?: number;
community_id: number;
honeypot?: string;
auth: string;
}
export interface PostResponse {
post_view: PostView;
}
export interface GetPost {
id?: number;
comment_id?: number;
auth?: string;
}
export interface GetPostResponse {
post_view: PostView;
community_view: CommunityView;
moderators: CommunityModeratorView[];
online: number;
}
export interface GetPosts {
type_?: ListingType;
sort?: SortType;
page?: number;
limit?: number;
community_id?: number;
/**
* To get posts for a federated community by name, use `name@instance.tld` .
*/
community_name?: string;
saved_only?: boolean;
auth?: string;
}
export interface GetPostsResponse {
posts: PostView[];
}
export interface CreatePostLike {
post_id: number;
/**
* `score` can be 0, -1, or 1. Anything else will be rejected.
*/
score: number;
auth: string;
}
export interface EditPost {
post_id: number;
name?: string;
url?: string;
body?: string;
nsfw?: boolean;
language_id?: number;
auth: string;
}
export interface DeletePost {
post_id: number;
deleted: boolean;
auth: string;
}
/**
* Only admins and mods can remove a post.
*/
export interface RemovePost {
post_id: number;
removed: boolean;
reason?: string;
auth: string;
}
/**
* Marks a post as read.
*/
export interface MarkPostAsRead {
post_id: number;
read: boolean;
auth: string;
}
/**
* Only admins and mods can lock a post.
*/
export interface LockPost {
post_id: number;
locked: boolean;
auth: string;
}
/**
* Only admins and mods can feature a community post.
*/
export interface FeaturePost {
post_id: number;
featured: boolean;
feature_type: PostFeatureType;
auth: string;
}
export interface SavePost {
post_id: number;
save: boolean;
auth: string;
}
export interface CreatePostReport {
post_id: number;
reason: string;
auth: string;
}
export interface PostReportResponse {
post_report_view: PostReportView;
}
export interface ResolvePostReport {
report_id: number;
/**
* Either resolve or unresolve a report.
*/
resolved: boolean;
auth: string;
}
export interface ListPostReports {
page?: number;
limit?: number;
/**
* if no community is given, it returns reports for all communities moderated by the auth user.
*/
community_id?: number;
/**
* Only shows the unresolved reports.
*/
unresolved_only?: boolean;
auth: string;
}
export interface ListPostReportsResponse {
post_reports: PostReportView[];
}
export interface GetSiteMetadata {
url: string;
}
export interface GetSiteMetadataResponse {
metadata: SiteMetadata;
}

View file

@ -1,302 +0,0 @@
import {
ListingType,
ModlogActionType,
RegistrationMode,
SearchType,
SortType,
} from "../others";
import { Language, Tagline } from "../source";
import {
AdminPurgeCommentView,
AdminPurgeCommunityView,
AdminPurgePersonView,
AdminPurgePostView,
CommentView,
CommunityBlockView,
CommunityFollowerView,
CommunityModeratorView,
CommunityView,
CustomEmojiView,
LocalUserSettingsView,
ModAddCommunityView,
ModAddView,
ModBanFromCommunityView,
ModBanView,
ModFeaturePostView,
ModLockPostView,
ModRemoveCommentView,
ModRemoveCommunityView,
ModRemovePostView,
ModTransferCommunityView,
PersonBlockView,
PersonView,
PostView,
RegistrationApplicationView,
SiteView,
} from "../views";
/**
* Search lemmy for different types of data.
*/
export interface Search {
/**
* The search query string.
*/
q: string;
type_?: SearchType;
community_id?: number;
community_name?: string;
creator_id?: number;
sort?: SortType;
listing_type?: ListingType;
page?: number;
limit?: number;
auth?: string;
}
export interface SearchResponse {
/**
* The [[SearchType]].
*/
type_: string;
comments: CommentView[];
posts: PostView[];
communities: CommunityView[];
users: PersonView[];
}
export interface GetModlog {
mod_person_id?: number;
community_id?: number;
page?: number;
limit?: number;
auth?: string;
type_: ModlogActionType;
other_person_id?: number;
}
export interface GetModlogResponse {
removed_posts: ModRemovePostView[];
locked_posts: ModLockPostView[];
featured_posts: ModFeaturePostView[];
removed_comments: ModRemoveCommentView[];
removed_communities: ModRemoveCommunityView[];
banned_from_community: ModBanFromCommunityView[];
banned: ModBanView[];
added_to_community: ModAddCommunityView[];
transferred_to_community: ModTransferCommunityView[];
added: ModAddView[];
admin_purged_persons: AdminPurgePersonView[];
admin_purged_communities: AdminPurgeCommunityView[];
admin_purged_posts: AdminPurgePostView[];
admin_purged_comments: AdminPurgeCommentView[];
}
export interface CreateSite {
name: string;
sidebar?: string;
description?: string;
icon?: string;
banner?: string;
enable_downvotes?: boolean;
enable_nsfw?: boolean;
community_creation_admin_only?: boolean;
require_email_verification?: boolean;
registration_mode?: RegistrationMode;
application_question?: string;
private_instance?: boolean;
default_theme?: string;
default_post_listing_type?: ListingType;
application_email_admins?: boolean;
reports_email_admins?: boolean;
hide_modlog_mod_names?: boolean;
discussion_languages?: number[];
legal_information?: string;
slur_filter_regex?: string;
actor_name_max_length?: number;
rate_limit_message?: number;
rate_limit_message_per_second?: number;
rate_limit_post?: number;
rate_limit_post_per_second?: number;
rate_limit_register?: number;
rate_limit_register_per_second?: number;
rate_limit_image?: number;
rate_limit_image_per_second?: number;
rate_limit_comment?: number;
rate_limit_comment_per_second?: number;
rate_limit_search?: number;
rate_limit_search_per_second?: number;
federation_enabled?: boolean;
federation_debug?: boolean;
federation_worker_count?: number;
captcha_enabled?: boolean;
captcha_difficulty?: string;
allowed_instances?: string[];
blocked_instances?: string[];
taglines?: string[];
auth: string;
}
export interface EditSite {
name?: string;
sidebar?: string;
description?: string;
icon?: string;
banner?: string;
enable_downvotes?: boolean;
enable_nsfw?: boolean;
community_creation_admin_only?: boolean;
require_email_verification?: boolean;
registration_mode?: RegistrationMode;
application_question?: string;
private_instance?: boolean;
default_theme?: string;
default_post_listing_type?: ListingType;
legal_information?: string;
application_email_admins?: boolean;
reports_email_admins?: boolean;
hide_modlog_mod_names?: boolean;
discussion_languages?: number[];
slur_filter_regex?: string;
actor_name_max_length?: number;
rate_limit_message?: number;
rate_limit_message_per_second?: number;
rate_limit_post?: number;
rate_limit_post_per_second?: number;
rate_limit_register?: number;
rate_limit_register_per_second?: number;
rate_limit_image?: number;
rate_limit_image_per_second?: number;
rate_limit_comment?: number;
rate_limit_comment_per_second?: number;
rate_limit_search?: number;
rate_limit_search_per_second?: number;
federation_enabled?: boolean;
federation_debug?: boolean;
federation_worker_count?: number;
captcha_enabled?: boolean;
captcha_difficulty?: string;
allowed_instances?: string[];
blocked_instances?: string[];
taglines?: string[];
auth: string;
}
export interface GetSite {
auth?: string;
}
export interface SiteResponse {
site_view: SiteView;
}
export interface GetSiteResponse {
site_view: SiteView;
admins: PersonView[];
online: number;
version: string;
/**
* If you're logged in, you'll get back extra user info.
*/
my_user?: MyUserInfo;
federated_instances?: FederatedInstances;
all_languages: Language[];
discussion_languages: number[];
taglines: Tagline[];
custom_emojis: CustomEmojiView[];
}
/**
* Your user info, such as blocks, follows, etc.
*/
export interface MyUserInfo {
local_user_view: LocalUserSettingsView;
follows: CommunityFollowerView[];
moderates: CommunityModeratorView[];
community_blocks: CommunityBlockView[];
person_blocks: PersonBlockView[];
discussion_languages: number[];
}
export interface LeaveAdmin {
auth: string;
}
export interface FederatedInstances {
linked: string[];
allowed?: string[];
blocked?: string[];
}
export interface ResolveObject {
q: string;
auth?: string;
}
export interface ResolveObjectResponse {
comment?: CommentView;
post?: PostView;
community?: CommunityView;
person?: PersonView;
}
export interface PurgePerson {
person_id: number;
reason?: string;
auth: string;
}
export interface PurgeCommunity {
community_id: number;
reason?: string;
auth: string;
}
export interface PurgePost {
post_id: number;
reason?: string;
auth: string;
}
export interface PurgeComment {
comment_id: number;
reason?: string;
auth: string;
}
export interface PurgeItemResponse {
success: boolean;
}
export interface ListRegistrationApplications {
/**
* Only shows the unread applications (IE those without an admin actor)
*/
unread_only?: boolean;
page?: number;
limit?: number;
auth: string;
}
export interface ListRegistrationApplicationsResponse {
registration_applications: RegistrationApplicationView[];
}
export interface ApproveRegistrationApplication {
id: number;
approve: boolean;
deny_reason?: string;
auth: string;
}
export interface RegistrationApplicationResponse {
registration_application: RegistrationApplicationView;
}
export interface GetUnreadRegistrationApplicationCount {
auth: string;
}
export interface GetUnreadRegistrationApplicationCountResponse {
registration_applications: number;
}

View file

@ -1,34 +0,0 @@
export interface UserJoin {
auth: string;
}
export interface UserJoinResponse {
joined: boolean;
}
/**
* The main / frontpage community is `community_id: 0`.
*/
export interface CommunityJoin {
community_id: number;
}
export interface CommunityJoinResponse {
joined: boolean;
}
export interface ModJoin {
community_id: number;
}
export interface ModJoinResponse {
joined: boolean;
}
export interface PostJoin {
post_id: number;
}
export interface PostJoinResponse {
joined: boolean;
}

View file

@ -1,5 +0,0 @@
export * from "./aggregates";
export * from "./api";
export * from "./others";
export * from "./source";
export * from "./views";

View file

@ -1,268 +0,0 @@
export const VERSION = "v3";
/**
* All of the websocket operations available.
*/
export enum UserOperation {
Login,
Register,
GetCaptcha,
CreateCommunity,
CreatePost,
ListCommunities,
GetPost,
GetCommunity,
CreateComment,
EditComment,
DeleteComment,
RemoveComment,
SaveComment,
CreateCommentLike,
GetPosts,
CreatePostLike,
EditPost,
DeletePost,
RemovePost,
LockPost,
FeaturePost,
MarkPostAsRead,
SavePost,
EditCommunity,
DeleteCommunity,
RemoveCommunity,
FollowCommunity,
GetPersonDetails,
GetReplies,
GetPersonMentions,
MarkPersonMentionAsRead,
MarkCommentReplyAsRead,
GetModlog,
BanFromCommunity,
AddModToCommunity,
CreateSite,
EditSite,
GetSite,
AddAdmin,
GetUnreadRegistrationApplicationCount,
ListRegistrationApplications,
ApproveRegistrationApplication,
BanPerson,
GetBannedPersons,
Search,
ResolveObject,
MarkAllAsRead,
SaveUserSettings,
TransferCommunity,
LeaveAdmin,
DeleteAccount,
PasswordReset,
PasswordChange,
CreatePrivateMessage,
EditPrivateMessage,
DeletePrivateMessage,
MarkPrivateMessageAsRead,
CreatePrivateMessageReport,
ResolvePrivateMessageReport,
ListPrivateMessageReports,
GetPrivateMessages,
UserJoin,
GetComments,
GetComment,
PostJoin,
CommunityJoin,
ChangePassword,
GetSiteMetadata,
BlockCommunity,
BlockPerson,
PurgePerson,
PurgeCommunity,
PurgePost,
PurgeComment,
CreateCommentReport,
ResolveCommentReport,
ListCommentReports,
CreatePostReport,
ResolvePostReport,
ListPostReports,
GetReportCount,
GetUnreadCount,
VerifyEmail,
CreateCustomEmoji,
EditCustomEmoji,
DeleteCustomEmoji,
}
/**
* Different post sort types used in lemmy.
*/
export enum SortType {
/**
* Posts sorted by hot, but bumped by new comments up to 2 days
*/
Active = "Active",
/**
* Posts sorted by a decaying rank.
*/
Hot = "Hot",
/**
* Posts sorted by the published time.
*/
New = "New",
/**
* Posts sorted by the published time ascending
*/
Old = "Old",
/**
* The top posts for this last day.
*/
TopDay = "TopDay",
/**
* The top posts for this last week.
*/
TopWeek = "TopWeek",
/**
* The top posts for this last month.
*/
TopMonth = "TopMonth",
/**
* The top posts for this last year.
*/
TopYear = "TopYear",
/**
* The top posts of all time.
*/
TopAll = "TopAll",
/**
* Posts sorted by the most comments.
*/
MostComments = "MostComments",
/**
* Posts sorted by the newest comments, with no necrobumping. IE a forum sort.
*/
NewComments = "NewComments",
}
/**
* Different comment sort types used in lemmy.
*/
export enum CommentSortType {
/**
* Comments sorted by a decaying rank.
*/
Hot = "Hot",
/**
* Comments sorted by top score.
*/
Top = "Top",
/**
* Comments sorted by new.
*/
New = "New",
/**
* Comments sorted by old.
*/
Old = "Old",
}
/**
* The different listing types for post and comment fetches.
*/
export enum ListingType {
All = "All",
Local = "Local",
Subscribed = "Subscribed",
Community = "Community",
}
/**
* The different types of registration modes
*/
export enum RegistrationMode {
Closed = "Closed",
RequireApplication = "RequireApplication",
Open = "Open",
}
/**
* Search types for lemmy's search.
*/
export enum SearchType {
All = "All",
Comments = "Comments",
Posts = "Posts",
Communities = "Communities",
Users = "Users",
Url = "Url",
}
/**
* Mod log action types
*/
export enum ModlogActionType {
All = "All",
ModRemovePost = "ModRemovePost",
ModLockPost = "ModLockPost",
ModFeaturePost = "ModFeaturePost",
ModRemoveComment = "ModRemoveComment",
ModRemoveCommunity = "ModRemoveCommunity",
ModBanFromCommunity = "ModBanFromCommunity",
ModAddCommunity = "ModAddCommunity",
ModTransferCommunity = "ModTransferCommunity",
ModAdd = "ModAdd",
ModBan = "ModBan",
ModHideCommunity = "ModHideCommunity",
AdminPurgePerson = "AdminPurgePerson",
AdminPurgeCommunity = "AdminPurgeCommunity",
AdminPurgePost = "AdminPurgePost",
AdminPurgeComment = "AdminPurgeComment",
}
/**
* Different Subscribed states
*/
export enum SubscribedType {
Subscribed = "Subscribed",
NotSubscribed = "NotSubscribed",
Pending = "Pending",
}
/**
* Different Subscribed states
*/
export enum PostFeatureType {
Local = "Local",
Community = "Community",
}
/**
* A holder for a site's metadata ( such as opengraph tags ), used for post links.
*/
export interface SiteMetadata {
title?: string;
description?: string;
image?: string;
html?: string;
}
export interface UploadImage {
image: File | Buffer;
/**
* Optional if cookie with jwt set is already present. Otherwise, auth is required.
*/
auth?: string;
}
export interface UploadImageResponse {
/**
* Is "ok" if the upload was successful; is something else otherwise.
*/
msg: string;
files?: ImageFile[];
url?: string;
delete_url?: string;
}
export interface ImageFile {
file: string;
delete_token: string;
}

View file

@ -1,405 +0,0 @@
import { ListingType, RegistrationMode, SortType } from "./others";
export interface LocalUserSettings {
id: number;
person_id: number;
email?: string;
show_nsfw: boolean;
theme: string;
default_sort_type: SortType;
default_listing_type: ListingType;
interface_language: string;
show_avatars: boolean;
send_notifications_to_email: boolean;
validator_time: string;
show_bot_accounts: boolean;
show_scores: boolean;
show_read_posts: boolean;
show_new_post_notifs: boolean;
email_verified: boolean;
accepted_application: boolean;
/**
* An installation url for your 2-factor authenticator app.
*/
totp_2fa_url?: string;
}
export interface Person {
id: number;
name: string;
display_name?: string;
avatar?: string;
banned: boolean;
published: string;
updated?: string;
actor_id: string;
bio?: string;
local: boolean;
banner?: string;
deleted: boolean;
inbox_url: string;
shared_inbox_url?: string;
matrix_user_id?: string;
admin: boolean;
bot_account: boolean;
ban_expires?: string;
instance_id: number;
}
export interface Site {
id: number;
name: string;
sidebar?: string;
published: string;
updated?: string;
icon?: string;
banner?: string;
description?: string;
actor_id: string;
last_refreshed_at: string;
inbox_url: string;
private_key?: string;
public_key: string;
instance_id: number;
}
export interface LocalSite {
id: number;
site_id: number;
site_setup: boolean;
enable_downvotes: boolean;
registration_mode: RegistrationMode;
enable_nsfw: boolean;
community_creation_admin_only: boolean;
require_email_verification: boolean;
application_question?: string;
private_instance: boolean;
default_theme: string;
default_post_listing_type: ListingType;
legal_information?: string;
hide_modlog_mod_names: boolean;
application_email_admins: boolean;
reports_email_admins: boolean;
slur_filter_regex?: string;
actor_name_max_length: number;
federation_enabled: boolean;
federation_debug: boolean;
federation_worker_count: number;
captcha_enabled: boolean;
captcha_difficulty: string;
published: string;
updated?: string;
}
export interface LocalSiteRateLimit {
id: number;
local_site_id: number;
message: number;
message_per_second: number;
post: number;
post_per_second: number;
register: number;
register_per_second: number;
image: number;
image_per_second: number;
comment: number;
comment_per_second: number;
search: number;
search_per_second: number;
published: string;
updated?: string;
}
export interface PrivateMessage {
id: number;
creator_id: number;
recipient_id: number;
content: string;
deleted: boolean;
read: boolean;
published: string;
updated?: string;
ap_id: string;
local: boolean;
}
export interface PostReport {
id: number;
creator_id: number;
post_id: number;
original_post_name: string;
original_post_url?: string;
original_post_body?: string;
reason: string;
resolved: boolean;
resolver_id?: number;
published: string;
updated?: string;
}
export interface Post {
id: number;
name: string;
url?: string;
body?: string;
creator_id: number;
community_id: number;
removed: boolean;
locked: boolean;
published: string;
updated?: string;
deleted: boolean;
nsfw: boolean;
embed_title?: string;
embed_description?: string;
embed_video_url?: string;
thumbnail_url?: string;
ap_id: string;
local: boolean;
language_id: number;
featured_community: boolean;
featured_local: boolean;
}
export interface PasswordResetRequest {
id: number;
local_user_id: number;
token_encrypted: string;
published: string;
}
export interface ModRemovePost {
id: number;
mod_person_id: number;
post_id: number;
reason?: string;
removed: boolean;
when_: string;
}
export interface ModLockPost {
id: number;
mod_person_id: number;
post_id: number;
locked?: boolean;
when_: string;
}
export interface ModFeaturePost {
id: number;
mod_person_id: number;
post_id: number;
featured: boolean;
is_featured_community: boolean;
when_: string;
}
export interface ModRemoveComment {
id: number;
mod_person_id: number;
comment_id: number;
reason?: string;
removed: boolean;
when_: string;
}
export interface ModRemoveCommunity {
id: number;
mod_person_id: number;
community_id: number;
reason?: string;
removed: boolean;
expires?: string;
when_: string;
}
export interface ModBanFromCommunity {
id: number;
mod_person_id: number;
other_person_id: number;
community_id: number;
reason?: string;
banned?: boolean;
expires?: string;
when_: string;
}
export interface ModBan {
id: number;
mod_person_id: number;
other_person_id: number;
reason?: string;
banned?: boolean;
expires?: string;
when_: string;
}
export interface ModAddCommunity {
id: number;
mod_person_id: number;
other_person_id: number;
community_id: number;
removed: boolean;
when_: string;
}
export interface ModTransferCommunity {
id: number;
mod_person_id: number;
other_person_id: number;
community_id: number;
when_: string;
}
export interface ModAdd {
id: number;
mod_person_id: number;
other_person_id: number;
removed: boolean;
when_: string;
}
export interface AdminPurgePerson {
id: number;
admin_person_id: number;
reason?: string;
when_: string;
}
export interface AdminPurgeCommunity {
id: number;
admin_person_id: number;
reason?: string;
when_: string;
}
export interface AdminPurgePost {
id: number;
admin_person_id: number;
community_id: number;
reason?: string;
when_: string;
}
export interface AdminPurgeComment {
id: number;
admin_person_id: number;
post_id: number;
reason?: string;
when_: string;
}
export interface Community {
id: number;
name: string;
title: string;
description?: string;
removed: boolean;
published: string;
updated?: string;
deleted: boolean;
nsfw: boolean;
actor_id: string;
local: boolean;
icon?: string;
banner?: string;
hidden: boolean;
posting_restricted_to_mods: boolean;
instance_id: number;
}
export interface CommentReport {
id: number;
creator_id: number;
comment_id: number;
original_comment_text: string;
reason: string;
resolved: boolean;
resolver_id?: number;
published: string;
updated?: string;
}
export interface Comment {
id: number;
creator_id: number;
post_id: number;
content: string;
removed: boolean;
published: string;
updated?: string;
deleted: boolean;
ap_id: string;
local: boolean;
path: string;
distinguished: boolean;
language_id: number;
}
export interface PersonMention {
id: number;
recipient_id: number;
comment_id: number;
read: boolean;
published: string;
}
export interface CommentReply {
id: number;
recipient_id: number;
comment_id: number;
read: boolean;
published: string;
}
export interface RegistrationApplication {
id: number;
local_user_id: number;
answer: string;
admin_id?: number;
deny_reason?: string;
published: string;
}
export interface Language {
id: number;
code: string;
name: string;
}
export interface PrivateMessageReport {
id: number;
creator_id: number;
private_message_id: number;
original_pm_text: string;
reason: string;
resolved: boolean;
resolver_id?: number;
published: string;
updated?: string;
}
export interface Tagline {
id: number;
local_site_id: number;
content: string;
published: string;
updated?: string;
}
export class CustomEmoji {
id: number;
local_site_id: number;
shortcode: string;
image_url: string;
alt_text: string;
category: string;
published: string;
updated: string;
}
export class CustomEmojiKeyword {
id: number;
custom_emoji_id: number;
keyword: string;
}

View file

@ -1,298 +0,0 @@
import {
CommentAggregates,
CommunityAggregates,
PersonAggregates,
PostAggregates,
SiteAggregates,
} from "./aggregates";
import { SubscribedType } from "./others";
import {
AdminPurgeComment,
AdminPurgeCommunity,
AdminPurgePerson,
AdminPurgePost,
Comment,
CommentReply,
CommentReport,
Community,
CustomEmoji,
CustomEmojiKeyword,
LocalSite,
LocalSiteRateLimit,
LocalUserSettings,
ModAdd,
ModAddCommunity,
ModBan,
ModBanFromCommunity,
ModFeaturePost,
ModLockPost,
ModRemoveComment,
ModRemoveCommunity,
ModRemovePost,
ModTransferCommunity,
Person,
PersonMention,
Post,
PostReport,
PrivateMessage,
PrivateMessageReport,
RegistrationApplication,
Site,
Tagline,
} from "./source";
export interface PersonView {
person: Person;
counts: PersonAggregates;
}
export interface PersonMentionView {
person_mention: PersonMention;
comment: Comment;
creator: Person;
post: Post;
community: Community;
recipient: Person;
counts: CommentAggregates;
creator_banned_from_community: boolean;
subscribed: SubscribedType;
saved: boolean;
creator_blocked: boolean;
my_vote?: number;
}
export interface LocalUserSettingsView {
local_user: LocalUserSettings;
person: Person;
counts: PersonAggregates;
}
export interface SiteView {
site: Site;
local_site: LocalSite;
local_site_rate_limit: LocalSiteRateLimit;
taglines?: Tagline[];
counts: SiteAggregates;
}
export interface PrivateMessageView {
private_message: PrivateMessage;
creator: Person;
recipient: Person;
}
export interface PostView {
post: Post;
creator: Person;
community: Community;
creator_banned_from_community: boolean;
counts: PostAggregates;
subscribed: SubscribedType;
saved: boolean;
read: boolean;
creator_blocked: boolean;
my_vote?: number;
unread_comments: number;
}
export interface PostReportView {
post_report: PostReport;
post: Post;
community: Community;
creator: Person;
post_creator: Person;
creator_banned_from_community: boolean;
my_vote?: number;
counts: PostAggregates;
resolver?: Person;
}
export interface CommentView {
comment: Comment;
creator: Person;
post: Post;
community: Community;
counts: CommentAggregates;
creator_banned_from_community: boolean;
subscribed: SubscribedType;
saved: boolean;
creator_blocked: boolean;
my_vote?: number;
}
export interface CommentReplyView {
comment_reply: CommentReply;
comment: Comment;
creator: Person;
post: Post;
community: Community;
recipient: Person;
counts: CommentAggregates;
creator_banned_from_community: boolean;
subscribed: SubscribedType;
saved: boolean;
creator_blocked: boolean;
my_vote?: number;
}
export interface CommentReportView {
comment_report: CommentReport;
comment: Comment;
post: Post;
community: Community;
creator: Person;
comment_creator: Person;
counts: CommentAggregates;
creator_banned_from_community: boolean;
my_vote?: number;
resolver?: Person;
}
export interface ModAddCommunityView {
mod_add_community: ModAddCommunity;
moderator?: Person;
community: Community;
modded_person: Person;
}
export interface ModTransferCommunityView {
mod_transfer_community: ModTransferCommunity;
moderator?: Person;
community: Community;
modded_person: Person;
}
export interface ModAddView {
mod_add: ModAdd;
moderator?: Person;
modded_person: Person;
}
export interface ModBanFromCommunityView {
mod_ban_from_community: ModBanFromCommunity;
moderator?: Person;
community: Community;
banned_person: Person;
}
export interface ModBanView {
mod_ban: ModBan;
moderator?: Person;
banned_person: Person;
}
export interface ModLockPostView {
mod_lock_post: ModLockPost;
moderator?: Person;
post: Post;
community: Community;
}
export interface ModRemoveCommentView {
mod_remove_comment: ModRemoveComment;
moderator?: Person;
comment: Comment;
commenter: Person;
post: Post;
community: Community;
}
export interface ModRemoveCommunityView {
mod_remove_community: ModRemoveCommunity;
moderator?: Person;
community: Community;
}
export interface ModRemovePostView {
mod_remove_post: ModRemovePost;
moderator?: Person;
post: Post;
community: Community;
}
export interface ModFeaturePostView {
mod_feature_post: ModFeaturePost;
moderator?: Person;
post: Post;
community: Community;
}
export interface AdminPurgeCommunityView {
admin_purge_community: AdminPurgeCommunity;
admin?: Person;
}
export interface AdminPurgePersonView {
admin_purge_person: AdminPurgePerson;
admin?: Person;
}
export interface AdminPurgePostView {
admin_purge_post: AdminPurgePost;
admin?: Person;
community: Community;
}
export interface AdminPurgeCommentView {
admin_purge_comment: AdminPurgeComment;
admin?: Person;
post: Post;
}
export interface CommunityFollowerView {
community: Community;
follower: Person;
}
export interface CommunityBlockView {
person: Person;
community: Community;
}
export interface CommunityModeratorView {
community: Community;
moderator: Person;
}
export interface CommunityPersonBanView {
community: Community;
person: Person;
}
export interface PersonBlockView {
person: Person;
target: Person;
}
export interface CommunityView {
community: Community;
subscribed: SubscribedType;
blocked: boolean;
counts: CommunityAggregates;
}
export interface RegistrationApplicationView {
registration_application: RegistrationApplication;
creator_local_user: LocalUserSettings;
creator: Person;
admin?: Person;
}
export interface CommentNode {
comment_view: CommentView | PersonMentionView | CommentReplyView;
children: CommentNode[];
depth: number;
}
export interface PrivateMessageReportView {
private_message_report: PrivateMessageReport;
private_message: PrivateMessage;
private_message_creator: Person;
creator: Person;
resolver?: Person;
}
export class CustomEmojiView {
custom_emoji: CustomEmoji;
keywords: CustomEmojiKeyword[];
}

8
src/types/AddAdmin.ts Normal file
View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

View file

@ -0,0 +1,6 @@
// 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>;
}

View file

@ -0,0 +1,10 @@
// 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 { PersonId } from "./PersonId";
export interface AddModToCommunity {
community_id: CommunityId;
person_id: PersonId;
added: boolean;
auth: string;
}

View file

@ -0,0 +1,6 @@
// 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 {
moderators: Array<CommunityModeratorView>;
}

View file

@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId";
export interface AdminPurgeComment {
id: number;
admin_person_id: PersonId;
post_id: PostId;
reason?: string;
when_: string;
}

View file

@ -0,0 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AdminPurgeComment } from "./AdminPurgeComment";
import type { Person } from "./Person";
import type { Post } from "./Post";
export interface AdminPurgeCommentView {
admin_purge_comment: AdminPurgeComment;
admin?: Person;
post: Post;
}

View file

@ -0,0 +1,9 @@
// 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 {
id: number;
admin_person_id: PersonId;
reason?: string;
when_: string;
}

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AdminPurgeCommunity } from "./AdminPurgeCommunity";
import type { Person } from "./Person";
export interface AdminPurgeCommunityView {
admin_purge_community: AdminPurgeCommunity;
admin?: Person;
}

View file

@ -0,0 +1,9 @@
// 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 {
id: number;
admin_person_id: PersonId;
reason?: string;
when_: string;
}

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AdminPurgePerson } from "./AdminPurgePerson";
import type { Person } from "./Person";
export interface AdminPurgePersonView {
admin_purge_person: AdminPurgePerson;
admin?: Person;
}

View file

@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommunityId } from "./CommunityId";
import type { PersonId } from "./PersonId";
export interface AdminPurgePost {
id: number;
admin_person_id: PersonId;
community_id: CommunityId;
reason?: string;
when_: string;
}

View file

@ -0,0 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AdminPurgePost } from "./AdminPurgePost";
import type { Community } from "./Community";
import type { Person } from "./Person";
export interface AdminPurgePostView {
admin_purge_post: AdminPurgePost;
admin?: Person;
community: Community;
}

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface ApproveRegistrationApplication {
id: number;
approve: boolean;
deny_reason?: string;
auth: string;
}

View file

@ -0,0 +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";
import type { PersonId } from "./PersonId";
export interface BanFromCommunity {
community_id: CommunityId;
person_id: PersonId;
ban: boolean;
remove_data?: boolean;
reason?: string;
expires?: bigint;
auth: string;
}

View file

@ -0,0 +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 BanFromCommunityResponse {
person_view: PersonView;
banned: boolean;
}

11
src/types/BanPerson.ts Normal file
View file

@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PersonId } from "./PersonId";
export interface BanPerson {
person_id: PersonId;
ban: boolean;
remove_data?: boolean;
reason?: string;
expires?: bigint;
auth: string;
}

View file

@ -0,0 +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;
}

View file

@ -0,0 +1,6 @@
// 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>;
}

View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

View file

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

8
src/types/BlockPerson.ts Normal file
View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

View file

@ -0,0 +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;
}

View file

@ -0,0 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface CaptchaResponse {
png: string;
wav: string;
uuid: string;
}

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface ChangePassword {
new_password: string;
new_password_verify: string;
old_password: string;
auth: string;
}

21
src/types/Comment.ts Normal file
View file

@ -0,0 +1,21 @@
// 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 { LanguageId } from "./LanguageId";
import type { PersonId } from "./PersonId";
import type { PostId } from "./PostId";
export interface Comment {
id: CommentId;
creator_id: PersonId;
post_id: PostId;
content: string;
removed: boolean;
published: string;
updated?: string;
deleted: boolean;
ap_id: string;
local: boolean;
path: string;
distinguished: boolean;
language_id: LanguageId;
}

View file

@ -0,0 +1,12 @@
// 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 {
id: number;
comment_id: CommentId;
score: bigint;
upvotes: bigint;
downvotes: bigint;
published: string;
child_count: number;
}

3
src/types/CommentId.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 CommentId = number;

12
src/types/CommentReply.ts Normal file
View file

@ -0,0 +1,12 @@
// 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 { CommentReplyId } from "./CommentReplyId";
import type { PersonId } from "./PersonId";
export interface CommentReply {
id: CommentReplyId;
recipient_id: PersonId;
comment_id: CommentId;
read: boolean;
published: string;
}

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 CommentReplyId = number;

View file

@ -0,0 +1,6 @@
// 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;
}

View file

@ -0,0 +1,23 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Comment } from "./Comment";
import type { CommentAggregates } from "./CommentAggregates";
import type { CommentReply } from "./CommentReply";
import type { Community } from "./Community";
import type { Person } from "./Person";
import type { Post } from "./Post";
import type { SubscribedType } from "./SubscribedType";
export interface CommentReplyView {
comment_reply: CommentReply;
comment: Comment;
creator: Person;
post: Post;
community: Community;
recipient: Person;
counts: CommentAggregates;
creator_banned_from_community: boolean;
subscribed: SubscribedType;
saved: boolean;
creator_blocked: boolean;
my_vote?: number;
}

View file

@ -0,0 +1,16 @@
// 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 { CommentReportId } from "./CommentReportId";
import type { PersonId } from "./PersonId";
export interface CommentReport {
id: CommentReportId;
creator_id: PersonId;
comment_id: CommentId;
original_comment_text: string;
reason: string;
resolved: boolean;
resolver_id?: PersonId;
published: string;
updated?: string;
}

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 CommentReportId = number;

View file

@ -0,0 +1,6 @@
// 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;
}

View file

@ -0,0 +1,20 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Comment } from "./Comment";
import type { CommentAggregates } from "./CommentAggregates";
import type { CommentReport } from "./CommentReport";
import type { Community } from "./Community";
import type { Person } from "./Person";
import type { Post } from "./Post";
export interface CommentReportView {
comment_report: CommentReport;
comment: Comment;
post: Post;
community: Community;
creator: Person;
comment_creator: Person;
counts: CommentAggregates;
creator_banned_from_community: boolean;
my_vote?: number;
resolver?: Person;
}

View file

@ -0,0 +1,9 @@
// 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 { LocalUserId } from "./LocalUserId";
export interface CommentResponse {
comment_view: CommentView;
recipient_ids: Array<LocalUserId>;
form_id?: string;
}

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 CommentSortType = "Hot" | "Top" | "New" | "Old";

20
src/types/CommentView.ts Normal file
View file

@ -0,0 +1,20 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Comment } from "./Comment";
import type { CommentAggregates } from "./CommentAggregates";
import type { Community } from "./Community";
import type { Person } from "./Person";
import type { Post } from "./Post";
import type { SubscribedType } from "./SubscribedType";
export interface CommentView {
comment: Comment;
creator: Person;
post: Post;
community: Community;
counts: CommentAggregates;
creator_banned_from_community: boolean;
subscribed: SubscribedType;
saved: boolean;
creator_blocked: boolean;
my_vote?: number;
}

22
src/types/Community.ts Normal file
View file

@ -0,0 +1,22 @@
// 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 { InstanceId } from "./InstanceId";
export interface Community {
id: CommunityId;
name: string;
title: string;
description?: string;
removed: boolean;
published: string;
updated?: string;
deleted: boolean;
nsfw: boolean;
actor_id: string;
local: boolean;
icon?: string;
banner?: string;
hidden: boolean;
posting_restricted_to_mods: boolean;
instance_id: InstanceId;
}

View file

@ -0,0 +1,15 @@
// 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 {
id: number;
community_id: CommunityId;
subscribers: bigint;
posts: bigint;
comments: bigint;
published: string;
users_active_day: bigint;
users_active_week: bigint;
users_active_month: bigint;
users_active_half_year: bigint;
}

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 CommunityBlockId = number;

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Community } from "./Community";
import type { Person } from "./Person";
export interface CommunityBlockView {
person: Person;
community: Community;
}

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Community } from "./Community";
import type { Person } from "./Person";
export interface CommunityFollowerView {
community: Community;
follower: Person;
}

3
src/types/CommunityId.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 CommunityId = number;

View file

@ -0,0 +1,6 @@
// 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 CommunityJoin {
community_id: CommunityId;
}

View file

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

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Community } from "./Community";
import type { Person } from "./Person";
export interface CommunityModeratorView {
community: Community;
moderator: Person;
}

View file

@ -0,0 +1,8 @@
// 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 { LanguageId } from "./LanguageId";
export interface CommunityResponse {
community_view: CommunityView;
discussion_languages: Array<LanguageId>;
}

View file

@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Community } from "./Community";
import type { CommunityAggregates } from "./CommunityAggregates";
import type { SubscribedType } from "./SubscribedType";
export interface CommunityView {
community: Community;
subscribed: SubscribedType;
blocked: boolean;
counts: CommunityAggregates;
}

View file

@ -0,0 +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";
import type { LanguageId } from "./LanguageId";
import type { PostId } from "./PostId";
export interface CreateComment {
content: string;
post_id: PostId;
parent_id?: CommentId;
language_id?: LanguageId;
form_id?: string;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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 {
comment_id: CommentId;
score: number;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

View file

@ -0,0 +1,14 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LanguageId } from "./LanguageId";
export interface CreateCommunity {
name: string;
title: string;
description?: string;
icon?: string;
banner?: string;
nsfw?: boolean;
posting_restricted_to_mods?: boolean;
discussion_languages?: Array<LanguageId>;
auth: string;
}

View file

@ -0,0 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface CreateCustomEmoji {
category: string;
shortcode: string;
image_url: string;
alt_text: string;
keywords: Array<string>;
auth: string;
}

14
src/types/CreatePost.ts Normal file
View file

@ -0,0 +1,14 @@
// 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 { LanguageId } from "./LanguageId";
export interface CreatePost {
name: string;
community_id: CommunityId;
url?: string;
body?: string;
honeypot?: string;
nsfw?: boolean;
language_id?: LanguageId;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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 {
post_id: PostId;
score: number;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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 {
private_message_id: PrivateMessageId;
reason: string;
auth: string;
}

48
src/types/CreateSite.ts Normal file
View file

@ -0,0 +1,48 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LanguageId } from "./LanguageId";
import type { ListingType } from "./ListingType";
import type { RegistrationMode } from "./RegistrationMode";
export interface CreateSite {
name: string;
sidebar?: string;
description?: string;
icon?: string;
banner?: string;
enable_downvotes?: boolean;
enable_nsfw?: boolean;
community_creation_admin_only?: boolean;
require_email_verification?: boolean;
application_question?: string;
private_instance?: boolean;
default_theme?: string;
default_post_listing_type?: ListingType;
legal_information?: string;
application_email_admins?: boolean;
hide_modlog_mod_names?: boolean;
discussion_languages?: Array<LanguageId>;
slur_filter_regex?: string;
actor_name_max_length?: number;
rate_limit_message?: number;
rate_limit_message_per_second?: number;
rate_limit_post?: number;
rate_limit_post_per_second?: number;
rate_limit_register?: number;
rate_limit_register_per_second?: number;
rate_limit_image?: number;
rate_limit_image_per_second?: number;
rate_limit_comment?: number;
rate_limit_comment_per_second?: number;
rate_limit_search?: number;
rate_limit_search_per_second?: number;
federation_enabled?: boolean;
federation_debug?: boolean;
federation_worker_count?: number;
captcha_enabled?: boolean;
captcha_difficulty?: string;
allowed_instances?: Array<string>;
blocked_instances?: Array<string>;
taglines?: Array<string>;
registration_mode?: RegistrationMode;
auth: string;
}

14
src/types/CustomEmoji.ts Normal file
View file

@ -0,0 +1,14 @@
// 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 { LocalSiteId } from "./LocalSiteId";
export interface CustomEmoji {
id: CustomEmojiId;
local_site_id: LocalSiteId;
shortcode: string;
image_url: string;
alt_text: string;
category: string;
published: string;
updated?: string;
}

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 CustomEmojiId = number;

View file

@ -0,0 +1,8 @@
// 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 {
id: number;
custom_emoji_id: CustomEmojiId;
keyword: string;
}

View file

@ -0,0 +1,6 @@
// 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;
}

View file

@ -0,0 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CustomEmoji } from "./CustomEmoji";
import type { CustomEmojiKeyword } from "./CustomEmojiKeyword";
export interface CustomEmojiView {
custom_emoji: CustomEmoji;
keywords: Array<CustomEmojiKeyword>;
}

View file

@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface DeleteAccount {
password: string;
auth: string;
}

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 DeleteAccountResponse = null;

View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

View file

@ -0,0 +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;
auth: string;
}

View file

@ -0,0 +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 DeleteCustomEmojiResponse {
id: CustomEmojiId;
success: boolean;
}

8
src/types/DeletePost.ts Normal file
View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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 {
private_message_id: PrivateMessageId;
deleted: boolean;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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 {
comment_id: CommentId;
distinguished: boolean;
auth: string;
}

11
src/types/EditComment.ts Normal file
View file

@ -0,0 +1,11 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CommentId } from "./CommentId";
import type { LanguageId } from "./LanguageId";
export interface EditComment {
comment_id: CommentId;
content?: string;
language_id?: LanguageId;
form_id?: string;
auth: string;
}

View file

@ -0,0 +1,15 @@
// 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 { LanguageId } from "./LanguageId";
export interface EditCommunity {
community_id: CommunityId;
title?: string;
description?: string;
icon?: string;
banner?: string;
nsfw?: boolean;
posting_restricted_to_mods?: boolean;
discussion_languages?: Array<LanguageId>;
auth: string;
}

View file

@ -0,0 +1,11 @@
// 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 {
id: CustomEmojiId;
category: string;
image_url: string;
alt_text: string;
keywords: Array<string>;
auth: string;
}

13
src/types/EditPost.ts Normal file
View file

@ -0,0 +1,13 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LanguageId } from "./LanguageId";
import type { PostId } from "./PostId";
export interface EditPost {
post_id: PostId;
name?: string;
url?: string;
body?: string;
nsfw?: boolean;
language_id?: LanguageId;
auth: string;
}

View file

@ -0,0 +1,8 @@
// 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 {
private_message_id: PrivateMessageId;
content: string;
auth: string;
}

49
src/types/EditSite.ts Normal file
View file

@ -0,0 +1,49 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { LanguageId } from "./LanguageId";
import type { ListingType } from "./ListingType";
import type { RegistrationMode } from "./RegistrationMode";
export interface EditSite {
name?: string;
sidebar?: string;
description?: string;
icon?: string;
banner?: string;
enable_downvotes?: boolean;
enable_nsfw?: boolean;
community_creation_admin_only?: boolean;
require_email_verification?: boolean;
application_question?: string;
private_instance?: boolean;
default_theme?: string;
default_post_listing_type?: ListingType;
legal_information?: string;
application_email_admins?: boolean;
hide_modlog_mod_names?: boolean;
discussion_languages?: Array<LanguageId>;
slur_filter_regex?: string;
actor_name_max_length?: number;
rate_limit_message?: number;
rate_limit_message_per_second?: number;
rate_limit_post?: number;
rate_limit_post_per_second?: number;
rate_limit_register?: number;
rate_limit_register_per_second?: number;
rate_limit_image?: number;
rate_limit_image_per_second?: number;
rate_limit_comment?: number;
rate_limit_comment_per_second?: number;
rate_limit_search?: number;
rate_limit_search_per_second?: number;
federation_enabled?: boolean;
federation_debug?: boolean;
federation_worker_count?: number;
captcha_enabled?: boolean;
captcha_difficulty?: string;
allowed_instances?: Array<string>;
blocked_instances?: Array<string>;
taglines?: Array<string>;
registration_mode?: RegistrationMode;
reports_email_admins?: boolean;
auth: string;
}

10
src/types/FeaturePost.ts Normal file
View file

@ -0,0 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { PostFeatureType } from "./PostFeatureType";
import type { PostId } from "./PostId";
export interface FeaturePost {
post_id: PostId;
featured: boolean;
feature_type: PostFeatureType;
auth: string;
}

View file

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

View file

@ -0,0 +1,8 @@
// 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;
auth: string;
}

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