32 lines
766 B
TypeScript
32 lines
766 B
TypeScript
/**
|
|
* 发送消息请求
|
|
*
|
|
*/
|
|
import { z } from "zod";
|
|
|
|
import {
|
|
booleanOrFalse,
|
|
numberOrZero,
|
|
stringOrEmpty,
|
|
} from "../../nullable-defaults";
|
|
|
|
export const SendMessageRequestSchema = z
|
|
.object({
|
|
characterId: z.string().min(1),
|
|
message: stringOrEmpty,
|
|
image: stringOrEmpty,
|
|
imageId: stringOrEmpty,
|
|
imageThumbUrl: stringOrEmpty,
|
|
imageMediumUrl: stringOrEmpty,
|
|
imageOriginalUrl: stringOrEmpty,
|
|
imageWidth: numberOrZero,
|
|
imageHeight: numberOrZero,
|
|
useWebSocket: booleanOrFalse,
|
|
})
|
|
.readonly();
|
|
|
|
export type SendMessageRequestInput = z.input<typeof SendMessageRequestSchema>;
|
|
export type SendMessageRequestData = z.output<typeof SendMessageRequestSchema>;
|
|
|
|
export type SendMessageRequest = SendMessageRequestData;
|