2025-11-21 08:31:02 +01:00
|
|
|
import { z } from "zod";
|
2025-02-12 23:04:44 +01:00
|
|
|
|
|
|
|
|
export const Rule = z
|
|
|
|
|
.object({
|
2025-07-07 03:42:35 +02:00
|
|
|
id: z.string().meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description: "The identifier for the rule.",
|
|
|
|
|
example: "1",
|
|
|
|
|
}),
|
2025-07-07 03:42:35 +02:00
|
|
|
text: z.string().meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description: "The rule to be followed.",
|
|
|
|
|
example: "Do not spam pictures of skibidi toilet.",
|
|
|
|
|
}),
|
2025-07-07 03:42:35 +02:00
|
|
|
hint: z.string().optional().meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description: "Longer-form description of the rule.",
|
|
|
|
|
example: "Please, we beg you.",
|
|
|
|
|
}),
|
|
|
|
|
})
|
2025-07-07 03:42:35 +02:00
|
|
|
.meta({
|
2025-02-12 23:04:44 +01:00
|
|
|
description: "Represents a rule that server users should follow.",
|
|
|
|
|
externalDocs: {
|
|
|
|
|
url: "https://docs.joinmastodon.org/entities/Rule",
|
|
|
|
|
},
|
2025-07-07 03:42:35 +02:00
|
|
|
id: "Rule",
|
2025-02-12 23:04:44 +01:00
|
|
|
});
|