mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
const boolean = () => z.preprocess(
|
const boolean = () => z.preprocess(
|
||||||
val => typeof val === 'string' && (val.toLowerCase() === 'false' || val === '0') ? false : Boolean(val),
|
val => typeof val === 'string' && (val.toLowerCase() === 'false' || val === '0') ? false : Boolean(val),
|
||||||
z.boolean()
|
z.boolean()
|
@@ -1,6 +1,6 @@
|
|||||||
import { ConfigBase } from '@/common/config-base';
|
import { ConfigBase } from '@/common/config-base';
|
||||||
import { NapCatCore } from '@/core';
|
import { NapCatCore } from '@/core';
|
||||||
import { actionType } from '@/onebot/action/type';
|
import { actionType } from '@/common/coerce';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
export const NapcatConfigSchema = z.object({
|
export const NapcatConfigSchema = z.object({
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { OneBotAction } from '../OneBotAction';
|
import { OneBotAction } from '../OneBotAction';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
rawData: actionType.string(),
|
rawData: actionType.string(),
|
||||||
brief: actionType.string(),
|
brief: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
count: actionType.number().default(48),
|
count: actionType.number().default(48),
|
||||||
});
|
});
|
||||||
|
@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { MessageUnique } from '@/common/message-unique';
|
import { MessageUnique } from '@/common/message-unique';
|
||||||
import { type NTQQMsgApi } from '@/core/apis';
|
import { type NTQQMsgApi } from '@/core/apis';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
message_id: actionType.string(),
|
message_id: actionType.string(),
|
||||||
emojiId: actionType.string(),
|
emojiId: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
chat_type: actionType.number().default(1),
|
chat_type: actionType.number().default(1),
|
||||||
|
@@ -2,7 +2,7 @@ import { type NTQQCollectionApi } from '@/core/apis/collection';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
category: actionType.number(),
|
category: actionType.number(),
|
||||||
count: actionType.number().default(1),
|
count: actionType.number().default(1),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -3,7 +3,7 @@ import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
|||||||
import { MiniAppInfo, MiniAppInfoHelper } from '@/core/packet/utils/helper/miniAppHelper';
|
import { MiniAppInfo, MiniAppInfoHelper } from '@/core/packet/utils/helper/miniAppHelper';
|
||||||
import { MiniAppData, MiniAppRawData, MiniAppReqCustomParams, MiniAppReqParams } from '@/core/packet/entities/miniApp';
|
import { MiniAppData, MiniAppRawData, MiniAppReqCustomParams, MiniAppReqParams } from '@/core/packet/entities/miniApp';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.union([
|
const SchemaData = z.union([
|
||||||
z.object({
|
z.object({
|
||||||
type: z.union([z.literal('bili'), z.literal('weibo')]),
|
type: z.union([z.literal('bili'), z.literal('weibo')]),
|
||||||
|
@@ -2,7 +2,7 @@ import { NTVoteInfo } from '@/core';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
user_id: actionType.string().optional(),
|
user_id: actionType.string().optional(),
|
||||||
start: actionType.number().default(0),
|
start: actionType.number().default(0),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
user_id: actionType.number(),
|
user_id: actionType.number(),
|
||||||
});
|
});
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
file_id: actionType.string(),
|
file_id: actionType.string(),
|
||||||
|
@@ -4,7 +4,7 @@ import { checkFileExist, uriToLocalFile } from '@/common/file';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { GeneralCallResultStatus } from '@/core';
|
import { GeneralCallResultStatus } from '@/core';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
image: actionType.string(),
|
image: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
file_id: actionType.string(),
|
file_id: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { PacketHexStr } from '@/core/packet/transformer/base';
|
|||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
cmd: actionType.string(),
|
cmd: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
face_id: actionType.string(),// 参考 face_config.json 的 QSid
|
face_id: actionType.string(),// 参考 face_config.json 的 QSid
|
||||||
face_type: actionType.string().default('1'),
|
face_type: actionType.string().default('1'),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
remark: actionType.string(),
|
remark: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { ChatType } from '@/core';
|
import { ChatType } from '@/core';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
user_id: actionType.string(),
|
user_id: actionType.string(),
|
||||||
event_type: actionType.number(),
|
event_type: actionType.number(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
longNick: actionType.string(),
|
longNick: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
status: actionType.number(),
|
status: actionType.number(),
|
||||||
ext_status: actionType.number(),
|
ext_status: actionType.number(),
|
||||||
|
@@ -3,7 +3,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import fs from 'node:fs/promises';
|
import fs from 'node:fs/promises';
|
||||||
import { checkFileExist, uriToLocalFile } from '@/common/file';
|
import { checkFileExist, uriToLocalFile } from '@/common/file';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
file: actionType.string(),
|
file: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
user_id: actionType.string(),
|
user_id: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { GeneralCallResult } from '@/core';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
user_id: actionType.string().optional(),
|
user_id: actionType.string().optional(),
|
||||||
group_id: actionType.string().optional(),
|
group_id: actionType.string().optional(),
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
file_id: actionType.string(),
|
file_id: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
words: z.array(actionType.string()),
|
words: z.array(actionType.string()),
|
||||||
});
|
});
|
||||||
|
@@ -4,7 +4,7 @@ import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { OB11MessageImage, OB11MessageVideo } from '@/onebot/types';
|
import { OB11MessageImage, OB11MessageVideo } from '@/onebot/types';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
export interface GetFileResponse {
|
export interface GetFileResponse {
|
||||||
file?: string; // path
|
file?: string; // path
|
||||||
url?: string;
|
url?: string;
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
file_id: actionType.string(),
|
file_id: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
file_id: actionType.string(),
|
file_id: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
folder_name: actionType.string(),
|
folder_name: actionType.string(),
|
||||||
|
@@ -4,7 +4,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { NTQQGroupApi } from '@/core/apis';
|
import { NTQQGroupApi } from '@/core/apis';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
file_id: actionType.string(),
|
file_id: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { NTQQGroupApi } from '@/core/apis';
|
import { NTQQGroupApi } from '@/core/apis';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
folder_id: actionType.string().optional(),
|
folder_id: actionType.string().optional(),
|
||||||
|
@@ -5,7 +5,7 @@ import { join as joinPath } from 'node:path';
|
|||||||
import { calculateFileMD5, uriToLocalFile } from '@/common/file';
|
import { calculateFileMD5, uriToLocalFile } from '@/common/file';
|
||||||
import { randomUUID } from 'crypto';
|
import { randomUUID } from 'crypto';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
interface FileResponse {
|
interface FileResponse {
|
||||||
file: string;
|
file: string;
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@ import { MessageUnique } from '@/common/message-unique';
|
|||||||
import { ChatType, ElementType, MsgSourceType, NTMsgType, RawMessage } from '@/core';
|
import { ChatType, ElementType, MsgSourceType, NTMsgType, RawMessage } from '@/core';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { isNumeric } from '@/common/helper';
|
import { isNumeric } from '@/common/helper';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
message_id: actionType.string().optional(),
|
message_id: actionType.string().optional(),
|
||||||
id: actionType.string().optional(),
|
id: actionType.string().optional(),
|
||||||
|
@@ -5,7 +5,7 @@ import { ChatType } from '@/core/types';
|
|||||||
import { MessageUnique } from '@/common/message-unique';
|
import { MessageUnique } from '@/common/message-unique';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
interface Response {
|
interface Response {
|
||||||
messages: OB11Message[];
|
messages: OB11Message[];
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string()
|
group_id: actionType.string()
|
||||||
});
|
});
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string()
|
group_id: actionType.string()
|
||||||
});
|
});
|
||||||
|
@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { OB11Construct } from '@/onebot/helper/data';
|
import { OB11Construct } from '@/onebot/helper/data';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
folder_id: actionType.string().optional(),
|
folder_id: actionType.string().optional(),
|
||||||
|
@@ -2,7 +2,7 @@ import { WebHonorType } from '@/core';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
type: z.nativeEnum(WebHonorType).optional()
|
type: z.nativeEnum(WebHonorType).optional()
|
||||||
|
@@ -5,7 +5,7 @@ import { ChatType, Peer } from '@/core/types';
|
|||||||
import { MessageUnique } from '@/common/message-unique';
|
import { MessageUnique } from '@/common/message-unique';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
interface Response {
|
interface Response {
|
||||||
messages: OB11Message[];
|
messages: OB11Message[];
|
||||||
|
@@ -4,7 +4,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { OB11GroupFile, OB11GroupFileFolder } from '@/onebot';
|
import { OB11GroupFile, OB11GroupFileFolder } from '@/onebot';
|
||||||
import { OB11Construct } from '@/onebot/helper/data';
|
import { OB11Construct } from '@/onebot/helper/data';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
file_count: actionType.number().default(50),
|
file_count: actionType.number().default(50),
|
||||||
|
@@ -4,7 +4,7 @@ import { OB11Construct } from '@/onebot/helper/data';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { calcQQLevel } from '@/common/helper';
|
import { calcQQLevel } from '@/common/helper';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
user_id: actionType.string(),
|
user_id: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
url: actionType.string(),
|
url: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
friend_id: actionType.string().optional(),
|
friend_id: actionType.string().optional(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
model: actionType.string(),
|
model: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { unlink } from 'node:fs/promises';
|
import { unlink } from 'node:fs/promises';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
content: actionType.string(),
|
content: actionType.string(),
|
||||||
|
@@ -4,7 +4,7 @@ import { checkFileExistV2, uriToLocalFile } from '@/common/file';
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import fs from 'node:fs/promises';
|
import fs from 'node:fs/promises';
|
||||||
import { GeneralCallResult } from '@/core';
|
import { GeneralCallResult } from '@/core';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
file: actionType.string(),
|
file: actionType.string(),
|
||||||
group_id: actionType.string()
|
group_id: actionType.string()
|
||||||
|
@@ -2,7 +2,7 @@ import { NTQQUserApi } from '@/core/apis';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
nickname: actionType.string(),
|
nickname: actionType.string(),
|
||||||
personal_note: actionType.string().optional(),
|
personal_note: actionType.string().optional(),
|
||||||
|
@@ -5,7 +5,7 @@ import fs from 'fs';
|
|||||||
import { uriToLocalFile } from '@/common/file';
|
import { uriToLocalFile } from '@/common/file';
|
||||||
import { SendMessageContext } from '@/onebot/api';
|
import { SendMessageContext } from '@/onebot/api';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
file: actionType.string(),
|
file: actionType.string(),
|
||||||
|
@@ -6,7 +6,7 @@ import { uriToLocalFile } from '@/common/file';
|
|||||||
import { SendMessageContext } from '@/onebot/api';
|
import { SendMessageContext } from '@/onebot/api';
|
||||||
import { ContextMode, createContext } from '@/onebot/action/msg/SendMsg';
|
import { ContextMode, createContext } from '@/onebot/action/msg/SendMsg';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
user_id: actionType.string(),
|
user_id: actionType.string(),
|
||||||
file: actionType.string(),
|
file: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { MessageUnique } from '@/common/message-unique';
|
import { MessageUnique } from '@/common/message-unique';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
message_id: actionType.string(),
|
message_id: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
notice_id: actionType.string()
|
notice_id: actionType.string()
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
character: actionType.string(),
|
character: actionType.string(),
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
|
@@ -5,7 +5,7 @@ import { MessageUnique } from '@/common/message-unique';
|
|||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -3,7 +3,7 @@ import { OB11Construct } from '@/onebot/helper/data';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -3,7 +3,7 @@ import { OB11Construct } from '@/onebot/helper/data';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
no_cache: actionType.boolean().default(false),
|
no_cache: actionType.boolean().default(false),
|
||||||
|
@@ -3,7 +3,7 @@ import { OB11Construct } from '@/onebot/helper/data';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
|
@@ -4,7 +4,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { GroupMember } from '@/core';
|
import { GroupMember } from '@/core';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { WebApiGroupNoticeFeed } from '@/core';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
interface GroupNotice {
|
interface GroupNotice {
|
||||||
sender_id: number;
|
sender_id: number;
|
||||||
publish_time: number;
|
publish_time: number;
|
||||||
|
@@ -2,7 +2,7 @@ import { ShutUpGroupMember } from '@/core';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
user_id: actionType.string(),
|
user_id: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
import { AIVoiceChatType } from '@/core/packet/entities/aiChat';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
character: actionType.string(),
|
character: actionType.string(),
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { MessageUnique } from '@/common/message-unique';
|
import { MessageUnique } from '@/common/message-unique';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
message_id: actionType.string(),
|
message_id: actionType.string(),
|
||||||
});
|
});
|
||||||
|
@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { NTGroupRequestOperateTypes } from '@/core/types';
|
import { NTGroupRequestOperateTypes } from '@/core/types';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
flag: actionType.string(),
|
flag: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { NTGroupMemberRole } from '@/core/types';
|
import { NTGroupMemberRole } from '@/core/types';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
user_id: actionType.string(),
|
user_id: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
user_id: actionType.string(),
|
user_id: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
group_name: actionType.string(),
|
group_name: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string(),
|
group_id: actionType.string(),
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { MessageUnique } from '@/common/message-unique';
|
import { MessageUnique } from '@/common/message-unique';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
message_id: actionType.string(),
|
message_id: actionType.string(),
|
||||||
|
@@ -3,7 +3,7 @@ import { ChatType, Peer } from '@/core/types';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { MessageUnique } from '@/common/message-unique';
|
import { MessageUnique } from '@/common/message-unique';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
message_id: actionType.string(),
|
message_id: actionType.string(),
|
||||||
group_id: actionType.string().optional(),
|
group_id: actionType.string().optional(),
|
||||||
|
@@ -5,7 +5,7 @@ import { MessageUnique } from '@/common/message-unique';
|
|||||||
import { RawMessage } from '@/core';
|
import { RawMessage } from '@/core';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
export type ReturnDataType = OB11Message
|
export type ReturnDataType = OB11Message
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
|
@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { MessageUnique } from '@/common/message-unique';
|
import { MessageUnique } from '@/common/message-unique';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
user_id: actionType.string().optional(),
|
user_id: actionType.string().optional(),
|
||||||
group_id: actionType.string().optional(),
|
group_id: actionType.string().optional(),
|
||||||
|
@@ -2,7 +2,7 @@ import { ActionName } from '@/onebot/action/router';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { MessageUnique } from '@/common/message-unique';
|
import { MessageUnique } from '@/common/message-unique';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
message_id: actionType.string(),
|
message_id: actionType.string(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
group_id: actionType.string().optional(),
|
group_id: actionType.string().optional(),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
interface Response {
|
interface Response {
|
||||||
cookies: string,
|
cookies: string,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
import { GetPacketStatusDepends } from '@/onebot/action/packet/GetPacketStatus';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
user_id: actionType.string()
|
user_id: actionType.string()
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
interface Response {
|
interface Response {
|
||||||
cookies: string,
|
cookies: string,
|
||||||
bkn: string
|
bkn: string
|
||||||
|
@@ -3,7 +3,7 @@ import { OB11Construct } from '@/onebot/helper/data';
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
no_cache: actionType.boolean().optional(),
|
no_cache: actionType.boolean().optional(),
|
||||||
|
@@ -3,7 +3,7 @@ import { OneBotAction } from '@/onebot/action/OneBotAction';
|
|||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
count: actionType.number().default(10),
|
count: actionType.number().default(10),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
times: actionType.number().default(1),
|
times: actionType.number().default(1),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||||
import { ActionName } from '@/onebot/action/router';
|
import { ActionName } from '@/onebot/action/router';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../type';
|
import { actionType } from '@/common/coerce';
|
||||||
|
|
||||||
const SchemaData = z.object({
|
const SchemaData = z.object({
|
||||||
flag: actionType.string(),
|
flag: actionType.string(),
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '../action/type';
|
import { actionType } from '../../common/coerce';
|
||||||
|
|
||||||
const HttpServerConfigSchema = z.object({
|
const HttpServerConfigSchema = z.object({
|
||||||
name: actionType.string().default('http-server'),
|
name: actionType.string().default('http-server'),
|
||||||
|
@@ -4,7 +4,7 @@ import { resolve } from 'node:path';
|
|||||||
import { deepMerge } from '../utils/object';
|
import { deepMerge } from '../utils/object';
|
||||||
import { themeType } from '../types/theme';
|
import { themeType } from '../types/theme';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { actionType } from '@/onebot/action/type';
|
import { actionType } from '@/common/coerce';
|
||||||
// 定义配置的类型
|
// 定义配置的类型
|
||||||
const WebUiConfigSchema = z.object({
|
const WebUiConfigSchema = z.object({
|
||||||
host: actionType.string().default('0.0.0.0'),
|
host: actionType.string().default('0.0.0.0'),
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { actionType } from '@/onebot/action/type';
|
import { actionType } from '@/common/coerce';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
|
||||||
export const themeType = z.object(
|
export const themeType = z.object(
|
||||||
|
Reference in New Issue
Block a user