This commit is contained in:
手瓜一十雪
2025-04-17 09:52:03 +08:00
parent 3f6249f39c
commit 54e6d5c3f2
88 changed files with 87 additions and 88 deletions

View File

@@ -1,5 +1,4 @@
import { z } from "zod";
const boolean = () => z.preprocess(
val => typeof val === 'string' && (val.toLowerCase() === 'false' || val === '0') ? false : Boolean(val),
z.boolean()

View File

@@ -1,6 +1,6 @@
import { ConfigBase } from '@/common/config-base';
import { NapCatCore } from '@/core';
import { actionType } from '@/onebot/action/type';
import { actionType } from '@/common/coerce';
import { z } from 'zod';
export const NapcatConfigSchema = z.object({

View File

@@ -1,7 +1,7 @@
import { ActionName } from '@/onebot/action/router';
import { OneBotAction } from '../OneBotAction';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
rawData: actionType.string(),
brief: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { z } from 'zod';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
count: actionType.number().default(48),
});

View File

@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { MessageUnique } from '@/common/message-unique';
import { type NTQQMsgApi } from '@/core/apis';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
message_id: actionType.string(),
emojiId: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
chat_type: actionType.number().default(1),

View File

@@ -2,7 +2,7 @@ import { type NTQQCollectionApi } from '@/core/apis/collection';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
category: actionType.number(),
count: actionType.number().default(1),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
});

View File

@@ -3,7 +3,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { MiniAppInfo, MiniAppInfoHelper } from '@/core/packet/utils/helper/miniAppHelper';
import { MiniAppData, MiniAppRawData, MiniAppReqCustomParams, MiniAppReqParams } from '@/core/packet/entities/miniApp';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.union([
z.object({
type: z.union([z.literal('bili'), z.literal('weibo')]),

View File

@@ -2,7 +2,7 @@ import { NTVoteInfo } from '@/core';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
user_id: actionType.string().optional(),
start: actionType.number().default(0),

View File

@@ -1,7 +1,7 @@
import { ActionName } from '@/onebot/action/router';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
user_id: actionType.number(),
});

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
file_id: actionType.string(),

View File

@@ -4,7 +4,7 @@ import { checkFileExist, uriToLocalFile } from '@/common/file';
import fs from 'fs';
import { z } from 'zod';
import { GeneralCallResultStatus } from '@/core';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
image: actionType.string(),
});

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
file_id: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { PacketHexStr } from '@/core/packet/transformer/base';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
cmd: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
face_id: actionType.string(),// 参考 face_config.json 的 QSid
face_type: actionType.string().default('1'),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
remark: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
});

View File

@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { ChatType } from '@/core';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
user_id: actionType.string(),
event_type: actionType.number(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
longNick: actionType.string(),
});

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
status: actionType.number(),
ext_status: actionType.number(),

View File

@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
import fs from 'node:fs/promises';
import { checkFileExist, uriToLocalFile } from '@/common/file';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
file: actionType.string(),
});

View File

@@ -1,7 +1,7 @@
import { ActionName } from '@/onebot/action/router';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
user_id: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { GeneralCallResult } from '@/core';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
user_id: actionType.string().optional(),
group_id: actionType.string().optional(),

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
file_id: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
words: z.array(actionType.string()),
});

View File

@@ -4,7 +4,7 @@ import { FileNapCatOneBotUUID } from '@/common/file-uuid';
import { ActionName } from '@/onebot/action/router';
import { OB11MessageImage, OB11MessageVideo } from '@/onebot/types';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
export interface GetFileResponse {
file?: string; // path
url?: string;

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
file_id: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
file_id: actionType.string(),
});

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
folder_name: actionType.string(),

View File

@@ -4,7 +4,7 @@ import { ActionName } from '@/onebot/action/router';
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
import { z } from 'zod';
import { NTQQGroupApi } from '@/core/apis';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
file_id: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { z } from 'zod';
import { NTQQGroupApi } from '@/core/apis';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
folder_id: actionType.string().optional(),

View File

@@ -5,7 +5,7 @@ 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';
import { actionType } from '@/common/coerce';
interface FileResponse {
file: string;
}

View File

@@ -5,7 +5,7 @@ import { MessageUnique } from '@/common/message-unique';
import { ChatType, ElementType, MsgSourceType, NTMsgType, RawMessage } from '@/core';
import { z } from 'zod';
import { isNumeric } from '@/common/helper';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
message_id: actionType.string().optional(),
id: actionType.string().optional(),

View File

@@ -5,7 +5,7 @@ import { ChatType } from '@/core/types';
import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod';
import { NetworkAdapterConfig } from '@/onebot/config/config';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
interface Response {
messages: OB11Message[];

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string()
});

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string()
});

View File

@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { OB11Construct } from '@/onebot/helper/data';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
folder_id: actionType.string().optional(),

View File

@@ -2,7 +2,7 @@ import { WebHonorType } from '@/core';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
type: z.nativeEnum(WebHonorType).optional()

View File

@@ -5,7 +5,7 @@ import { ChatType, Peer } from '@/core/types';
import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod';
import { NetworkAdapterConfig } from '@/onebot/config/config';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
interface Response {
messages: OB11Message[];

View File

@@ -4,7 +4,7 @@ import { ActionName } from '@/onebot/action/router';
import { OB11GroupFile, OB11GroupFileFolder } from '@/onebot';
import { OB11Construct } from '@/onebot/helper/data';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
file_count: actionType.number().default(50),

View File

@@ -4,7 +4,7 @@ import { OB11Construct } from '@/onebot/helper/data';
import { ActionName } from '@/onebot/action/router';
import { calcQQLevel } from '@/common/helper';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
user_id: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
url: actionType.string(),
});

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
friend_id: actionType.string().optional(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
model: actionType.string(),
});

View File

@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { unlink } from 'node:fs/promises';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
content: actionType.string(),

View File

@@ -4,7 +4,7 @@ import { checkFileExistV2, uriToLocalFile } from '@/common/file';
import { z } from 'zod';
import fs from 'node:fs/promises';
import { GeneralCallResult } from '@/core';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
file: actionType.string(),
group_id: actionType.string()

View File

@@ -2,7 +2,7 @@ import { NTQQUserApi } from '@/core/apis';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
nickname: actionType.string(),
personal_note: actionType.string().optional(),

View File

@@ -5,7 +5,7 @@ import fs from 'fs';
import { uriToLocalFile } from '@/common/file';
import { SendMessageContext } from '@/onebot/api';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
file: actionType.string(),

View File

@@ -6,7 +6,7 @@ import { uriToLocalFile } from '@/common/file';
import { SendMessageContext } from '@/onebot/api';
import { ContextMode, createContext } from '@/onebot/action/msg/SendMsg';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
user_id: actionType.string(),
file: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
message_id: actionType.string(),
});

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
notice_id: actionType.string()

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
character: actionType.string(),
group_id: actionType.string(),

View File

@@ -5,7 +5,7 @@ import { MessageUnique } from '@/common/message-unique';
import crypto from 'crypto';
import { z } from 'zod';
import { NetworkAdapterConfig } from '@/onebot/config/config';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
});

View File

@@ -3,7 +3,7 @@ import { OB11Construct } from '@/onebot/helper/data';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
});

View File

@@ -3,7 +3,7 @@ import { OB11Construct } from '@/onebot/helper/data';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
no_cache: actionType.boolean().default(false),

View File

@@ -3,7 +3,7 @@ import { OB11Construct } from '@/onebot/helper/data';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),

View File

@@ -4,7 +4,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { GroupMember } from '@/core';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { WebApiGroupNoticeFeed } from '@/core';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
interface GroupNotice {
sender_id: number;
publish_time: number;

View File

@@ -2,7 +2,7 @@ import { ShutUpGroupMember } from '@/core';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
});

View File

@@ -1,7 +1,7 @@
import { ActionName } from '@/onebot/action/router';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
user_id: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
character: actionType.string(),
group_id: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
message_id: actionType.string(),
});

View File

@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { NTGroupRequestOperateTypes } from '@/core/types';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
flag: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { NTGroupMemberRole } from '@/core/types';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
user_id: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
user_id: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),

View File

@@ -2,7 +2,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),
group_name: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string(),

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
message_id: actionType.string(),

View File

@@ -3,7 +3,7 @@ import { ChatType, Peer } from '@/core/types';
import { ActionName } from '@/onebot/action/router';
import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
message_id: actionType.string(),
group_id: actionType.string().optional(),

View File

@@ -5,7 +5,7 @@ import { MessageUnique } from '@/common/message-unique';
import { RawMessage } from '@/core';
import { z } from 'zod';
import { NetworkAdapterConfig } from '@/onebot/config/config';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
export type ReturnDataType = OB11Message
const SchemaData = z.object({

View File

@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
user_id: actionType.string().optional(),
group_id: actionType.string().optional(),

View File

@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { MessageUnique } from '@/common/message-unique';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
message_id: actionType.string(),

View File

@@ -1,7 +1,7 @@
import { ActionName } from '@/onebot/action/router';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
group_id: actionType.string().optional(),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
interface Response {
cookies: string,

View File

@@ -1,7 +1,7 @@
import { ActionName } from '@/onebot/action/router';
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
user_id: actionType.string()

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
interface Response {
cookies: string,
bkn: string

View File

@@ -3,7 +3,7 @@ import { OB11Construct } from '@/onebot/helper/data';
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
no_cache: actionType.boolean().optional(),

View File

@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { NetworkAdapterConfig } from '@/onebot/config/config';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
count: actionType.number().default(10),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
times: actionType.number().default(1),

View File

@@ -1,7 +1,7 @@
import { OneBotAction } from '@/onebot/action/OneBotAction';
import { ActionName } from '@/onebot/action/router';
import { z } from 'zod';
import { actionType } from '../type';
import { actionType } from '@/common/coerce';
const SchemaData = z.object({
flag: actionType.string(),

View File

@@ -1,5 +1,5 @@
import { z } from 'zod';
import { actionType } from '../action/type';
import { actionType } from '../../common/coerce';
const HttpServerConfigSchema = z.object({
name: actionType.string().default('http-server'),

View File

@@ -4,7 +4,7 @@ import { resolve } from 'node:path';
import { deepMerge } from '../utils/object';
import { themeType } from '../types/theme';
import { z } from 'zod';
import { actionType } from '@/onebot/action/type';
import { actionType } from '@/common/coerce';
// 定义配置的类型
const WebUiConfigSchema = z.object({
host: actionType.string().default('0.0.0.0'),

View File

@@ -1,4 +1,4 @@
import { actionType } from '@/onebot/action/type';
import { actionType } from '@/common/coerce';
import { z } from 'zod';
export const themeType = z.object(