2025-04-08 16:01:10 +02:00
|
|
|
/**
|
|
|
|
|
* Custom emojis extension.
|
|
|
|
|
* @module federation/schemas/extensions/custom_emojis
|
|
|
|
|
* @see module:federation/schemas/base
|
|
|
|
|
* @see https://versia.pub/extensions/custom-emojis
|
|
|
|
|
*/
|
2025-07-07 03:42:35 +02:00
|
|
|
import { z } from "zod/v4";
|
2025-04-08 16:01:10 +02:00
|
|
|
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,
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
});
|