mirror of
https://github.com/versia-pub/server.git
synced 2026-01-26 04:06:01 +01:00
fix(packages/client): 🐛 Fix client types, and add missing banner schema for Instance
This commit is contained in:
parent
77cd27a458
commit
6d85dbdfcb
|
|
@ -102,6 +102,25 @@ export const Instance = z
|
||||||
.openapi({
|
.openapi({
|
||||||
description: "An image used to represent this instance.",
|
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({
|
icon: z.array(InstanceIcon).openapi({
|
||||||
description:
|
description:
|
||||||
"The list of available size variants for this instance configured icon.",
|
"The list of available size variants for this instance configured icon.",
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export class BaseClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Overridable by testing */
|
/** Overridable by testing */
|
||||||
private fetch = fetch;
|
private fetch = (...args: Parameters<typeof fetch>) => fetch(...args);
|
||||||
|
|
||||||
private async request<ReturnType>(
|
private async request<ReturnType>(
|
||||||
request: Request,
|
request: Request,
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,6 @@ export const generateClient = async (
|
||||||
token?.data.accessToken,
|
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
|
// biome-ignore lint/complexity/useLiteralKeys: Overriding private properties
|
||||||
client["fetch"] = (
|
client["fetch"] = (
|
||||||
input: RequestInfo | string | URL | Request,
|
input: RequestInfo | string | URL | Request,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue