diff --git a/src/providers/piefed/compat.ts b/src/providers/piefed/compat.ts index f5fdcd6..fe2e2dc 100644 --- a/src/providers/piefed/compat.ts +++ b/src/providers/piefed/compat.ts @@ -7,7 +7,7 @@ export const fromPageParams = lemmyCompat.fromPageParams; export function toComment( comment: components["schemas"]["Comment"], - creator_id: number, // TODO piefed types are wrong, this isn't being returned rn + creator_id: number // TODO piefed types are wrong, this isn't being returned rn ) { return { ...comment, @@ -18,7 +18,7 @@ export function toComment( } export function toCommentReplyView( - reply: components["schemas"]["CommentReplyView"], + reply: components["schemas"]["CommentReplyView"] ) { return { ...reply, @@ -31,26 +31,35 @@ export function toCommentReplyView( }; } -export function toCommentView(comment: components["schemas"]["CommentView"]) { +export function toCommentView( + comment: components["schemas"]["CommentView"] +): types.CommentView { return { ...comment, comment: toComment(comment.comment, comment.creator.id), community: toCommunity(comment.community), creator: toPerson(comment.creator), post: toPost(comment.post), + + // TODO: is this correct? Piefed types are wide (string) here + subscribed: comment.subscribed as types.CommentView["subscribed"], }; } -export function toCommunity(community: components["schemas"]["Community"]) { +export function toCommunity( + community: components["schemas"]["Community"] +): types.Community { return { ...community, + banner: community.banner ?? undefined, + icon: community.icon ?? undefined, posting_restricted_to_mods: community.restricted_to_mods, visibility: "Public" as const, }; } export function toCommunityModeratorView( - view: components["schemas"]["CommunityModeratorView"], + view: components["schemas"]["CommunityModeratorView"] ) { return { ...view, @@ -60,7 +69,7 @@ export function toCommunityModeratorView( } export function toCommunityView( - community: components["schemas"]["CommunityView"], + community: components["schemas"]["CommunityView"] ): types.CommunityView { return { ...community, @@ -78,7 +87,7 @@ export function toCommunityView( } export function toGetCommunityResponse( - response: components["schemas"]["GetCommunityResponse"], + response: components["schemas"]["GetCommunityResponse"] ) { return { community_view: toCommunityView(response.community_view), @@ -87,7 +96,7 @@ export function toGetCommunityResponse( } export function toLocalSite( - site: components["schemas"]["Site"], + site: components["schemas"]["Site"] ): types.LocalSite { return { captcha_enabled: false, @@ -100,18 +109,21 @@ export function toLocalSite( }; } -export function toPerson(person: components["schemas"]["Person"]) { +export function toPerson( + person: components["schemas"]["Person"] +): types.Person { return { ...person, avatar: person.avatar ?? undefined, // TODO piefed types are wrong, this is returned as null if not set bot_account: person.bot, display_name: person.title ?? undefined, // TODO piefed types are wrong, this is returned as null if not set name: person.user_name!, + published: person.published!, }; } export function toPersonMentionView( - mention: components["schemas"]["CommentReplyView"], + mention: components["schemas"]["CommentReplyView"] ): types.PersonMentionView { return { ...mention, @@ -143,7 +155,7 @@ export function toPost(post: components["schemas"]["Post"]) { } export function toPostView( - post: components["schemas"]["PostView"], + post: components["schemas"]["PostView"] ): types.PostView { return { ...post, @@ -155,7 +167,7 @@ export function toPostView( } export function toPrivateMessageView( - message: components["schemas"]["PrivateMessageView"], + message: components["schemas"]["PrivateMessageView"] ) { return { ...message, @@ -163,3 +175,10 @@ export function toPrivateMessageView( recipient: toPerson(message.recipient), }; } + +export function toSite(site: components["schemas"]["Site"]): types.Site { + return { + ...site, + icon: site.icon ?? undefined, + }; +} diff --git a/src/providers/piefed/index.ts b/src/providers/piefed/index.ts index 6e95f91..ab998fc 100644 --- a/src/providers/piefed/index.ts +++ b/src/providers/piefed/index.ts @@ -62,7 +62,7 @@ export class UnsafePiefedClient implements BaseClient { this.#headers = headers; this.#client = createClient({ - baseUrl: `${url}/api/alpha`, + baseUrl: url, fetch: options.fetchFunction, // TODO: piefed doesn't allow CORS headers other than Authorization headers, @@ -75,7 +75,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - await this.#client.POST("/community/moderate/ban", { + await this.#client.POST("/api/alpha/community/moderate/ban", { ...options, // @ts-expect-error TODO: fix this body: payload, @@ -86,7 +86,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.POST("/community/block", { + const response = await this.#client.POST("/api/alpha/community/block", { ...options, body: { ...payload }, }); @@ -100,7 +100,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - await this.#client.POST("/site/block", { + await this.#client.POST("/api/alpha/site/block", { ...options, body: { ...payload }, }); @@ -110,7 +110,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.POST("/user/block", { + const response = await this.#client.POST("/api/alpha/user/block", { ...options, body: { ...payload }, }); @@ -125,7 +125,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.POST("/comment", { + const response = await this.#client.POST("/api/alpha/comment", { ...options, body: { ...payload, @@ -142,9 +142,9 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - await this.#client.POST("/comment/report", { + await this.#client.POST("/api/alpha/comment/report", { ...options, - body: { ...payload }, + body: { ...payload, report_remote: true }, }); } @@ -152,7 +152,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ) { - const response = await this.#client.POST("/post", { + const response = await this.#client.POST("/api/alpha/post", { ...options, body: { ...payload, @@ -169,7 +169,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - await this.#client.POST("/post/report", { + await this.#client.POST("/api/alpha/post/report", { ...options, body: { ...payload }, }); @@ -179,7 +179,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.POST("/private_message", { + const response = await this.#client.POST("/api/alpha/private_message", { ...options, body: { ...payload }, }); @@ -203,7 +203,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.POST("/comment/delete", { + const response = await this.#client.POST("/api/alpha/comment/delete", { ...options, body: { ...payload }, }); @@ -223,7 +223,7 @@ export class UnsafePiefedClient implements BaseClient { payload: { deleted: boolean; post_id: number }, options?: RequestOptions ): Promise<{ post_view: PostView }> { - const response = await this.#client.POST("/post/delete", { + const response = await this.#client.POST("/api/alpha/post/delete", { ...options, body: { ...payload }, }); @@ -245,11 +245,14 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.PUT("/comment", { + const response = await this.#client.PUT("/api/alpha/comment", { ...options, body: { ...payload, body: payload.content, + // TODO: piefed types say this is required, but it's not + } as unknown as components["schemas"]["EditCommentRequest"] & { + distinguished: boolean; }, }); @@ -262,7 +265,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ) { - const response = await this.#client.PUT("/post", { + const response = await this.#client.PUT("/api/alpha/post", { ...options, body: { ...payload, @@ -279,7 +282,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): Promise<{ post_view: PostView }> { - const response = await this.#client.POST("/post/feature", { + const response = await this.#client.POST("/api/alpha/post/feature", { ...options, body: { ...payload }, }); @@ -293,7 +296,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.POST("/community/follow", { + const response = await this.#client.POST("/api/alpha/community/follow", { ...options, body: { ...payload }, }); @@ -320,11 +323,10 @@ export class UnsafePiefedClient implements BaseClient { const query = cleanThreadiverseParams( compat.fromPageParams(payload) - ) satisfies components["schemas"]["GetComments"]; + ) satisfies paths["/api/alpha/comment/list"]["get"]["parameters"]["query"]; - const response = await this.#client.GET("/comment/list", { + const response = await this.#client.GET("/api/alpha/comment/list", { ...options, - // @ts-expect-error TODO: fix this params: { query }, }); @@ -338,9 +340,8 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.GET("/community", { + const response = await this.#client.GET("/api/alpha/community", { ...options, - // @ts-expect-error TODO: fix this params: { query: payload }, }); @@ -350,7 +351,7 @@ export class UnsafePiefedClient implements BaseClient { async getFederatedInstances( ..._params: Parameters ): ReturnType { - const response = await this.#client.GET("/federated_instances"); + const response = await this.#client.GET("/api/alpha/federated_instances"); return response.data!; } @@ -390,9 +391,8 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.GET("/user", { + const response = await this.#client.GET("/api/alpha/user", { ...options, - // @ts-expect-error TODO: fix this params: { query: payload }, }); @@ -407,9 +407,8 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.GET("/user/mentions", { + const response = await this.#client.GET("/api/alpha/user/mentions", { ...options, - // @ts-expect-error TODO: fix this params: { query: compat.fromPageParams(payload) }, }); @@ -423,11 +422,11 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ) { - const query = payload satisfies components["schemas"]["GetPost"]; + const query = + payload satisfies paths["/api/alpha/post"]["get"]["parameters"]["query"]; - const response = await this.#client.GET("/post", { + const response = await this.#client.GET("/api/alpha/post", { ...options, - // @ts-expect-error TODO: fix this params: { query }, }); @@ -447,11 +446,10 @@ export class UnsafePiefedClient implements BaseClient { const query = cleanThreadiverseParams( compat.fromPageParams(payload) - ) satisfies components["schemas"]["GetPosts"]; + ) satisfies paths["/api/alpha/post/list"]["get"]["parameters"]["query"]; - const response = await this.#client.GET("/post/list", { + const response = await this.#client.GET("/api/alpha/post/list", { ...options, - // @ts-expect-error TODO: fix this params: { query }, }); @@ -465,9 +463,8 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.GET("/private_message/list", { + const response = await this.#client.GET("/api/alpha/private_message/list", { ...options, - // @ts-expect-error TODO: fix this params: { query: compat.fromPageParams(payload) }, }); @@ -489,9 +486,8 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.GET("/user/replies", { + const response = await this.#client.GET("/api/alpha/user/replies", { ...options, - // @ts-expect-error TODO: fix this params: { query: compat.fromPageParams(payload) }, }); @@ -502,7 +498,9 @@ export class UnsafePiefedClient implements BaseClient { } async getSite(options?: RequestOptions): ReturnType { - const response = await this.#client.GET("/site", options); + const response = await this.#client.GET("/api/alpha/site", { + ...options, + }); return { ...response.data!, @@ -512,7 +510,7 @@ export class UnsafePiefedClient implements BaseClient { ? { ...response.data!.my_user, community_blocks: response.data!.my_user?.community_blocks.map( - ({ community }) => compat.toCommunity(community) + ({ community }) => compat.toCommunity(community!) ), follows: response.data!.my_user.follows.map((f) => ({ community: compat.toCommunity(f.community), @@ -542,7 +540,7 @@ export class UnsafePiefedClient implements BaseClient { : undefined, site_view: { local_site: compat.toLocalSite(response.data!.site), - site: response.data!.site, + site: compat.toSite(response.data!.site), }, }; } @@ -554,7 +552,7 @@ export class UnsafePiefedClient implements BaseClient { } async getUnreadCount(options?: RequestOptions) { - const response = await this.#client.GET("/user/unread_count", { + const response = await this.#client.GET("/api/alpha/user/unread_count", { ...options, }); @@ -565,10 +563,11 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.POST("/comment/like", { + const response = await this.#client.POST("/api/alpha/comment/like", { ...options, body: { ...payload, + private: false, }, }); @@ -581,7 +580,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ) { - const response = await this.#client.POST("/post/like", { + const response = await this.#client.POST("/api/alpha/post/like", { ...options, body: { ...payload, @@ -605,7 +604,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.GET("/community/list", { + const response = await this.#client.GET("/api/alpha/community/list", { ...options, // @ts-expect-error TODO: fix this params: { query: compat.fromPageParams(payload) }, @@ -661,10 +660,9 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.GET("/user", { + const response = await this.#client.GET("/api/alpha/user", { ...options, params: { - // @ts-expect-error TODO: fix this query: { ...compat.fromPageParams(payload), saved_only: true }, }, }); @@ -710,7 +708,7 @@ export class UnsafePiefedClient implements BaseClient { payload: { locked: boolean; post_id: number }, options?: RequestOptions ): Promise<{ post_view: PostView }> { - const response = await this.#client.POST("/post/lock", { + const response = await this.#client.POST("/api/alpha/post/lock", { ...options, body: { ...payload }, }); @@ -724,7 +722,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ) { - const response = await this.#client.POST("/user/login", { + const response = await this.#client.POST("/api/alpha/user/login", { ...options, body: { password: payload.password, username: payload.username_or_email }, }); @@ -736,14 +734,14 @@ export class UnsafePiefedClient implements BaseClient { } async markAllAsRead(options: Parameters[0]) { - await this.#client.POST("/user/mark_all_as_read", options); + await this.#client.POST("/api/alpha/user/mark_all_as_read", options); } async markCommentReplyAsRead( payload: Parameters[0], options?: RequestOptions ): ReturnType { - await this.#client.POST("/comment/mark_as_read", { + await this.#client.POST("/api/alpha/comment/mark_as_read", { ...options, body: payload, }); @@ -753,7 +751,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - await this.#client.POST("/comment/mark_as_read", { + await this.#client.POST("/api/alpha/comment/mark_as_read", { ...options, body: { comment_reply_id: payload.person_mention_id, @@ -766,7 +764,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - await this.#client.POST("/post/mark_as_read", { + await this.#client.POST("/api/alpha/post/mark_as_read", { ...options, body: payload, }); @@ -776,7 +774,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - await this.#client.POST("/private_message/mark_as_read", { + await this.#client.POST("/api/alpha/private_message/mark_as_read", { ...options, body: payload, }); @@ -792,7 +790,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.POST("/comment/remove", { + const response = await this.#client.POST("/api/alpha/comment/remove", { ...options, body: { ...payload }, }); @@ -806,7 +804,7 @@ export class UnsafePiefedClient implements BaseClient { payload: { post_id: number; removed: boolean }, options?: RequestOptions ): Promise<{ post_view: PostView }> { - const response = await this.#client.POST("/post/remove", { + const response = await this.#client.POST("/api/alpha/post/remove", { ...options, body: { ...payload }, }); @@ -828,9 +826,8 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.GET("/resolve_object", { + const response = await this.#client.GET("/api/alpha/resolve_object", { ...options, - // @ts-expect-error TODO: fix this params: { query: payload }, }); @@ -866,7 +863,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.PUT("/comment/save", { + const response = await this.#client.PUT("/api/alpha/comment/save", { ...options, body: { ...payload }, }); @@ -880,7 +877,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - const response = await this.#client.PUT("/post/save", { + const response = await this.#client.PUT("/api/alpha/post/save", { ...options, body: { ...payload }, }); @@ -900,11 +897,7 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ): ReturnType { - if (payload.type_ === "Comments") { - throw new UnsupportedError("Comment search is not supported by piefed"); - } - - const response = await this.#client.GET("/search", { + const response = await this.#client.GET("/api/alpha/search", { ...options, // @ts-expect-error TODO: fix this params: { query: compat.fromPageParams(payload) }, @@ -916,6 +909,7 @@ export class UnsafePiefedClient implements BaseClient { ...response.data!.communities.map(compat.toCommunityView), ...response.data!.posts.map(compat.toPostView), ...response.data!.users.map(compat.toPersonView), + ...response.data!.comments.map(compat.toCommentView), ], }; } @@ -956,9 +950,8 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ) { - const response = await this.#client.GET("/comment/list", { + const response = await this.#client.GET("/api/alpha/comment/list", { ...options, - // @ts-expect-error TODO: fix this params: { query: compat.fromPageParams(payload) }, }); @@ -972,9 +965,8 @@ export class UnsafePiefedClient implements BaseClient { payload: Parameters[0], options?: RequestOptions ) { - const response = await this.#client.GET("/post/list", { + const response = await this.#client.GET("/api/alpha/post/list", { ...options, - // @ts-expect-error TODO: fix this params: { query: compat.fromPageParams(payload) }, }); diff --git a/src/providers/piefed/schema.ts b/src/providers/piefed/schema.ts index 998074e..6f5cc6e 100644 --- a/src/providers/piefed/schema.ts +++ b/src/providers/piefed/schema.ts @@ -4,7 +4,7 @@ */ export interface paths { - "/site": { + "/api/alpha/site": { parameters: { query?: never; header?: never; @@ -30,13 +30,13 @@ export interface paths { "application/json": components["schemas"]["GetSiteResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; }; @@ -49,14 +49,14 @@ export interface paths { patch?: never; trace?: never; }; - "/site/version": { + "/api/alpha/site/version": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** (instances running PieFed v1.2 or later only) Gets version of PieFed. */ + /** Gets version of PieFed. */ get: { parameters: { query?: never; @@ -66,7 +66,7 @@ export interface paths { }; requestBody?: never; responses: { - /** @description OK, */ + /** @description OK */ 200: { headers: { [name: string]: unknown; @@ -75,13 +75,13 @@ export interface paths { "application/json": components["schemas"]["GetSiteVersionResponse"]; }; }; - /** @description Bad Request, */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; }; @@ -94,7 +94,7 @@ export interface paths { patch?: never; trace?: never; }; - "/site/block": { + "/api/alpha/site/block": { parameters: { query?: never; header?: never; @@ -111,9 +111,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["BlockInstance"]; + "application/json": components["schemas"]["BlockInstanceRequest"]; }; }; responses: { @@ -126,15 +126,16 @@ export interface paths { "application/json": components["schemas"]["BlockInstanceResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -143,14 +144,14 @@ export interface paths { patch?: never; trace?: never; }; - "/site/instance_chooser": { + "/api/alpha/site/instance_chooser": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** (instances running PieFed v1.2 or later only) Gets the site info for use by other instances in the Instance Chooser functionality. */ + /** Gets the site info for use by other instances in the Instance Chooser functionality. */ get: { parameters: { query?: never; @@ -175,7 +176,7 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; }; @@ -188,18 +189,21 @@ export interface paths { patch?: never; trace?: never; }; - "/site/instance_chooser_search": { + "/api/alpha/site/instance_chooser_search": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** (instances running PieFed v1.2 or later only) Search for other instances. */ + /** Search for other instances. */ get: { parameters: { query?: { - InstanceChooserSearch?: components["schemas"]["InstanceChooserSearch"]; + q?: string; + nsfw?: string; + language?: string; + newbie?: string; }; header?: never; path?: never; @@ -222,9 +226,10 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; put?: never; @@ -235,7 +240,7 @@ export interface paths { patch?: never; trace?: never; }; - "/search": { + "/api/alpha/search": { parameters: { query?: never; header?: never; @@ -245,8 +250,15 @@ export interface paths { /** Search PieFed. */ get: { parameters: { - query?: { - Search?: components["schemas"]["Search"]; + query: { + q: string; + type_: "Communities" | "Posts" | "Users" | "Url"; + limit?: number; + listing_type?: "All" | "Local" | "Subscribed" | "Popular" | "Moderating" | "ModeratorView"; + page?: number; + sort?: "Active" | "Hot" | "New" | "Top" | "TopHour" | "TopSixHour" | "TopTwelveHour" | "TopDay" | "TopWeek" | "TopMonth" | "TopThreeMonths" | "TopSixMonths" | "TopNineMonths" | "TopYear" | "TopAll" | "Scaled" | "Old"; + community_name?: string; + community_id?: number; }; header?: never; path?: never; @@ -263,15 +275,16 @@ export interface paths { "application/json": components["schemas"]["SearchResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; put?: never; @@ -282,7 +295,7 @@ export interface paths { patch?: never; trace?: never; }; - "/resolve_object": { + "/api/alpha/resolve_object": { parameters: { query?: never; header?: never; @@ -292,8 +305,8 @@ export interface paths { /** Fetch a non-local / federated object. */ get: { parameters: { - query?: { - ResolveObject?: components["schemas"]["ResolveObject"]; + query: { + q: string; }; header?: never; path?: never; @@ -310,6 +323,16 @@ export interface paths { "application/json": components["schemas"]["ResolveObjectResponse"]; }; }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; put?: never; @@ -320,7 +343,7 @@ export interface paths { patch?: never; trace?: never; }; - "/federated_instances": { + "/api/alpha/federated_instances": { parameters: { query?: never; header?: never; @@ -346,6 +369,15 @@ export interface paths { "application/json": components["schemas"]["GetFederatedInstancesResponse"]; }; }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; }; }; put?: never; @@ -356,7 +388,7 @@ export interface paths { patch?: never; trace?: never; }; - "/community": { + "/api/alpha/community": { parameters: { query?: never; header?: never; @@ -367,7 +399,8 @@ export interface paths { get: { parameters: { query?: { - GetCommunity?: components["schemas"]["GetCommunity"]; + id?: number; + name?: string; }; header?: never; path?: never; @@ -384,15 +417,16 @@ export interface paths { "application/json": components["schemas"]["GetCommunityResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; /** Edit community. */ @@ -403,9 +437,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["EditCommunity"]; + "application/json": components["schemas"]["EditCommunityRequest"]; }; }; responses: { @@ -418,15 +452,16 @@ export interface paths { "application/json": components["schemas"]["CommunityResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; /** Create a new community. */ @@ -437,9 +472,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["CreateCommunity"]; + "application/json": components["schemas"]["CreateCommunityRequest"]; }; }; responses: { @@ -452,71 +487,23 @@ export interface paths { "application/json": components["schemas"]["CommunityResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; - /** @description You are being rate limited */ + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + /** @description Too Many Requests */ 429: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; - }; - }; - }; - }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/community/delete": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Delete a community. */ - post: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: { - content: { - "application/json": components["schemas"]["DeleteCommunity"]; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["CommunityResponse"]; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; }; @@ -527,7 +514,7 @@ export interface paths { patch?: never; trace?: never; }; - "/community/list": { + "/api/alpha/community/list": { parameters: { query?: never; header?: never; @@ -538,7 +525,11 @@ export interface paths { get: { parameters: { query?: { - ListCommunities?: components["schemas"]["ListCommunities"]; + limit?: number; + page?: number; + show_nsfw?: boolean; + sort?: "Hot" | "Top" | "New"; + type_?: "All" | "Local" | "Subscribed"; }; header?: never; path?: never; @@ -555,15 +546,16 @@ export interface paths { "application/json": components["schemas"]["ListCommunitiesResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; put?: never; @@ -574,7 +566,7 @@ export interface paths { patch?: never; trace?: never; }; - "/community/follow": { + "/api/alpha/community/follow": { parameters: { query?: never; header?: never; @@ -591,9 +583,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["FollowCommunity"]; + "application/json": components["schemas"]["FollowCommunityRequest"]; }; }; responses: { @@ -606,15 +598,16 @@ export interface paths { "application/json": components["schemas"]["CommunityResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -623,7 +616,7 @@ export interface paths { patch?: never; trace?: never; }; - "/community/block": { + "/api/alpha/community/block": { parameters: { query?: never; header?: never; @@ -640,9 +633,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["BlockCommunity"]; + "application/json": components["schemas"]["BlockCommunityRequest"]; }; }; responses: { @@ -655,15 +648,16 @@ export interface paths { "application/json": components["schemas"]["BlockCommunityResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -672,7 +666,7 @@ export interface paths { patch?: never; trace?: never; }; - "/community/mod": { + "/api/alpha/community/subscribe": { parameters: { query?: never; header?: never; @@ -680,18 +674,17 @@ export interface paths { cookie?: never; }; get?: never; - put?: never; - /** Add or remove a moderator for your community.. */ - post: { + /** Subscribe to activities in a community. */ + put: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["AddModToCommunity"]; + "application/json": components["schemas"]["SubscribeCommunityRequest"]; }; }; responses: { @@ -701,27 +694,29 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["AddModToCommunityResponse"]; + "application/json": components["schemas"]["CommunityResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/community/subscribe": { + "/api/alpha/community/delete": { parameters: { query?: never; header?: never; @@ -729,17 +724,18 @@ export interface paths { cookie?: never; }; get?: never; - /** Subscribe to activities in a community. */ - put: { + put?: never; + /** Delete a community. */ + post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["SubscribeCommunity"]; + "application/json": components["schemas"]["DeleteCommunityRequest"]; }; }; responses: { @@ -752,42 +748,46 @@ export interface paths { "application/json": components["schemas"]["CommunityResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/community/moderate/bans": { + "/api/alpha/community/mod": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get the list of banned users for a community. */ - get: { + get?: never; + put?: never; + /** Add or remove a moderator for your community. */ + post: { parameters: { - query?: { - GetCommunityModerationBansList?: components["schemas"]["GetCommunityModerationBansList"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["ModCommunityRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -795,50 +795,47 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["ModerationCommunityBansListResponse"]; + "application/json": components["schemas"]["ModCommunityResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/community/moderate/ban": { + "/api/alpha/community/moderate/bans": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - put?: never; - /** Ban a user from a community. */ - post: { + /** Get the list of banned users for a community. */ + get: { parameters: { - query?: never; + query: { + community_id: number; + limit?: number; + page?: number; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["ModerateCommunityBan"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -846,27 +843,30 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["ModerateCommunityBanResponse"]; + "application/json": components["schemas"]["CommunityModerationBansListResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + put?: never; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/community/moderate/unban": { + "/api/alpha/community/moderate/unban": { parameters: { query?: never; header?: never; @@ -882,9 +882,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["ModerateCommunityUnBan"]; + "application/json": components["schemas"]["CommunityModerationUnbanRequest"]; }; }; responses: { @@ -894,18 +894,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["ModerateCommunityUnBanResponse"]; + "application/json": components["schemas"]["CommunityModerationBanItem"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; post?: never; @@ -915,7 +916,7 @@ export interface paths { patch?: never; trace?: never; }; - "/community/moderate/post/nsfw": { + "/api/alpha/community/moderate/ban": { parameters: { query?: never; header?: never; @@ -924,7 +925,7 @@ export interface paths { }; get?: never; put?: never; - /** Mark or unmark a post as NSFW. */ + /** Ban a user from a community. */ post: { parameters: { query?: never; @@ -932,9 +933,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["ModerateCommunityPostNsfw"]; + "application/json": components["schemas"]["CommunityModerationBanRequest"]; }; }; responses: { @@ -944,18 +945,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["ModerateCommunityPostNsfwResponse"]; + "application/json": components["schemas"]["CommunityModerationBanItem"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -964,24 +966,28 @@ export interface paths { patch?: never; trace?: never; }; - "/post/list": { + "/api/alpha/community/moderate/post/nsfw": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get / fetch posts, with various filters. */ - get: { + get?: never; + put?: never; + /** Mark or unmark a post as NSFW. */ + post: { parameters: { - query?: { - GetPosts?: components["schemas"]["GetPosts"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["CommunityModerationNsfwRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -989,68 +995,36 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["GetPostsResponse"]; + "application/json": components["schemas"]["PostView"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/post": { + "/api/alpha/community/flair": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get / fetch a post. */ - get: { - parameters: { - query?: { - GetPost?: components["schemas"]["GetPost"]; - }; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GetPostResponse"]; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BadRequest"]; - }; - }; - }; - }; - /** Edit a post. */ + get?: never; + /** Edit an existing post flair in the community */ put: { parameters: { query?: never; @@ -1058,9 +1032,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["EditPost"]; + "application/json": components["schemas"]["CommunityFlairEditRequest"]; }; }; responses: { @@ -1070,21 +1044,22 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostResponse"]; + "application/json": components["schemas"]["CommunityFlairEditResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - /** Create a post. */ + /** Create a new post flair in the community */ post: { parameters: { query?: never; @@ -1092,9 +1067,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["CreatePost"]; + "application/json": components["schemas"]["CommunityFlairCreateRequest"]; }; }; responses: { @@ -1104,27 +1079,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostResponse"]; + "application/json": components["schemas"]["CommunityFlairCreateResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; - }; - }; - /** @description You are being rate limited */ - 429: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -1133,7 +1100,7 @@ export interface paths { patch?: never; trace?: never; }; - "/post/like": { + "/api/alpha/community/flair/delete": { parameters: { query?: never; header?: never; @@ -1142,7 +1109,7 @@ export interface paths { }; get?: never; put?: never; - /** Like / vote on a post. */ + /** Delete a post flair in a community */ post: { parameters: { query?: never; @@ -1150,9 +1117,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["CreatePostLike"]; + "application/json": components["schemas"]["CommunityFlairDeleteRequest"]; }; }; responses: { @@ -1162,18 +1129,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostResponse"]; + "application/json": components["schemas"]["CommunityFlairDeleteResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -1182,27 +1150,27 @@ export interface paths { patch?: never; trace?: never; }; - "/post/save": { + "/api/alpha/feed/list": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - /** Save a post. */ - put: { + /** Get list of feeds */ + get: { parameters: { - query?: never; + query?: { + /** @description include list of communities in each feed with result */ + include_communities?: boolean; + /** @description only return feeds created by the authorized user */ + mine_only?: boolean; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["SavePost"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -1210,20 +1178,22 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostResponse"]; + "application/json": components["schemas"]["FeedListResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + put?: never; post?: never; delete?: never; options?: never; @@ -1231,27 +1201,25 @@ export interface paths { patch?: never; trace?: never; }; - "/post/subscribe": { + "/api/alpha/topic/list": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - /** Subscribe to a post. */ - put: { + /** Get list of topics */ + get: { parameters: { - query?: never; + query?: { + /** @description include list of communities in each topic with result */ + include_communities?: boolean; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["SubscribePost"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -1259,20 +1227,22 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostResponse"]; + "application/json": components["schemas"]["TopicListResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + put?: never; post?: never; delete?: never; options?: never; @@ -1280,28 +1250,34 @@ export interface paths { patch?: never; trace?: never; }; - "/post/delete": { + "/api/alpha/user": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - put?: never; - /** Delete a post. */ - post: { + /** Get the details for a person */ + get: { parameters: { - query?: never; + query?: { + /** @description One of either person_id or username must be specified */ + person_id?: number; + /** @description One of either person_id or username must be specified */ + username?: string; + sort?: "Active" | "Hot" | "New" | "Top" | "TopHour" | "TopSixHour" | "TopTwelveHour" | "TopDay" | "TopWeek" | "TopMonth" | "TopThreeMonths" | "TopSixMonths" | "TopNineMonths" | "TopYear" | "TopAll" | "Scaled" | "Old"; + page?: number; + limit?: number; + /** @description Limit posts/comments to just a single community */ + community_id?: number; + saved_only?: boolean; + include_content?: boolean; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["DeletePost"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -1309,27 +1285,30 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostResponse"]; + "application/json": components["schemas"]["GetUserResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + put?: never; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/post/report": { + "/api/alpha/user/login": { parameters: { query?: never; header?: never; @@ -1338,7 +1317,7 @@ export interface paths { }; get?: never; put?: never; - /** Report a post. */ + /** Log into PieFed */ post: { parameters: { query?: never; @@ -1346,9 +1325,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["CreatePostReport"]; + "application/json": components["schemas"]["UserLoginRequest"]; }; }; responses: { @@ -1358,16 +1337,26 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostReportResponse"]; + "application/json": components["schemas"]["UserLoginResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + /** @description Too Many Requests */ + 429: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; }; }; }; @@ -1378,28 +1367,22 @@ export interface paths { patch?: never; trace?: never; }; - "/post/lock": { + "/api/alpha/user/unread_count": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - put?: never; - /** A moderator can lock a post ( IE disable new comments ). */ - post: { + /** Get your unread counts */ + get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["LockPost"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -1407,48 +1390,49 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostResponse"]; + "application/json": components["schemas"]["UserUnreadCountsResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; }; }; + put?: never; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/post/feature": { + "/api/alpha/user/replies": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - put?: never; - /** A moderator can feature a community post ( IE stick it to the top of a community ). */ - post: { + /** Get comment replies */ + get: { parameters: { - query?: never; + query?: { + limit?: number; + page?: number; + sort?: "Hot" | "Top" | "New" | "Old"; + unread_only?: boolean; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["FeaturePost"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -1456,48 +1440,50 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostResponse"]; + "application/json": components["schemas"]["UserRepliesResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + put?: never; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/post/mark_as_read": { + "/api/alpha/user/mentions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - put?: never; - /** Mark a post as read. */ - post: { + /** Get mentions of your account made in comments */ + get: { parameters: { - query?: never; + query?: { + limit?: number; + page?: number; + sort?: "Hot" | "Top" | "New" | "Old"; + unread_only?: boolean; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["MarkPostAsRead"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -1505,18 +1491,30 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["SuccessResponse-2"]; + "application/json": components["schemas"]["UserMentionsResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + put?: never; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/post/remove": { + "/api/alpha/user/block": { parameters: { query?: never; header?: never; @@ -1525,7 +1523,7 @@ export interface paths { }; get?: never; put?: never; - /** A moderator remove for a post. */ + /** Block or unblock a person */ post: { parameters: { query?: never; @@ -1533,9 +1531,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["RemovePost"]; + "application/json": components["schemas"]["UserBlockRequest"]; }; }; responses: { @@ -1545,18 +1543,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PostResponse"]; + "application/json": components["schemas"]["UserBlockResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -1565,19 +1564,19 @@ export interface paths { patch?: never; trace?: never; }; - "/comment": { + "/api/alpha/user/mark_all_as_read": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get / fetch a comment. */ - get: { + get?: never; + put?: never; + /** Mark all notifications and messages as read */ + post: { parameters: { - query?: { - GetComments?: components["schemas"]["GetComment"]; - }; + query?: never; header?: never; path?: never; cookie?: never; @@ -1590,21 +1589,35 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["CommentResponse"]; + "application/json": components["schemas"]["UserMarkAllReadResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; }; }; - /** Edit a comment. */ + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/user/subscribe": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** Subscribe or unsubscribe to activites of another user */ put: { parameters: { query?: never; @@ -1612,9 +1625,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["EditComment"]; + "application/json": components["schemas"]["UserSubscribeRequest"]; }; }; responses: { @@ -1624,31 +1637,47 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["CommentResponse"]; + "application/json": components["schemas"]["UserSubscribeResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - /** Create a comment. */ - post: { + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/user/save_user_settings": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** Save your user settings */ + put: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["CreateComment"]; + "application/json": components["schemas"]["UserSaveSettingsRequest"]; }; }; responses: { @@ -1658,47 +1687,42 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["CommentResponse"]; + "application/json": components["schemas"]["UserSaveSettingsResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; - }; - }; - /** @description You are being rate limited */ - 429: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/comment/list": { + "/api/alpha/user/notifications": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get / fetch comments. */ + /** Get your user notifications (not all notification types supported yet) */ get: { parameters: { - query?: { - GetComments?: components["schemas"]["GetComments"]; + query: { + status: "All" | "Unread" | "Read"; + limit?: number; + page?: number; }; header?: never; path?: never; @@ -1712,18 +1736,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["GetCommentsResponse"]; + "application/json": components["schemas"]["UserNotificationsResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; put?: never; @@ -1734,7 +1759,7 @@ export interface paths { patch?: never; trace?: never; }; - "/comment/delete": { + "/api/alpha/user/notification_state": { parameters: { query?: never; header?: never; @@ -1742,18 +1767,17 @@ export interface paths { cookie?: never; }; get?: never; - put?: never; - /** Delete a comment. */ - post: { + /** Set the read status of a given notification (not all notification types supported yet) */ + put: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["DeleteComment"]; + "application/json": components["schemas"]["UserNotificationStateRequest"]; }; }; responses: { @@ -1763,48 +1787,44 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["CommentResponse"]; + "application/json": components["schemas"]["UserNotificationItemView"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/comment/mark_as_read": { + "/api/alpha/user/notifications_count": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - put?: never; - /** Mark a comment reply as read. */ - post: { + /** Get user unread notifications count */ + get: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["MarkReplyAsRead"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -1812,27 +1832,29 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["CommentReplyResponse-2"]; + "application/json": components["schemas"]["UserNotificationsCountResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; }; }; + put?: never; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/comment/remove": { + "/api/alpha/user/mark_all_notifications_read": { parameters: { query?: never; header?: never; @@ -1840,20 +1862,15 @@ export interface paths { cookie?: never; }; get?: never; - put?: never; - /** A moderator remove for a comment. */ - post: { + /** Mark all notifications as read */ + put: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["RemoveComment"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -1861,27 +1878,28 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["CommentResponse"]; + "application/json": components["schemas"]["UserMarkAllNotifsReadResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; }; }; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/comment/like": { + "/api/alpha/user/verify_credentials": { parameters: { query?: never; header?: never; @@ -1890,7 +1908,7 @@ export interface paths { }; get?: never; put?: never; - /** Like / vote on a comment. */ + /** Verify username/password credentials */ post: { parameters: { query?: never; @@ -1898,9 +1916,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["CreateCommentLike"]; + "application/json": components["schemas"]["UserLoginRequest"]; }; }; responses: { @@ -1909,19 +1927,18 @@ export interface paths { headers: { [name: string]: unknown; }; - content: { - "application/json": components["schemas"]["CommentResponse"]; - }; + content?: never; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -1930,7 +1947,7 @@ export interface paths { patch?: never; trace?: never; }; - "/comment/save": { + "/api/alpha/user/set_flair": { parameters: { query?: never; header?: never; @@ -1938,17 +1955,18 @@ export interface paths { cookie?: never; }; get?: never; - /** Save a comment. */ - put: { + put?: never; + /** Set your flair for a community */ + post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["SaveComment"]; + "application/json": components["schemas"]["UserSetFlairRequest"]; }; }; responses: { @@ -1958,48 +1976,56 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["CommentResponse"]; + "application/json": components["schemas"]["UserSetFlairResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/comment/subscribe": { + "/api/alpha/comment/list": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - /** Subscribe to a comment. */ - put: { + /** List comments, with various filters. */ + get: { parameters: { - query?: never; + query?: { + limit?: number; + page?: number; + sort?: "Hot" | "Top" | "New" | "Old"; + liked_only?: boolean; + saved_only?: boolean; + person_id?: number; + community_id?: number; + post_id?: number; + parent_id?: number; + max_depth?: number; + /** @description guarantee parent comments are on the same page as any fetched comments */ + depth_first?: boolean; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["SubscribeComment"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -2007,20 +2033,22 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["CommentResponse"]; + "application/json": components["schemas"]["ListCommentsResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + put?: never; post?: never; delete?: never; options?: never; @@ -2028,7 +2056,7 @@ export interface paths { patch?: never; trace?: never; }; - "/comment/report": { + "/api/alpha/comment/like": { parameters: { query?: never; header?: never; @@ -2037,7 +2065,7 @@ export interface paths { }; get?: never; put?: never; - /** Report a comment. */ + /** Like / vote on a comment. */ post: { parameters: { query?: never; @@ -2045,9 +2073,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["CreateCommentReport"]; + "application/json": components["schemas"]["LikeCommentRequest"]; }; }; responses: { @@ -2057,18 +2085,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["CommentReportResponse"]; + "application/json": components["schemas"]["GetCommentResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -2077,24 +2106,27 @@ export interface paths { patch?: never; trace?: never; }; - "/private_message/list": { + "/api/alpha/comment/save": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get / fetch private messages. */ - get: { + get?: never; + /** Save a comment. */ + put: { parameters: { - query?: { - GetPrivateMessages?: components["schemas"]["GetPrivateMessages"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["SaveCommentRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -2102,21 +2134,21 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PrivateMessagesResponse"]; + "application/json": components["schemas"]["GetCommentResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; post?: never; delete?: never; options?: never; @@ -2124,24 +2156,27 @@ export interface paths { patch?: never; trace?: never; }; - "/private_message/conversation": { + "/api/alpha/comment/subscribe": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get / fetch private messages. */ - get: { + get?: never; + /** Subscribe to a comment. */ + put: { parameters: { - query?: { - GetPrivateMessagesConversation?: components["schemas"]["GetPrivateMessagesConversation"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["SubscribeCommentRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -2149,21 +2184,21 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PrivateMessagesResponse"]; + "application/json": components["schemas"]["GetCommentResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; post?: never; delete?: never; options?: never; @@ -2171,27 +2206,24 @@ export interface paths { patch?: never; trace?: never; }; - "/private_message": { + "/api/alpha/comment": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - /** Edit a private message. */ - put: { + /** Get / fetch a comment. */ + get: { parameters: { - query?: never; + query: { + id: number; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["EditPrivateMessage"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -2199,22 +2231,32 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PrivateMessageResponse"]; + "application/json": components["schemas"]["GetCommentResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - /** Create a private message. */ - post: { + /** Edit a comment. */ + put: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["CreatePrivateMessage"]; + "application/json": components["schemas"]["EditCommentRequest"]; }; }; responses: { @@ -2224,27 +2266,22 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PrivateMessageResponse"]; + "application/json": components["schemas"]["GetCommentResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/private_message/mark_as_read": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Mark a private message as read. */ + /** Create a comment. */ post: { parameters: { query?: never; @@ -2252,9 +2289,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["MarkPrivateMessageAsRead"]; + "application/json": components["schemas"]["CreateCommentRequest"]; }; }; responses: { @@ -2264,7 +2301,26 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PrivateMessageResponse"]; + "application/json": components["schemas"]["GetCommentResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + /** @description Too Many Requests */ + 429: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; }; }; }; @@ -2275,7 +2331,7 @@ export interface paths { patch?: never; trace?: never; }; - "/private_message/delete": { + "/api/alpha/comment/delete": { parameters: { query?: never; header?: never; @@ -2284,7 +2340,7 @@ export interface paths { }; get?: never; put?: never; - /** Delete a private message. */ + /** Delete a comment. */ post: { parameters: { query?: never; @@ -2292,9 +2348,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["DeletePrivateMessage"]; + "application/json": components["schemas"]["DeleteCommentRequest"]; }; }; responses: { @@ -2304,9 +2360,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PrivateMessageResponse"]; + "application/json": components["schemas"]["GetCommentResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -2315,24 +2381,28 @@ export interface paths { patch?: never; trace?: never; }; - "/user": { + "/api/alpha/comment/report": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get the details for a person. */ - get: { + get?: never; + put?: never; + /** Report a comment. */ + post: { parameters: { - query?: { - GetPersonDetails?: components["schemas"]["GetPersonDetails"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["ReportCommentRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -2340,46 +2410,49 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["GetPersonDetailsResponse"]; + "application/json": components["schemas"]["GetCommentReportResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/user/replies": { + "/api/alpha/comment/remove": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get comment replies. */ - get: { + get?: never; + put?: never; + /** Remove a comment as a moderator. */ + post: { parameters: { - query?: { - GetReplies?: components["schemas"]["GetReplies"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["RemoveCommentRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -2387,46 +2460,49 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["GetRepliesResponse"]; + "application/json": components["schemas"]["GetCommentResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/user/mentions": { + "/api/alpha/comment/mark_as_read": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get mentions of your account made in comments. */ - get: { + get?: never; + put?: never; + /** Mark a comment reply as read. */ + post: { parameters: { - query?: { - GetReplies?: components["schemas"]["GetReplies"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["MarkCommentAsReadRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -2434,29 +2510,28 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["GetRepliesResponse"]; + "application/json": components["schemas"]["GetCommentReplyResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/user/block": { + "/api/alpha/comment/lock": { parameters: { query?: never; header?: never; @@ -2465,7 +2540,7 @@ export interface paths { }; get?: never; put?: never; - /** Block a person. */ + /** Lock a comment chain as a moderator. */ post: { parameters: { query?: never; @@ -2473,9 +2548,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["BlockPerson"]; + "application/json": components["schemas"]["LockCommentRequest"]; }; }; responses: { @@ -2485,18 +2560,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BlockPersonResponse"]; + "application/json": components["schemas"]["GetCommentResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -2505,28 +2581,26 @@ export interface paths { patch?: never; trace?: never; }; - "/user/login": { + "/api/alpha/comment/like/list": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - put?: never; - /** Log into PieFed. */ - post: { + /** View comment votes as a moderator. */ + get: { parameters: { - query?: never; + query: { + comment_id: number; + page?: number; + limit?: number; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["Login"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { @@ -2534,54 +2608,54 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["LoginResponse"]; + "application/json": components["schemas"]["ListCommentLikesResponse"]; }; }; - /** @description BAD REQUEST */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["ErrorResponseLogin"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/user/mark_all_as_read": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; put?: never; - /** Mark all replies as read. */ - post: operations["markAllAsRead"]; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/user/unread_count": { + "/api/alpha/post/list": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get your unread counts */ + /** List posts. */ get: { parameters: { - query?: never; + query?: { + q?: string; + sort?: "Hot" | "Top" | "TopHour" | "TopSixHour" | "TopTwelveHour" | "TopWeek" | "TopDay" | "TopMonth" | "TopThreeMonths" | "TopSixMonths" | "TopNineMonths" | "TopYear" | "TopAll" | "New" | "Scaled" | "Active"; + type_?: "All" | "Local" | "Subscribed" | "Popular" | "Moderating" | "ModeratorView"; + community_name?: string; + community_id?: number; + saved_only?: boolean; + person_id?: number; + limit?: number; + page?: number; + page_cursor?: number; + liked_only?: boolean; + feed_id?: number; + topic_id?: number; + }; header?: never; path?: never; cookie?: never; @@ -2594,18 +2668,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["GetUnreadCountResponse"]; + "application/json": components["schemas"]["ListPostsResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; put?: never; @@ -2616,15 +2691,47 @@ export interface paths { patch?: never; trace?: never; }; - "/user/subscribe": { + "/api/alpha/post": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - /** Subscribe to activities from another user */ + /** Get/fetch a post */ + get: { + parameters: { + query: { + id: number; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["GetPostResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + }; + }; + /** Edit a post. */ put: { parameters: { query?: never; @@ -2632,9 +2739,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["SubscribePerson"]; + "application/json": components["schemas"]["EditPostRequest"]; }; }; responses: { @@ -2644,37 +2751,22 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PersonResponse"]; + "application/json": components["schemas"]["GetPostResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/user/set_flair": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Set your flair for a community */ + /** Create a new post. */ post: { parameters: { query?: never; @@ -2682,9 +2774,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["SetPersonFlair"]; + "application/json": components["schemas"]["CreatePostRequest"]; }; }; responses: { @@ -2694,16 +2786,26 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["PersonResponse"]; + "application/json": components["schemas"]["GetPostResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + /** @description Too Many Requests */ + 429: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; }; }; }; @@ -2714,37 +2816,52 @@ export interface paths { patch?: never; trace?: never; }; - "/user/save_user_settings": { + "/api/alpha/post/replies": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - get?: never; - /** Save your user settings. */ - put: { + /** Get replies/comments for a post with nested structure. */ + get: { parameters: { - query?: never; + query?: { + post_id?: number; + parent_id?: number; + sort?: "Hot" | "Top" | "New" | "Old"; + max_depth?: number; + page?: string; + limit?: number; + }; header?: never; path?: never; cookie?: never; }; - requestBody?: { - content: { - "application/json": components["schemas"]["SaveUserSettings"]; - }; - }; + requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": components["schemas"]["GetPostRepliesResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + put?: never; post?: never; delete?: never; options?: never; @@ -2752,24 +2869,28 @@ export interface paths { patch?: never; trace?: never; }; - "/user/notifications": { + "/api/alpha/post/like": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get your user notifications */ - get: { + get?: never; + put?: never; + /** Like or unlike a post. */ + post: { parameters: { - query?: { - Status?: components["schemas"]["GetNotificationStatus"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["LikePostRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -2777,29 +2898,28 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["NotificationsResponse"]; + "application/json": components["schemas"]["GetPostResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/user/notification_state": { + "/api/alpha/post/save": { parameters: { query?: never; header?: never; @@ -2807,7 +2927,7 @@ export interface paths { cookie?: never; }; get?: never; - /** Set the read status of a given notification. */ + /** Save or unsave a post. */ put: { parameters: { query?: never; @@ -2815,9 +2935,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["EditNotificationState"]; + "application/json": components["schemas"]["SavePostRequest"]; }; }; responses: { @@ -2827,18 +2947,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["NotificationsReadStatusResponse"]; + "application/json": components["schemas"]["GetPostResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; post?: never; @@ -2848,22 +2969,27 @@ export interface paths { patch?: never; trace?: never; }; - "/user/notifications_count": { + "/api/alpha/post/subscribe": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get user unread notifications count. */ - get: { + get?: never; + /** Subscribe or unsubscribe to a post. */ + put: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["SubscribePostRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -2871,21 +2997,21 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["NotificationsCountResponse"]; + "application/json": components["schemas"]["GetPostResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; post?: never; delete?: never; options?: never; @@ -2893,7 +3019,7 @@ export interface paths { patch?: never; trace?: never; }; - "/user/mark_all_notifications_read": { + "/api/alpha/post/delete": { parameters: { query?: never; header?: never; @@ -2901,15 +3027,20 @@ export interface paths { cookie?: never; }; get?: never; - /** Set all unread user notifications to read. */ - put: { + put?: never; + /** Delete or restore a post. */ + post: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["DeletePostRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -2917,28 +3048,28 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["NotificationsMarkAllReadResponse"]; + "application/json": components["schemas"]["GetPostResponse"]; }; }; - /** @description Bad request */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/user/verify_credentials": { + "/api/alpha/post/report": { parameters: { query?: never; header?: never; @@ -2947,7 +3078,7 @@ export interface paths { }; get?: never; put?: never; - /** Verify username / password credentials */ + /** Report a post. */ post: { parameters: { query?: never; @@ -2955,9 +3086,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "application/json": components["schemas"]["Login"]; + "application/json": components["schemas"]["ReportPostRequest"]; }; }; responses: { @@ -2966,15 +3097,20 @@ export interface paths { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": components["schemas"]["PostReportResponse"]; + }; }; - /** @description BAD REQUEST */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; - content?: never; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -2983,24 +3119,28 @@ export interface paths { patch?: never; trace?: never; }; - "/feed/list": { + "/api/alpha/post/lock": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get list of feeds */ - get: { + get?: never; + put?: never; + /** Lock or unlock a post. */ + post: { parameters: { - query?: { - FeedList?: components["schemas"]["FeedList"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["LockPostRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -3008,7 +3148,7 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["FeedListResponse"]; + "application/json": components["schemas"]["GetPostResponse"]; }; }; /** @description Bad Request */ @@ -3017,37 +3157,40 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/topic/list": { + "/api/alpha/post/feature": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; - /** Get list of topics */ - get: { + get?: never; + put?: never; + /** Feature or unfeature a post. */ + post: { parameters: { - query?: { - TopicList?: components["schemas"]["TopicList"]; - }; + query?: never; header?: never; path?: never; cookie?: never; }; - requestBody?: never; + requestBody: { + content: { + "application/json": components["schemas"]["FeaturePostRequest"]; + }; + }; responses: { /** @description OK */ 200: { @@ -3055,7 +3198,7 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["TopicListResponse"]; + "application/json": components["schemas"]["GetPostResponse"]; }; }; /** @description Bad Request */ @@ -3064,20 +3207,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; - put?: never; - post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/upload/image": { + "/api/alpha/post/remove": { parameters: { query?: never; header?: never; @@ -3086,6 +3228,7 @@ export interface paths { }; get?: never; put?: never; + /** Remove or restore a post as a moderator. */ post: { parameters: { query?: never; @@ -3093,9 +3236,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "multipart/form-data": components["schemas"]["ImageUpload"]; + "application/json": components["schemas"]["RemovePostRequest"]; }; }; responses: { @@ -3105,27 +3248,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["UploadResponse"]; + "application/json": components["schemas"]["GetPostResponse"]; }; }; - /** @description The uploaded image was missing or invalid */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; - }; - }; - /** @description You are being rate limited */ - 429: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -3134,7 +3269,7 @@ export interface paths { patch?: never; trace?: never; }; - "/upload/community_image": { + "/api/alpha/post/mark_as_read": { parameters: { query?: never; header?: never; @@ -3143,6 +3278,7 @@ export interface paths { }; get?: never; put?: never; + /** Mark one or more posts as read or unread. */ post: { parameters: { query?: never; @@ -3150,9 +3286,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "multipart/form-data": components["schemas"]["ImageUpload"]; + "application/json": components["schemas"]["MarkPostAsReadRequest"]; }; }; responses: { @@ -3162,36 +3298,78 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["UploadResponse"]; + "application/json": components["schemas"]["SuccessResponse"]; }; }; - /** @description The uploaded image was missing or invalid */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; - /** @description You are being rate limited */ - 429: { + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + }; + }; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/post/like/list": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** View post votes as a moderator. */ + get: { + parameters: { + query: { + post_id: number; + page?: number; + limit?: number; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ListPostLikesResponse"]; + }; + }; + /** @description Bad Request */ + 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; + put?: never; + post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; - "/upload/user_image": { + "/api/alpha/post/assign_flair": { parameters: { query?: never; header?: never; @@ -3200,6 +3378,7 @@ export interface paths { }; get?: never; put?: never; + /** Add/remove flair from a post */ post: { parameters: { query?: never; @@ -3207,9 +3386,9 @@ export interface paths { path?: never; cookie?: never; }; - requestBody?: { + requestBody: { content: { - "multipart/form-data": components["schemas"]["ImageUpload"]; + "application/json": components["schemas"]["PostSetFlairRequest"]; }; }; responses: { @@ -3219,27 +3398,19 @@ export interface paths { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["UploadResponse"]; + "application/json": components["schemas"]["PostSetFlairResponse"]; }; }; - /** @description The uploaded image was missing or invalid */ + /** @description Bad Request */ 400: { headers: { [name: string]: unknown; }; content: { - "application/json": components["schemas"]["BadRequest"]; - }; - }; - /** @description You are being rate limited */ - 429: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BadRequest"]; + "application/json": components["schemas"]["DefaultError"]; }; }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; }; }; delete?: never; @@ -3248,2181 +3419,1775 @@ export interface paths { patch?: never; trace?: never; }; -} -export type webhooks = Record; -export interface components { - schemas: { - /** BlockInstance */ - BlockInstance: { - /** BlockInstance.instance_id */ - instance_id: number; - /** BlockInstance.block */ - block: boolean; - }; - /** InstanceChooserSearch */ - InstanceChooserSearch: { - /** InstanceChooserSearch.q */ - q?: string; - /** - * InstanceChooserSearch.nsfw - * @example no - */ - nsfw?: string; - /** - * InstanceChooserSearch.language - * @example en - */ - language?: string; - /** - * InstanceChooserSearch.newbie - * @example yes - */ - newbie?: string; - }; - /** Search */ - Search: { - /** Search.q */ - q: string; - /** Search.type_ */ - type_?: components["schemas"]["SearchType"]; - /** Search.sort */ - sort?: components["schemas"]["SortType"]; - /** Search.listing_type */ - listing_type?: components["schemas"]["ListingType"]; - /** Search.page */ - page?: number; - /** Search.limit */ - limit?: number; - }; - /** ResolveObject */ - ResolveObject: { - /** ResolveObject.q */ - q: string; - }; - /** GetCommunity */ - GetCommunity: { - /** GetCommunity.id */ - id?: number; - /** GetCommunity.name */ - name?: string; - }; - /** CreateCommunity */ - CreateCommunity: { - /** CreateCommunity.name */ - name: string; - /** CreateCommunity.title */ - title: string; - /** CreateCommunity.description */ - description?: string; - /** CreateCommunity.rules */ - rules?: string; - /** - * CreateCommunity.icon - * Format: url - */ - icon_url?: string; - /** - * CreateCommunity.banner - * Format: url - */ - banner_url?: string; - /** CreateCommunity.nsfw */ - nsfw?: boolean; - /** CreateCommunity.restricted_to_mods */ - restricted_to_mods?: boolean; - /** CreateCommunity.local_only */ - local_only?: boolean; - /** CreateCommunity.discussion_languages */ - discussion_languages?: number[]; - }; - /** CreateCommunity */ - EditCommunity: { - /** CreateCommunity.id */ - id: number; - /** CreateCommunity.title */ - title?: string; - /** CreateCommunity.description */ - description?: string; - /** CreateCommunity.rules */ - rules?: string; - /** - * CreateCommunity.icon - * Format: url - */ - icon_url?: string; - /** - * CreateCommunity.banner - * Format: url - */ - banner_url?: string; - /** CreateCommunity.nsfw */ - nsfw?: boolean; - /** CreateCommunity.restricted_to_mods */ - restricted_to_mods?: boolean; - /** CreateCommunity.local_only */ - local_only?: boolean; - /** CreateCommunity.discussion_languages */ - discussion_languages?: number[]; - }; - /** DeleteCommunity */ - DeleteCommunity: { - /** DeleteCommunity.community_id */ - community_id: number; - /** DeleteCommunity.deleted */ - deleted: boolean; - }; - /** AddModToCommunity */ - AddModToCommunity: { - /** AddModToCommunity.community_id */ - community_id: number; - /** AddModToCommunity.person_id */ - person_id: number; - /** AddModToCommunity.added */ - added: boolean; - }; - /** ListCommunities */ - ListCommunities: { - /** ListCommunities.type_ */ - type_?: components["schemas"]["ListingType"]; - /** ListCommunities.sort */ - sort?: components["schemas"]["CommunitySortType"]; - /** ListCommunities.show_nsfw */ - show_nsfw?: boolean; - /** ListCommunities.page */ - page?: number; - /** ListCommunities.limit */ - limit?: number; - }; - /** FollowCommunity */ - FollowCommunity: { - /** FollowCommunity.community_id */ - community_id: number; - /** FollowCommunity.follow */ - follow: boolean; - }; - /** BlockCommunity */ - BlockCommunity: { - /** BlockCommunity.community_id */ - community_id: number; - /** BlockCommunity.block */ - block: boolean; - }; - /** SubscribeCommunity */ - SubscribeCommunity: { - /** SubscribeCommunity.community_id */ - community_id: number; - /** SubscribeCommunity.subscribe */ - subscribe: boolean; - }; - /** GetCommunityModerationBansList */ - GetCommunityModerationBansList: { - /** - * GetCommunityModerationBansList.community_id - * @example 42 - */ - community_id?: number; - /** - * GetCommunityModerationBansList.page - * @example 1 - */ - page?: number; - }; - /** ModerateCommunityBan */ - ModerateCommunityBan: { - /** - * PostCommunityModerateBan.community_id - * @example 42 - */ - community_id: number; - /** - * PostCommunityModerateBan.user_id - * @example 1234 - */ - user_id: number; - /** - * PostCommunityModerateBan.reason - * @example Violation of Rule 1. - */ - reason: string; - /** - * PostCommunityModerateBan.expiredAt - * @example 2025-01-01T12:00:00 - */ - expiredAt: string; - }; - /** ModerateCommunityUnBan */ - ModerateCommunityUnBan: { - /** - * PutCommunityModerateUnBan.community_id - * @example 42 - */ - community_id: number; - /** - * PutCommunityModerateUnBan.user_id - * @example 1234 - */ - user_id: number; - }; - /** ModerateCommunityPostNsfw */ - ModerateCommunityPostNsfw: { - /** - * PostCommunityModeratePostNsfw.post_id - * @example 123456 - */ - post_id: number; - /** - * PostCommunityModeratePostNsfw.nsfw_status - * @example true - */ - nsfw_status: boolean; - }; - /** GetPosts */ - GetPosts: { - /** GetPosts.type_ */ - type_?: components["schemas"]["ListingType"]; - /** GetPosts.sort */ - sort?: components["schemas"]["SortType"]; - /** GetPosts.page_cursor */ - page_cursor?: number; - /** GetPosts.limit */ - limit?: number; - /** GetPosts.community_id */ - community_id?: number; - /** GetPosts.person_id */ - person_id?: number; - /** GetPosts.community_name */ - community_name?: string; - /** GetPosts.liked_only */ - liked_only?: boolean; - /** GetPosts.saved_only */ - saved_only?: boolean; - }; - /** GetPost */ - GetPost: { - /** GetPost.id */ - id?: number; - /** GetPost.comment_id */ - comment_id?: number; - }; - /** EditPost */ - EditPost: { - /** EditPost.post_id */ - post_id: number; - /** EditPost.title */ - title?: string; - /** - * EditPost.url - * Format: url - */ - url?: string; - /** EditPost.body */ - body?: string; - /** EditPost.nsfw */ - nsfw?: boolean; - /** EditPost.language_id */ - language_id?: number; - }; - /** CreatePost */ - CreatePost: { - /** CreatePost.title */ - title: string; - /** CreatePost.community_id */ - community_id: number; - /** - * CreatePost.url - * Format: url - */ - url?: string; - /** CreatePost.body */ - body?: string; - /** CreatePost.nsfw */ - nsfw?: boolean; - /** CreatePost.language_id */ - language_id?: number; - }; - /** CreatePostLike */ - CreatePostLike: { - /** CreatePostLike.post_id */ - post_id: number; - /** CreatePostLike.score */ - score: number; - }; - /** SavePost */ - SavePost: { - /** SavePost.post_id */ - post_id: number; - /** SavePost.save */ - save: boolean; - }; - /** SubscribePost */ - SubscribePost: { - /** SubscribePost.post_id */ - post_id: number; - /** SubscribePost.subscribe */ - subscribe: boolean; - }; - /** DeletePost */ - DeletePost: { - /** DeletePost.post_id */ - post_id: number; - /** DeletePost.deleted */ - deleted: boolean; - }; - /** CreatePostReport */ - CreatePostReport: { - /** CreatePostReport.post_id */ - post_id: number; - /** CreatePostReport.reason */ - reason: string; - }; - /** LockPost */ - LockPost: { - /** LockPost.post_id */ - post_id: number; - /** LockPost.locked */ - locked: boolean; - }; - /** FeaturePost */ - FeaturePost: { - /** FeaturePost.post_id */ - post_id: number; - /** FeaturePost.featured */ - featured: boolean; - /** FeaturePost.feature_type */ - feature_type: components["schemas"]["PostFeatureType"]; - }; - /** MarkPostAsRead */ - MarkPostAsRead: { - /** MarkPostAsRead.post_ids */ - post_ids?: number[]; - /** MarkPostAsRead.post.id */ - post_id?: number; - /** MarkPostAsRead.read */ - read: boolean; - }; - /** RemovePost */ - RemovePost: { - /** RemovePost.post_id */ - post_id: number; - /** RemovePost.removed */ - removed: boolean; - /** RemovePost.reason */ - reason?: string; - }; - /** CreateComment */ - CreateComment: { - /** CreateComment.content */ - body: string; - /** CreateComment.post_id */ - post_id: number; - /** CreateComment.parent_id */ - parent_id?: number; - /** CreateComment.language_id */ - language_id?: number; - }; - /** EditComment */ - EditComment: { - /** EditComment.comment_id */ - comment_id: number; - /** EditComment.content */ - body?: string; - /** EditComment.language_id */ - language_id?: number; - }; - /** GetComment */ - GetComment: { - /** GetComment.id */ - id: number; - }; - /** GetComments */ - GetComments: { - /** GetComments.type_ */ - type_?: components["schemas"]["ListingType"]; - /** GetComments.sort */ - sort?: components["schemas"]["CommentSortType"]; - /** GetComments.max_depth */ - max_depth?: number; - /** GetComments.page */ - page?: number; - /** GetComments.limit */ - limit?: number; - /** GetComments.community_id */ - community_id?: number; - /** GetComments.post_id */ - post_id?: number; - /** GetComments.parent_id */ - parent_id?: number; - /** GetComments.person_id */ - person_id?: number; - /** GetComments.liked_only */ - liked_only?: boolean; - /** GetComments.saved_only */ - saved_only?: boolean; - }; - /** DeleteComment */ - DeleteComment: { - /** DeleteComment.comment_id */ - comment_id: number; - /** DeleteComment.deleted */ - deleted: boolean; - }; - /** MarkReplyAsRead */ - MarkReplyAsRead: { - /** MarkReplyAsRead.comment_reply_id */ - comment_reply_id: number; - read: boolean; - }; - /** RemoveComment */ - RemoveComment: { - /** RemoveComment.comment_id */ - comment_id: number; - /** RemoveComment.removed */ - removed: boolean; - /** RemoveComment.reason */ - reason?: string; - }; - /** CreateCommentLike */ - CreateCommentLike: { - /** CreateCommentLike.comment_id */ - comment_id: number; - /** CreateCommentLike.score */ - score: number; - }; - /** SaveComment */ - SaveComment: { - /** SaveComment.comment_id */ - comment_id: number; - /** SaveComment.save */ - save: boolean; - }; - /** SubscribeComment */ - SubscribeComment: { - /** SubscribeComment.comment_id */ - comment_id: number; - /** SubscribeComment.subscribe */ - subscribe: boolean; - }; - /** CreateCommentReport */ - CreateCommentReport: { - /** CreateCommentReport.comment_id */ - comment_id: number; - /** CreateCommentReport.reason */ - reason: string; - }; - /** GetPrivateMessages */ - GetPrivateMessages: { - /** GetPrivateMessages.unread_only */ - unread_only?: boolean; - /** GetPrivateMessages.page */ - page?: number; - /** GetPrivateMessages.limit */ - limit?: number; - }; - /** GetPrivateMessagesConversation */ - GetPrivateMessagesConversation: { - /** GetPrivateMessagesConversation.page */ - page?: number; - /** GetPrivateMessagesConversation.limit */ - limit?: number; - /** GetPrivateMessagesConversation.person_id */ - person_id: number; - }; - /** CreatePrivateMessage */ - CreatePrivateMessage: { - /** CreatePrivateMessage.content */ - content: string; - /** CreatePrivateMessage.recipient_id */ - recipient_id: number; - }; - /** EditPrivateMessage */ - EditPrivateMessage: { - /** EditPrivateMessage.private_message_id */ - private_message_id: number; - /** EditPrivateMessage.content */ - content: string; - }; - /** MarkPrivateMessageAsRead */ - MarkPrivateMessageAsRead: { - /** MarkPrivateMessageAsRead.private_message_id */ - private_message_id: number; - /** MarkPrivateMessageAsRead.read */ - read: boolean; - }; - /** DeletePrivateMessage */ - DeletePrivateMessage: { - /** DeletePrivateMessage.private_message_id */ - private_message_id: number; - /** DeletePrivateMessage.deleted */ - deleted: boolean; - }; - /** GetPersonDetails */ - GetPersonDetails: { - /** GetPersonDetails.person_id */ - person_id?: number; - /** GetPersonDetails.username */ - username?: string; - /** GetPersonDetails.sort */ - sort?: components["schemas"]["SortType"]; - /** GetPersonDetails.page */ - page?: number; - /** GetPersonDetails.limit */ - limit?: number; - /** GetPersonDetails.community_id */ - community_id?: number; - /** GetPersonDetails.saved_only */ - saved_only?: boolean; - /** GetPersonDetails.include_content */ - include_content?: boolean; - }; - /** GetReplies */ - GetReplies: { - /** GetReplies.sort */ - sort?: components["schemas"]["CommentSortType"]; - /** GetReplies.page */ - page?: number; - /** GetReplies.limit */ - limit?: number; - /** GetReplies.unread_only */ - unread_only?: boolean; - }; - /** BlockPerson */ - BlockPerson: { - /** BlockPerson.person_id */ - person_id: number; - /** BlockPerson.block */ - block: boolean; - }; - /** Login */ - Login: { - /** Login.username */ - username: string; - /** Login.password */ - password: string; - }; - /** GetUnreadCountResponse */ - GetUnreadCountResponse: { - /** GetUnreadCountResponse.replies */ - replies: number; - /** GetUnreadCountResponse.mentions */ - mentions: number; - /** GetUnreadCountResponse.private_messages */ - private_messages: number; - }; - /** SubscribePerson */ - SubscribePerson: { - /** SubscribePerson.person_id */ - person_id: number; - /** SubscribePerson.subscribe */ - subscribe: boolean; - }; - /** SetPersonFlair */ - SetPersonFlair: { - /** SetPersonFlair.community_id */ - community_id: number; - /** SetPersonFlair.flair_text */ - flair_text: string; - }; - /** SaveUserSettings */ - SaveUserSettings: { - /** SaveUserSettings.show_nsfw */ - show_nsfw?: boolean; - /** SaveUserSettings.show_read_posts */ - show_read_posts?: boolean; - /** SaveUserSettings.bio */ - bio?: string; - }; - /** GetNotificationStatus */ - GetNotificationStatus: { - /** GetNotificationStatus.status */ - status: components["schemas"]["NotificationStatusType"]; - /** - * GetNotificationStatus.page - * @default 1 - */ - page: number; - }; - /** EditNotificationState */ - EditNotificationState: { - /** GetNotificationStatus.notif_id */ - notif_id?: number; - /** GetNotificationStatus.read_state */ - read_state?: boolean; - }; - /** FeedList */ - FeedList: { - /** - * FeedList.include_communities - * @description include list of communities in each feed with result - */ - include_communities?: boolean; - /** - * FeedList.mine_only - * @description only return feeds created by the authorized user - */ - mine_only?: boolean; - }; - /** TopicList */ - TopicList: { - /** - * TopicList.include_communities - * @description include list of communities in each topic with result - */ - include_communities?: boolean; - }; - ImageUpload: { - /** Format: binary */ - file: string; - }; - /** SuccessResponse */ - SuccessResponse: { - success: boolean; - }; - BadRequest: { - /** @example An error occurred */ - error: string; - }; - /** GetSiteResponse */ - GetSiteResponse: { - /** GetSiteResponse.my_user */ - my_user?: components["schemas"]["MyUserInfo"]; - /** GetSiteResponse.site */ - site: components["schemas"]["Site"]; - /** GetSiteResponse.version */ - version: string; - /** GetSiteResponse.admins */ - admins: components["schemas"]["PersonView"][]; - }; - /** GetSiteVersionResponse */ - GetSiteVersionResponse: { - /** GetSiteVersionResponse.version */ - version: string; - }; - /** BlockInstanceResponse */ - BlockInstanceResponse: { - /** BlockInstanceResponse.blocked */ - blocked: boolean; - }; - GetSiteInstanceChooserResponse: { - language: components["schemas"]["LanguageView"]; - /** GetSiteInstanceChooserResponse.nsfw */ - nsfw: boolean; - /** GetSiteInstanceChooserResponse.newbie_friendly */ - newbie_friendly: boolean; - /** GetSiteInstanceChooserResponse.name */ - name: string; - /** GetSiteInstanceChooserResponse.elevator_pitch */ - elevator_pitch: string; - /** GetSiteInstanceChooserResponse.description */ - description: string; - /** GetSiteInstanceChooserResponse.about */ - about: string; - /** GetSiteInstanceChooserResponse.sidebar */ - sidebar: string; - /** GetSiteInstanceChooserResponse.logo_url */ - logo_url: string; - /** GetSiteInstanceChooserResponse.majority */ - maturity: string; - /** GetSiteInstanceChooserResponse.tos_url */ - tos_url: string; - /** GetSiteInstanceChooserResponse.mau */ - mau: number; - /** GetSiteInstanceChooserResponse.can_make_communities */ - can_make_communities: boolean; - /** GetSiteInstanceChooserResponse.defederation */ - defederation: string[]; - /** GetSiteInstanceChooserResponse.trusts */ - trusts: string[]; - /** GetSiteInstanceChooserResponse.registration_mode */ - registration_mode: string; - }; - GetSiteInstanceChooserSearchResponse: { - result: components["schemas"]["GetSiteInstanceChooserSearchResponseItem"][]; - }; - /** SearchResponse */ - SearchResponse: { - /** SearchResponse.type_ */ - type_: components["schemas"]["SearchType"]; - /** SearchResponse.posts */ - posts: components["schemas"]["PostView"][]; - /** SearchResponse.communities */ - communities: components["schemas"]["CommunityView"][]; - /** SearchResponse.users */ - users: components["schemas"]["PersonView"][]; - }; - /** ResolveObjectResponse */ - ResolveObjectResponse: { - /** ResolveObjectResponse.comment */ - comment?: components["schemas"]["CommentView"]; - /** ResolveObjectResponse.post */ - post?: components["schemas"]["PostView"]; - /** ResolveObjectResponse.community */ - community?: components["schemas"]["CommunityView"]; - /** ResolveObjectResponse.person */ - person?: components["schemas"]["PersonView"]; - }; - /** GetFederatedInstancesResponse */ - GetFederatedInstancesResponse: { - /** GetFederatedInstancesResponse.federated_instances */ - federated_instances?: components["schemas"]["FederatedInstancesView"]; - }; - /** GetCommunityResponse */ - GetCommunityResponse: { - /** GetCommunityResponse.community_view */ - community_view: components["schemas"]["CommunityView"]; - /** GetCommunityResponse.site */ - site?: components["schemas"]["Site"]; - /** GetCommunityResponse.moderators */ - moderators: components["schemas"]["CommunityModeratorView"][]; - /** GetCommunityResponse.discussion_languages */ - discussion_languages: number[]; - }; - /** CommunityResponse */ - CommunityResponse: { - /** CommunityResponse.community_view */ - community_view: components["schemas"]["CommunityView"]; - /** CommunityResponse.discussion_languages */ - discussion_languages: number[]; - }; - /** ListCommunitiesResponse */ - ListCommunitiesResponse: { - /** ListCommunitiesResponse.communities */ - communities: components["schemas"]["CommunityView"][]; + "/api/alpha/upload/image": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - /** BlockCommunityResponse */ - BlockCommunityResponse: { - /** BlockCommunityResponse.community_view */ - community_view: components["schemas"]["CommunityView"]; - /** BlockCommunityResponse.blocked */ - blocked: boolean; + get?: never; + put?: never; + /** Upload a general image. */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "multipart/form-data": components["schemas"]["ImageUploadRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ImageUploadResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + /** @description Too Many Requests */ + 429: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + }; }; - /** AddModToCommunityResponse */ - AddModToCommunityResponse: { - /** AddModToCommunityResponse.moderators */ - moderators: components["schemas"]["CommunityModeratorView"][]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/upload/community_image": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - /** ModerationCommunityBansListResponse */ - ModerationCommunityBansListResponse: { - /** GetCommunityModerationBansListResponse.items */ - items?: components["schemas"]["CommunityModerationBanItem"][]; - /** - * GetCommunityModerationBansListResponse.next_page - * @example 3 - */ - next_page?: string; - }; - /** ModerateCommunityBanResponse */ - ModerateCommunityBanResponse: components["schemas"]["CommunityModerationBanItem"]; - /** ModerateCommunityUnBanResponse */ - ModerateCommunityUnBanResponse: components["schemas"]["CommunityModerationBanItem"]; - /** ModerateCommunityPostNsfwResponse */ - ModerateCommunityPostNsfwResponse: components["schemas"]["PostView"]; - /** GetPostsResponse */ - GetPostsResponse: { - /** GetPostsResponse.posts */ - posts: components["schemas"]["PostView"][]; + get?: never; + put?: never; + /** Upload a community image. */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "multipart/form-data": components["schemas"]["ImageUploadRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ImageUploadResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + /** @description Too Many Requests */ + 429: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + }; }; - /** GetPostResponse */ - GetPostResponse: { - /** GetPostResponse.post_view */ - post_view: components["schemas"]["PostView"]; - /** GetPostResponse.community_view */ - community_view: components["schemas"]["CommunityView"]; - /** GetPostResponse.moderators */ - moderators: components["schemas"]["CommunityModeratorView"][]; - /** GetPostResponse.cross_posts */ - cross_posts: components["schemas"]["PostView"][]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/upload/user_image": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - /** PostResponse */ - PostResponse: { - /** PostResponse.post_view */ - post_view: components["schemas"]["PostView"]; + get?: never; + put?: never; + /** Upload a user image. */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "multipart/form-data": components["schemas"]["ImageUploadRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ImageUploadResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + /** @description Too Many Requests */ + 429: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + }; }; - /** PostReportResponse */ - PostReportResponse: { - /** PostReportResponse.post_report_view */ - post_report_view: components["schemas"]["PostReportView"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/private_message/list": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - /** CommentResponse */ - CommentResponse: { - /** CommentResponse.comment_view */ - comment_view: components["schemas"]["CommentView"]; + /** List private messages. */ + get: { + parameters: { + query?: { + page?: number; + limit?: number; + unread_only?: boolean; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ListPrivateMessagesResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + }; }; - /** GetCommentsResponse */ - GetCommentsResponse: { - /** GetCommentsResponse.comments */ - comments: components["schemas"]["CommentView"][]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/private_message/conversation": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - /** CommentReportResponse */ - CommentReportResponse: { - /** CommentReportResponse.comment_report_view */ - comment_report_view: components["schemas"]["CommentReportView"]; + /** Get conversation with a specific person. */ + get: { + parameters: { + query: { + person_id: number; + page?: number; + limit?: number; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["GetPrivateMessageConversationResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + }; }; - /** PrivateMessagesResponse */ - PrivateMessagesResponse: { - /** PrivateMessagesResponse.private_messages */ - private_messages: components["schemas"]["PrivateMessageView"][]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/private_message": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - /** PrivateMessageResponse */ - PrivateMessageResponse: { - /** PrivateMessageResponse.private_message_view */ - private_message_view: components["schemas"]["PrivateMessageView"]; + get?: never; + /** Edit a private message. */ + put: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["EditPrivateMessageRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PrivateMessageResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + }; }; - /** GetPersonDetailsResponse */ - GetPersonDetailsResponse: { - /** GetPersonDetailsResponse.person_view */ - person_view: components["schemas"]["PersonView"]; - /** GetPersonDetailsResponse.site */ - site?: components["schemas"]["Site"]; - /** GetPersonDetailsResponse.comments */ - comments: components["schemas"]["CommentView"][]; - /** GetPersonDetailsResponse.posts */ - posts: components["schemas"]["PostView"][]; - /** GetPersonDetailsResponse.moderates */ - moderates: components["schemas"]["CommunityModeratorView"][]; + /** Create a new private message. */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["CreatePrivateMessageRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PrivateMessageResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + /** @description Too Many Requests */ + 429: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + }; }; - /** GetRepliesResponse */ - GetRepliesResponse: { - /** GetRepliesResponse.replies */ - replies: components["schemas"]["CommentReplyView"][]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/private_message/mark_as_read": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - /** PersonResponse */ - PersonResponse: { - /** PersonResponse.person_view */ - person_view: components["schemas"]["PersonView"]; + get?: never; + put?: never; + /** Mark a private message as read or unread. */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["MarkPrivateMessageAsReadRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PrivateMessageResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + }; }; - /** BlockPersonResponse */ - BlockPersonResponse: { - /** BlockPersonResponse.person_view */ - person_view: components["schemas"]["PersonView"]; - /** BlockPersonResponse.blocked */ - blocked: boolean; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/private_message/delete": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - /** LoginResponse */ - LoginResponse: { - /** LoginResponse.jwt */ - jwt?: string; - }; - ErrorResponseLogin: { - /** @example incorrect_login */ - error?: string; - }; - /** NotificationsResponse */ - NotificationsResponse: { - /** NotificationsResponse.counts */ - counts: components["schemas"]["NotificationsCountsView"]; - /** NotificationsResponse.items */ - items: (components["schemas"]["NotificationsItemUserView"] | components["schemas"]["NotificationsItemCommunityView"] | components["schemas"]["NotificationsItemTopicView"] | components["schemas"]["NotificationsItemPostView"] | components["schemas"]["NotificationsItemReplyView"] | components["schemas"]["NotificationsItemFeedView"] | components["schemas"]["NotificationsItemPostMentionView"] | components["schemas"]["NotificationsItemCommentMentionView"])[]; - /** - * NotificationsResponse.status - * @example New - */ - status: string; - /** - * NotificationsResponse.user - * @example MyPieFedUserName - */ - user: string; + get?: never; + put?: never; + /** Delete or restore a private message. */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["DeletePrivateMessageRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PrivateMessageResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + }; }; - /** NotificationsReadStatusResponse */ - NotificationsReadStatusResponse: components["schemas"]["NotificationsItemUserView"] | components["schemas"]["NotificationsItemCommunityView"] | components["schemas"]["NotificationsItemTopicView"] | components["schemas"]["NotificationsItemPostView"] | components["schemas"]["NotificationsItemReplyView"] | components["schemas"]["NotificationsItemFeedView"] | components["schemas"]["NotificationsItemPostMentionView"] | components["schemas"]["NotificationsItemCommentMentionView"]; - /** NotificationsCountResponse */ - NotificationsCountResponse: { - /** - * NotificationsCountResponse.count - * @example 42 - */ - count?: number; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/api/alpha/private_message/report": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; }; - /** NotificationsMarkAllReadResponse */ - NotificationsMarkAllReadResponse: { - /** - * NotificationsMarkAllReadResponse.mark_all_notifications_as_read - * @example complete - */ - mark_all_notifications_as_read?: string; + get?: never; + put?: never; + /** Report a private message. */ + post: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ReportPrivateMessageRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PrivateMessageResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["DefaultError"]; + }; + }; + 422: components["responses"]["UNPROCESSABLE_CONTENT"]; + }; }; - FeedListResponse: { - feeds: components["schemas"]["FeedView"][]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +} +export type webhooks = Record; +export interface components { + schemas: { + Error: { + /** @description Error code */ + code?: number; + /** @description Error name */ + status?: string; + /** @description Error message */ + message?: string; + /** @description Errors */ + errors?: { + [key: string]: unknown; + }; + }; + PaginationMetadata: { + total?: number; + total_pages?: number; + first_page?: number; + last_page?: number; + page?: number; + previous_page?: number; + next_page?: number; }; - TopicListResponse: { - /** TopicListResponse.topics */ - topics: components["schemas"]["TopicView"][]; + DefaultError: { + message?: string; }; - UploadResponse: { - /** - * Format: url - * @example https://preferred.social/static/media/image.png - */ - url: string; + PersonAggregates: { + comment_count: number; + person_id: number; + post_count: number; }; - /** Site */ - Site: { - /** - * Site.actor_id - * Format: url - * @example https://piefed.social/ - */ + Person: { + /** @example https://piefed.social/u/rimu */ actor_id: string; - /** Site.all_languages */ - all_languages?: components["schemas"]["LanguageView"][]; - /** Site.description */ - description?: string; - /** Site.enable_downvotes */ - enable_downvotes?: boolean; - /** - * Site.icon - * Format: url - */ - icon?: string; - /** Site.name */ - name: string; - /** Site.registration_mode */ - registration_mode?: components["schemas"]["RegistrationMode"]; - /** Site.sidebar */ - sidebar?: string; - /** Site.user_count */ - user_count?: number; - }; - /** Instance */ - Instance: { - /** Instance.id */ + banned: boolean; + bot: boolean; + deleted: boolean; id: number; - /** Instance.domain */ - domain: string; - /** - * Instance.published - * Format: date-time - */ - published: string; + instance_id: number; + local: boolean; + user_name: string; + /** Format: markdown */ + about?: string; + /** Format: html */ + about_html?: string; + /** Format: url */ + avatar?: string | null; + /** Format: url */ + banner?: string | null; + flair?: string; /** - * Instance.updated - * Format: date-time + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ - updated?: string; - /** Instance.software */ - software?: string; - /** Instance.version */ - version?: string; + published?: string; + title?: string | null; }; - /** InstanceWithoutFederationState */ - InstanceWithoutFederationState: { - /** InstanceWithoutFederationState.id */ - id: number; - /** InstanceWithoutFederationState.domain */ - domain: string; - /** InstanceWithoutFederationState.published */ - published: string; - /** InstanceWithoutFederationState.updated */ - updated?: string; - /** InstanceWithoutFederationState.software */ - software?: string; - /** InstanceWithoutFederationState.version */ - version?: string; + PersonView: { + activity_alert: boolean; + counts: components["schemas"]["PersonAggregates"]; + is_admin: boolean; + person: components["schemas"]["Person"]; }; - /** Community */ - Community: { + LanguageView: { + /** @example en */ + code?: string; + /** @example 2 */ + id?: number; + /** @example English */ + name?: string; + }; + Site: { /** - * Community.actor_id * Format: url + * @example https://piefed.social */ actor_id: string; - /** Community.ap_domain */ - ap_domain?: string; - /** Community.banned */ - banned?: boolean; + name: string; + all_languages?: components["schemas"]["LanguageView"][]; + description?: string; + enable_downvotes?: boolean; + /** Format: url */ + icon?: string | null; + /** @enum {string} */ + registration_mode?: "Closed" | "RequireApplication" | "Open"; + /** Format: html */ + sidebar?: string; + /** Format: markdown */ + sidebar_md?: string; + user_count?: number; + }; + Community: { /** - * Community.banner * Format: url + * @example https://piefed.social/c/piefed_meta */ - banner?: string; - /** Community.deleted */ + actor_id: string; + /** @example piefed.social */ + ap_domain?: string; deleted: boolean; - /** Community.description */ - description?: string; - /** Community.hidden */ hidden: boolean; - /** - * Community.icon - * Format: url - */ - icon?: string; - /** Community.id */ id: number; - /** Community.instance_id */ instance_id: number; - /** Community.local */ local: boolean; - /** Community.name */ name: string; - /** Community.nsfw */ nsfw: boolean; - /** Community.posting_warning */ - posting_warning?: string; /** - * Community.published - * Format: date-time + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ published: string; - /** Community.removed */ removed: boolean; - /** Community.restricted_to_mods */ restricted_to_mods: boolean; - /** Community.title */ - title: string; - /** - * Community.updated - * Format: date-time - */ - updated?: string; - }; - /** Post */ - Post: { - /** Post.id */ - id: number; - /** Post.title */ title: string; + banned?: boolean; + /** Format: url */ + banner?: string | null; + /** Format: markdown */ + description?: string; + /** Format: url */ + icon?: string | null; + posting_warning?: string | null; /** - * Post.url - * Format: url - */ - url?: string; - /** Post.body */ - body?: string; - /** Post.user_id */ - user_id: number; - /** Post.community_id */ - community_id: number; - /** Post.removed */ - removed: boolean; - /** Post.locked */ - locked: boolean; - /** - * Post.published - * Format: date-time - */ - published: string; - /** - * Post.updated - * Format: date-time - */ - updated?: string; - /** Post.deleted */ - deleted: boolean; - /** Post.nsfw */ - nsfw: boolean; - /** - * Post.thumbnail_url - * Format: url - */ - thumbnail_url?: string; - /** - * Post.small_thumbnail_url - * Format: url - */ - small_thumbnail_url?: string; - /** - * Post.ap_id - * Format: url - */ - ap_id: string; - /** Post.local */ - local: boolean; - /** Post.language_id */ - language_id: number; - /** Post.sticky */ - sticky: boolean; - /** Post.alt_text */ - alt_text?: string; - }; - /** PostReport */ - PostReport: { - /** PostReport.id */ - id: number; - /** PostReport.creator_id */ - creator_id: number; - /** PostReport.post_id */ - post_id: number; - /** PostReport.original_post_name */ - original_post_name: string; - /** PostReport.original_post_url */ - original_post_url?: string; - /** PostReport.original_post_body */ - original_post_body?: string; - /** PostReport.reason */ - reason: string; - /** PostReport.resolved */ - resolved: boolean; - /** PostReport.resolver_id */ - resolver_id?: number; - /** - * PostReport.published - * Format: date-time - */ - published: string; - /** - * PostReport.updated - * Format: date-time - */ - updated?: string; - }; - /** Comment */ - Comment: { - /** Comment.id */ - id: number; - /** Comment.user_id */ - user_id: number; - /** Comment.post_id */ - post_id: number; - /** Comment.body */ - body: string; - /** Comment.removed */ - removed: boolean; - /** - * Comment.published - * Format: date-time - */ - published: string; - /** - * Comment.updated - * Format: date-time + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ updated?: string; - /** Comment.deleted */ - deleted: boolean; - /** - * Comment.ap_id - * Format: url - */ - ap_id: string; - /** Comment.local */ - local: boolean; - /** Comment.path */ - path: string; - /** Comment.distinguished */ - distinguished?: boolean; - /** Comment.language_id */ - language_id: number; }; - /** CommentReply */ - CommentReply: { - /** CommentReply.id */ - id: number; - /** CommentReply.recipient_id */ - recipient_id: number; - /** CommentReply.comment_id */ - comment_id: number; - /** CommentReply.read */ - read: boolean; - /** - * CommentReply.published - * Format: date-time - */ - published: string; + CommunityBlockView: { + community?: components["schemas"]["Community"]; + person?: components["schemas"]["Person"]; }; - /** CommentReport */ - CommentReport: { - /** CommentReport.id */ - id: number; - /** CommentReport.creator_id */ - creator_id: number; - /** CommentReport.comment_id */ - comment_id: number; - /** CommentReport.original_comment_text */ - original_comment_text: string; - /** CommentReport.reason */ - reason: string; - /** CommentReport.resolved */ - resolved: boolean; - /** CommentReport.resolver_id */ - resolver_id?: number; - /** - * CommentReport.published - * Format: date-time - */ - published: string; - /** - * CommentReport.updated - * Format: date-time - */ - updated?: string; + CommunityFollowerView: { + community: components["schemas"]["Community"]; + follower: components["schemas"]["Person"]; }; - /** PrivateMessage */ - PrivateMessage: { - /** PrivateMessage.id */ + Instance: { + /** @example piefed.social */ + domain: string; id: number; - /** PrivateMessage.creator_id */ - creator_id: number; - /** PrivateMessage.recipient_id */ - recipient_id: number; - /** PrivateMessage.content */ - content: string; - /** PrivateMessage.deleted */ - deleted: boolean; - /** PrivateMessage.read */ - read: boolean; /** - * PrivateMessage.published - * Format: date-time + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ published: string; + software?: string; /** - * PrivateMessage.updated - * Format: date-time + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ updated?: string; - /** - * PrivateMessage.ap_id - * Format: url - */ - ap_id: string; - /** PrivateMessage.local */ - local: boolean; + version?: string; }; - /** Person */ - Person: { - /** - * Person.actor_id - * Format: url - */ - actor_id: string; - /** - * Person.avatar - * Format: url - */ - avatar?: string; - /** Person.banned */ - banned: boolean; - /** - * Person.banner - * Format: url - */ - banner?: string; - /** Person.about */ - about?: string; - /** Person.bot */ - bot: boolean; - /** Person.deleted */ - deleted: boolean; - /** Person.flair */ - flair?: string; - /** Person.id */ - id: number; - /** Person.instance_id */ - instance_id: number; - /** Person.local */ - local: boolean; - /** - * Person.published - * Format: date-time - */ - published: string; - /** Person.title */ - title?: string; - /** Person.user_name */ - user_name: string; + InstanceBlockView: { + instance: components["schemas"]["Instance"]; + person: components["schemas"]["Person"]; }; - /** LocalUser */ LocalUser: { - /** LocalUser.default_listing_type */ - default_listing_type: components["schemas"]["ListingType"]; - /** LocalUser.default_sort_type */ - default_sort_type: components["schemas"]["SortType"]; - /** LocalUser.show_bot_accounts */ + /** @enum {string} */ + default_comment_sort_type: "Hot" | "Top" | "New" | "Old"; + /** @enum {string} */ + default_listing_type: "All" | "Local" | "Subscribed" | "Popular" | "Moderating" | "ModeratorView"; + /** @enum {string} */ + default_sort_type?: "Active" | "Hot" | "New" | "Top" | "TopHour" | "TopSixHour" | "TopTwelveHour" | "TopDay" | "TopWeek" | "TopMonth" | "TopThreeMonths" | "TopSixMonths" | "TopNineMonths" | "TopYear" | "TopAll" | "Scaled" | "Old"; show_bot_accounts: boolean; - /** LocalUser.show_nsfw */ + show_nsfl: boolean; show_nsfw: boolean; - /** LocalUser.show_read_posts */ show_read_posts: boolean; - /** LocalUser.show_scores */ show_scores: boolean; }; - /** MyUserInfo */ + LocalUserView: { + counts: components["schemas"]["PersonAggregates"]; + local_user: components["schemas"]["LocalUser"]; + person: components["schemas"]["Person"]; + }; + CommunityModeratorView: { + community: components["schemas"]["Community"]; + moderator: components["schemas"]["Person"]; + }; + PersonBlockView: { + person: components["schemas"]["Person"]; + target: components["schemas"]["Person"]; + }; MyUserInfo: { - /** MyUserInfo.community_blocks */ community_blocks: components["schemas"]["CommunityBlockView"][]; - /** MyUserInfo.discussion_languages */ discussion_languages: components["schemas"]["LanguageView"][]; - /** MyUserInfo.follows */ follows: components["schemas"]["CommunityFollowerView"][]; - /** MyUserInfo.instance_blocks */ instance_blocks: components["schemas"]["InstanceBlockView"][]; - /** MyUserInfo.local_user_view */ local_user_view: components["schemas"]["LocalUserView"]; - /** MyUserInfo.moderates */ moderates: components["schemas"]["CommunityModeratorView"][]; - /** MyUserInfo.person_blocks */ person_blocks: components["schemas"]["PersonBlockView"][]; }; + GetSiteResponse: { + admins: components["schemas"]["PersonView"][]; + site: components["schemas"]["Site"]; + /** Software version */ + version: string; + my_user?: components["schemas"]["MyUserInfo"]; + }; + GetSiteVersionResponse: { + version: string; + }; + BlockInstanceRequest: { + block: boolean; + instance_id: number; + }; + BlockInstanceResponse: { + blocked: boolean; + }; + GetSiteInstanceChooserResponse: { + language: components["schemas"]["LanguageView"]; + nsfw: boolean; + newbie_friendly: boolean; + name: string; + elevator_pitch: string; + description: string; + about: string; + sidebar: string; + logo_url: string; + maturity: string; + tos_url: string; + mau: number; + can_make_communities: boolean; + defederation: string[]; + trusts: string[]; + registration_mode: string; + }; GetSiteInstanceChooserSearchResponseItem: { - /** GetSiteInstanceChooserSearchResponseItem.id */ id: number; - /** GetSiteInstanceChooserSearchResponseItem.name */ name: string; - /** GetSiteInstanceChooserSearchResponseItem.domain */ domain: string; - /** GetSiteInstanceChooserSearchResponseItem.elevator_pitch */ elevator_pitch: string; - /** GetSiteInstanceChooserSearchResponseItem.description */ description: string; - /** GetSiteInstanceChooserSearchResponseItem.about */ about: string; - /** GetSiteInstanceChooserSearchResponseItem.sidebar */ sidebar: string; - /** GetSiteInstanceChooserSearchResponseItem.logo_url */ logo_url: string; - /** GetSiteInstanceChooserSearchResponseItem.maturity */ maturity: string; - /** GetSiteInstanceChooserSearchResponseItem.tos_url */ tos_url: string; - /** GetSiteInstanceChooserSearchResponseItem.uptime */ uptime: string; - /** GetSiteInstanceChooserSearchResponseItem.mau */ mau: number; - /** GetSiteInstanceChooserSearchResponseItem.can_make_communities */ can_make_communities: boolean; - /** GetSiteInstanceChooserSearchResponseItem.newbie_friendly */ newbie_friendly: boolean; - /** GetSiteInstanceChooserSearchResponseItem.defederation */ defederation: string[]; - /** GetSiteInstanceChooserSearchResponseItem.trusts */ trusts: string[]; - /** GetSiteInstanceChooserSearchResponseItem.registration_mode */ registration_mode: string; - /** GetSiteInstanceChooserSearchResponseItem.language */ language: string; - /** GetSiteInstanceChooserSearchResponseItem.monthsmonitored */ monthsmonitored: number; }; - /** FederatedInstancesView */ - FederatedInstancesView: { - /** FederatedInstances.linked */ - linked: components["schemas"]["InstanceWithoutFederationState"][]; - /** FederatedInstances.allowed */ - allowed: components["schemas"]["InstanceWithoutFederationState"][]; - /** FederatedInstances.blocked */ - blocked: components["schemas"]["InstanceWithoutFederationState"][]; + GetSiteInstanceChooserSearchResponse: { + result: components["schemas"]["GetSiteInstanceChooserSearchResponseItem"][]; + }; + CommunityAggregates: { + id: number; + post_count: number; + post_reply_count: number; + published: string; + subscriptions_count: number; + total_subscriptions_count: number; + active_daily?: number; + active_weekly?: number; + active_monthly?: number; + active_6monthly?: number; + }; + CommunityFlair: { + id: number; + community_id: number; + flair_title: string; + /** + * @description Hex color code for the text of the flair + * @example #000000 + */ + text_color: string; + /** + * @description Hex color code for the background of the flair + * @example #DEDDDA + */ + background_color: string; + blur_images: boolean; + /** + * Format: url + * @description Legacy tags that existed prior to 1.2 and some tags for remote communities might not have a defined ap_id + */ + ap_id: string | null; + }; + CommunityView: { + activity_alert: boolean; + blocked: boolean; + community: components["schemas"]["Community"]; + counts: components["schemas"]["CommunityAggregates"]; + /** @enum {string} */ + subscribed: "Subscribed" | "NotSubscribed" | "Pending"; + flair_list?: components["schemas"]["CommunityFlair"][]; + }; + PostAggregates: { + comments: number; + downvotes: number; + /** + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z + */ + newest_comment_time: string; + post_id: number; + /** + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z + */ + published: string; + score: number; + upvotes: number; + cross_posts: number; }; - /** CommunityBlockView */ - CommunityBlockView: { - /** CommunityBlockView.community */ - community: components["schemas"]["Community"]; - /** CommunityBlockView.person */ - person: components["schemas"]["Person"]; + WidthHeight: { + width?: number; + height?: number; }; - /** CommunityFollowerView */ - CommunityFollowerView: { - /** CommunityFollowerView.community */ - community: components["schemas"]["Community"]; - /** CommunityFollowerView.follower */ - follower: components["schemas"]["Person"]; + MiniCrossPosts: { + post_id?: number; + reply_count?: number; + community_name?: string; }; - /** LanguageView */ - LanguageView: { - /** - * Language.code - * @example en - */ - code?: string; + Post: { + /** Format: url */ + ap_id: string; + community_id: number; + deleted: boolean; + id: number; + language_id: number; + local: boolean; + locked: boolean; + nsfw: boolean; /** - * Language.id - * @example 2 + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ - id?: number; + published: string; + removed: boolean; + sticky: boolean; + title: string; + user_id: number; + alt_text?: string; + /** Format: markdown */ + body?: string; + /** Format: url */ + small_thumbnail_url?: string; + /** Format: url */ + thumbnail_url?: string; /** - * Language.name - * @example English + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ - name?: string; - }; - /** InstanceBlockView */ - InstanceBlockView: { - /** InstanceBlockView.person */ - person: components["schemas"]["Person"]; - /** InstanceBlockView.instance */ - instance: components["schemas"]["Instance"]; - /** InstanceBlockView.site */ - site?: components["schemas"]["Site"]; - }; - /** LocalUserView */ - LocalUserView: { - /** LocalUserView.counts */ - counts: components["schemas"]["PersonAggregates"]; - /** LocalUserView.local_user */ - local_user: components["schemas"]["LocalUser"]; - /** LocalUserView.person */ - person: components["schemas"]["Person"]; + updated?: string; + /** Format: url */ + url?: string; + image_details?: components["schemas"]["WidthHeight"]; + cross_posts?: components["schemas"]["MiniCrossPosts"][]; }; - /** CommunityModeratorView */ - CommunityModeratorView: { - /** CommunityModeratorView.community */ + PostView: { + banned_from_community: boolean; community: components["schemas"]["Community"]; - /** CommunityModeratorView.moderator */ - moderator: components["schemas"]["Person"]; - }; - /** PersonBlockView */ - PersonBlockView: { - /** PersonBlockView.person */ - person: components["schemas"]["Person"]; - /** PersonBlockView.target */ - target: components["schemas"]["Person"]; - }; - /** PersonView */ - PersonView: { - /** PersonView.person */ - person: components["schemas"]["Person"]; - /** PersonView.counts */ - counts: components["schemas"]["PersonAggregates"]; - /** PersonView.is_admin */ - is_admin: boolean; - /** PersonView.activity_alert */ - activity_alert: boolean; - }; - /** CommentView */ - CommentView: { - /** CommentView.comment */ - comment: components["schemas"]["Comment"]; - /** CommentView.creator */ + counts: components["schemas"]["PostAggregates"]; creator: components["schemas"]["Person"]; - /** CommentView.post */ - post: components["schemas"]["Post"]; - /** CommentView.community */ - community: components["schemas"]["Community"]; - /** CommentView.counts */ - counts: components["schemas"]["CommentAggregates"]; - /** CommentView.creator_banned_from_community */ creator_banned_from_community: boolean; - /** CommentView.banned_from_community */ - banned_from_community: boolean; - /** CommentView.creator_is_moderator */ - creator_is_moderator: boolean; - /** CommentView.creator_is_admin */ creator_is_admin: boolean; - /** CommentView.subscribed */ - subscribed: components["schemas"]["SubscribedType"]; - /** CommentView.saved */ - saved: boolean; - /** CommentView.activity_alert */ - activity_alert: boolean; - /** CommentView.creator_blocked */ - creator_blocked: boolean; - /** CommentView.my_vote */ - my_vote?: number; - }; - /** PostView */ - PostView: { - /** PostView.post */ - post: components["schemas"]["Post"]; - /** PostView.creator */ - creator: components["schemas"]["Person"]; - /** PostView.community */ - community: components["schemas"]["Community"]; - /** PostView.creator_banned_from_community */ - creator_banned_from_community: boolean; - /** PostView.banned_from_community */ - banned_from_community: boolean; - /** PostView.creator_is_moderator */ creator_is_moderator: boolean; - /** PostView.creator_is_admin */ - creator_is_admin: boolean; - /** PostView.counts */ - counts: components["schemas"]["PostAggregates"]; - /** PostView.subscribed */ - subscribed: components["schemas"]["SubscribedType"]; - /** PostView.saved */ + hidden: boolean; + post: components["schemas"]["Post"]; + read: boolean; saved: boolean; - /** PostView.activity_alert */ + /** @enum {string} */ + subscribed: "Subscribed" | "NotSubscribed" | "Pending"; + unread_comments: number; activity_alert?: boolean; - /** PostView.read */ - read: boolean; - /** PostView.hidden */ - hidden: boolean; - /** PostView.my_vote */ my_vote?: number; - /** PostView.unread_comments */ - unread_comments: number; + flair_list?: components["schemas"]["CommunityFlair"][]; }; - /** CommunityView */ - CommunityView: { - /** CommunityView.community */ - community: components["schemas"]["Community"]; - /** CommunityView.subscribed */ - subscribed: components["schemas"]["SubscribedType"]; - /** CommunityView.blocked */ - blocked: boolean; - /** CommunityView.counts */ - counts: components["schemas"]["CommunityAggregates"]; - /** CommunityView.activity_alert */ - activity_alert: boolean; + Comment: { + /** Format: url */ + ap_id: string; + /** Format: markdown */ + body: string; + deleted: boolean; + id: number; + language_id: number; + local: boolean; + path: string; + post_id: number; + /** + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z + */ + published: string; + removed: boolean; + user_id: number; + distinguished?: boolean; + /** + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z + */ + updated?: string; + locked?: boolean; }; - /** PostReportView */ - PostReportView: { - /** PostReportView.post_report */ - post_report: components["schemas"]["PostReport"]; - /** PostReportView.post */ - post: components["schemas"]["Post"]; - /** PostReportView.community */ - community: components["schemas"]["Community"]; - /** PostReportView.creator */ - creator: components["schemas"]["Person"]; - /** PostReportView.post_creator */ - post_creator: components["schemas"]["Person"]; - /** PostReportView.creator_banned_from_community */ - creator_banned_from_community: boolean; - /** PostReportView.creator_is_moderator */ - creator_is_moderator: boolean; - /** PostReportView.creator_is_admin */ - creator_is_admin: boolean; - /** PostReportView.subscribed */ - subscribed: components["schemas"]["SubscribedType"]; - /** PostReportView.saved */ - saved: boolean; - /** PostReportView.creator_blocked */ - creator_blocked: boolean; - /** PostReportView.my_vote */ - my_vote?: number; - /** PostReportView.counts */ - counts: components["schemas"]["PostAggregates"]; - /** PostReportView.resolver */ - resolver?: components["schemas"]["Person"]; + CommentAggregates: { + child_count: number; + comment_id: number; + downvotes: number; + /** + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z + */ + published: string; + score: number; + upvotes: number; }; - /** CommentReportView */ - CommentReportView: { - /** CommentReportView.comment_report */ - comment_report: components["schemas"]["CommentReport"]; - /** CommentReportView.comment */ + CommentView: { + activity_alert: boolean; + banned_from_community: boolean; comment: components["schemas"]["Comment"]; - /** CommentReportView.post */ - post: components["schemas"]["Post"]; - /** CommentReportView.community */ community: components["schemas"]["Community"]; - /** CommentReportView.creator */ - creator: components["schemas"]["Person"]; - /** CommentReportView.comment_creator */ - comment_creator: components["schemas"]["Person"]; - /** CommentReportView.counts */ counts: components["schemas"]["CommentAggregates"]; - /** CommentReportView.creator_banned_from_community */ - creator_banned_from_community: boolean; - /** CommentReportView.creator_is_moderator */ - creator_is_moderator: boolean; - /** CommentReportView.creator_is_admin */ - creator_is_admin: boolean; - /** CommentReportView.creator_blocked */ - creator_blocked: boolean; - /** CommentReportView.subscribed */ - subscribed: components["schemas"]["SubscribedType"]; - /** CommentReportView.saved */ - saved: boolean; - /** CommentReportView.my_vote */ - my_vote?: number; - /** CommentReportView.resolver */ - resolver?: components["schemas"]["Person"]; - }; - /** CommentReplyView */ - CommentReplyView: { - /** CommentReplyView.comment_reply */ - comment_reply: components["schemas"]["CommentReply"]; - /** CommentReplyView.comment */ - comment: components["schemas"]["Comment"]; - /** CommentReplyView.creator */ creator: components["schemas"]["Person"]; - /** CommentReplyView.post */ - post: components["schemas"]["Post"]; - /** CommentReplyView.community */ - community: components["schemas"]["Community"]; - /** CommentReplyView.recipient */ - recipient: components["schemas"]["Person"]; - /** CommentReplyView.counts */ - counts: components["schemas"]["CommentAggregates"]; - /** CommentReplyView.creator_banned_from_community */ creator_banned_from_community: boolean; - /** CommentReplyView.creator_is_moderator */ - creator_is_moderator: boolean; - /** CommentReplyView.creator_is_admin */ + creator_blocked: boolean; creator_is_admin: boolean; - /** CommentReplyView.subscribed */ - subscribed: components["schemas"]["SubscribedType"]; - /** CommentReplyView.saved */ + creator_is_moderator: boolean; + post: components["schemas"]["Post"]; saved: boolean; - /** CommentReplyView.creator_blocked */ - creator_blocked: boolean; - /** CommentReplyView.my_vote */ + subscribed: string; my_vote?: number; + can_auth_user_moderate?: boolean; }; - /** CommentReplyResponse */ - CommentReplyResponse: { - /** CommentResponse.comment_reply_view */ - comment_reply_view: components["schemas"]["CommentReplyView"]; + SearchResponse: { + /** @enum {string} */ + type_: "Communities" | "Posts" | "Users" | "Url"; + communities: components["schemas"]["CommunityView"][]; + posts: components["schemas"]["PostView"][]; + users: components["schemas"]["PersonView"][]; + comments: components["schemas"]["CommentView"][]; + }; + ResolveObjectResponse: { + comment?: components["schemas"]["CommentView"]; + post?: components["schemas"]["PostView"]; + community?: components["schemas"]["CommunityView"]; + person?: components["schemas"]["PersonView"]; + }; + InstanceWithoutFederationState: { + domain: string; + id: number; + /** + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z + */ + published: string; + software?: string; + /** + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z + */ + updated?: string; + version?: string; + }; + FederatedInstancesView: { + allowed: components["schemas"]["InstanceWithoutFederationState"][]; + blocked: components["schemas"]["InstanceWithoutFederationState"][]; + linked: components["schemas"]["InstanceWithoutFederationState"][]; + }; + GetFederatedInstancesResponse: { + federated_instances?: components["schemas"]["FederatedInstancesView"]; + }; + GetCommunityResponse: { + community_view: components["schemas"]["CommunityView"]; + discussion_languages: number[]; + moderators: components["schemas"]["CommunityModeratorView"][]; + site?: components["schemas"]["Site"]; + }; + ListCommunitiesResponse: { + communities: components["schemas"]["CommunityView"][]; + next_page?: string | null; + }; + FollowCommunityRequest: { + community_id: number; + follow: boolean; + }; + CommunityResponse: { + community_view: components["schemas"]["CommunityView"]; + discussion_languages: number[]; + }; + BlockCommunityRequest: { + block: boolean; + community_id: number; + }; + BlockCommunityResponse: { + community_view: components["schemas"]["CommunityView"]; + blocked: boolean; + }; + CreateCommunityRequest: { + name: string; + title: string; + /** Format: url */ + banner_url?: string | null; + /** Format: markdown */ + description?: string; + discussion_languages?: number[]; + /** Format: url */ + icon_url?: string | null; + local_only?: boolean; + nsfw?: boolean; + restricted_to_mods?: boolean; + rules?: string; + }; + EditCommunityRequest: { + community_id: number; + title: string; + /** Format: url */ + banner_url?: string | null; + /** Format: markdown */ + description?: string; + discussion_languages?: number[]; + /** Format: url */ + icon_url?: string | null; + local_only?: boolean; + nsfw?: boolean; + restricted_to_mods?: boolean; + rules?: string; + }; + SubscribeCommunityRequest: { + community_id: number; + subscribe: boolean; + }; + DeleteCommunityRequest: { + community_id: number; + deleted: boolean; + }; + ModCommunityRequest: { + added: boolean; + community_id: number; + person_id: number; }; - /** PrivateMessageView */ - PrivateMessageView: { - /** PrivateMessageView.private_message */ - private_message: components["schemas"]["PrivateMessage"]; - /** PrivateMessageView.creator */ - creator: components["schemas"]["Person"]; - /** PrivateMessageView.recipient */ - recipient: components["schemas"]["Person"]; + ModCommunityResponse: { + moderators: components["schemas"]["CommunityModeratorView"][]; }; - /** CommunityModerationBanItem */ CommunityModerationBanItem: { + banned_by?: components["schemas"]["Person"]; + banned_user?: components["schemas"]["Person"]; + community?: components["schemas"]["Community"]; + expired?: boolean; /** - * CommunityModerationBanItem.reason - * @example Violation of Rule 4 - */ - reason: string; - /** - * CommunityModerationBanItem.expiredAt - * @example 2042-01-01T12:00:00 - */ - expiredAt: string; - /** CommunityModerationBanItem.community */ - community: components["schemas"]["Community"]; - /** CommunityModerationBanItem.bannedUser */ - bannedUser: components["schemas"]["Person"]; - /** CommunityModerationBanItem.bannedBy */ - bannedBy: components["schemas"]["Person"]; - /** - * CommunityModerationBanItem.expired - * @example false - */ - expired: boolean; - }; - /** NotificationsCountsView */ - NotificationsCountsView: { - /** NotificationsCountsView.new_notifications */ - new_notifications: number; - /** NotificationsCountsView.read_notifications */ - read_notifications: number; - /** NotificationsCountsView.total_notifications */ - total_notifications?: number; - }; - /** NotificationsItemUserView */ - NotificationsItemUserView: { - /** - * NotificationsItemUserView.notif_id - * @example 1234 - */ - notif_id?: number; - /** - * NotificationsItemUserView.notif_type - * @example 0 - */ - notif_type?: number; - /** - * NotificationsItemUserView.notif_subtype - * @example new_post_from_followed_user - */ - notif_subtype?: string; - /** NotificationsItemUserView.author */ - author?: components["schemas"]["Person"]; - /** NotificationsItemUserView.post */ - post?: components["schemas"]["PostView"]; - /** - * NotificationsItemUserView.post_id - * @example 1234 + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z, null=permanent ban */ - post_id?: number; + expired_at?: string | null; /** - * NotificationsItemUserView.notif_body - * @example This is the body of a post. + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z, null=permanent ban */ - notif_body?: string; + expires_at?: string | null; + reason?: string; }; - /** NotificationsItemCommunityView */ - NotificationsItemCommunityView: { - /** - * NotificationsItemCommunityView.notif_id - * @example 1234 - */ - notif_id?: number; - /** - * NotificationsItemCommunityView.notif_type - * @example 1 - */ - notif_type?: number; - /** - * NotificationsItemCommunityView.notif_subtype - * @example new_post_in_followed_community - */ - notif_subtype?: string; - /** NotificationsItemCommunityView.author */ - author?: components["schemas"]["Person"]; - /** NotificationsItemCommunityView.post */ - post?: components["schemas"]["PostView"]; - /** - * NotificationsItemCommunityView.post_id - * @example 1234 - */ - post_id?: number; - /** NotificationsItemCommunityView.community */ - community?: components["schemas"]["CommunityView"]; - /** - * NotificationsItemCommunityView.notif_body - * @example This is the body of a post. - */ - notif_body?: string; + CommunityModerationBansListResponse: { + items?: components["schemas"]["CommunityModerationBanItem"][]; + next_page?: string | null; }; - /** NotificationsItemTopicView */ - NotificationsItemTopicView: { - /** - * NotificationsItemTopicView.notif_id - * @example 1234 - */ - notif_id?: number; - /** - * NotificationsItemTopicView.notif_type - * @example 2 - */ - notif_type?: number; - /** - * NotificationsItemTopicView.notif_subtype - * @example new_post_in_followed_topic - */ - notif_subtype?: string; - /** NotificationsItemTopicView.author */ - author?: components["schemas"]["Person"]; - /** NotificationsItemTopicView.post */ - post?: components["schemas"]["PostView"]; - /** - * NotificationsItemTopicView.post_id - * @example 1234 - */ - post_id?: number; - /** - * NotificationsItemTopicView.notif_body - * @example This is the body of a post. - */ - notif_body?: string; + CommunityModerationUnbanRequest: { + community_id: number; + user_id: number; }; - /** NotificationsItemPostView */ - NotificationsItemPostView: { - /** - * NotificationsItemPostView.notif_id - * @example 1234 - */ - notif_id?: number; - /** - * NotificationsItemPostView.notif_type - * @example 3 - */ - notif_type?: number; - /** - * NotificationsItemPostView.notif_subtype - * @example top_level_comment_on_followed_post - */ - notif_subtype?: string; - /** NotificationsItemPostView.author */ - author?: components["schemas"]["Person"]; - /** NotificationsItemPostView.post */ - post?: components["schemas"]["PostView"]; - /** - * NotificationsItemPostView.post_id - * @example 1234 - */ - post_id?: number; - /** NotificationsItemPostView.comment */ - comment?: components["schemas"]["Comment"]; - /** - * NotificationsItemPostView.comment_id - * @example 1234 - */ - comment_id?: number; + CommunityModerationBanRequest: { + community_id: number; + reason: string; + user_id: number; /** - * NotificationsItemPostView.notif_body - * @example This is the body of a comment. + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ - notif_body?: string; + expires_at?: string; + permanent?: boolean; }; - /** NotificationsItemReplyView */ - NotificationsItemReplyView: { - /** - * NotificationsItemReplyView.notif_id - * @example 1234 - */ - notif_id?: number; - /** - * NotificationsItemReplyView.notif_type - * @example 4 - */ - notif_type?: number; - /** - * NotificationsItemReplyView.notif_subtype - * @example new_reply_on_followed_comment - */ - notif_subtype?: string; - /** NotificationsItemReplyView.author */ - author?: components["schemas"]["Person"]; - /** NotificationsItemReplyView.post */ - post?: components["schemas"]["PostView"]; - /** - * NotificationsItemReplyView.post_id - * @example 1234 - */ - post_id?: number; - /** NotificationsItemReplyView.comment */ - comment?: components["schemas"]["Comment"]; - /** - * NotificationsItemReplyView.comment_id - * @example 1234 - */ - comment_id?: number; - /** - * NotificationsItemReplyView.notif_body - * @example This is the body of a comment. - */ - notif_body?: string; + CommunityModerationNsfwRequest: { + post_id: number; + nsfw_status: boolean; }; - /** NotificationsItemFeedView */ - NotificationsItemFeedView: { - /** - * NotificationsItemFeedView.notif_id - * @example 1234 - */ - notif_id?: number; - /** - * NotificationsItemFeedView.notif_type - * @example 5 - */ - notif_type?: number; - /** - * NotificationsItemFeedView.notif_subtype - * @example new_post_in_followed_feed - */ - notif_subtype?: string; - /** NotificationsItemFeedView.author */ - author?: components["schemas"]["Person"]; - /** NotificationsItemFeedView.post */ - post?: components["schemas"]["PostView"]; + CommunityFlairCreateRequest: { + community_id: number; + flair_title: string; /** - * NotificationsItemFeedView.post_id - * @example 1234 + * @description Hex color code for the text of the flair. + * @default #000000 + * @example #000 or #000000 */ - post_id?: number; + text_color: string; /** - * NotificationsItemFeedView.notif_body - * @example This is the body of a post. + * @description Hex color code for the background of the flair. + * @default #DEDDDA + * @example #fff or #FFFFFF */ - notif_body?: string; + background_color: string; + /** @default false */ + blur_images: boolean; }; - /** NotificationsItemPostMentionView */ - NotificationsItemPostMentionView: { - /** - * NotificationsItemPostMentionView.notif_id - * @example 1234 - */ - notif_id?: number; - /** - * NotificationsItemPostMentionView.notif_type - * @example 6 - */ - notif_type?: number; + CommunityFlairCreateResponse: { + id: number; + community_id: number; + flair_title: string; /** - * NotificationsItemPostMentionView.notif_subtype - * @example post_mention + * @description Hex color code for the text of the flair + * @example #000000 */ - notif_subtype?: string; - /** NotificationsItemPostMentionView.author */ - author?: components["schemas"]["Person"]; - /** NotificationsItemPostMentionView.post */ - post?: components["schemas"]["PostView"]; + text_color: string; /** - * NotificationsItemPostMentionView.post_id - * @example 1234 + * @description Hex color code for the background of the flair + * @example #DEDDDA */ - post_id?: number; + background_color: string; + blur_images: boolean; /** - * NotificationsItemPostMentionView.notif_body - * @example This is the body of a post. + * Format: url + * @description Legacy tags that existed prior to 1.2 and some tags for remote communities might not have a defined ap_id */ - notif_body?: string; + ap_id: string | null; }; - /** NotificationsItemCommentMentionView */ - NotificationsItemCommentMentionView: { + CommunityFlairEditRequest: { + flair_id: number; + flair_title?: string; /** - * NotificationsItemCommentMentionView.notif_id - * @example 1234 + * @description Hex color code for the text of the flair. + * @example #000 or #000000 */ - notif_id?: number; + text_color?: string; /** - * NotificationsItemCommentMentionView.notif_type - * @example 6 + * @description Hex color code for the background of the flair. + * @example #fff or #FFFFFF */ - notif_type?: number; + background_color?: string; + blur_images?: boolean; + }; + CommunityFlairEditResponse: { + id: number; + community_id: number; + flair_title: string; /** - * NotificationsItemCommentMentionView.notif_subtype - * @example comment_mention + * @description Hex color code for the text of the flair + * @example #000000 */ - notif_subtype?: string; - /** NotificationsItemCommentMentionView.author */ - author?: components["schemas"]["Person"]; - /** NotificationsItemCommentMentionView.comment */ - comment?: components["schemas"]["Comment"]; + text_color: string; /** - * NotificationsItemCommentMentionView.comment_id - * @example 1234 + * @description Hex color code for the background of the flair + * @example #DEDDDA */ - comment_id?: number; + background_color: string; + blur_images: boolean; /** - * NotificationsItemCommentMentionView.notif_body - * @example This is the body of a comment. + * Format: url + * @description Legacy tags that existed prior to 1.2 and some tags for remote communities might not have a defined ap_id */ - notif_body?: string; + ap_id: string | null; + }; + CommunityFlairDeleteRequest: { + flair_id: number; + }; + CommunityFlairDeleteResponse: { + community_view: components["schemas"]["CommunityView"]; + discussion_languages: number[]; + moderators: components["schemas"]["CommunityModeratorView"][]; + site?: components["schemas"]["Site"]; }; FeedView: { - /** - * FeedView.actor_id - * Format: url - */ + /** Format: url */ actor_id: string; - /** FeedView.ap_domain */ ap_domain: string; - /** FeedView.children */ children: components["schemas"]["FeedView"][]; - /** FeedView.communities */ communities: components["schemas"]["Community"][]; - /** FeedView.communities_count */ communities_count: number; - /** FeedView.id */ id: number; - /** FeedView.is_instance_feed */ is_instance_feed: boolean; - /** FeedView.local */ local: boolean; - /** FeedView.name */ name: string; - /** FeedView.nsfl */ nsfl: boolean; - /** FeedView.nsfw */ nsfw: boolean; - /** - * FeedView.owner - * @description Is the authorized user the creator of the feed? - */ + /** @description Is the authorized user the creator of the feed? */ owner: boolean; - /** FeedView.public */ public: boolean; /** - * FeedView.published * Format: datetime * @example 2025-06-07T02:29:07.980084Z */ published: string; - /** FeedView.show_posts_from_children */ show_posts_from_children: boolean; - /** FeedView.subscribed */ subscribed: boolean; - /** FeedView.subscriptions_count */ subscriptions_count: number; - /** FeedView.title */ title: string; /** - * FeedView.updated * Format: datetime * @example 2025-06-07T02:29:07.980084Z */ updated: string; + /** @description user_id of the feed creator/owner */ + user_id: number; + /** Format: url */ + banner?: string | null; + /** Format: markdown */ + description?: string | null; + /** Format: html */ + description_html?: string | null; + /** Format: url */ + icon?: string | null; + parent_feed_id?: number | null; + }; + FeedListResponse: { + feeds: components["schemas"]["FeedView"][]; + }; + TopicView: { + children: components["schemas"]["TopicView"][]; + communities: components["schemas"]["Community"][]; + communities_count: number; + id: number; + name: string; + show_posts_from_children: boolean; + title: string; + parent_topic_id?: number | null; + }; + TopicListResponse: { + topics: components["schemas"]["TopicView"][]; + }; + GetUserResponse: { + comments: components["schemas"]["CommentView"][]; + moderates: components["schemas"]["CommunityModeratorView"][]; + person_view: components["schemas"]["PersonView"]; + posts: components["schemas"]["PostView"][]; + site?: components["schemas"]["Site"]; + }; + UserLoginRequest: { + username: string; + password: string; + }; + UserLoginResponse: { + jwt: string; + }; + UserUnreadCountsResponse: { + /** @description Post and comment mentions */ + mentions: number; + private_messages: number; + /** @description Replies to posts and comments */ + replies: number; + /** @description Any other type of notification (reports, activity alerts, etc.) */ + other: number; + }; + CommentReply: { + id: number; + comment_id: number; /** - * FeedView.user_id - * @description user_id of the feed creator/owner + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ - user_id: number; + published: string; + read: boolean; + recipient_id: number; + }; + CommentReplyView: { + activity_alert: boolean; + comment: components["schemas"]["Comment"]; + comment_reply: components["schemas"]["CommentReply"]; + community: components["schemas"]["Community"]; + counts: components["schemas"]["CommentAggregates"]; + creator: components["schemas"]["Person"]; + creator_banned_from_community: boolean; + creator_blocked: boolean; + creator_is_admin: boolean; + creator_is_moderator: boolean; + my_vote: number; + post: components["schemas"]["Post"]; + recipient: components["schemas"]["Person"]; + saved: boolean; + /** @enum {string} */ + subscribed: "Subscribed" | "NotSubscribed" | "Pending"; + }; + UserRepliesResponse: { + next_page?: string | null; + replies: components["schemas"]["CommentReplyView"][]; + }; + UserMentionsResponse: { + next_page?: string | null; + replies: components["schemas"]["CommentReplyView"][]; + }; + UserBlockRequest: { + block: boolean; + person_id: number; + }; + UserBlockResponse: { + blocked: boolean; + person_view: components["schemas"]["PersonView"]; + }; + UserMarkAllReadResponse: { + /** @description Should be empty list */ + replies: components["schemas"]["CommentReplyView"][]; + }; + UserSubscribeRequest: { + person_id: number; + subscribe: boolean; + }; + UserSubscribeResponse: { + person_view: components["schemas"]["PersonView"]; + subscribed: boolean; + }; + UserSaveSettingsRequest: { + /** + * Format: url + * @description Pass a null value to remove the image + */ + avatar?: string | null; + /** Format: markdown */ + bio?: string; /** - * FeedView.banner * Format: url + * @description Pass a null value to remove the image + */ + cover?: string | null; + /** @enum {string} */ + default_comment_sort_type?: "Hot" | "Top" | "New" | "Old"; + /** @enum {string} */ + default_sort_type?: "Hot" | "Top" | "New" | "Active" | "Old" | "Scaled"; + show_nsfw?: boolean; + show_nsfl?: boolean; + show_read_posts?: boolean; + }; + UserSaveSettingsResponse: { + my_user?: components["schemas"]["MyUserInfo"]; + }; + UserNotificationsCounts: { + unread: number; + read: number; + total: number; + }; + UserNotificationItemView: { + /** @description returned for all notif types */ + author: components["schemas"]["Person"]; + /** @description returned for all notif types */ + notif_body: string; + /** @description returned for all notif types */ + notif_id: number; + /** @description returned for all notif types */ + notif_subtype: string; + /** @description returned for all notif types */ + notif_type: number; + /** + * @description returned for all notif types + * @enum {string} + */ + status: "Unread" | "Read"; + /** @description returned for notif_types: 3, 4, 6 (comment_mention subtype) */ + comment?: components["schemas"]["Comment"]; + /** @description returned for notif_types: 3, 4, 6 (comment_mention subtype) */ + comment_id?: number; + /** @description returned for notif_type 1 */ + community?: components["schemas"]["Community"]; + /** @description returned for notif_types: 0, 1, 2, 3, 4, 5, 6 (post_mention subtype) */ + post?: components["schemas"]["PostView"]; + /** @description returned for notif_types: 0, 1, 2, 3, 4, 5, 6 (post_mention subtype) */ + post_id?: number; + }; + UserNotificationsResponse: { + counts: components["schemas"]["UserNotificationsCounts"]; + items: components["schemas"]["UserNotificationItemView"][]; + /** @enum {string} */ + status: "All" | "Unread" | "Read"; + username: string; + next_page?: string | null; + }; + UserNotificationStateRequest: { + notif_id: number; + /** @description true sets notification as read, false marks it unread */ + read_state: boolean; + }; + UserNotificationsCountResponse: { + count: number; + }; + UserMarkAllNotifsReadResponse: { + /** @example complete */ + mark_all_notifications_as_read: string; + }; + UserSetFlairRequest: { + community_id: number; + /** @description Either omit or set to null to remove existing flair */ + flair_text?: string | null; + }; + UserSetFlairResponse: { + person_view?: components["schemas"]["PersonView"]; + }; + ListCommentsResponse: { + comments: components["schemas"]["CommentView"][]; + next_page?: string | null; + }; + LikeCommentRequest: { + comment_id: number; + /** + * @description -1 to downvote, 1 to upvote, 0 to revert previous vote + * @example 1 + */ + score: number; + /** + * @description private votes are not federated to other instances + * @default false + */ + private: boolean; + }; + GetCommentResponse: { + comment_view: components["schemas"]["CommentView"]; + }; + SaveCommentRequest: { + comment_id: number; + save: boolean; + }; + SubscribeCommentRequest: { + comment_id: number; + subscribe: boolean; + }; + CreateCommentRequest: { + body: string; + post_id: number; + parent_id?: number; + language_id?: number; + }; + EditCommentRequest: { + body: string; + comment_id: number; + language_id?: number; + /** + * @description Visibly mark reply as from a moderator in the web UI + * @default false */ - banner?: string; + distinguished: boolean; + }; + DeleteCommentRequest: { + comment_id: number; + deleted: boolean; + }; + ReportCommentRequest: { + comment_id: number; + reason: string; + description?: string; /** - * FeedView.description - * Format: markdown + * @description Also send report to originating instance + * @default true */ - description?: string; + report_remote: boolean; + }; + CommentReport: { + id: number; + creator_id: number; + comment_id: number; + original_comment_text?: string; + reason?: string; + resolved: boolean; /** - * FeedView.description_html - * Format: html + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ - description_html?: string; + published: string; /** - * FeedView.icon - * Format: url + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ - icon?: string; - /** FeedView.parent_feed_id */ - parent_feed_id?: number; + updated?: string; }; - TopicView: { - /** TopicView.children */ - children: components["schemas"]["TopicView"][]; - /** TopicView.communities */ - communities: components["schemas"]["Community"][]; - /** TopicView.communities_count */ - communities_count: number; - /** TopicView.id */ - id: number; - /** TopicView.name */ - name: string; - /** TopicView.show_posts_from_children */ - show_posts_from_children: boolean; - /** TopicView.title */ - title: string; - /** TopicView.parent_topic_id */ - parent_topic_id?: number; - }; - /** - * RegistrationMode - * @enum {string} - */ - RegistrationMode: "Closed" | "RequireApplication" | "Open"; - /** - * SearchType - * @enum {string} - */ - SearchType: "Communities" | "Posts" | "Users" | "Url"; - /** - * CommunitySortType - * @enum {string} - */ - CommunitySortType: "Active" | "New"; - /** - * ListingType - * @enum {string} - */ - ListingType: "All" | "Local" | "Subscribed" | "Popular" | "ModeratorView"; - /** - * SortType - * @enum {string} - */ - SortType: "Active" | "Hot" | "New" | "TopHour" | "TopSixHour" | "TopTwelveHour" | "TopDay" | "TopWeek" | "TopMonth" | "TopThreeMonths" | "TopSixMonths" | "TopNineMonths" | "TopYear" | "TopAll" | "Scaled"; - /** - * SubscribedType - * @enum {string} - */ - SubscribedType: "Subscribed" | "NotSubscribed" | "Pending"; - /** - * PostFeatureType - * @enum {string} - */ - PostFeatureType: "Local" | "Community"; - /** - * CommentSortType - * @enum {string} - */ - CommentSortType: "Hot" | "Top" | "New" | "Old"; - /** - * NotificationStatusType - * @enum {string} - */ - NotificationStatusType: "All" | "New" | "Read"; - /** PersonAggregates */ - PersonAggregates: { - /** PersonAggregates.comment_count */ - comment_count: number; - /** PersonAggregates.person_id */ - person_id: number; - /** PersonAggregates.post_count */ - post_count: number; + CommentReportView: { + activity_alert: boolean; + banned_from_community: boolean; + comment: components["schemas"]["Comment"]; + community: components["schemas"]["Community"]; + counts: components["schemas"]["CommentAggregates"]; + creator: components["schemas"]["Person"]; + creator_banned_from_community: boolean; + creator_blocked: boolean; + creator_is_admin: boolean; + creator_is_moderator: boolean; + post: components["schemas"]["Post"]; + saved: boolean; + subscribed: string; + my_vote?: number; + can_auth_user_moderate?: boolean; + comment_report: components["schemas"]["CommentReport"]; + comment_creator: components["schemas"]["Person"]; }; - /** CommentAggregates */ - CommentAggregates: { - /** CommentAggregates.comment_id */ + GetCommentReportResponse: { + comment_report_view: components["schemas"]["CommentReportView"]; + }; + RemoveCommentRequest: { + comment_id: number; + removed: boolean; + reason?: string; + }; + MarkCommentAsReadRequest: { + comment_reply_id: number; + read: boolean; + }; + GetCommentReplyResponse: { + comment_reply_view: components["schemas"]["CommentReplyView"]; + }; + LockCommentRequest: { comment_id: number; - /** CommentAggregates.score */ + locked: boolean; + }; + CommentLikeView: { score: number; - /** CommentAggregates.upvotes */ - upvotes: number; - /** CommentAggregates.downvotes */ - downvotes: number; - /** - * CommentAggregates.published - * Format: date-time - */ - published: string; - /** CommentAggregates.child_count */ - child_count: number; + creator_banned_from_community: boolean; + creator_banned: boolean; + creator: components["schemas"]["Person"]; }; - /** PostAggregates */ - PostAggregates: { - /** PostAggregates.post_id */ + ListCommentLikesResponse: { + comment_likes: components["schemas"]["CommentLikeView"][]; + next_page?: string | null; + }; + ListPostsResponse: { + posts: components["schemas"]["PostView"][]; + next_page?: string | null; + }; + GetPostResponse: { + post_view: components["schemas"]["PostView"]; + community_view?: components["schemas"]["CommunityView"]; + moderators?: components["schemas"]["CommunityModeratorView"][]; + cross_posts?: components["schemas"]["PostView"][]; + }; + PostReplyView: { + activity_alert: boolean; + banned_from_community: boolean; + comment: components["schemas"]["Comment"]; + community?: components["schemas"]["Community"]; + counts: components["schemas"]["CommentAggregates"]; + creator: components["schemas"]["Person"]; + creator_banned_from_community: boolean; + creator_blocked: boolean; + creator_is_admin: boolean; + creator_is_moderator: boolean; + post?: components["schemas"]["Post"]; + saved: boolean; + subscribed: string; + my_vote?: number; + can_auth_user_moderate?: boolean; + replies?: components["schemas"]["PostReplyView"][]; + }; + GetPostRepliesResponse: { + comments?: components["schemas"]["PostReplyView"][]; + next_page?: string | null; + }; + LikePostRequest: { post_id: number; - /** PostAggregates.comments */ - comments: number; - /** PostAggregates.score */ score: number; - /** PostAggregates.upvotes */ - upvotes: number; - /** PostAggregates.downvotes */ - downvotes: number; + private?: boolean; + auth?: string; + }; + SavePostRequest: { + post_id: number; + save: boolean; + }; + SubscribePostRequest: { + post_id: number; + subscribe: boolean; + }; + CreatePostRequest: { + title: string; + community_id: number; + body?: string; + /** Format: url */ + url?: string; + nsfw?: boolean; + language_id?: number; + }; + EditPostRequest: { + post_id: number; + title?: string; + body?: string; + /** Format: url */ + url?: string; + nsfw?: boolean; + language_id?: number; + }; + DeletePostRequest: { + post_id: number; + deleted: boolean; + }; + ReportPostRequest: { + post_id: number; + reason: string; + }; + PostReport: { + id: number; + creator_id: number; + post_id: number; + original_post_name: string; + original_post_body: string; + reason: string; + resolved: boolean; /** - * PostAggregates.published - * Format: date-time + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ - published: string; - /** PostAggregates.newest_comment_time */ - newest_comment_time: string; + published?: string; }; - /** CommunityAggregates */ - CommunityAggregates: { - /** CommunityAggregates.active_6monthly */ - active_6monthly: number; - /** CommunityAggregates.active_daily */ - active_daily: number; - /** CommunityAggregates.active_monthly */ - active_monthly: number; - /** CommunityAggregates.active_weekly */ - active_weekly: number; - /** CommunityAggregates.community_id */ + PostReportView: { + post_report: components["schemas"]["PostReport"]; + post: components["schemas"]["Post"]; + community: components["schemas"]["Community"]; + creator: components["schemas"]["Person"]; + post_creator: components["schemas"]["Person"]; + counts: components["schemas"]["PostAggregates"]; + creator_banned_from_community: boolean; + creator_is_moderator: boolean; + creator_is_admin: boolean; + creator_blocked: boolean; + /** @enum {string} */ + subscribed: "Subscribed" | "NotSubscribed" | "Pending"; + saved: boolean; + }; + PostReportResponse: { + post_report_view: components["schemas"]["PostReportView"]; + }; + LockPostRequest: { + post_id: number; + locked: boolean; + }; + FeaturePostRequest: { + post_id: number; + featured: boolean; + feature_type: string; + }; + RemovePostRequest: { + post_id: number; + removed: boolean; + reason?: string; + }; + MarkPostAsReadRequest: { + read: boolean; + post_id?: number; + post_ids?: number[]; + }; + SuccessResponse: { + success: boolean; + }; + PostLikeView: { + score: number; + creator_banned_from_community: boolean; + creator_banned: boolean; + creator: components["schemas"]["Person"]; + }; + ListPostLikesResponse: { + post_likes: components["schemas"]["PostLikeView"][]; + next_page?: string | null; + }; + PostSetFlairRequest: { + post_id: number; + /** @description A list of all the flair id to assign to the post. Either pass an empty list or null to remove flair */ + flair_id_list?: number[] | null; + }; + PostSetFlairResponse: { + banned_from_community: boolean; + community: components["schemas"]["Community"]; + counts: components["schemas"]["PostAggregates"]; + creator: components["schemas"]["Person"]; + creator_banned_from_community: boolean; + creator_is_admin: boolean; + creator_is_moderator: boolean; + hidden: boolean; + post: components["schemas"]["Post"]; + read: boolean; + saved: boolean; + /** @enum {string} */ + subscribed: "Subscribed" | "NotSubscribed" | "Pending"; + unread_comments: number; + activity_alert?: boolean; + my_vote?: number; + flair_list?: components["schemas"]["CommunityFlair"][]; + }; + ImageUploadRequest: { + /** Format: binary */ + file: string; + }; + ImageUploadResponse: { + /** Format: url */ + url: string; + liked_only?: boolean; + saved_only?: boolean; + q?: string; + }; + PrivateMessage: { id: number; - /** CommunityAggregates.post_count */ - post_count: number; - /** CommunityAggregates.post_reply_count */ - post_reply_count: number; + creator_id: number; + recipient_id: number; + content: string; + deleted: boolean; + read: boolean; /** - * CommunityAggregates.published - * Format: date-time + * Format: datetime + * @example 2025-06-07T02:29:07.980084Z */ published: string; - /** CommunityAggregates.subscriptions_count */ - subscriptions_count: number; - /** CommunityAggregates.total_subscriptions_count */ - total_subscriptions_count: number; + /** Format: url */ + ap_id: string; + local: boolean; + }; + PrivateMessageView: { + private_message: components["schemas"]["PrivateMessage"]; + creator: components["schemas"]["Person"]; + recipient: components["schemas"]["Person"]; + }; + ListPrivateMessagesResponse: { + private_messages: components["schemas"]["PrivateMessageView"][]; + }; + GetPrivateMessageConversationResponse: { + private_messages: components["schemas"]["PrivateMessageView"][]; + }; + CreatePrivateMessageRequest: { + content: string; + recipient_id: number; + }; + PrivateMessageResponse: { + private_message_view: components["schemas"]["PrivateMessageView"]; + }; + EditPrivateMessageRequest: { + private_message_id: number; + content: string; + }; + MarkPrivateMessageAsReadRequest: { + private_message_id: number; + read: boolean; + }; + DeletePrivateMessageRequest: { + private_message_id: number; + deleted: boolean; + }; + ReportPrivateMessageRequest: { + private_message_id: number; + reason: string; + }; + }; + responses: { + /** @description Unprocessable Content */ + UNPROCESSABLE_CONTENT: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Error"]; + }; }; - "SuccessResponse-2": unknown; - "CommentReplyResponse-2": unknown; }; - responses: never; parameters: never; requestBodies: never; headers: never; pathItems: never; } export type $defs = Record; -export interface operations { - markAllAsRead: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["GetRepliesResponse"]; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["BadRequest"]; - }; - }; - }; - }; -} +export type operations = Record; diff --git a/src/types/CommentSortType.ts b/src/types/CommentSortType.ts index b3435c6..17fb862 100644 --- a/src/types/CommentSortType.ts +++ b/src/types/CommentSortType.ts @@ -1,7 +1,7 @@ import { GetComments as LemmyV0GetComments } from "lemmy-js-client-v0"; import { GetComments as LemmyV1GetComments } from "lemmy-js-client-v1"; -import { components } from "../providers/piefed/schema"; +import { paths } from "../providers/piefed/schema"; export type CommentSortType = | CommentSortTypeByMode[keyof CommentSortTypeByMode] @@ -20,7 +20,14 @@ export type CommentSortTypeByMode = { Required> & { mode: "lemmyv1"; }; - piefed: Required> & { + piefed: Pick< + Required< + NonNullable< + paths["/api/alpha/comment/list"]["get"]["parameters"]["query"] + > + >, + "sort" + > & { mode: "piefed"; }; }; diff --git a/src/types/CommunitySortType.ts b/src/types/CommunitySortType.ts index 5f936a0..c91892b 100644 --- a/src/types/CommunitySortType.ts +++ b/src/types/CommunitySortType.ts @@ -1,7 +1,7 @@ import { ListCommunities as LemmyV0ListCommunities } from "lemmy-js-client-v0"; import { ListCommunities as LemmyV1ListCommunities } from "lemmy-js-client-v1"; -import { components } from "../providers/piefed/schema"; +import { paths } from "../providers/piefed/schema"; export type CommunitySortType = | CommunitySortTypeByMode[keyof CommunitySortTypeByMode] @@ -20,7 +20,14 @@ export type CommunitySortTypeByMode = { Required> & { mode: "lemmyv1"; }; - piefed: Required> & { + piefed: Pick< + Required< + NonNullable< + paths["/api/alpha/community/list"]["get"]["parameters"]["query"] + > + >, + "sort" + > & { mode: "piefed"; }; }; diff --git a/src/types/EditComment.ts b/src/types/EditComment.ts index bd4cb6d..a77eded 100644 --- a/src/types/EditComment.ts +++ b/src/types/EditComment.ts @@ -1,5 +1,5 @@ export interface EditComment { comment_id: number; - content?: string; + content: string; language_id?: number; } diff --git a/src/types/GetPost.ts b/src/types/GetPost.ts index 9837c90..d10fcdc 100644 --- a/src/types/GetPost.ts +++ b/src/types/GetPost.ts @@ -1,4 +1,4 @@ export interface GetPost { comment_id?: number; - id?: number; + id: number; } diff --git a/src/types/PostSortType.ts b/src/types/PostSortType.ts index 104d149..f19457e 100644 --- a/src/types/PostSortType.ts +++ b/src/types/PostSortType.ts @@ -1,7 +1,7 @@ import { GetPosts as LemmyV0GetPosts } from "lemmy-js-client-v0"; import { GetPosts as LemmyV1GetPosts } from "lemmy-js-client-v1"; -import { components } from "../providers/piefed/schema"; +import { paths } from "../providers/piefed/schema"; export type PostSortType = | PostSortTypeByMode[keyof PostSortTypeByMode] @@ -20,7 +20,12 @@ export type PostSortTypeByMode = { Required> & { mode: "lemmyv1"; }; - piefed: Required> & { + piefed: Pick< + Required< + NonNullable + >, + "sort" + > & { mode: "piefed"; }; }; diff --git a/src/types/SearchSortType.ts b/src/types/SearchSortType.ts index d1fff9b..a15fbee 100644 --- a/src/types/SearchSortType.ts +++ b/src/types/SearchSortType.ts @@ -1,7 +1,7 @@ import { Search as LemmyV0Search } from "lemmy-js-client-v0"; import { Search as LemmyV1Search } from "lemmy-js-client-v1"; -import { components } from "../providers/piefed/schema"; +import { paths } from "../providers/piefed/schema"; export type SearchSortType = | SearchSortTypeByMode[keyof SearchSortTypeByMode] @@ -20,7 +20,12 @@ export type SearchSortTypeByMode = { Required> & { mode: "lemmyv1"; }; - piefed: Required> & { + piefed: Pick< + Required< + NonNullable + >, + "sort" + > & { mode: "piefed"; }; };