import Post from "../models/Post.js"; import { type ExtractValue, type TransformDataBodyToOptions, type TransformDataQueryToOptions } from "../util.js"; import Base from "./Base.js"; import PostFlag from "./posts/Flag.js"; import PostVotes from "./posts/Votes.js"; import type { DeletePostData, GetPostInSequenceData, GetRecommendedPostsData, ListPostFavoritesData, MovePostFavoritesData, RecommendedPosts, SearchPostsData } from "../generated/types.js"; /** @category Modules/Types */ export interface DeletePostOptions extends TransformDataBodyToOptions { } /** @category Modules/Types */ export interface MovePostFavoritesOptions extends TransformDataBodyToOptions { } /** @category Modules/Types */ export interface SearchPostsOptions extends TransformDataQueryToOptions { } /** @category Modules/Types */ export interface ListPostFavoritesOptions extends TransformDataQueryToOptions { } /** @category Modules/Types */ export interface GetRecommendedPostsOptions extends TransformDataQueryToOptions { } /** @category Modules */ export default class Posts extends Base { flag: PostFlag; votes: PostVotes; /** * AI Check Post * * You must be Janitor+. * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-aiCheckPost aiCheckPost} * * @see {@link https://e621.wiki/#operations-Posts-aiCheckPost Documentation} for more details. */ aiCheck(id: number): Promise; /** * Copy Notes To Post * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-copyNotesToPost copyNotesToPost} * * @see {@link https://e621.wiki/#operations-Posts-copyNotesToPost Documentation} for more details. */ copyNotes(id: number, other_post_id: number): Promise; /** * Delete Post * * You must have the "Approve Posts" permission. `commit=Delete` must be set. * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-deletePost deletePost} * * @see {@link https://e621.wiki/#operations-Posts-deletePost Documentation} for more details. */ delete(id: number, options: DeletePostOptions): Promise; /** * Expunge Post * * You must have the "Approve Posts" permission and be Admin+. * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-expungePost expungePost} * * @see {@link https://e621.wiki/#operations-Posts-expungePost Documentation} for more details. */ expunge(id: number, reason: string): Promise; /** * List Post Favorites * * You must be the user or Moderator+ to see users that have their favorites hidden. * * @operationId {@link https://e621.wiki/#operations-Posts-listPostFavorites listPostFavorites} * * @see {@link https://e621.wiki/#operations-Posts-listPostFavorites Documentation} for more details. */ favorites(id: number, options: ListPostFavoritesOptions): Promise>; /** * Get Post * * @operationId {@link https://e621.wiki/#operations-Posts-getPost getPost} * * @see {@link https://e621.wiki/#operations-Posts-getPost Documentation} for more details. */ get(id: number): Promise; /** * Mark Post As Translated * * Will error if no body is provided. * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-markPostAsTranslated markPostAsTranslated} * * @see {@link https://e621.wiki/#operations-Posts-markPostAsTranslated Documentation} for more details. */ markTranslated(id: number): Promise; /** * Move Post Favorites * * You must have the "Approve Posts" permission. `commit=Submit`` must be set. * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-movePostFavorites movePostFavorites} * * @see {@link https://e621.wiki/#operations-Posts-movePostFavorites Documentation} for more details. */ moveFavorites(id: number, options: MovePostFavoritesOptions): Promise; /** * Get Random Post * * @operationId {@link https://e621.wiki/#operations-Posts-getRandomPost getRandomPost} * * @see {@link https://e621.wiki/#operations-Posts-getRandomPost Documentation} for more details. */ random(tags?: string): Promise; /** * Get Recommended Posts * * @operationId {@link https://e621.wiki/#operations-Posts-getRecommendedPosts getRecommendedPosts} * * @see {@link https://e621.wiki/#operations-Posts-getRecommendedPosts Documentation} for more details. */ recommended(id: number, options: GetRecommendedPostsOptions): Promise; /** * Regenerate Post Thumbnails * * You must be Janitor+. * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-regeneratePostThumbnails regeneratePostThumbnails} * * @see {@link https://e621.wiki/#operations-Posts-regeneratePostThumbnails Documentation} for more details. */ regenerateThumbnails(id: number): Promise; /** * Regenerate Post Videos * * You must be Janitor+. * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-regeneratePostVideos regeneratePostVideos} * * @see {@link https://e621.wiki/#operations-Posts-regeneratePostVideos Documentation} for more details. */ regenerateVideos(id: number): Promise; /** * Revert Post * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-revertPost revertPost} * * @see {@link https://e621.wiki/#operations-Posts-revertPost Documentation} for more details. */ revert(id: number, version_id: number): Promise; /** * Search Posts * * @operationId {@link https://e621.wiki/#operations-Posts-searchPosts searchPosts} * * @see {@link https://e621.wiki/#operations-Posts-searchPosts Documentation} for more details. */ search(options?: SearchPostsOptions): Promise>; /** * Get Post In Sequence * * @operationId {@link https://e621.wiki/#operations-Posts-getPostInSequence getPostInSequence} * * @see {@link https://e621.wiki/#operations-Posts-getPostInSequence Documentation} for more details. */ sequence(id: number, seq?: ExtractValue<"seq", GetPostInSequenceData>): Promise; /** * Undelete Post * * You must have the "Approve Posts" permission. * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-undeletePost undeletePost} * * @see {@link https://e621.wiki/#operations-Posts-undeletePost Documentation} for more details. */ undelete(id: number): Promise; /** * Update Post IQDB * * You must be Admin+. * * @requiresApiKeyAuth * * @operationId {@link https://e621.wiki/#operations-Posts-updatePostIqdb updatePostIqdb} * * @see {@link https://e621.wiki/#operations-Posts-updatePostIqdb Documentation} for more details. */ updateIqdb(id: number): Promise; }