mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 16:20:25 +00:00
fix: zod boolean强制转换
This commit is contained in:
@@ -5,16 +5,16 @@ import { join as joinPath } from 'node:path';
|
||||
import { calculateFileMD5, uriToLocalFile } from '@/common/file';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { actionType } from '../type';
|
||||
interface FileResponse {
|
||||
file: string;
|
||||
}
|
||||
|
||||
const SchemaData = z.object({
|
||||
url: z.coerce.string().optional(),
|
||||
base64: z.coerce.string().optional(),
|
||||
name: z.coerce.string().optional(),
|
||||
headers: z.union([z.coerce.string(), z.array(z.coerce.string())]).optional(),
|
||||
url: actionType.string().optional(),
|
||||
base64: actionType.string().optional(),
|
||||
name: actionType.string().optional(),
|
||||
headers: z.union([actionType.string(), z.array(actionType.string())]).optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
Reference in New Issue
Block a user