refactor(api): ♻️ Move all client schema code to new package

This commit is contained in:
Jesse Wierzbinski 2025-03-22 02:34:03 +01:00
parent 52602c3da7
commit 3fe07a79b8
No known key found for this signature in database
128 changed files with 3904 additions and 169 deletions

View file

@ -0,0 +1,23 @@
import { z } from "@hono/zod-openapi";
export const Rule = z
.object({
id: z.string().openapi({
description: "The identifier for the rule.",
example: "1",
}),
text: z.string().openapi({
description: "The rule to be followed.",
example: "Do not spam pictures of skibidi toilet.",
}),
hint: z.string().optional().openapi({
description: "Longer-form description of the rule.",
example: "Please, we beg you.",
}),
})
.openapi({
description: "Represents a rule that server users should follow.",
externalDocs: {
url: "https://docs.joinmastodon.org/entities/Rule",
},
});