迁移类型校验到zod
This commit is contained in:
1 parent
4084e431ec
commit
8a116d2d7b
101 files changed
+951
-945
No files matched your search
@@ -1,17 +1,17 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
import { z } from 'zod';
|
||||
|
||||
interface Response {
|
||||
cookies: string,
|
||||
token: number
|
||||
}
|
||||
|
||||
const SchemaData = Type.Object({
|
||||
domain: Type.String()
|
||||
const SchemaData = z.object({
|
||||
domain: z.string()
|
||||
});
|
||||
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
|
||||
export class GetCredentials extends OneBotAction<Payload, Response> {
|
||||
|
||||
Reference in new issue
Block a user