mirror of
https://github.com/versia-pub/server.git
synced 2026-04-28 13:19:16 +02:00
refactor: ⬆️ Upgrade to Zod v4 and hono-openapi 0.5.0
This commit is contained in:
parent
add2429606
commit
24d4150da4
209 changed files with 1331 additions and 1622 deletions
|
|
@ -1,23 +1,23 @@
|
|||
import { z } from "zod";
|
||||
import { z } from "zod/v4";
|
||||
import { Source } from "./account.ts";
|
||||
|
||||
export const Preferences = z
|
||||
.object({
|
||||
"posting:default:visibility": Source.shape.privacy.openapi({
|
||||
"posting:default:visibility": Source.shape.privacy.meta({
|
||||
description: "Default visibility for new posts.",
|
||||
example: "public",
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/entities/Preferences/#posting-default-visibility",
|
||||
},
|
||||
}),
|
||||
"posting:default:sensitive": Source.shape.sensitive.openapi({
|
||||
"posting:default:sensitive": Source.shape.sensitive.meta({
|
||||
description: "Default sensitivity flag for new posts.",
|
||||
example: false,
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/entities/Preferences/#posting-default-sensitive",
|
||||
},
|
||||
}),
|
||||
"posting:default:language": Source.shape.language.nullable().openapi({
|
||||
"posting:default:language": Source.shape.language.nullable().meta({
|
||||
description: "Default language for new posts.",
|
||||
example: null,
|
||||
externalDocs: {
|
||||
|
|
@ -26,7 +26,7 @@ export const Preferences = z
|
|||
}),
|
||||
"reading:expand:media": z
|
||||
.enum(["default", "show_all", "hide_all"])
|
||||
.openapi({
|
||||
.meta({
|
||||
description:
|
||||
"Whether media attachments should be automatically displayed or blurred/hidden.",
|
||||
example: "default",
|
||||
|
|
@ -34,7 +34,7 @@ export const Preferences = z
|
|||
url: "https://docs.joinmastodon.org/entities/Preferences/#reading-expand-media",
|
||||
},
|
||||
}),
|
||||
"reading:expand:spoilers": z.boolean().openapi({
|
||||
"reading:expand:spoilers": z.boolean().meta({
|
||||
description: "Whether CWs should be expanded by default.",
|
||||
example: false,
|
||||
externalDocs: {
|
||||
|
|
@ -42,10 +42,10 @@ export const Preferences = z
|
|||
},
|
||||
}),
|
||||
})
|
||||
.openapi({
|
||||
.meta({
|
||||
description: "Represents a user's preferences.",
|
||||
externalDocs: {
|
||||
url: "https://docs.joinmastodon.org/entities/Preferences",
|
||||
},
|
||||
ref: "Preferences",
|
||||
id: "Preferences",
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue