mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 08:10:25 +00:00
fix
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string(),
|
||||
folder_name: actionType.string(),
|
||||
group_id: coerce.string(),
|
||||
folder_name: coerce.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,10 +4,10 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { FileNapCatOneBotUUID } from '@/common/file-uuid';
|
||||
import { z } from 'zod';
|
||||
import { NTQQGroupApi } from '@/core/apis';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string(),
|
||||
file_id: actionType.string(),
|
||||
group_id: coerce.string(),
|
||||
file_id: coerce.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -2,11 +2,11 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { z } from 'zod';
|
||||
import { NTQQGroupApi } from '@/core/apis';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string(),
|
||||
folder_id: actionType.string().optional(),
|
||||
folder: actionType.string().optional(),
|
||||
group_id: coerce.string(),
|
||||
folder_id: coerce.string().optional(),
|
||||
folder: coerce.string().optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,16 +5,16 @@ import { join as joinPath } from 'node:path';
|
||||
import { calculateFileMD5, uriToLocalFile } from '@/common/file';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
interface FileResponse {
|
||||
file: string;
|
||||
}
|
||||
|
||||
const SchemaData = z.object({
|
||||
url: actionType.string().optional(),
|
||||
base64: actionType.string().optional(),
|
||||
name: actionType.string().optional(),
|
||||
headers: z.union([actionType.string(), z.array(actionType.string())]).optional(),
|
||||
url: coerce.string().optional(),
|
||||
base64: coerce.string().optional(),
|
||||
name: coerce.string().optional(),
|
||||
headers: z.union([coerce.string(), z.array(coerce.string())]).optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,10 +5,10 @@ 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 '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
message_id: actionType.string().optional(),
|
||||
id: actionType.string().optional(),
|
||||
message_id: coerce.string().optional(),
|
||||
id: coerce.string().optional(),
|
||||
});
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
|
||||
@@ -5,16 +5,16 @@ import { ChatType } from '@/core/types';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
import { z } from 'zod';
|
||||
import { NetworkAdapterConfig } from '@/onebot/config/config';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
|
||||
interface Response {
|
||||
messages: OB11Message[];
|
||||
}
|
||||
const SchemaData = z.object({
|
||||
user_id: actionType.string(),
|
||||
message_seq: actionType.string().optional(),
|
||||
count: actionType.number().default(20),
|
||||
reverseOrder: actionType.boolean().default(false)
|
||||
user_id: coerce.string(),
|
||||
message_seq: coerce.string().optional(),
|
||||
count: coerce.number().default(20),
|
||||
reverseOrder: coerce.boolean().default(false)
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string()
|
||||
group_id: coerce.string()
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string()
|
||||
group_id: coerce.string()
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,12 +3,12 @@ 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 '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string(),
|
||||
folder_id: actionType.string().optional(),
|
||||
folder: actionType.string().optional(),
|
||||
file_count: actionType.number().default(50),
|
||||
group_id: coerce.string(),
|
||||
folder_id: coerce.string().optional(),
|
||||
folder: coerce.string().optional(),
|
||||
file_count: coerce.number().default(50),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -2,9 +2,9 @@ import { WebHonorType } from '@/core';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string(),
|
||||
group_id: coerce.string(),
|
||||
type: z.nativeEnum(WebHonorType).optional()
|
||||
});
|
||||
|
||||
|
||||
@@ -5,17 +5,17 @@ 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 '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
|
||||
interface Response {
|
||||
messages: OB11Message[];
|
||||
}
|
||||
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string(),
|
||||
message_seq: actionType.string().optional(),
|
||||
count: actionType.number().default(20),
|
||||
reverseOrder: actionType.boolean().default(false)
|
||||
group_id: coerce.string(),
|
||||
message_seq: coerce.string().optional(),
|
||||
count: coerce.number().default(20),
|
||||
reverseOrder: coerce.boolean().default(false)
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ import { ActionName } from '@/onebot/action/router';
|
||||
import { OB11GroupFile, OB11GroupFileFolder } from '@/onebot';
|
||||
import { OB11Construct } from '@/onebot/helper/data';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string(),
|
||||
file_count: actionType.number().default(50),
|
||||
group_id: coerce.string(),
|
||||
file_count: coerce.number().default(50),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,11 +4,11 @@ import { OB11Construct } from '@/onebot/helper/data';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { calcQQLevel } from '@/common/helper';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
|
||||
const SchemaData = z.object({
|
||||
user_id: actionType.string(),
|
||||
no_cache: actionType.boolean().default(false),
|
||||
user_id: coerce.string(),
|
||||
no_cache: coerce.boolean().default(false),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
url: actionType.string(),
|
||||
url: coerce.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
|
||||
const SchemaData = z.object({
|
||||
friend_id: actionType.string().optional(),
|
||||
user_id: actionType.string().optional(),
|
||||
temp_block: actionType.boolean().optional(),
|
||||
temp_both_del: actionType.boolean().optional(),
|
||||
friend_id: coerce.string().optional(),
|
||||
user_id: coerce.string().optional(),
|
||||
temp_block: coerce.boolean().optional(),
|
||||
temp_both_del: coerce.boolean().optional(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
model: actionType.string(),
|
||||
model: coerce.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -3,16 +3,16 @@ 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 '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string(),
|
||||
content: actionType.string(),
|
||||
image: actionType.string().optional(),
|
||||
pinned: actionType.number().default(0),
|
||||
type: actionType.number().default(1),
|
||||
confirm_required: actionType.number().default(1),
|
||||
is_show_edit_card: actionType.number().default(0),
|
||||
tip_window_type: actionType.number().default(0),
|
||||
group_id: coerce.string(),
|
||||
content: coerce.string(),
|
||||
image: coerce.string().optional(),
|
||||
pinned: coerce.number().default(0),
|
||||
type: coerce.number().default(1),
|
||||
confirm_required: coerce.number().default(1),
|
||||
is_show_edit_card: coerce.number().default(0),
|
||||
tip_window_type: coerce.number().default(0),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -4,10 +4,10 @@ import { checkFileExistV2, uriToLocalFile } from '@/common/file';
|
||||
import { z } from 'zod';
|
||||
import fs from 'node:fs/promises';
|
||||
import { GeneralCallResult } from '@/core';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
file: actionType.string(),
|
||||
group_id: actionType.string()
|
||||
file: coerce.string(),
|
||||
group_id: coerce.string()
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -2,11 +2,11 @@ import { NTQQUserApi } from '@/core/apis';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '@/onebot/action/router';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
nickname: actionType.string(),
|
||||
personal_note: actionType.string().optional(),
|
||||
sex: actionType.string().optional(), // 传Sex值?建议传0
|
||||
nickname: coerce.string(),
|
||||
personal_note: coerce.string().optional(),
|
||||
sex: coerce.string().optional(), // 传Sex值?建议传0
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -5,13 +5,13 @@ import fs from 'fs';
|
||||
import { uriToLocalFile } from '@/common/file';
|
||||
import { SendMessageContext } from '@/onebot/api';
|
||||
import { z } from 'zod';
|
||||
import { actionType } from '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
group_id: actionType.string(),
|
||||
file: actionType.string(),
|
||||
name: actionType.string(),
|
||||
folder: actionType.string().optional(),
|
||||
folder_id: actionType.string().optional(),//临时扩展
|
||||
group_id: coerce.string(),
|
||||
file: coerce.string(),
|
||||
name: coerce.string(),
|
||||
folder: coerce.string().optional(),
|
||||
folder_id: coerce.string().optional(),//临时扩展
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
@@ -6,11 +6,11 @@ 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 '@/common/coerce';
|
||||
import { coerce } from '@/common/coerce';
|
||||
const SchemaData = z.object({
|
||||
user_id: actionType.string(),
|
||||
file: actionType.string(),
|
||||
name: actionType.string(),
|
||||
user_id: coerce.string(),
|
||||
file: coerce.string(),
|
||||
name: coerce.string(),
|
||||
});
|
||||
|
||||
type Payload = z.infer<typeof SchemaData>;
|
||||
|
||||
Reference in New Issue
Block a user