fix(packages/client): 🐛 Fix client types, and add missing banner schema for Instance

This commit is contained in:
Jesse Wierzbinski 2025-05-26 11:04:09 +02:00
parent 77cd27a458
commit 6d85dbdfcb
No known key found for this signature in database
3 changed files with 20 additions and 3 deletions

View file

@ -102,6 +102,25 @@ export const Instance = z
.openapi({
description: "An image used to represent this instance.",
}),
/* Versia Server API extension */
banner: z
.object({
url: z.string().url().openapi({
description: "The URL for the banner image.",
example:
"https://files.mastodon.social/site_uploads/files/000/000/001/@1x/57c12f441d083cde.png",
}),
blurhash: z.string().optional().openapi({
description:
"A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.",
example: "UUKJMXv|x]t7^*t7Rjaz^jazRjaz",
}),
})
.optional()
.openapi({
description:
"A wide banner image used to represent this instance.",
}),
icon: z.array(InstanceIcon).openapi({
description:
"The list of available size variants for this instance configured icon.",

View file

@ -103,7 +103,7 @@ export class BaseClient {
}
/** Overridable by testing */
private fetch = fetch;
private fetch = (...args: Parameters<typeof fetch>) => fetch(...args);
private async request<ReturnType>(
request: Request,

View file

@ -61,8 +61,6 @@ export const generateClient = async (
token?.data.accessToken,
);
// @ts-expect-error This doesn't include fetch.preconnect, which is a custom property
// added by Bun
// biome-ignore lint/complexity/useLiteralKeys: Overriding private properties
client["fetch"] = (
input: RequestInfo | string | URL | Request,