mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-02 00:30:25 +00:00
refactor: type-check (#586)
* refactor: type-check * fix: default * refactor: type-check
This commit is contained in:
@@ -1,21 +1,18 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { Static, Type } from '@sinclair/typebox';
|
||||
|
||||
interface Response {
|
||||
cookies: string,
|
||||
token: number
|
||||
}
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
domain: { type: 'string' },
|
||||
},
|
||||
required: ['domain'],
|
||||
} as const satisfies JSONSchema;
|
||||
const SchemaData = Type.Object({
|
||||
domain: Type.String()
|
||||
});
|
||||
|
||||
type Payload = Static<typeof SchemaData>;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetCredentials extends OneBotAction<Payload, Response> {
|
||||
actionName = ActionName.GetCredentials;
|
||||
|
||||
Reference in New Issue
Block a user