refactor(data): replace schema classes with readonly models

This commit is contained in:
2026-07-17 13:21:40 +08:00
parent 3437312167
commit ae97366a4a
103 changed files with 1220 additions and 2117 deletions
+3 -7
View File
@@ -3,11 +3,7 @@
*/
import { z } from "zod";
import {
booleanOrFalse,
schemaOr,
stringOrNull,
} from "../nullable-defaults";
import { booleanOrFalse, schemaOr, stringOrNull } from "../nullable-defaults";
const CHAT_IMAGE_DEFAULTS = { type: null, url: null } as const;
@@ -22,7 +18,7 @@ export const ChatImageSchema = schemaOr(
url: stringOrNull,
}),
CHAT_IMAGE_DEFAULTS,
);
).readonly();
export const ChatLockDetailSchema = schemaOr(
z.object({
@@ -30,7 +26,7 @@ export const ChatLockDetailSchema = schemaOr(
reason: stringOrNull,
}),
CHAT_LOCK_DETAIL_DEFAULTS,
);
).readonly();
export type ChatImageInput = z.input<typeof ChatImageSchema>;
export type ChatImageData = z.output<typeof ChatImageSchema>;