feat(chat): migrate chat protocol to lock detail
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Chat wire payload fragments shared by send response and history messages.
|
||||
*/
|
||||
import { z } from "zod";
|
||||
|
||||
export const ChatImageSchema = z
|
||||
.object({
|
||||
type: z.string().nullable().default(null),
|
||||
url: z.string().nullable().default(null),
|
||||
})
|
||||
.default({ type: null, url: null });
|
||||
|
||||
export const ChatLockDetailSchema = z
|
||||
.object({
|
||||
locked: z.boolean().default(false),
|
||||
showContent: z.boolean().default(true),
|
||||
showUpgrade: z.boolean().default(false),
|
||||
reason: z.string().nullable().default(null),
|
||||
hint: z.string().nullable().default(null),
|
||||
detail: z.record(z.string(), z.unknown()).nullable().default(null),
|
||||
})
|
||||
.default({
|
||||
locked: false,
|
||||
showContent: true,
|
||||
showUpgrade: false,
|
||||
reason: null,
|
||||
hint: null,
|
||||
detail: null,
|
||||
});
|
||||
|
||||
export type ChatImageInput = z.input<typeof ChatImageSchema>;
|
||||
export type ChatImageData = z.output<typeof ChatImageSchema>;
|
||||
export type ChatLockDetailInput = z.input<typeof ChatLockDetailSchema>;
|
||||
export type ChatLockDetailData = z.output<typeof ChatLockDetailSchema>;
|
||||
Reference in New Issue
Block a user