mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
26 lines
769 B
TypeScript
26 lines
769 B
TypeScript
|
|
/**
|
||
|
|
* Custom emojis extension.
|
||
|
|
* @module federation/schemas/extensions/custom_emojis
|
||
|
|
* @see module:federation/schemas/base
|
||
|
|
* @see https://versia.pub/extensions/custom-emojis
|
||
|
|
*/
|
||
|
|
import { z } from "zod";
|
||
|
|
import { emojiRegex } from "../../regex.ts";
|
||
|
|
import { ImageContentFormatSchema } from "../contentformat.ts";
|
||
|
|
|
||
|
|
export const CustomEmojiExtensionSchema = z.strictObject({
|
||
|
|
emojis: z.array(
|
||
|
|
z.strictObject({
|
||
|
|
name: z
|
||
|
|
.string()
|
||
|
|
.min(1)
|
||
|
|
.max(256)
|
||
|
|
.regex(
|
||
|
|
emojiRegex,
|
||
|
|
"Emoji name must be alphanumeric, underscores, or dashes, and surrounded by identifiers",
|
||
|
|
),
|
||
|
|
url: ImageContentFormatSchema,
|
||
|
|
}),
|
||
|
|
),
|
||
|
|
});
|