2025-07-07 03:42:35 +02:00
|
|
|
import { z } from "zod/v4";
|
2025-02-12 23:04:44 +01:00
|
|
|
import { Source } from "./account.ts";
|
|
|
|
|
|
|
|
|
|
export const Preferences = z
|
|
|
|
|
.object({
|
2025-07-07 03:42:35 +02:00
|
|
|
"posting:default:visibility": Source.shape.privacy.meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description: "Default visibility for new posts.",
|
|
|
|
|
example: "public",
|
|
|
|
|
externalDocs: {
|
|
|
|
|
url: "https://docs.joinmastodon.org/entities/Preferences/#posting-default-visibility",
|
|
|
|
|
},
|
|
|
|
|
}),
|
2025-07-07 03:42:35 +02:00
|
|
|
"posting:default:sensitive": Source.shape.sensitive.meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description: "Default sensitivity flag for new posts.",
|
|
|
|
|
example: false,
|
|
|
|
|
externalDocs: {
|
|
|
|
|
url: "https://docs.joinmastodon.org/entities/Preferences/#posting-default-sensitive",
|
|
|
|
|
},
|
|
|
|
|
}),
|
2025-07-07 03:42:35 +02:00
|
|
|
"posting:default:language": Source.shape.language.nullable().meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description: "Default language for new posts.",
|
|
|
|
|
example: null,
|
|
|
|
|
externalDocs: {
|
|
|
|
|
url: "https://docs.joinmastodon.org/entities/Preferences/#posting-default-language",
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
"reading:expand:media": z
|
|
|
|
|
.enum(["default", "show_all", "hide_all"])
|
2025-07-07 03:42:35 +02:00
|
|
|
.meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description:
|
|
|
|
|
"Whether media attachments should be automatically displayed or blurred/hidden.",
|
|
|
|
|
example: "default",
|
|
|
|
|
externalDocs: {
|
|
|
|
|
url: "https://docs.joinmastodon.org/entities/Preferences/#reading-expand-media",
|
|
|
|
|
},
|
|
|
|
|
}),
|
2025-07-07 03:42:35 +02:00
|
|
|
"reading:expand:spoilers": z.boolean().meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description: "Whether CWs should be expanded by default.",
|
|
|
|
|
example: false,
|
|
|
|
|
externalDocs: {
|
|
|
|
|
url: "https://docs.joinmastodon.org/entities/Preferences/#reading-expand-spoilers",
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
})
|
2025-07-07 03:42:35 +02:00
|
|
|
.meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description: "Represents a user's preferences.",
|
|
|
|
|
externalDocs: {
|
|
|
|
|
url: "https://docs.joinmastodon.org/entities/Preferences",
|
|
|
|
|
},
|
2025-07-07 03:42:35 +02:00
|
|
|
id: "Preferences",
|
2025-02-12 23:04:44 +01:00
|
|
|
});
|