Revert "fix:coerce"

This reverts commit dd895d7c17.
This commit is contained in:
手瓜一十雪
2025-04-19 10:58:56 +08:00
parent 2a4589e268
commit d3a27ad701
88 changed files with 276 additions and 277 deletions

View File

@@ -3,7 +3,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
const SchemaData = z.object({
user_id: z.union([z.coerce.number(), z.coerce.string()])
user_id: z.union([z.number(), z.string()])
});
type Payload = z.infer<typeof SchemaData>;

View File

@@ -7,7 +7,7 @@ interface Response {
}
const SchemaData = z.object({
domain: z.coerce.string()
domain: z.string()
});
type Payload = z.infer<typeof SchemaData>;

View File

@@ -5,7 +5,7 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
const SchemaData = z.object({
no_cache: z.coerce.boolean().optional(),
no_cache: z.boolean().optional(),
});
type Payload = z.infer<typeof SchemaData>;

View File

@@ -5,7 +5,7 @@ import { NetworkAdapterConfig } from '@/onebot/config/config';
import { z } from 'zod';
const SchemaData = z.object({
count: z.coerce.number().default(10),
count: z.number().default(10),
});
type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,8 +3,8 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
const SchemaData = z.object({
times: z.union([z.coerce.number(), z.coerce.string()]).default(1),
user_id: z.union([z.coerce.number(), z.coerce.string()])
times: z.union([z.number(), z.string()]).default(1),
user_id: z.union([z.number(), z.string()])
});
type Payload = z.infer<typeof SchemaData>;

View File

@@ -3,9 +3,9 @@ import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
const SchemaData = z.object({
flag: z.union([z.coerce.string(), z.coerce.number()]),
approve: z.union([z.coerce.string(), z.coerce.boolean()]).default(true),
remark: z.union([z.coerce.string(), z.null()]).nullable().optional()
flag: z.union([z.string(), z.number()]),
approve: z.union([z.string(), z.boolean()]).default(true),
remark: z.union([z.string(), z.null()]).nullable().optional()
});
type Payload = z.infer<typeof SchemaData>;