mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-26 14:21:12 +00:00
Removing auth and useless interfaces.
This commit is contained in:
parent
4439d22157
commit
4dd1cc8323
98 changed files with 45 additions and 257 deletions
|
@ -1,5 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Remove the old bindings
|
||||
pushd ../lemmy/crates
|
||||
rm -rf **/bindings
|
||||
popd
|
||||
|
||||
# First re-generate the types by running cargo test on lemmy
|
||||
pushd ../lemmy/scripts
|
||||
./test.sh
|
||||
|
|
76
src/http.ts
76
src/http.ts
|
@ -48,15 +48,12 @@ import { EditPrivateMessage } from "./types/EditPrivateMessage";
|
|||
import { EditSite } from "./types/EditSite";
|
||||
import { FeaturePost } from "./types/FeaturePost";
|
||||
import { FollowCommunity } from "./types/FollowCommunity";
|
||||
import { GetBannedPersons } from "./types/GetBannedPersons";
|
||||
import { GetCaptcha } from "./types/GetCaptcha";
|
||||
import { GetCaptchaResponse } from "./types/GetCaptchaResponse";
|
||||
import { GetComment } from "./types/GetComment";
|
||||
import { GetComments } from "./types/GetComments";
|
||||
import { GetCommentsResponse } from "./types/GetCommentsResponse";
|
||||
import { GetCommunity } from "./types/GetCommunity";
|
||||
import { GetCommunityResponse } from "./types/GetCommunityResponse";
|
||||
import { GetFederatedInstances } from "./types/GetFederatedInstances";
|
||||
import { GetFederatedInstancesResponse } from "./types/GetFederatedInstancesResponse";
|
||||
import { GetModlog } from "./types/GetModlog";
|
||||
import { GetModlogResponse } from "./types/GetModlogResponse";
|
||||
|
@ -73,15 +70,11 @@ import { GetReplies } from "./types/GetReplies";
|
|||
import { GetRepliesResponse } from "./types/GetRepliesResponse";
|
||||
import { GetReportCount } from "./types/GetReportCount";
|
||||
import { GetReportCountResponse } from "./types/GetReportCountResponse";
|
||||
import { GetSite } from "./types/GetSite";
|
||||
import { GetSiteMetadata } from "./types/GetSiteMetadata";
|
||||
import { GetSiteMetadataResponse } from "./types/GetSiteMetadataResponse";
|
||||
import { GetSiteResponse } from "./types/GetSiteResponse";
|
||||
import { GetUnreadCount } from "./types/GetUnreadCount";
|
||||
import { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
|
||||
import { GetUnreadRegistrationApplicationCount } from "./types/GetUnreadRegistrationApplicationCount";
|
||||
import { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
|
||||
import { LeaveAdmin } from "./types/LeaveAdmin";
|
||||
import { ListCommentReports } from "./types/ListCommentReports";
|
||||
import { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
|
||||
import { ListCommunities } from "./types/ListCommunities";
|
||||
|
@ -95,7 +88,6 @@ import { ListRegistrationApplicationsResponse } from "./types/ListRegistrationAp
|
|||
import { LockPost } from "./types/LockPost";
|
||||
import { Login } from "./types/Login";
|
||||
import { LoginResponse } from "./types/LoginResponse";
|
||||
import { MarkAllAsRead } from "./types/MarkAllAsRead";
|
||||
import { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
|
||||
import { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
|
||||
import { MarkPostAsRead } from "./types/MarkPostAsRead";
|
||||
|
@ -134,8 +126,6 @@ import { TransferCommunity } from "./types/TransferCommunity";
|
|||
import { VerifyEmail } from "./types/VerifyEmail";
|
||||
import { VerifyEmailResponse } from "./types/VerifyEmailResponse";
|
||||
import { UploadImage, UploadImageResponse, VERSION } from "./types/others";
|
||||
import { BlockInstance } from "./types/BlockInstance";
|
||||
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
||||
|
||||
enum HttpType {
|
||||
Get = "GET",
|
||||
|
@ -180,8 +170,8 @@ export class LemmyHttp {
|
|||
*
|
||||
* `HTTP.GET /site`
|
||||
*/
|
||||
getSite(form: GetSite = {}) {
|
||||
return this.#wrapper<GetSite, GetSiteResponse>(HttpType.Get, "/site", form);
|
||||
getSite() {
|
||||
return this.#wrapper<object, GetSiteResponse>(HttpType.Get, "/site", {});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -211,11 +201,11 @@ export class LemmyHttp {
|
|||
*
|
||||
* `HTTP.POST /user/leave_admin`
|
||||
*/
|
||||
leaveAdmin(form: LeaveAdmin) {
|
||||
return this.#wrapper<LeaveAdmin, GetSiteResponse>(
|
||||
leaveAdmin() {
|
||||
return this.#wrapper<object, GetSiteResponse>(
|
||||
HttpType.Post,
|
||||
"/user/leave_admin",
|
||||
form,
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -950,11 +940,11 @@ export class LemmyHttp {
|
|||
*
|
||||
* `HTTP.GET /user/banned`
|
||||
*/
|
||||
getBannedPersons(form: GetBannedPersons) {
|
||||
return this.#wrapper<GetBannedPersons, BannedPersonsResponse>(
|
||||
getBannedPersons() {
|
||||
return this.#wrapper<object, BannedPersonsResponse>(
|
||||
HttpType.Get,
|
||||
"/user/banned",
|
||||
form,
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -976,11 +966,11 @@ export class LemmyHttp {
|
|||
*
|
||||
* `HTTP.GET /user/get_captcha`
|
||||
*/
|
||||
getCaptcha(form: GetCaptcha = {}) {
|
||||
return this.#wrapper<GetCaptcha, GetCaptchaResponse>(
|
||||
getCaptcha() {
|
||||
return this.#wrapper<object, GetCaptchaResponse>(
|
||||
HttpType.Get,
|
||||
"/user/get_captcha",
|
||||
form,
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1028,11 +1018,11 @@ export class LemmyHttp {
|
|||
*
|
||||
* `HTTP.POST /user/mark_all_as_read`
|
||||
*/
|
||||
markAllAsRead(form: MarkAllAsRead) {
|
||||
return this.#wrapper<MarkAllAsRead, GetRepliesResponse>(
|
||||
markAllAsRead() {
|
||||
return this.#wrapper<object, GetRepliesResponse>(
|
||||
HttpType.Post,
|
||||
"/user/mark_all_as_read",
|
||||
form,
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1080,11 +1070,11 @@ export class LemmyHttp {
|
|||
*
|
||||
* `HTTP.GET /user/unread_count`
|
||||
*/
|
||||
getUnreadCount(form: GetUnreadCount) {
|
||||
return this.#wrapper<GetUnreadCount, GetUnreadCountResponse>(
|
||||
getUnreadCount() {
|
||||
return this.#wrapper<object, GetUnreadCountResponse>(
|
||||
HttpType.Get,
|
||||
"/user/unread_count",
|
||||
form,
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1119,13 +1109,12 @@ export class LemmyHttp {
|
|||
*
|
||||
* `HTTP.GET /admin/registration_application/count`
|
||||
*/
|
||||
getUnreadRegistrationApplicationCount(
|
||||
form: GetUnreadRegistrationApplicationCount,
|
||||
) {
|
||||
return this.#wrapper<
|
||||
GetUnreadRegistrationApplicationCount,
|
||||
GetUnreadRegistrationApplicationCountResponse
|
||||
>(HttpType.Get, "/admin/registration_application/count", form);
|
||||
getUnreadRegistrationApplicationCount() {
|
||||
return this.#wrapper<object, GetUnreadRegistrationApplicationCountResponse>(
|
||||
HttpType.Get,
|
||||
"/admin/registration_application/count",
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1248,24 +1237,11 @@ export class LemmyHttp {
|
|||
*
|
||||
* `HTTP.Get /federated_instances`
|
||||
*/
|
||||
getFederatedInstances(form: GetFederatedInstances = {}) {
|
||||
return this.#wrapper<GetFederatedInstances, GetFederatedInstancesResponse>(
|
||||
getFederatedInstances() {
|
||||
return this.#wrapper<object, GetFederatedInstancesResponse>(
|
||||
HttpType.Get,
|
||||
"/federated_instances",
|
||||
form,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Block an instance
|
||||
*
|
||||
* `HTTP.POST /site/block`
|
||||
*/
|
||||
blockInstance(form: BlockInstance) {
|
||||
return this.#wrapper<BlockInstance, BlockInstanceResponse>(
|
||||
HttpType.Post,
|
||||
"/site/block",
|
||||
form,
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
24
src/index.ts
24
src/index.ts
|
@ -19,8 +19,6 @@ export { BanPersonResponse } from "./types/BanPersonResponse";
|
|||
export { BannedPersonsResponse } from "./types/BannedPersonsResponse";
|
||||
export { BlockCommunity } from "./types/BlockCommunity";
|
||||
export { BlockCommunityResponse } from "./types/BlockCommunityResponse";
|
||||
export { BlockInstance } from "./types/BlockInstance";
|
||||
export { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
||||
export { BlockPerson } from "./types/BlockPerson";
|
||||
export { BlockPersonResponse } from "./types/BlockPersonResponse";
|
||||
export { CaptchaResponse } from "./types/CaptchaResponse";
|
||||
|
@ -45,8 +43,6 @@ export { CommunityBlockId } from "./types/CommunityBlockId";
|
|||
export { CommunityBlockView } from "./types/CommunityBlockView";
|
||||
export { CommunityFollowerView } from "./types/CommunityFollowerView";
|
||||
export { CommunityId } from "./types/CommunityId";
|
||||
export { CommunityJoin } from "./types/CommunityJoin";
|
||||
export { CommunityJoinResponse } from "./types/CommunityJoinResponse";
|
||||
export { CommunityModeratorView } from "./types/CommunityModeratorView";
|
||||
export { CommunityResponse } from "./types/CommunityResponse";
|
||||
export { CommunityView } from "./types/CommunityView";
|
||||
|
@ -84,15 +80,12 @@ export { EditSite } from "./types/EditSite";
|
|||
export { FeaturePost } from "./types/FeaturePost";
|
||||
export { FederatedInstances } from "./types/FederatedInstances";
|
||||
export { FollowCommunity } from "./types/FollowCommunity";
|
||||
export { GetBannedPersons } from "./types/GetBannedPersons";
|
||||
export { GetCaptcha } from "./types/GetCaptcha";
|
||||
export { GetCaptchaResponse } from "./types/GetCaptchaResponse";
|
||||
export { GetComment } from "./types/GetComment";
|
||||
export { GetComments } from "./types/GetComments";
|
||||
export { GetCommentsResponse } from "./types/GetCommentsResponse";
|
||||
export { GetCommunity } from "./types/GetCommunity";
|
||||
export { GetCommunityResponse } from "./types/GetCommunityResponse";
|
||||
export { GetFederatedInstances } from "./types/GetFederatedInstances";
|
||||
export { GetFederatedInstancesResponse } from "./types/GetFederatedInstancesResponse";
|
||||
export { GetModlog } from "./types/GetModlog";
|
||||
export { GetModlogResponse } from "./types/GetModlogResponse";
|
||||
|
@ -109,22 +102,18 @@ export { GetReplies } from "./types/GetReplies";
|
|||
export { GetRepliesResponse } from "./types/GetRepliesResponse";
|
||||
export { GetReportCount } from "./types/GetReportCount";
|
||||
export { GetReportCountResponse } from "./types/GetReportCountResponse";
|
||||
export { GetSite } from "./types/GetSite";
|
||||
export { GetSiteMetadata } from "./types/GetSiteMetadata";
|
||||
export { GetSiteMetadataResponse } from "./types/GetSiteMetadataResponse";
|
||||
export { GetSiteResponse } from "./types/GetSiteResponse";
|
||||
export { GetUnreadCount } from "./types/GetUnreadCount";
|
||||
export { GetUnreadCountResponse } from "./types/GetUnreadCountResponse";
|
||||
export { GetUnreadRegistrationApplicationCount } from "./types/GetUnreadRegistrationApplicationCount";
|
||||
export { GetUnreadRegistrationApplicationCountResponse } from "./types/GetUnreadRegistrationApplicationCountResponse";
|
||||
export { HideCommunity } from "./types/HideCommunity";
|
||||
export { ImageUpload } from "./types/ImageUpload";
|
||||
export { ImageUploadId } from "./types/ImageUploadId";
|
||||
export { Instance } from "./types/Instance";
|
||||
export { InstanceBlockView } from "./types/InstanceBlockView";
|
||||
export { InstanceId } from "./types/InstanceId";
|
||||
export { Language } from "./types/Language";
|
||||
export { LanguageId } from "./types/LanguageId";
|
||||
export { LeaveAdmin } from "./types/LeaveAdmin";
|
||||
export { LemmyErrorType } from "./types/LemmyErrorType";
|
||||
export { ListCommentReports } from "./types/ListCommentReports";
|
||||
export { ListCommentReportsResponse } from "./types/ListCommentReportsResponse";
|
||||
export { ListCommunities } from "./types/ListCommunities";
|
||||
|
@ -145,7 +134,6 @@ export { LocalUserView } from "./types/LocalUserView";
|
|||
export { LockPost } from "./types/LockPost";
|
||||
export { Login } from "./types/Login";
|
||||
export { LoginResponse } from "./types/LoginResponse";
|
||||
export { MarkAllAsRead } from "./types/MarkAllAsRead";
|
||||
export { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
|
||||
export { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
|
||||
export { MarkPostAsRead } from "./types/MarkPostAsRead";
|
||||
|
@ -162,8 +150,6 @@ export { ModFeaturePost } from "./types/ModFeaturePost";
|
|||
export { ModFeaturePostView } from "./types/ModFeaturePostView";
|
||||
export { ModHideCommunity } from "./types/ModHideCommunity";
|
||||
export { ModHideCommunityView } from "./types/ModHideCommunityView";
|
||||
export { ModJoin } from "./types/ModJoin";
|
||||
export { ModJoinResponse } from "./types/ModJoinResponse";
|
||||
export { ModLockPost } from "./types/ModLockPost";
|
||||
export { ModLockPostView } from "./types/ModLockPostView";
|
||||
export { ModRemoveComment } from "./types/ModRemoveComment";
|
||||
|
@ -195,10 +181,7 @@ export { Post } from "./types/Post";
|
|||
export { PostAggregates } from "./types/PostAggregates";
|
||||
export { PostFeatureType } from "./types/PostFeatureType";
|
||||
export { PostId } from "./types/PostId";
|
||||
export { PostJoin } from "./types/PostJoin";
|
||||
export { PostJoinResponse } from "./types/PostJoinResponse";
|
||||
export { PostListingMode } from "./types/PostListingMode";
|
||||
export { PostOrCommentId } from "./types/PostOrCommentId";
|
||||
export { PostReport } from "./types/PostReport";
|
||||
export { PostReportId } from "./types/PostReportId";
|
||||
export { PostReportResponse } from "./types/PostReportResponse";
|
||||
|
@ -248,8 +231,5 @@ export { SortType } from "./types/SortType";
|
|||
export { SubscribedType } from "./types/SubscribedType";
|
||||
export { Tagline } from "./types/Tagline";
|
||||
export { TransferCommunity } from "./types/TransferCommunity";
|
||||
export { UserJoin } from "./types/UserJoin";
|
||||
export { UserJoinResponse } from "./types/UserJoinResponse";
|
||||
export { VerifyEmail } from "./types/VerifyEmail";
|
||||
export { VerifyEmailResponse } from "./types/VerifyEmailResponse";
|
||||
export { UploadImage, UploadImageResponse, ImageFile } from "./types/others";
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PersonId } from "./PersonId";
|
|||
export interface AddAdmin {
|
||||
person_id: PersonId;
|
||||
added: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export interface AddModToCommunity {
|
|||
community_id: CommunityId;
|
||||
person_id: PersonId;
|
||||
added: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ export interface ApproveRegistrationApplication {
|
|||
id: number;
|
||||
approve: boolean;
|
||||
deny_reason?: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -9,5 +9,4 @@ export interface BanFromCommunity {
|
|||
remove_data?: boolean;
|
||||
reason?: string;
|
||||
expires?: number;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -7,5 +7,4 @@ export interface BanPerson {
|
|||
remove_data?: boolean;
|
||||
reason?: string;
|
||||
expires?: number;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommunityId } from "./CommunityId";
|
|||
export interface BlockCommunity {
|
||||
community_id: CommunityId;
|
||||
block: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
// 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;
|
||||
auth: string;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -4,5 +4,4 @@ import type { PersonId } from "./PersonId";
|
|||
export interface BlockPerson {
|
||||
person_id: PersonId;
|
||||
block: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ export interface ChangePassword {
|
|||
new_password: string;
|
||||
new_password_verify: string;
|
||||
old_password: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// 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;
|
||||
}
|
|
@ -8,5 +8,4 @@ export interface CreateComment {
|
|||
post_id: PostId;
|
||||
parent_id?: CommentId;
|
||||
language_id?: LanguageId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommentId } from "./CommentId";
|
|||
export interface CreateCommentLike {
|
||||
comment_id: CommentId;
|
||||
score: number;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommentId } from "./CommentId";
|
|||
export interface CreateCommentReport {
|
||||
comment_id: CommentId;
|
||||
reason: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -10,5 +10,4 @@ export interface CreateCommunity {
|
|||
nsfw?: boolean;
|
||||
posting_restricted_to_mods?: boolean;
|
||||
discussion_languages?: Array<LanguageId>;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export interface CreateCustomEmoji {
|
|||
image_url: string;
|
||||
alt_text: string;
|
||||
keywords: Array<string>;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -10,5 +10,4 @@ export interface CreatePost {
|
|||
honeypot?: string;
|
||||
nsfw?: boolean;
|
||||
language_id?: LanguageId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PostId } from "./PostId";
|
|||
export interface CreatePostLike {
|
||||
post_id: PostId;
|
||||
score: number;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PostId } from "./PostId";
|
|||
export interface CreatePostReport {
|
||||
post_id: PostId;
|
||||
reason: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PersonId } from "./PersonId";
|
|||
export interface CreatePrivateMessage {
|
||||
content: string;
|
||||
recipient_id: PersonId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PrivateMessageId } from "./PrivateMessageId";
|
|||
export interface CreatePrivateMessageReport {
|
||||
private_message_id: PrivateMessageId;
|
||||
reason: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -43,5 +43,4 @@ export interface CreateSite {
|
|||
blocked_instances?: Array<string>;
|
||||
taglines?: Array<string>;
|
||||
registration_mode?: RegistrationMode;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -3,5 +3,4 @@
|
|||
export interface DeleteAccount {
|
||||
password: string;
|
||||
delete_content: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommentId } from "./CommentId";
|
|||
export interface DeleteComment {
|
||||
comment_id: CommentId;
|
||||
deleted: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommunityId } from "./CommunityId";
|
|||
export interface DeleteCommunity {
|
||||
community_id: CommunityId;
|
||||
deleted: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -3,5 +3,4 @@ import type { CustomEmojiId } from "./CustomEmojiId";
|
|||
|
||||
export interface DeleteCustomEmoji {
|
||||
id: CustomEmojiId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PostId } from "./PostId";
|
|||
export interface DeletePost {
|
||||
post_id: PostId;
|
||||
deleted: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PrivateMessageId } from "./PrivateMessageId";
|
|||
export interface DeletePrivateMessage {
|
||||
private_message_id: PrivateMessageId;
|
||||
deleted: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommentId } from "./CommentId";
|
|||
export interface DistinguishComment {
|
||||
comment_id: CommentId;
|
||||
distinguished: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export interface EditComment {
|
|||
comment_id: CommentId;
|
||||
content?: string;
|
||||
language_id?: LanguageId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -11,5 +11,4 @@ export interface EditCommunity {
|
|||
nsfw?: boolean;
|
||||
posting_restricted_to_mods?: boolean;
|
||||
discussion_languages?: Array<LanguageId>;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -7,5 +7,4 @@ export interface EditCustomEmoji {
|
|||
image_url: string;
|
||||
alt_text: string;
|
||||
keywords: Array<string>;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -9,5 +9,4 @@ export interface EditPost {
|
|||
body?: string;
|
||||
nsfw?: boolean;
|
||||
language_id?: LanguageId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PrivateMessageId } from "./PrivateMessageId";
|
|||
export interface EditPrivateMessage {
|
||||
private_message_id: PrivateMessageId;
|
||||
content: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -44,5 +44,4 @@ export interface EditSite {
|
|||
taglines?: Array<string>;
|
||||
registration_mode?: RegistrationMode;
|
||||
reports_email_admins?: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export interface FeaturePost {
|
|||
post_id: PostId;
|
||||
featured: boolean;
|
||||
feature_type: PostFeatureType;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommunityId } from "./CommunityId";
|
|||
export interface FollowCommunity {
|
||||
community_id: CommunityId;
|
||||
follow: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface GetBannedPersons {
|
||||
auth: string;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface GetCaptcha {
|
||||
auth?: string;
|
||||
}
|
|
@ -3,5 +3,4 @@ import type { CommentId } from "./CommentId";
|
|||
|
||||
export interface GetComment {
|
||||
id: CommentId;
|
||||
auth?: string;
|
||||
}
|
||||
|
|
|
@ -18,5 +18,4 @@ export interface GetComments {
|
|||
saved_only?: boolean;
|
||||
liked_only?: boolean;
|
||||
disliked_only?: boolean;
|
||||
auth?: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommunityId } from "./CommunityId";
|
|||
export interface GetCommunity {
|
||||
id?: CommunityId;
|
||||
name?: string;
|
||||
auth?: string;
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface GetFederatedInstances {
|
||||
auth?: string;
|
||||
}
|
|
@ -10,5 +10,4 @@ export interface GetModlog {
|
|||
limit?: number;
|
||||
type_?: ModlogActionType;
|
||||
other_person_id?: PersonId;
|
||||
auth?: string;
|
||||
}
|
||||
|
|
|
@ -11,5 +11,4 @@ export interface GetPersonDetails {
|
|||
limit?: number;
|
||||
community_id?: CommunityId;
|
||||
saved_only?: boolean;
|
||||
auth?: string;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export interface GetPersonMentions {
|
|||
page?: number;
|
||||
limit?: number;
|
||||
unread_only?: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -5,5 +5,4 @@ import type { PostId } from "./PostId";
|
|||
export interface GetPost {
|
||||
id?: PostId;
|
||||
comment_id?: CommentId;
|
||||
auth?: string;
|
||||
}
|
||||
|
|
|
@ -13,5 +13,4 @@ export interface GetPosts {
|
|||
saved_only?: boolean;
|
||||
liked_only?: boolean;
|
||||
disliked_only?: boolean;
|
||||
auth?: string;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export interface GetPrivateMessages {
|
|||
page?: number;
|
||||
limit?: number;
|
||||
creator_id?: PersonId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export interface GetReplies {
|
|||
page?: number;
|
||||
limit?: number;
|
||||
unread_only?: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -3,5 +3,4 @@ import type { CommunityId } from "./CommunityId";
|
|||
|
||||
export interface GetReportCount {
|
||||
community_id?: CommunityId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface GetSite {
|
||||
auth?: string;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface GetUnreadCount {
|
||||
auth: string;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface GetUnreadRegistrationApplicationCount {
|
||||
auth: string;
|
||||
}
|
|
@ -5,5 +5,4 @@ export interface HideCommunity {
|
|||
community_id: CommunityId;
|
||||
hidden: boolean;
|
||||
reason?: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
11
src/types/ImageUpload.ts
Normal file
11
src/types/ImageUpload.ts
Normal 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 { ImageUploadId } from "./ImageUploadId";
|
||||
import type { LocalUserId } from "./LocalUserId";
|
||||
|
||||
export interface ImageUpload {
|
||||
id: ImageUploadId;
|
||||
local_user_id: LocalUserId;
|
||||
pictrs_alias: string;
|
||||
pictrs_delete_token: string;
|
||||
published: string;
|
||||
}
|
|
@ -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 UserJoin {
|
||||
auth: string;
|
||||
}
|
||||
export type ImageUploadId = number;
|
|
@ -1,10 +0,0 @@
|
|||
// 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";
|
||||
import type { Person } from "./Person";
|
||||
import type { Site } from "./Site";
|
||||
|
||||
export interface InstanceBlockView {
|
||||
person: Person;
|
||||
instance: Instance;
|
||||
site?: Site;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface LeaveAdmin {
|
||||
auth: string;
|
||||
}
|
|
@ -6,5 +6,4 @@ export interface ListCommentReports {
|
|||
limit?: number;
|
||||
unresolved_only?: boolean;
|
||||
community_id?: CommunityId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -8,5 +8,4 @@ export interface ListCommunities {
|
|||
show_nsfw?: boolean;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
auth?: string;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export interface ListPostReports {
|
|||
limit?: number;
|
||||
unresolved_only?: boolean;
|
||||
community_id?: CommunityId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ export interface ListPrivateMessageReports {
|
|||
page?: number;
|
||||
limit?: number;
|
||||
unresolved_only?: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ export interface ListRegistrationApplications {
|
|||
unread_only?: boolean;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PostId } from "./PostId";
|
|||
export interface LockPost {
|
||||
post_id: PostId;
|
||||
locked: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface MarkAllAsRead {
|
||||
auth: string;
|
||||
}
|
|
@ -4,5 +4,4 @@ import type { CommentReplyId } from "./CommentReplyId";
|
|||
export interface MarkCommentReplyAsRead {
|
||||
comment_reply_id: CommentReplyId;
|
||||
read: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PersonMentionId } from "./PersonMentionId";
|
|||
export interface MarkPersonMentionAsRead {
|
||||
person_mention_id: PersonMentionId;
|
||||
read: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PostId } from "./PostId";
|
|||
export interface MarkPostAsRead {
|
||||
post_id: PostId;
|
||||
read: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PrivateMessageId } from "./PrivateMessageId";
|
|||
export interface MarkPrivateMessageAsRead {
|
||||
private_message_id: PrivateMessageId;
|
||||
read: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
// 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 ModJoin {
|
||||
community_id: CommunityId;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface ModJoinResponse {
|
||||
joined: boolean;
|
||||
}
|
|
@ -2,7 +2,6 @@
|
|||
import type { CommunityBlockView } from "./CommunityBlockView";
|
||||
import type { CommunityFollowerView } from "./CommunityFollowerView";
|
||||
import type { CommunityModeratorView } from "./CommunityModeratorView";
|
||||
import type { InstanceBlockView } from "./InstanceBlockView";
|
||||
import type { LanguageId } from "./LanguageId";
|
||||
import type { LocalUserView } from "./LocalUserView";
|
||||
import type { PersonBlockView } from "./PersonBlockView";
|
||||
|
@ -12,7 +11,6 @@ export interface MyUserInfo {
|
|||
follows: Array<CommunityFollowerView>;
|
||||
moderates: Array<CommunityModeratorView>;
|
||||
community_blocks: Array<CommunityBlockView>;
|
||||
instance_blocks: Array<InstanceBlockView>;
|
||||
person_blocks: Array<PersonBlockView>;
|
||||
discussion_languages: Array<LanguageId>;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// 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";
|
||||
import type { PersonId } from "./PersonId";
|
||||
import type { PostId } from "./PostId";
|
||||
|
||||
|
@ -21,5 +20,4 @@ export interface PostAggregates {
|
|||
community_id: CommunityId;
|
||||
creator_id: PersonId;
|
||||
controversy_rank: number;
|
||||
instance_id: InstanceId;
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
// 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 PostJoin {
|
||||
post_id: PostId;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface PostJoinResponse {
|
||||
joined: boolean;
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
// 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 { PostId } from "./PostId";
|
||||
|
||||
export type PostOrCommentId = { Post: PostId } | { Comment: CommentId };
|
|
@ -4,5 +4,4 @@ import type { CommentId } from "./CommentId";
|
|||
export interface PurgeComment {
|
||||
comment_id: CommentId;
|
||||
reason?: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommunityId } from "./CommunityId";
|
|||
export interface PurgeCommunity {
|
||||
community_id: CommunityId;
|
||||
reason?: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PersonId } from "./PersonId";
|
|||
export interface PurgePerson {
|
||||
person_id: PersonId;
|
||||
reason?: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PostId } from "./PostId";
|
|||
export interface PurgePost {
|
||||
post_id: PostId;
|
||||
reason?: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -5,5 +5,4 @@ export interface RemoveComment {
|
|||
comment_id: CommentId;
|
||||
removed: boolean;
|
||||
reason?: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,4 @@ export interface RemoveCommunity {
|
|||
removed: boolean;
|
||||
reason?: string;
|
||||
expires?: number;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -5,5 +5,4 @@ export interface RemovePost {
|
|||
post_id: PostId;
|
||||
removed: boolean;
|
||||
reason?: string;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommentReportId } from "./CommentReportId";
|
|||
export interface ResolveCommentReport {
|
||||
report_id: CommentReportId;
|
||||
resolved: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -2,5 +2,4 @@
|
|||
|
||||
export interface ResolveObject {
|
||||
q: string;
|
||||
auth: string | null;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PostReportId } from "./PostReportId";
|
|||
export interface ResolvePostReport {
|
||||
report_id: PostReportId;
|
||||
resolved: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PrivateMessageReportId } from "./PrivateMessageReportId";
|
|||
export interface ResolvePrivateMessageReport {
|
||||
report_id: PrivateMessageReportId;
|
||||
resolved: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { CommentId } from "./CommentId";
|
|||
export interface SaveComment {
|
||||
comment_id: CommentId;
|
||||
save: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { PostId } from "./PostId";
|
|||
export interface SavePost {
|
||||
post_id: PostId;
|
||||
save: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ export interface SaveUserSettings {
|
|||
show_new_post_notifs?: boolean;
|
||||
discussion_languages?: Array<LanguageId>;
|
||||
generate_totp_2fa?: boolean;
|
||||
auth: string;
|
||||
open_links_in_new_tab?: boolean;
|
||||
infinite_scroll_enabled?: boolean;
|
||||
}
|
||||
|
|
|
@ -15,5 +15,4 @@ export interface Search {
|
|||
listing_type?: ListingType;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
auth?: string;
|
||||
}
|
||||
|
|
|
@ -5,5 +5,4 @@ import type { PersonId } from "./PersonId";
|
|||
export interface TransferCommunity {
|
||||
community_id: CommunityId;
|
||||
person_id: PersonId;
|
||||
auth: string;
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export interface UserJoinResponse {
|
||||
joined: boolean;
|
||||
}
|
Loading…
Reference in a new issue