mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-12-05 02:31:12 +00:00
Instance blocks with mod log entry and expiration
This commit is contained in:
parent
c275eea006
commit
dff3b2ebef
20 changed files with 131 additions and 11 deletions
11
src/index.ts
11
src/index.ts
|
@ -10,6 +10,12 @@ export { AddAdmin } from "./types/AddAdmin";
|
|||
export { AddAdminResponse } from "./types/AddAdminResponse";
|
||||
export { AddModToCommunity } from "./types/AddModToCommunity";
|
||||
export { AddModToCommunityResponse } from "./types/AddModToCommunityResponse";
|
||||
export { AdminAllowInstance } from "./types/AdminAllowInstance";
|
||||
export { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
|
||||
export { AdminAllowInstanceView } from "./types/AdminAllowInstanceView";
|
||||
export { AdminBlockInstance } from "./types/AdminBlockInstance";
|
||||
export { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
|
||||
export { AdminBlockInstanceView } from "./types/AdminBlockInstanceView";
|
||||
export { AdminPurgeComment } from "./types/AdminPurgeComment";
|
||||
export { AdminPurgeCommentView } from "./types/AdminPurgeCommentView";
|
||||
export { AdminPurgeCommunity } from "./types/AdminPurgeCommunity";
|
||||
|
@ -28,8 +34,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";
|
||||
|
@ -95,6 +99,7 @@ export { EditPrivateMessage } from "./types/EditPrivateMessage";
|
|||
export { EditSite } from "./types/EditSite";
|
||||
export { FeaturePost } from "./types/FeaturePost";
|
||||
export { FederatedInstances } from "./types/FederatedInstances";
|
||||
export { FederationBlockList } from "./types/FederationBlockList";
|
||||
export { FederationError } from "./types/FederationError";
|
||||
export { FederationMode } from "./types/FederationMode";
|
||||
export { FollowCommunity } from "./types/FollowCommunity";
|
||||
|
@ -179,6 +184,7 @@ export { Login } from "./types/Login";
|
|||
export { LoginResponse } from "./types/LoginResponse";
|
||||
export { LoginToken } from "./types/LoginToken";
|
||||
export { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead";
|
||||
export { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead";
|
||||
export { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead";
|
||||
export { MarkPostAsRead } from "./types/MarkPostAsRead";
|
||||
export { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead";
|
||||
|
@ -285,5 +291,6 @@ export { TransferCommunity } from "./types/TransferCommunity";
|
|||
export { UpdateTagline } from "./types/UpdateTagline";
|
||||
export { UpdateTotp } from "./types/UpdateTotp";
|
||||
export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
||||
export { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
|
||||
export { VerifyEmail } from "./types/VerifyEmail";
|
||||
export { VoteView } from "./types/VoteView";
|
||||
|
|
12
src/types/AdminAllowInstance.ts
Normal file
12
src/types/AdminAllowInstance.ts
Normal 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 { InstanceId } from "./InstanceId";
|
||||
import type { PersonId } from "./PersonId";
|
||||
|
||||
export type AdminAllowInstance = {
|
||||
id: number;
|
||||
instance_id: InstanceId;
|
||||
admin_person_id: PersonId;
|
||||
allowed: boolean;
|
||||
reason?: string;
|
||||
published: string;
|
||||
};
|
8
src/types/AdminAllowInstanceParams.ts
Normal file
8
src/types/AdminAllowInstanceParams.ts
Normal 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 { InstanceId } from "./InstanceId";
|
||||
|
||||
export type AdminAllowInstanceParams = {
|
||||
instance_id: InstanceId;
|
||||
allow: boolean;
|
||||
reason?: string;
|
||||
};
|
13
src/types/AdminAllowInstanceView.ts
Normal file
13
src/types/AdminAllowInstanceView.ts
Normal 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 { AdminAllowInstance } from "./AdminAllowInstance";
|
||||
import type { Instance } from "./Instance";
|
||||
import type { Person } from "./Person";
|
||||
|
||||
/**
|
||||
* When an admin purges a post.
|
||||
*/
|
||||
export type AdminAllowInstanceView = {
|
||||
admin_block_instance: AdminAllowInstance;
|
||||
instance: Instance;
|
||||
admin?: Person;
|
||||
};
|
13
src/types/AdminBlockInstance.ts
Normal file
13
src/types/AdminBlockInstance.ts
Normal 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 { InstanceId } from "./InstanceId";
|
||||
import type { PersonId } from "./PersonId";
|
||||
|
||||
export type AdminBlockInstance = {
|
||||
id: number;
|
||||
instance_id: InstanceId;
|
||||
admin_person_id: PersonId;
|
||||
blocked: boolean;
|
||||
reason?: string;
|
||||
expires?: string;
|
||||
published: string;
|
||||
};
|
9
src/types/AdminBlockInstanceParams.ts
Normal file
9
src/types/AdminBlockInstanceParams.ts
Normal 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 { InstanceId } from "./InstanceId";
|
||||
|
||||
export type AdminBlockInstanceParams = {
|
||||
instance_id: InstanceId;
|
||||
block: boolean;
|
||||
reason?: string;
|
||||
expires?: string;
|
||||
};
|
13
src/types/AdminBlockInstanceView.ts
Normal file
13
src/types/AdminBlockInstanceView.ts
Normal 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 { AdminBlockInstance } from "./AdminBlockInstance";
|
||||
import type { Instance } from "./Instance";
|
||||
import type { Person } from "./Person";
|
||||
|
||||
/**
|
||||
* When an admin purges a post.
|
||||
*/
|
||||
export type AdminBlockInstanceView = {
|
||||
admin_block_instance: AdminBlockInstance;
|
||||
instance: Instance;
|
||||
admin?: Person;
|
||||
};
|
|
@ -1,3 +0,0 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type BlockInstanceResponse = { blocked: boolean };
|
9
src/types/FederationBlockList.ts
Normal file
9
src/types/FederationBlockList.ts
Normal 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 { InstanceId } from "./InstanceId";
|
||||
|
||||
export type FederationBlockList = {
|
||||
instance_id: InstanceId;
|
||||
published: string;
|
||||
updated?: string;
|
||||
expires?: string;
|
||||
};
|
|
@ -25,4 +25,5 @@ export type FederationError =
|
|||
| "InboxTimeout"
|
||||
| "CantDeleteSite"
|
||||
| "ObjectIsNotPublic"
|
||||
| "ObjectIsNotPrivate";
|
||||
| "ObjectIsNotPrivate"
|
||||
| "Unreachable";
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { AdminAllowInstanceView } from "./AdminAllowInstanceView";
|
||||
import type { AdminBlockInstanceView } from "./AdminBlockInstanceView";
|
||||
import type { AdminPurgeCommentView } from "./AdminPurgeCommentView";
|
||||
import type { AdminPurgeCommunityView } from "./AdminPurgeCommunityView";
|
||||
import type { AdminPurgePersonView } from "./AdminPurgePersonView";
|
||||
|
@ -34,4 +36,6 @@ export type GetModlogResponse = {
|
|||
admin_purged_posts: Array<AdminPurgePostView>;
|
||||
admin_purged_comments: Array<AdminPurgeCommentView>;
|
||||
hidden_communities: Array<ModHideCommunityView>;
|
||||
admin_block_instance: Array<AdminBlockInstanceView>;
|
||||
admin_allow_instance: Array<AdminAllowInstanceView>;
|
||||
};
|
||||
|
|
|
@ -29,6 +29,10 @@ export type GetPosts = {
|
|||
* If true, then show the nsfw posts (even if your user setting is to hide them)
|
||||
*/
|
||||
show_nsfw?: boolean;
|
||||
/**
|
||||
* Whether to automatically mark fetched posts as read.
|
||||
*/
|
||||
mark_as_read?: boolean;
|
||||
/**
|
||||
* If true, then only show posts with no comments
|
||||
*/
|
||||
|
|
|
@ -4,4 +4,4 @@ import type { PostId } from "./PostId";
|
|||
/**
|
||||
* Hide a post from list views
|
||||
*/
|
||||
export type HidePost = { post_ids: Array<PostId>; hide: boolean };
|
||||
export type HidePost = { post_id: PostId; hide: boolean };
|
||||
|
|
|
@ -63,7 +63,7 @@ export type LemmyErrorType =
|
|||
| { error: "no_email_setup" }
|
||||
| { error: "local_site_not_setup" }
|
||||
| { error: "email_smtp_server_needs_a_port" }
|
||||
| { error: "missing_an_email" }
|
||||
| { error: "invalid_email_address"; message: string }
|
||||
| { error: "rate_limit_error" }
|
||||
| { error: "invalid_name" }
|
||||
| { error: "invalid_display_name" }
|
||||
|
@ -116,6 +116,7 @@ export type LemmyErrorType =
|
|||
| { error: "invalid_regex" }
|
||||
| { error: "captcha_incorrect" }
|
||||
| { error: "couldnt_create_audio_captcha" }
|
||||
| { error: "couldnt_create_image_captcha" }
|
||||
| { error: "invalid_url_scheme" }
|
||||
| { error: "couldnt_send_webmention" }
|
||||
| { error: "contradicting_filters" }
|
||||
|
@ -135,4 +136,5 @@ export type LemmyErrorType =
|
|||
| { error: "community_has_no_followers" }
|
||||
| { error: "post_schedule_time_must_be_in_future" }
|
||||
| { error: "too_many_scheduled_posts" }
|
||||
| { error: "cannot_combine_federation_blocklist_and_allowlist" }
|
||||
| { error: "federation_error"; message: { error?: FederationError } };
|
||||
|
|
|
@ -73,9 +73,17 @@ export type LocalUser = {
|
|||
* should be paused
|
||||
*/
|
||||
enable_animated_images: boolean;
|
||||
/**
|
||||
* Whether a user can send / receive private messages
|
||||
*/
|
||||
enable_private_messages: boolean;
|
||||
/**
|
||||
* Whether to auto-collapse bot comments.
|
||||
*/
|
||||
collapse_bot_comments: boolean;
|
||||
default_comment_sort_type: CommentSortType;
|
||||
/**
|
||||
* Whether to automatically mark fetched posts as read.
|
||||
*/
|
||||
auto_mark_fetched_posts_as_read: boolean;
|
||||
};
|
||||
|
|
7
src/types/MarkManyPostsAsRead.ts
Normal file
7
src/types/MarkManyPostsAsRead.ts
Normal 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 { PostId } from "./PostId";
|
||||
|
||||
/**
|
||||
* Mark several posts as read.
|
||||
*/
|
||||
export type MarkManyPostsAsRead = { post_ids: Array<PostId> };
|
|
@ -4,4 +4,4 @@ import type { PostId } from "./PostId";
|
|||
/**
|
||||
* Mark a post as read.
|
||||
*/
|
||||
export type MarkPostAsRead = { post_ids: Array<PostId>; read: boolean };
|
||||
export type MarkPostAsRead = { post_id: PostId; read: boolean };
|
||||
|
|
|
@ -19,4 +19,6 @@ export type ModlogActionType =
|
|||
| "AdminPurgePerson"
|
||||
| "AdminPurgeCommunity"
|
||||
| "AdminPurgePost"
|
||||
| "AdminPurgeComment";
|
||||
| "AdminPurgeComment"
|
||||
| "AdminBlockInstance"
|
||||
| "AdminAllowInstance";
|
||||
|
|
|
@ -107,6 +107,10 @@ export type SaveUserSettings = {
|
|||
* should be paused
|
||||
*/
|
||||
enable_animated_images?: boolean;
|
||||
/**
|
||||
* Whether a user can send / receive private messages
|
||||
*/
|
||||
enable_private_messages?: boolean;
|
||||
/**
|
||||
* Whether to auto-collapse bot comments.
|
||||
*/
|
||||
|
@ -118,4 +122,8 @@ export type SaveUserSettings = {
|
|||
show_upvotes?: boolean;
|
||||
show_downvotes?: boolean;
|
||||
show_upvote_percentage?: boolean;
|
||||
/**
|
||||
* Whether to automatically mark fetched posts as read.
|
||||
*/
|
||||
auto_mark_fetched_posts_as_read?: boolean;
|
||||
};
|
||||
|
|
|
@ -4,4 +4,7 @@ import type { InstanceId } from "./InstanceId";
|
|||
/**
|
||||
* Block an instance as user
|
||||
*/
|
||||
export type BlockInstance = { instance_id: InstanceId; block: boolean };
|
||||
export type UserBlockInstanceParams = {
|
||||
instance_id: InstanceId;
|
||||
block: boolean;
|
||||
};
|
Loading…
Reference in a new issue