server/packages/client/schemas/relationship.ts
Jesse Wierzbinski 58342e86e1
refactor(api): ♻️ Move from @hono/zod-openapi to hono-openapi
hono-openapi is easier to work with and generates better OpenAPI definitions
2025-03-29 03:30:06 +01:00

76 lines
2.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { z } from "zod";
import { Id, iso631 } from "./common.ts";
export const Relationship = z
.object({
id: Id.openapi({
description: "The account ID.",
example: "51f34c31-c8c6-4dc2-9df1-3704fcdde9b6",
}),
following: z.boolean().openapi({
description: "Are you following this user?",
example: true,
}),
showing_reblogs: z.boolean().openapi({
description:
"Are you receiving this users boosts in your home timeline?",
example: true,
}),
notifying: z.boolean().openapi({
description: "Have you enabled notifications for this user?",
example: false,
}),
languages: z.array(iso631).openapi({
description: "Which languages are you following from this user?",
example: ["en"],
}),
followed_by: z.boolean().openapi({
description: "Are you followed by this user?",
example: true,
}),
blocking: z.boolean().openapi({
description: "Are you blocking this user?",
example: false,
}),
blocked_by: z.boolean().openapi({
description: "Is this user blocking you?",
example: false,
}),
muting: z.boolean().openapi({
description: "Are you muting this user?",
example: false,
}),
muting_notifications: z.boolean().openapi({
description: "Are you muting notifications from this user?",
example: false,
}),
requested: z.boolean().openapi({
description: "Do you have a pending follow request for this user?",
example: false,
}),
requested_by: z.boolean().openapi({
description: "Has this user requested to follow you?",
example: false,
}),
domain_blocking: z.boolean().openapi({
description: "Are you blocking this users domain?",
example: false,
}),
endorsed: z.boolean().openapi({
description: "Are you featuring this user on your profile?",
example: false,
}),
note: z.string().min(0).max(5000).trim().openapi({
description: "This users profile bio",
example: "they also like Kerbal Space Program",
}),
})
.openapi({
description:
"Represents the relationship between accounts, such as following / blocking / muting / etc.",
externalDocs: {
url: "https://docs.joinmastodon.org/entities/Relationship",
},
ref: "Relationship",
});