refactor: 优化eslint配置,提升代码质量 (#1341)
* feat: 统一并标准化eslint * lint: napcat.webui * lint: napcat.webui * lint: napcat.core * build: fix * lint: napcat.webui * refactor: 重构eslint * Update README.md
This commit is contained in:
651 files changed
+37978
-37584
No files matched your search
@@ -3,11 +3,11 @@ export enum LogLevel {
|
||||
INFO = 'info',
|
||||
WARN = 'warn',
|
||||
ERROR = 'error',
|
||||
FATAL = 'fatal'
|
||||
FATAL = 'fatal',
|
||||
}
|
||||
|
||||
export enum PlayMode {
|
||||
Loop = 'loop',
|
||||
Random = 'random',
|
||||
Single = 'single'
|
||||
Single = 'single',
|
||||
}
|
||||
@@ -9,7 +9,7 @@ enum key {
|
||||
isCollapsedMusicPlayer = 'is-collapsed-music-player',
|
||||
sideBarOpen = 'side-bar-open',
|
||||
httpDebugConfig = 'http-debug-config',
|
||||
wsDebugConfig = 'ws-debug-config'
|
||||
wsDebugConfig = 'ws-debug-config',
|
||||
}
|
||||
|
||||
export default key
|
||||
export default key;
|
||||
@@ -1,7 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
import { z } from 'zod';
|
||||
|
||||
import messageNodeSchema from './message/node'
|
||||
import { baseResponseSchema, commonResponseDataSchema } from './response'
|
||||
import messageNodeSchema from './message/node';
|
||||
import { baseResponseSchema, commonResponseDataSchema } from './response';
|
||||
|
||||
const oneBotHttpApiGroup = {
|
||||
'/set_group_kick': {
|
||||
@@ -9,18 +9,18 @@ const oneBotHttpApiGroup = {
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
user_id: z.union([z.string(), z.number()]).describe('QQ 号'),
|
||||
reject_add_request: z.boolean().describe('拒绝此人的加群请求')
|
||||
reject_add_request: z.boolean().describe('拒绝此人的加群请求'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/set_group_ban': {
|
||||
description: '群禁言',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
user_id: z.union([z.string(), z.number()]).describe('QQ 号'),
|
||||
duration: z.number()
|
||||
duration: z.number(),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/get_group_system_msg': {
|
||||
description: '获取群系统消息',
|
||||
@@ -38,7 +38,7 @@ const oneBotHttpApiGroup = {
|
||||
message: z.string().describe('入群回答'),
|
||||
group_name: z.string().describe('群名称'),
|
||||
checked: z.boolean().describe('是否已处理'),
|
||||
actor: z.string().describe('处理人 QQ 号')
|
||||
actor: z.string().describe('处理人 QQ 号'),
|
||||
})
|
||||
.describe('邀请入群请求')
|
||||
)
|
||||
@@ -52,16 +52,16 @@ const oneBotHttpApiGroup = {
|
||||
message: z.string().describe('入群回答'),
|
||||
group_name: z.string().describe('群名称'),
|
||||
checked: z.boolean().describe('是否已处理'),
|
||||
actor: z.string().describe('处理人 QQ 号')
|
||||
actor: z.string().describe('处理人 QQ 号'),
|
||||
})
|
||||
)
|
||||
})
|
||||
})
|
||||
),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_essence_msg_list': {
|
||||
description: '获取精华消息',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z
|
||||
@@ -76,44 +76,44 @@ const oneBotHttpApiGroup = {
|
||||
operator_nick: z.string().describe('操作人昵称'),
|
||||
message_id: z.string().describe('消息 ID'),
|
||||
operator_time: z.string().describe('操作时间'),
|
||||
content: z.array(messageNodeSchema)
|
||||
content: z.array(messageNodeSchema),
|
||||
})
|
||||
.describe('精华消息')
|
||||
)
|
||||
.describe('精华消息列表')
|
||||
})
|
||||
.describe('精华消息列表'),
|
||||
}),
|
||||
},
|
||||
'/set_group_whole_ban': {
|
||||
description: '全员禁言',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
enable: z.boolean().describe('是否开启')
|
||||
enable: z.boolean().describe('是否开启'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/set_group_portrait': {
|
||||
description: '设置群头像',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
file: z.string().describe('图片文件路径,服务器本地路径或远程 URL')
|
||||
file: z.string().describe('图片文件路径,服务器本地路径或远程 URL'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/set_group_admin': {
|
||||
description: '设置群管理',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
user_id: z.union([z.string(), z.number()]).describe('QQ 号'),
|
||||
enable: z.boolean().describe('是否设置为管理员')
|
||||
enable: z.boolean().describe('是否设置为管理员'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/set_essence_msg': {
|
||||
description: '设置群精华消息',
|
||||
request: z.object({
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息 ID')
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息 ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
@@ -139,28 +139,28 @@ const oneBotHttpApiGroup = {
|
||||
addDigestTime: z.number().describe('添加精华消息时间'),
|
||||
startTime: z.number().describe('开始时间'),
|
||||
latestMsgSeq: z.number().describe('最新消息序号'),
|
||||
opType: z.number().describe('操作类型')
|
||||
opType: z.number().describe('操作类型'),
|
||||
})
|
||||
.describe('消息内容'),
|
||||
errorCode: z.number().describe('错误码')
|
||||
errorCode: z.number().describe('错误码'),
|
||||
})
|
||||
.describe('结果')
|
||||
})
|
||||
})
|
||||
.describe('结果'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/set_group_card': {
|
||||
description: '设置群成员名片',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
user_id: z.union([z.string(), z.number()]).describe('QQ 号'),
|
||||
card: z.string().describe('名片')
|
||||
card: z.string().describe('名片'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/delete_essence_msg': {
|
||||
description: '删除群精华消息',
|
||||
request: z.object({
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息 ID')
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息 ID'),
|
||||
}),
|
||||
|
||||
response: baseResponseSchema.extend({
|
||||
@@ -186,42 +186,42 @@ const oneBotHttpApiGroup = {
|
||||
addDigestTime: z.number().describe('添加精华消息时间'),
|
||||
startTime: z.number().describe('开始时间'),
|
||||
latestMsgSeq: z.number().describe('最新消息序号'),
|
||||
opType: z.number().describe('操作类型')
|
||||
opType: z.number().describe('操作类型'),
|
||||
}),
|
||||
errorCode: z.number().describe('错误码')
|
||||
errorCode: z.number().describe('错误码'),
|
||||
})
|
||||
.describe('结果')
|
||||
})
|
||||
})
|
||||
.describe('结果'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/set_group_name': {
|
||||
description: '设置群名称',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
group_name: z.string().describe('群名称')
|
||||
group_name: z.string().describe('群名称'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/set_group_leave': {
|
||||
description: '退出群聊',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/_send_group_notice': {
|
||||
description: '发送群公告',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
content: z.string().describe('公告内容'),
|
||||
image: z.string().optional().describe('图片地址')
|
||||
image: z.string().optional().describe('图片地址'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/_get_group_notice': {
|
||||
description: '获取群公告',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(
|
||||
@@ -237,24 +237,24 @@ const oneBotHttpApiGroup = {
|
||||
.object({
|
||||
id: z.string().describe('图片 ID'),
|
||||
height: z.string().describe('高度'),
|
||||
width: z.string().describe('宽度')
|
||||
width: z.string().describe('宽度'),
|
||||
})
|
||||
.describe('图片信息')
|
||||
)
|
||||
.describe('图片内容列表')
|
||||
})
|
||||
.describe('图片内容列表'),
|
||||
}),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/set_group_special_title': {
|
||||
description: '设置群成员专属头衔',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
user_id: z.union([z.string(), z.number()]).describe('QQ 号'),
|
||||
special_title: z.string().describe('专属头衔内容')
|
||||
special_title: z.string().describe('专属头衔内容'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/upload_group_file': {
|
||||
description: '上传群文件',
|
||||
@@ -262,34 +262,34 @@ const oneBotHttpApiGroup = {
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
file: z.string().describe('文件路径'),
|
||||
name: z.string().describe('文件名'),
|
||||
folder_id: z.string().describe('文件夹 ID')
|
||||
folder_id: z.string().describe('文件夹 ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/set_group_add_request': {
|
||||
description: '处理加群请求',
|
||||
request: z.object({
|
||||
flag: z.string().describe('请求ID'),
|
||||
approve: z.boolean().describe('是否同意'),
|
||||
reason: z.string().optional().describe('拒绝理由')
|
||||
reason: z.string().optional().describe('拒绝理由'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/get_group_info': {
|
||||
description: '获取群信息',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({})
|
||||
})
|
||||
data: z.object({}),
|
||||
}),
|
||||
},
|
||||
'/get_group_info_ex': {
|
||||
description: '获取群信息扩展',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z
|
||||
@@ -315,7 +315,7 @@ const oneBotHttpApiGroup = {
|
||||
.object({
|
||||
memberUin: z.string().describe('群主QQ号'),
|
||||
memberUid: z.string().describe('群主ID'),
|
||||
memberQid: z.string().describe('群主QID')
|
||||
memberQid: z.string().describe('群主QID'),
|
||||
})
|
||||
.describe('群主信息'),
|
||||
essentialMsgPrivilege: z.number().describe('精华消息权限'),
|
||||
@@ -327,7 +327,7 @@ const oneBotHttpApiGroup = {
|
||||
groupFlagPro1: z.string()?.describe('群标识1'),
|
||||
groupBindGuildIds: z
|
||||
.object({
|
||||
guildIds: z.array(z.string())
|
||||
guildIds: z.array(z.string()),
|
||||
})
|
||||
.describe('绑定频道ID列表?'),
|
||||
viewedMsgDisappearTime: z.string().describe('消息消失时间'),
|
||||
@@ -337,13 +337,13 @@ const oneBotHttpApiGroup = {
|
||||
dayNums: z.array(z.number()).describe('天数列表'),
|
||||
version: z.number().describe('版本号'),
|
||||
updateTime: z.string().describe('更新时间'),
|
||||
isDisplayDayNum: z.boolean().describe('是否显示天数')
|
||||
isDisplayDayNum: z.boolean().describe('是否显示天数'),
|
||||
}),
|
||||
groupBindGuildSwitch: z.number().describe('绑定频道开关'),
|
||||
groupAioBindGuildId: z.string().describe('AIO绑定频道ID'),
|
||||
groupExcludeGuildIds: z
|
||||
.object({
|
||||
guildIds: z.array(z.string()).describe('排除频道ID')
|
||||
guildIds: z.array(z.string()).describe('排除频道ID'),
|
||||
})
|
||||
.describe('排除频道ID列表?'),
|
||||
fullGroupExpansionSwitch: z.number().describe('全员群扩容开关'),
|
||||
@@ -354,18 +354,18 @@ const oneBotHttpApiGroup = {
|
||||
inviteRobotMemberExamine: z
|
||||
.number()
|
||||
.describe('邀请机器人成员审核'),
|
||||
groupSquareSwitch: z.number().describe('群广场开关')
|
||||
groupSquareSwitch: z.number().describe('群广场开关'),
|
||||
})
|
||||
.describe('扩展信息')
|
||||
.describe('扩展信息'),
|
||||
})
|
||||
.describe('结果')
|
||||
})
|
||||
.describe('结果'),
|
||||
}),
|
||||
},
|
||||
'/create_group_file_folder': {
|
||||
description: '创建群文件夹',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
folder_name: z.string().describe('文件夹名称')
|
||||
folder_name: z.string().describe('文件夹名称'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z
|
||||
@@ -374,7 +374,7 @@ const oneBotHttpApiGroup = {
|
||||
.object({
|
||||
retCode: z.number().describe('结果码'),
|
||||
retMsg: z.string().describe('结果信息'),
|
||||
clientWording: z.string().describe('客户端提示')
|
||||
clientWording: z.string().describe('客户端提示'),
|
||||
})
|
||||
.describe('结果'),
|
||||
groupItem: z
|
||||
@@ -393,20 +393,20 @@ const oneBotHttpApiGroup = {
|
||||
totalFileCount: z.string().describe('文件总数'),
|
||||
modifyUin: z.string().describe('修改人 QQ 号'),
|
||||
modifyName: z.string().describe('修改人昵称'),
|
||||
usedSpace: z.string().describe('已使用空间')
|
||||
usedSpace: z.string().describe('已使用空间'),
|
||||
})
|
||||
.describe('文件夹信息')
|
||||
.describe('文件夹信息'),
|
||||
})
|
||||
.describe('群文件夹信息')
|
||||
.describe('群文件夹信息'),
|
||||
})
|
||||
.describe('数据')
|
||||
})
|
||||
.describe('数据'),
|
||||
}),
|
||||
},
|
||||
'/delete_group_file': {
|
||||
description: '删除群文件',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
file_id: z.string().describe('文件 ID')
|
||||
file_id: z.string().describe('文件 ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z
|
||||
@@ -419,51 +419,51 @@ const oneBotHttpApiGroup = {
|
||||
.object({
|
||||
retCode: z.number().describe('结果码'),
|
||||
retMsg: z.string().describe('结果信息'),
|
||||
clientWording: z.string().describe('客户端提示')
|
||||
clientWording: z.string().describe('客户端提示'),
|
||||
})
|
||||
.describe('结果'),
|
||||
successFileIdList: z
|
||||
.array(z.string())
|
||||
.describe('成功文件 ID 列表'),
|
||||
failFileIdList: z.array(z.string()).describe('失败文件 ID 列表')
|
||||
failFileIdList: z.array(z.string()).describe('失败文件 ID 列表'),
|
||||
})
|
||||
.describe('删除群文件结果')
|
||||
.describe('删除群文件结果'),
|
||||
})
|
||||
.describe('结果')
|
||||
})
|
||||
.describe('结果'),
|
||||
}),
|
||||
},
|
||||
'/delete_group_folder': {
|
||||
description: '删除群文件夹',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
folder_id: z.string().describe('文件夹 ID')
|
||||
folder_id: z.string().describe('文件夹 ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
retCode: z.number().describe('结果码'),
|
||||
retMsg: z.string().describe('结果信息'),
|
||||
clientWording: z.string().describe('客户端提示')
|
||||
})
|
||||
})
|
||||
clientWording: z.string().describe('客户端提示'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_group_file_system_info': {
|
||||
description: '获取群文件系统信息',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
file_count: z.number().describe('文件总数'),
|
||||
limit_count: z.number().describe('文件总数限制'),
|
||||
used_space: z.number().describe('已使用空间'),
|
||||
total_space: z.number().describe('总空间')
|
||||
})
|
||||
})
|
||||
total_space: z.number().describe('总空间'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_group_root_files': {
|
||||
description: '获取群根目录文件列表',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(
|
||||
@@ -482,7 +482,7 @@ const oneBotHttpApiGroup = {
|
||||
modify_time: z.number().describe('修改时间'),
|
||||
download_times: z.number().describe('下载次数'),
|
||||
uploader: z.number().describe('上传人 QQ 号'),
|
||||
uploader_name: z.string().describe('上传人昵称')
|
||||
uploader_name: z.string().describe('上传人昵称'),
|
||||
})
|
||||
.describe('文件信息')
|
||||
)
|
||||
@@ -498,21 +498,21 @@ const oneBotHttpApiGroup = {
|
||||
create_time: z.string().describe('创建时间'),
|
||||
creator: z.string().describe('创建人 QQ 号'),
|
||||
creator_name: z.string().describe('创建人昵称'),
|
||||
total_file_count: z.string().describe('文件总数')
|
||||
total_file_count: z.string().describe('文件总数'),
|
||||
})
|
||||
.describe('文件夹信息')
|
||||
)
|
||||
.describe('文件夹列表')
|
||||
.describe('文件夹列表'),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/get_group_files_by_folder': {
|
||||
description: '获取群子目录文件列表',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
folder_id: z.string().describe('文件夹 ID'),
|
||||
file_count: z.number().describe('文件数量')
|
||||
file_count: z.number().describe('文件数量'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
@@ -530,7 +530,7 @@ const oneBotHttpApiGroup = {
|
||||
modify_time: z.number().describe('修改时间'),
|
||||
download_times: z.number().describe('下载次数'),
|
||||
uploader: z.number().describe('上传人 QQ 号'),
|
||||
uploader_name: z.string().describe('上传人昵称')
|
||||
uploader_name: z.string().describe('上传人昵称'),
|
||||
})
|
||||
.describe('文件信息')
|
||||
)
|
||||
@@ -546,60 +546,60 @@ const oneBotHttpApiGroup = {
|
||||
create_time: z.string().describe('创建时间'),
|
||||
creator: z.string().describe('创建人 QQ 号'),
|
||||
creator_name: z.string().describe('创建人昵称'),
|
||||
total_file_count: z.string().describe('文件总数')
|
||||
total_file_count: z.string().describe('文件总数'),
|
||||
})
|
||||
.describe('文件夹信息')
|
||||
)
|
||||
.describe('文件夹列表')
|
||||
})
|
||||
})
|
||||
.describe('文件夹列表'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_group_file_url': {
|
||||
description: '获取群文件下载链接',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
file_id: z.string().describe('文件 ID')
|
||||
file_id: z.string().describe('文件 ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
url: z.string().describe('下载链接')
|
||||
})
|
||||
})
|
||||
url: z.string().describe('下载链接'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_group_list': {
|
||||
description: '获取群列表',
|
||||
request: z.object({
|
||||
next_token: z.string().optional().describe('下一页标识')
|
||||
next_token: z.string().optional().describe('下一页标识'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(z.object({}))
|
||||
})
|
||||
data: z.array(z.object({})),
|
||||
}),
|
||||
},
|
||||
'/get_group_member_info': {
|
||||
description: '获取群成员信息',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
user_id: z.union([z.string(), z.number()]).describe('QQ 号'),
|
||||
no_cache: z.boolean().describe('是否不使用缓存')
|
||||
no_cache: z.boolean().describe('是否不使用缓存'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({})
|
||||
})
|
||||
data: z.object({}),
|
||||
}),
|
||||
},
|
||||
'/get_group_member_list': {
|
||||
description: '获取群成员列表',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
no_cache: z.boolean().describe('是否不使用缓存')
|
||||
no_cache: z.boolean().describe('是否不使用缓存'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(z.object({}))
|
||||
})
|
||||
data: z.array(z.object({})),
|
||||
}),
|
||||
},
|
||||
'/get_group_honor_info': {
|
||||
description: '获取群荣誉',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z
|
||||
@@ -611,7 +611,7 @@ const oneBotHttpApiGroup = {
|
||||
avatar: z.string().describe('头像 URL'),
|
||||
nickname: z.string().describe('昵称'),
|
||||
day_count: z.number().describe('天数'),
|
||||
description: z.string().describe('描述')
|
||||
description: z.string().describe('描述'),
|
||||
})
|
||||
.describe('当前龙王'),
|
||||
talkative_list: z
|
||||
@@ -621,7 +621,7 @@ const oneBotHttpApiGroup = {
|
||||
avatar: z.string().describe('头像 URL'),
|
||||
nickname: z.string().describe('昵称'),
|
||||
day_count: z.number().describe('天数'),
|
||||
description: z.string().describe('描述')
|
||||
description: z.string().describe('描述'),
|
||||
})
|
||||
)
|
||||
.describe('龙王榜'),
|
||||
@@ -631,34 +631,34 @@ const oneBotHttpApiGroup = {
|
||||
user_id: z.number().describe('QQ 号'),
|
||||
avatar: z.string().describe('头像 URL'),
|
||||
nickname: z.string().describe('昵称'),
|
||||
description: z.string().describe('描述')
|
||||
description: z.string().describe('描述'),
|
||||
})
|
||||
)
|
||||
.describe('?'),
|
||||
legend_list: z.array(z.string()).describe('?'),
|
||||
emotion_list: z.array(z.string()).describe('?'),
|
||||
strong_newbie_list: z.array(z.string()).describe('?')
|
||||
strong_newbie_list: z.array(z.string()).describe('?'),
|
||||
})
|
||||
.describe('群荣誉信息')
|
||||
})
|
||||
.describe('群荣誉信息'),
|
||||
}),
|
||||
},
|
||||
'/get_group_at_all_remain': {
|
||||
description: '获取群 @全体成员 剩余次数',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
can_at_all: z.boolean().describe('是否可以 @全体成员'),
|
||||
remain_at_all_count_for_group: z.number().describe('剩余次数(group?)'),
|
||||
remain_at_all_count_for_uin: z.number().describe('剩余次数(qq?)')
|
||||
})
|
||||
})
|
||||
remain_at_all_count_for_uin: z.number().describe('剩余次数(qq?)'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_group_ignored_notifies': {
|
||||
description: '获取群过滤系统消息',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
@@ -671,32 +671,32 @@ const oneBotHttpApiGroup = {
|
||||
group_id: z.string().describe('群号'),
|
||||
group_name: z.string().describe('群名称'),
|
||||
checked: z.boolean().describe('是否已处理'),
|
||||
actor: z.string().describe('处理人 QQ 号')
|
||||
actor: z.string().describe('处理人 QQ 号'),
|
||||
})
|
||||
)
|
||||
.describe('入群请求列表')
|
||||
})
|
||||
})
|
||||
.describe('入群请求列表'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/set_group_sign': {
|
||||
description: '设置群打卡',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/send_group_sign': {
|
||||
description: '发送群打卡',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/get_ai_characters': {
|
||||
description: '获取AI语音人物',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
chat_type: z.union([z.string(), z.number()]).describe('聊天类型')
|
||||
chat_type: z.union([z.string(), z.number()]).describe('聊天类型'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(
|
||||
@@ -707,38 +707,38 @@ const oneBotHttpApiGroup = {
|
||||
.object({
|
||||
character_id: z.string().describe('人物 ID'),
|
||||
character_name: z.string().describe('人物名称'),
|
||||
preview_url: z.string().describe('预览音频地址')
|
||||
preview_url: z.string().describe('预览音频地址'),
|
||||
})
|
||||
.describe('人物信息')
|
||||
)
|
||||
),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/send_group_ai_record': {
|
||||
description: '发送群AI语音',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
character: z.string().describe('人物ID'),
|
||||
text: z.string().describe('文本内容')
|
||||
text: z.string().describe('文本内容'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
message_id: z.string().describe('消息 ID')
|
||||
})
|
||||
})
|
||||
message_id: z.string().describe('消息 ID'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_ai_record': {
|
||||
description: '获取AI语音',
|
||||
request: z.object({
|
||||
group_id: z.string().describe('群号'),
|
||||
character: z.string().describe('人物ID'),
|
||||
text: z.string().describe('文本内容')
|
||||
text: z.string().describe('文本内容'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.string()
|
||||
})
|
||||
}
|
||||
} as const
|
||||
data: z.string(),
|
||||
}),
|
||||
},
|
||||
} as const;
|
||||
|
||||
export default oneBotHttpApiGroup
|
||||
export default oneBotHttpApiGroup;
|
||||
@@ -1,15 +1,15 @@
|
||||
import { ZodSchema } from 'zod'
|
||||
import { ZodSchema } from 'zod';
|
||||
|
||||
import oneBotHttpApiGroup from './group'
|
||||
import oneBotHttpApiMessage from './message'
|
||||
import oneBotHttpApiSystem from './system'
|
||||
import oneBotHttpApiUser from './user'
|
||||
import oneBotHttpApiGroup from './group';
|
||||
import oneBotHttpApiMessage from './message';
|
||||
import oneBotHttpApiSystem from './system';
|
||||
import oneBotHttpApiUser from './user';
|
||||
|
||||
type AllKey =
|
||||
| keyof typeof oneBotHttpApiUser
|
||||
| keyof typeof oneBotHttpApiMessage
|
||||
| keyof typeof oneBotHttpApiGroup
|
||||
| keyof typeof oneBotHttpApiSystem
|
||||
| keyof typeof oneBotHttpApiSystem;
|
||||
|
||||
export type OneBotHttpApi = Record<
|
||||
AllKey,
|
||||
@@ -18,17 +18,17 @@ export type OneBotHttpApi = Record<
|
||||
request: ZodSchema
|
||||
response: ZodSchema
|
||||
}
|
||||
>
|
||||
>;
|
||||
|
||||
const oneBotHttpApi: OneBotHttpApi = {
|
||||
...oneBotHttpApiUser,
|
||||
...oneBotHttpApiMessage,
|
||||
...oneBotHttpApiGroup,
|
||||
...oneBotHttpApiSystem
|
||||
} as const
|
||||
...oneBotHttpApiSystem,
|
||||
} as const;
|
||||
|
||||
export type OneBotHttpApiPath = keyof OneBotHttpApi
|
||||
export type OneBotHttpApiPath = keyof OneBotHttpApi;
|
||||
|
||||
export type OneBotHttpApiContent = OneBotHttpApi[OneBotHttpApiPath]
|
||||
export type OneBotHttpApiContent = OneBotHttpApi[OneBotHttpApiPath];
|
||||
|
||||
export default oneBotHttpApi
|
||||
export default oneBotHttpApi;
|
||||
@@ -1,8 +1,8 @@
|
||||
import { z } from 'zod'
|
||||
import type { ZodSchema } from 'zod'
|
||||
import { z } from 'zod';
|
||||
import type { ZodSchema } from 'zod';
|
||||
|
||||
import { baseResponseSchema, commonResponseDataSchema } from '../response'
|
||||
import messageNodeSchema, { nodeMessage } from './node'
|
||||
import { baseResponseSchema, commonResponseDataSchema } from '../response';
|
||||
import messageNodeSchema, { nodeMessage } from './node';
|
||||
|
||||
const oneBotHttpApiMessageGroup: Record<
|
||||
string,
|
||||
@@ -20,26 +20,26 @@ const oneBotHttpApiMessageGroup: Record<
|
||||
.union([z.string(), z.number()])
|
||||
.describe('群号')
|
||||
.describe('群号'),
|
||||
message: z.array(messageNodeSchema).describe('消息内容')
|
||||
message: z.array(messageNodeSchema).describe('消息内容'),
|
||||
})
|
||||
.refine(
|
||||
(data) => {
|
||||
const hasReply = data.message.some((item) => item.type === 'reply')
|
||||
const hasReply = data.message.some((item) => item.type === 'reply');
|
||||
|
||||
if (hasReply) {
|
||||
return data.message[0].type === 'reply'
|
||||
return data.message[0].type === 'reply';
|
||||
}
|
||||
|
||||
return true
|
||||
return true;
|
||||
},
|
||||
{
|
||||
message:
|
||||
'如果 message 包含 reply 类型的消息,那么只能包含一个,而且排在最前面'
|
||||
'如果 message 包含 reply 类型的消息,那么只能包含一个,而且排在最前面',
|
||||
}
|
||||
),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/send_group_forward_msg': {
|
||||
description: '发送群合并转发消息',
|
||||
@@ -49,36 +49,36 @@ const oneBotHttpApiMessageGroup: Record<
|
||||
news: z
|
||||
.array(
|
||||
z.object({
|
||||
text: z.string()
|
||||
text: z.string(),
|
||||
})
|
||||
)
|
||||
.describe('?'),
|
||||
prompt: z.string().describe('外显'),
|
||||
summary: z.string().describe('底下文本'),
|
||||
source: z.string().describe('内容')
|
||||
source: z.string().describe('内容'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/forward_group_single_msg': {
|
||||
description: '消息转发到群',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息 ID')
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息 ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/group_poke': {
|
||||
description: '发送戳一戳',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号')
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
}
|
||||
}
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
};
|
||||
|
||||
export default oneBotHttpApiMessageGroup
|
||||
export default oneBotHttpApiMessageGroup;
|
||||
@@ -1,9 +1,9 @@
|
||||
import { z } from 'zod'
|
||||
import { z } from 'zod';
|
||||
|
||||
import { baseResponseSchema, commonResponseDataSchema } from '../response'
|
||||
import oneBotHttpApiMessageGroup from './group'
|
||||
import messageNodeSchema from './node'
|
||||
import oneBotHttpApiMessagePrivate from './private'
|
||||
import { baseResponseSchema, commonResponseDataSchema } from '../response';
|
||||
import oneBotHttpApiMessageGroup from './group';
|
||||
import messageNodeSchema from './node';
|
||||
import oneBotHttpApiMessagePrivate from './private';
|
||||
|
||||
const fileSchema = z
|
||||
.object({
|
||||
@@ -11,9 +11,9 @@ const fileSchema = z
|
||||
url: z.string().describe('路径或链接'),
|
||||
file_size: z.string().describe('文件大小'),
|
||||
file_name: z.string().describe('文件名'),
|
||||
base64: z.string().describe('文件base64编码')
|
||||
base64: z.string().describe('文件base64编码'),
|
||||
})
|
||||
.describe('文件')
|
||||
.describe('文件');
|
||||
const messageSchema = z
|
||||
.object({
|
||||
self_id: z.number().describe('自己QQ号'),
|
||||
@@ -30,7 +30,7 @@ const messageSchema = z
|
||||
sex: z.enum(['male', 'female', 'unknown']).describe('性别'),
|
||||
age: z.number().describe('年龄'),
|
||||
card: z.string().describe('名片'),
|
||||
role: z.enum(['owner', 'admin', 'member']).describe('角色')
|
||||
role: z.enum(['owner', 'admin', 'member']).describe('角色'),
|
||||
})
|
||||
.describe('发送人信息'),
|
||||
raw_message: z.string().describe('原始消息'),
|
||||
@@ -40,9 +40,9 @@ const messageSchema = z
|
||||
message_format: z.string().describe('消息格式'),
|
||||
post_type: z.string().describe('?'),
|
||||
message_sent_type: z.string().describe('消息发送类型'),
|
||||
group_id: z.number().describe('群号')
|
||||
group_id: z.number().describe('群号'),
|
||||
})
|
||||
.describe('消息')
|
||||
.describe('消息');
|
||||
|
||||
const oneBotHttpApiMessage = {
|
||||
...oneBotHttpApiMessagePrivate,
|
||||
@@ -58,61 +58,61 @@ const oneBotHttpApiMessage = {
|
||||
user_id: z
|
||||
.union([z.string(), z.number()])
|
||||
.optional()
|
||||
.describe('用户QQ号,与 group_id 二选一')
|
||||
.describe('用户QQ号,与 group_id 二选一'),
|
||||
})
|
||||
.refine(
|
||||
(data) =>
|
||||
(data.group_id && !data.user_id) || (!data.group_id && data.user_id),
|
||||
{
|
||||
message: 'group_id 和 user_id 必须二选一,且不能同时存在或同时为空',
|
||||
path: ['group_id', 'user_id']
|
||||
path: ['group_id', 'user_id'],
|
||||
}
|
||||
),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/mark_group_msg_as_read': {
|
||||
description: '标记群消息已读',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/mark_private_msg_as_read': {
|
||||
description: '标记私聊消息已读',
|
||||
request: z.object({
|
||||
user_id: z.union([z.string(), z.number()]).describe('用户QQ号')
|
||||
user_id: z.union([z.string(), z.number()]).describe('用户QQ号'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/_mark_all_as_read': {
|
||||
description: '标记所有消息已读',
|
||||
request: z.object({}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/delete_msg': {
|
||||
description: '撤回消息',
|
||||
request: z.object({
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息ID')
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息ID'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/get_msg': {
|
||||
description: '获取消息',
|
||||
request: z.object({
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息ID')
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({})
|
||||
})
|
||||
data: z.object({}),
|
||||
}),
|
||||
},
|
||||
'/get_image': {
|
||||
description: '获取图片',
|
||||
request: z.object({
|
||||
file_id: z.string().describe('文件ID')
|
||||
file_id: z.string().describe('文件ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: fileSchema
|
||||
})
|
||||
data: fileSchema,
|
||||
}),
|
||||
},
|
||||
'/get_record': {
|
||||
description: '获取语音',
|
||||
@@ -120,20 +120,20 @@ const oneBotHttpApiMessage = {
|
||||
file_id: z.string().describe('文件ID'),
|
||||
out_format: z
|
||||
.enum(['mp3', 'amr', 'wma', 'm4a', 'spx', 'ogg', 'wav', 'flac'])
|
||||
.describe('输出格式')
|
||||
.describe('输出格式'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: fileSchema
|
||||
})
|
||||
data: fileSchema,
|
||||
}),
|
||||
},
|
||||
'/get_file': {
|
||||
description: '获取文件',
|
||||
request: z.object({
|
||||
file_id: z.string().describe('文件ID')
|
||||
file_id: z.string().describe('文件ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: fileSchema
|
||||
})
|
||||
data: fileSchema,
|
||||
}),
|
||||
},
|
||||
'/get_group_msg_history': {
|
||||
description: '获取群消息历史',
|
||||
@@ -141,24 +141,24 @@ const oneBotHttpApiMessage = {
|
||||
group_id: z.union([z.string(), z.number()]).describe('群号'),
|
||||
message_seq: z.union([z.string(), z.number()]).describe('消息序号'),
|
||||
count: z.number().int().positive().describe('获取数量'),
|
||||
reverseOrder: z.boolean().describe('是否倒序')
|
||||
reverseOrder: z.boolean().describe('是否倒序'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
messages: z.array(messageSchema).describe('消息列表')
|
||||
})
|
||||
})
|
||||
messages: z.array(messageSchema).describe('消息列表'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/set_msg_emoji_like': {
|
||||
description: '贴表情',
|
||||
request: z.object({
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息ID'),
|
||||
emoji_id: z.number().describe('表情ID'),
|
||||
set: z.boolean().describe('?')
|
||||
set: z.boolean().describe('?'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/get_friend_msg_history': {
|
||||
description: '获取好友消息历史',
|
||||
@@ -166,18 +166,18 @@ const oneBotHttpApiMessage = {
|
||||
user_id: z.union([z.string(), z.number()]).describe('用户QQ号'),
|
||||
message_seq: z.union([z.string(), z.number()]).describe('消息序号'),
|
||||
count: z.number().int().positive().describe('获取数量'),
|
||||
reverseOrder: z.boolean().describe('是否倒序')
|
||||
reverseOrder: z.boolean().describe('是否倒序'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
messages: z.array(messageSchema)
|
||||
})
|
||||
})
|
||||
messages: z.array(messageSchema),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_recent_contact': {
|
||||
description: '最近消息列表',
|
||||
request: z.object({
|
||||
count: z.number().int().positive().describe('获取数量')
|
||||
count: z.number().int().positive().describe('获取数量'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(
|
||||
@@ -190,10 +190,10 @@ const oneBotHttpApiMessage = {
|
||||
msgId: z.string().describe('消息ID'),
|
||||
sendNickName: z.string().describe('发送人昵称'),
|
||||
sendMemberName: z.string().describe('发送人?昵称'),
|
||||
peerName: z.string().describe('对方昵称')
|
||||
peerName: z.string().describe('对方昵称'),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/fetch_emoji_like': {
|
||||
description: '获取贴表情详情',
|
||||
@@ -206,7 +206,7 @@ const oneBotHttpApiMessage = {
|
||||
.union([z.string(), z.number()])
|
||||
.optional()
|
||||
.describe('用户QQ号'),
|
||||
count: z.number().int().positive().optional().describe('获取数量')
|
||||
count: z.number().int().positive().optional().describe('获取数量'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
@@ -218,25 +218,25 @@ const oneBotHttpApiMessage = {
|
||||
.object({
|
||||
tinyId: z.string().describe('表情ID'),
|
||||
nickName: z.string().describe('昵称?'),
|
||||
headUrl: z.string().describe('头像?')
|
||||
headUrl: z.string().describe('头像?'),
|
||||
})
|
||||
.describe('表情点赞列表')
|
||||
)
|
||||
.describe('表情点赞列表'),
|
||||
cookie: z.string().describe('cookie'),
|
||||
isLastPage: z.boolean().describe('是否最后一页'),
|
||||
isFirstPage: z.boolean().describe('是否第一页')
|
||||
})
|
||||
})
|
||||
isFirstPage: z.boolean().describe('是否第一页'),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_forward_msg': {
|
||||
description: '获取合并转发消息',
|
||||
request: z.object({
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息ID')
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({})
|
||||
})
|
||||
data: z.object({}),
|
||||
}),
|
||||
},
|
||||
'/send_forward_msg': {
|
||||
description: '发送合并转发消息',
|
||||
@@ -250,20 +250,20 @@ const oneBotHttpApiMessage = {
|
||||
news: z
|
||||
.array(
|
||||
z.object({
|
||||
text: z.string()
|
||||
text: z.string(),
|
||||
})
|
||||
)
|
||||
.describe('?'),
|
||||
prompt: z.string().describe('外显'),
|
||||
summary: z.string().describe('底下文字'),
|
||||
source: z.string().describe('内容')
|
||||
source: z.string().describe('内容'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema.extend({
|
||||
data: z.object({})
|
||||
})
|
||||
})
|
||||
}
|
||||
} as const
|
||||
data: z.object({}),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
} as const;
|
||||
|
||||
export default oneBotHttpApiMessage
|
||||
export default oneBotHttpApiMessage;
|
||||
@@ -1,68 +1,68 @@
|
||||
import { z } from 'zod'
|
||||
import { z } from 'zod';
|
||||
|
||||
const messageNode = z.union([
|
||||
z
|
||||
.object({
|
||||
type: z.literal('text'),
|
||||
data: z.object({
|
||||
text: z.string()
|
||||
})
|
||||
text: z.string(),
|
||||
}),
|
||||
})
|
||||
.describe('文本消息'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('at'),
|
||||
data: z.object({
|
||||
qq: z.string()
|
||||
})
|
||||
qq: z.string(),
|
||||
}),
|
||||
})
|
||||
.describe('@某人'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('image'),
|
||||
data: z.object({
|
||||
file: z.string()
|
||||
})
|
||||
file: z.string(),
|
||||
}),
|
||||
})
|
||||
.describe('图片消息'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('face'),
|
||||
data: z.object({
|
||||
id: z.number()
|
||||
})
|
||||
id: z.number(),
|
||||
}),
|
||||
})
|
||||
.describe('表情消息'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('json'),
|
||||
data: z.object({
|
||||
data: z.string()
|
||||
})
|
||||
data: z.string(),
|
||||
}),
|
||||
})
|
||||
.describe('json 卡片消息'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('record'),
|
||||
data: z.object({
|
||||
file: z.string()
|
||||
})
|
||||
file: z.string(),
|
||||
}),
|
||||
})
|
||||
.describe('语音消息'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('video'),
|
||||
data: z.object({
|
||||
file: z.string()
|
||||
})
|
||||
file: z.string(),
|
||||
}),
|
||||
})
|
||||
.describe('视频消息'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('reply'),
|
||||
data: z.object({
|
||||
id: z.number()
|
||||
})
|
||||
id: z.number(),
|
||||
}),
|
||||
})
|
||||
.describe('回复消息'),
|
||||
z
|
||||
@@ -71,37 +71,37 @@ const messageNode = z.union([
|
||||
data: z.union([
|
||||
z.object({
|
||||
type: z.enum(['qq', '163']),
|
||||
id: z.string()
|
||||
id: z.string(),
|
||||
}),
|
||||
z.object({
|
||||
type: z.literal('custom'),
|
||||
url: z.string(),
|
||||
audio: z.string(),
|
||||
title: z.string(),
|
||||
image: z.string()
|
||||
})
|
||||
])
|
||||
image: z.string(),
|
||||
}),
|
||||
]),
|
||||
})
|
||||
.describe('音乐消息'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('dice')
|
||||
type: z.literal('dice'),
|
||||
})
|
||||
.describe('掷骰子'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('rps')
|
||||
type: z.literal('rps'),
|
||||
})
|
||||
.describe('猜拳'),
|
||||
z
|
||||
.object({
|
||||
type: z.literal('file'),
|
||||
data: z.object({
|
||||
file: z.string().describe('文件路径,服务器本地或者网络文件均可')
|
||||
})
|
||||
file: z.string().describe('文件路径,服务器本地或者网络文件均可'),
|
||||
}),
|
||||
})
|
||||
.describe('发送消息')
|
||||
])
|
||||
.describe('发送消息'),
|
||||
]);
|
||||
|
||||
export const nodeMessage = z
|
||||
.object({
|
||||
@@ -109,11 +109,11 @@ export const nodeMessage = z
|
||||
data: z.object({
|
||||
user_id: z.string(),
|
||||
nickname: z.string(),
|
||||
content: z.array(messageNode)
|
||||
})
|
||||
content: z.array(messageNode),
|
||||
}),
|
||||
})
|
||||
.describe('消息节点')
|
||||
.describe('消息节点');
|
||||
|
||||
const messageNodeSchema = z.union([messageNode, nodeMessage])
|
||||
const messageNodeSchema = z.union([messageNode, nodeMessage]);
|
||||
|
||||
export default messageNodeSchema
|
||||
export default messageNodeSchema;
|
||||
@@ -1,8 +1,8 @@
|
||||
import { z } from 'zod'
|
||||
import type { ZodSchema } from 'zod'
|
||||
import { z } from 'zod';
|
||||
import type { ZodSchema } from 'zod';
|
||||
|
||||
import { baseResponseSchema, commonResponseDataSchema } from '../response'
|
||||
import messageNodeSchema, { nodeMessage } from './node'
|
||||
import { baseResponseSchema, commonResponseDataSchema } from '../response';
|
||||
import messageNodeSchema, { nodeMessage } from './node';
|
||||
|
||||
const oneBotHttpApiMessagePrivate: Record<
|
||||
string,
|
||||
@@ -17,26 +17,26 @@ const oneBotHttpApiMessagePrivate: Record<
|
||||
request: z
|
||||
.object({
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号'),
|
||||
message: z.array(messageNodeSchema).describe('消息内容')
|
||||
message: z.array(messageNodeSchema).describe('消息内容'),
|
||||
})
|
||||
.refine(
|
||||
(data) => {
|
||||
const hasReply = data.message.some((item) => item.type === 'reply')
|
||||
const hasReply = data.message.some((item) => item.type === 'reply');
|
||||
|
||||
if (hasReply) {
|
||||
return data.message[0].type === 'reply'
|
||||
return data.message[0].type === 'reply';
|
||||
}
|
||||
|
||||
return true
|
||||
return true;
|
||||
},
|
||||
{
|
||||
message:
|
||||
'如果 message 包含 reply 类型的消息,那么只能包含一个,而且排在最前面'
|
||||
'如果 message 包含 reply 类型的消息,那么只能包含一个,而且排在最前面',
|
||||
}
|
||||
),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/send_private_forward_msg': {
|
||||
description: '发送私聊合并转发消息',
|
||||
@@ -46,35 +46,35 @@ const oneBotHttpApiMessagePrivate: Record<
|
||||
news: z
|
||||
.array(
|
||||
z.object({
|
||||
text: z.string()
|
||||
text: z.string(),
|
||||
})
|
||||
)
|
||||
.describe('?'),
|
||||
prompt: z.string().describe('外显'),
|
||||
summary: z.string().describe('底下文本'),
|
||||
source: z.string().describe('内容')
|
||||
source: z.string().describe('内容'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/forward_friend_single_msg': {
|
||||
description: '消息转发到私聊',
|
||||
request: z.object({
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号'),
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息ID')
|
||||
message_id: z.union([z.string(), z.number()]).describe('消息ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/group_poke': {
|
||||
description: '发送私聊戳一戳',
|
||||
request: z.object({
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号')
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
}
|
||||
}
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
};
|
||||
|
||||
export default oneBotHttpApiMessagePrivate
|
||||
export default oneBotHttpApiMessagePrivate;
|
||||
@@ -1,4 +1,4 @@
|
||||
import { z } from 'zod'
|
||||
import { z } from 'zod';
|
||||
|
||||
// 定义 set_online_status 的 data 格式
|
||||
const onlineStatusDataSchema = z.union([
|
||||
@@ -7,7 +7,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(0),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('在线'),
|
||||
// Q我吧
|
||||
@@ -15,7 +15,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(60),
|
||||
ext_status: z.literal(0),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('Q我吧'),
|
||||
// 离开
|
||||
@@ -23,7 +23,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(30),
|
||||
ext_status: z.literal(0),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('离开'),
|
||||
// 忙碌
|
||||
@@ -31,7 +31,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(50),
|
||||
ext_status: z.literal(0),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('忙碌'),
|
||||
// 请勿打扰
|
||||
@@ -39,7 +39,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(70),
|
||||
ext_status: z.literal(0),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('请勿打扰'),
|
||||
// 隐身
|
||||
@@ -47,7 +47,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(40),
|
||||
ext_status: z.literal(0),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('隐身'),
|
||||
// 听歌中
|
||||
@@ -55,7 +55,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1028),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('听歌中'),
|
||||
// 春日限定
|
||||
@@ -63,7 +63,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2037),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('春日限定'),
|
||||
// 一起元梦
|
||||
@@ -71,7 +71,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2025),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('一起元梦'),
|
||||
// 求星搭子
|
||||
@@ -79,7 +79,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2026),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('求星搭子'),
|
||||
// 被掏空
|
||||
@@ -87,7 +87,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2014),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('被掏空'),
|
||||
// 今日天气
|
||||
@@ -95,7 +95,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1030),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('今日天气'),
|
||||
// 我crash了
|
||||
@@ -103,7 +103,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2019),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('我crash了'),
|
||||
// 爱你
|
||||
@@ -111,7 +111,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2006),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('爱你'),
|
||||
// 恋爱中
|
||||
@@ -119,7 +119,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1051),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('恋爱中'),
|
||||
// 好运锦鲤
|
||||
@@ -127,7 +127,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1071),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('好运锦鲤'),
|
||||
// 水逆退散
|
||||
@@ -135,7 +135,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1201),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('水逆退散'),
|
||||
// 嗨到飞起
|
||||
@@ -143,7 +143,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1056),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('嗨到飞起'),
|
||||
// 元气满满
|
||||
@@ -151,7 +151,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1058),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('元气满满'),
|
||||
// 宝宝认证
|
||||
@@ -159,7 +159,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1070),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('宝宝认证'),
|
||||
// 一言难尽
|
||||
@@ -167,7 +167,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1063),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('一言难尽'),
|
||||
// 难得糊涂
|
||||
@@ -175,7 +175,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2001),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('难得糊涂'),
|
||||
// emo中
|
||||
@@ -183,7 +183,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1401),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('emo中'),
|
||||
// 我太难了
|
||||
@@ -191,7 +191,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1062),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('我太难了'),
|
||||
// 我想开了
|
||||
@@ -199,7 +199,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2013),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('我想开了'),
|
||||
// 我没事
|
||||
@@ -207,7 +207,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1052),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('我没事'),
|
||||
// 想静静
|
||||
@@ -215,7 +215,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1061),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('想静静'),
|
||||
// 悠哉哉
|
||||
@@ -223,7 +223,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1059),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('悠哉哉'),
|
||||
// 去旅行
|
||||
@@ -231,7 +231,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2015),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('去旅行'),
|
||||
// 信号弱
|
||||
@@ -239,7 +239,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1011),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('信号弱'),
|
||||
// 出去浪
|
||||
@@ -247,7 +247,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2003),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('出去浪'),
|
||||
// 肝作业
|
||||
@@ -255,7 +255,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2012),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('肝作业'),
|
||||
// 学习中
|
||||
@@ -263,7 +263,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1018),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('学习中'),
|
||||
// 搬砖中
|
||||
@@ -271,7 +271,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(2023),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('搬砖中'),
|
||||
// 摸鱼中
|
||||
@@ -279,7 +279,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1300),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('摸鱼中'),
|
||||
// 无聊中
|
||||
@@ -287,7 +287,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1060),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('无聊中'),
|
||||
// timi中
|
||||
@@ -295,7 +295,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1027),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('timi中'),
|
||||
// 睡觉中
|
||||
@@ -303,7 +303,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1016),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('睡觉中'),
|
||||
// 熬夜中
|
||||
@@ -311,7 +311,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1032),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('熬夜中'),
|
||||
// 追剧中
|
||||
@@ -319,7 +319,7 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1021),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('追剧中'),
|
||||
// 我的电量
|
||||
@@ -327,9 +327,9 @@ const onlineStatusDataSchema = z.union([
|
||||
.object({
|
||||
status: z.literal(10),
|
||||
ext_status: z.literal(1000),
|
||||
battery_status: z.literal(0)
|
||||
battery_status: z.literal(0),
|
||||
})
|
||||
.describe('我的电量')
|
||||
])
|
||||
.describe('我的电量'),
|
||||
]);
|
||||
|
||||
export default onlineStatusDataSchema
|
||||
export default onlineStatusDataSchema;
|
||||
@@ -1,4 +1,4 @@
|
||||
import { z } from 'zod'
|
||||
import { z } from 'zod';
|
||||
|
||||
// 通用响应格式
|
||||
export const baseResponseSchema = z.object({
|
||||
@@ -7,10 +7,10 @@ export const baseResponseSchema = z.object({
|
||||
data: z.null(),
|
||||
message: z.string().describe('提示信息'), // 提示信息
|
||||
wording: z.string().describe('提示信息(人性化)'), // 人性化提示
|
||||
echo: z.string().describe('回显') // 请求回显内容
|
||||
})
|
||||
echo: z.string().describe('回显'), // 请求回显内容
|
||||
});
|
||||
|
||||
export const commonResponseDataSchema = z.object({
|
||||
result: z.number(),
|
||||
errMsg: z.string()
|
||||
})
|
||||
errMsg: z.string(),
|
||||
});
|
||||
@@ -1,18 +1,18 @@
|
||||
import { z } from 'zod'
|
||||
import { z } from 'zod';
|
||||
|
||||
import { baseResponseSchema, commonResponseDataSchema } from './response'
|
||||
import { baseResponseSchema, commonResponseDataSchema } from './response';
|
||||
|
||||
const oneBotHttpApiSystem = {
|
||||
'/get_online_clients': {
|
||||
description: '获取当前账号在线客户端列表',
|
||||
request: z.object({
|
||||
no_cache: z.boolean().optional().describe('是否不使用缓存')
|
||||
no_cache: z.boolean().optional().describe('是否不使用缓存'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
clients: z.object({})
|
||||
})
|
||||
})
|
||||
clients: z.object({}),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_robot_uin_range': {
|
||||
description: '获取机器人账号范围',
|
||||
@@ -21,15 +21,15 @@ const oneBotHttpApiSystem = {
|
||||
data: z.array(
|
||||
z.object({
|
||||
minUin: z.string(),
|
||||
maxUin: z.string()
|
||||
maxUin: z.string(),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/ocr_image': {
|
||||
description: 'OCR图片识别',
|
||||
request: z.object({
|
||||
image: z.string()
|
||||
image: z.string(),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(
|
||||
@@ -37,19 +37,19 @@ const oneBotHttpApiSystem = {
|
||||
text: z.string(),
|
||||
pt1: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt2: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt3: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt4: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
charBox: z.array(
|
||||
z.object({
|
||||
@@ -57,33 +57,33 @@ const oneBotHttpApiSystem = {
|
||||
charBox: z.object({
|
||||
pt1: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt2: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt3: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt4: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
})
|
||||
})
|
||||
y: z.string(),
|
||||
}),
|
||||
}),
|
||||
})
|
||||
),
|
||||
score: z.string()
|
||||
score: z.string(),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
|
||||
'/.ocr_image': {
|
||||
description: '.OCR图片识别',
|
||||
request: z.object({
|
||||
image: z.string()
|
||||
image: z.string(),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(
|
||||
@@ -91,19 +91,19 @@ const oneBotHttpApiSystem = {
|
||||
text: z.string(),
|
||||
pt1: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt2: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt3: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt4: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
charBox: z.array(
|
||||
z.object({
|
||||
@@ -111,36 +111,36 @@ const oneBotHttpApiSystem = {
|
||||
charBox: z.object({
|
||||
pt1: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt2: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt3: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
y: z.string(),
|
||||
}),
|
||||
pt4: z.object({
|
||||
x: z.string(),
|
||||
y: z.string()
|
||||
})
|
||||
})
|
||||
y: z.string(),
|
||||
}),
|
||||
}),
|
||||
})
|
||||
),
|
||||
score: z.string()
|
||||
score: z.string(),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/translate_en2zh': {
|
||||
description: '英文翻译为中文',
|
||||
request: z.object({
|
||||
words: z.array(z.string())
|
||||
words: z.array(z.string()),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(z.string())
|
||||
})
|
||||
data: z.array(z.string()),
|
||||
}),
|
||||
},
|
||||
'/get_login_info': {
|
||||
description: '获取登录号信息',
|
||||
@@ -148,19 +148,19 @@ const oneBotHttpApiSystem = {
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
user_id: z.number(),
|
||||
nickname: z.string()
|
||||
})
|
||||
})
|
||||
nickname: z.string(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/set_input_status': {
|
||||
description: '设置输入状态',
|
||||
request: z.object({
|
||||
eventType: z.union([z.literal(0), z.literal(1)]),
|
||||
user_id: z.union([z.number(), z.string()])
|
||||
user_id: z.union([z.number(), z.string()]),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/download_file': {
|
||||
description: '下载文件到缓存目录',
|
||||
@@ -170,112 +170,112 @@ const oneBotHttpApiSystem = {
|
||||
url: z.string().optional(),
|
||||
thread_count: z.number(),
|
||||
headers: z.union([z.string(), z.array(z.string())]),
|
||||
name: z.string().optional()
|
||||
name: z.string().optional(),
|
||||
})
|
||||
.refine(
|
||||
(data) => (data.base64 && !data.url) || (!data.base64 && data.url),
|
||||
{
|
||||
message: 'base64 和 url 必须二选一,且不能同时存在或同时为空',
|
||||
path: ['base64', 'url']
|
||||
path: ['base64', 'url'],
|
||||
}
|
||||
),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
file: z.string()
|
||||
})
|
||||
})
|
||||
file: z.string(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_cookies': {
|
||||
description: '获取cookies',
|
||||
request: z.object({
|
||||
domain: z.string()
|
||||
domain: z.string(),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
cookies: z.string(),
|
||||
bkn: z.string()
|
||||
})
|
||||
})
|
||||
bkn: z.string(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/.handle_quick_operation': {
|
||||
description: '.对事件执行快速操作',
|
||||
request: z.object({
|
||||
context: z.object({}),
|
||||
operation: z.object({})
|
||||
operation: z.object({}),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/get_csrf_token': {
|
||||
description: '获取CSRF Token',
|
||||
request: z.object({}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
token: z.number()
|
||||
})
|
||||
})
|
||||
token: z.number(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/_del_group_notice': {
|
||||
description: '_删除群公告',
|
||||
request: z.object({
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
notice_id: z.number()
|
||||
notice_id: z.number(),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/get_credentials': {
|
||||
description: '获取 QQ 相关接口凭证',
|
||||
request: z.object({
|
||||
domain: z.string()
|
||||
domain: z.string(),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
cookies: z.string(),
|
||||
token: z.number()
|
||||
})
|
||||
})
|
||||
token: z.number(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/_get_model_show': {
|
||||
description: '_获取在线机型',
|
||||
request: z.object({
|
||||
model: z.string()
|
||||
model: z.string(),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(
|
||||
z.object({
|
||||
variants: z.object({
|
||||
model_show: z.string(),
|
||||
need_pay: z.boolean()
|
||||
})
|
||||
need_pay: z.boolean(),
|
||||
}),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/_set_model_show': {
|
||||
description: '_设置在线机型',
|
||||
request: z.object({
|
||||
model: z.string(),
|
||||
model_show: z.string()
|
||||
model_show: z.string(),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/can_send_image': {
|
||||
description: '检查是否可以发送图片',
|
||||
request: z.object({}),
|
||||
response: baseResponseSchema.extend({
|
||||
yes: z.boolean()
|
||||
})
|
||||
yes: z.boolean(),
|
||||
}),
|
||||
},
|
||||
'/nc_get_packet_status': {
|
||||
description: '获取packet状态',
|
||||
request: z.object({}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/can_send_record': {
|
||||
description: '检查是否可以发送语音',
|
||||
request: z.object({}),
|
||||
response: baseResponseSchema.extend({
|
||||
yes: z.boolean()
|
||||
})
|
||||
yes: z.boolean(),
|
||||
}),
|
||||
},
|
||||
'/get_status': {
|
||||
description: '获取状态',
|
||||
@@ -284,9 +284,9 @@ const oneBotHttpApiSystem = {
|
||||
data: z.object({
|
||||
online: z.boolean(),
|
||||
good: z.boolean(),
|
||||
stat: z.object({})
|
||||
})
|
||||
})
|
||||
stat: z.object({}),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/nc_get_rkey': {
|
||||
description: '获取rkey',
|
||||
@@ -297,10 +297,10 @@ const oneBotHttpApiSystem = {
|
||||
rkey: z.string(),
|
||||
ttl: z.string(),
|
||||
time: z.number(),
|
||||
type: z.number()
|
||||
type: z.number(),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/get_version_info': {
|
||||
description: '获取版本信息',
|
||||
@@ -309,14 +309,14 @@ const oneBotHttpApiSystem = {
|
||||
data: z.object({
|
||||
app_name: z.string(),
|
||||
protocol_version: z.string(),
|
||||
app_version: z.string()
|
||||
})
|
||||
})
|
||||
app_version: z.string(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_group_shut_list': {
|
||||
description: '获取群禁言列表',
|
||||
request: z.object({
|
||||
group_id: z.union([z.number(), z.string()])
|
||||
group_id: z.union([z.number(), z.string()]),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
@@ -357,10 +357,10 @@ const oneBotHttpApiSystem = {
|
||||
memberMobileFlag: z.number(),
|
||||
memberFlagExt2: z.number(),
|
||||
isSpecialShielded: z.boolean(),
|
||||
cardNameId: z.number()
|
||||
})
|
||||
})
|
||||
}
|
||||
} as const
|
||||
cardNameId: z.number(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
} as const;
|
||||
|
||||
export default oneBotHttpApiSystem
|
||||
export default oneBotHttpApiSystem;
|
||||
@@ -1,7 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
import { z } from 'zod';
|
||||
|
||||
import onlineStatusDataSchema from './online_status'
|
||||
import { baseResponseSchema, commonResponseDataSchema } from './response'
|
||||
import onlineStatusDataSchema from './online_status';
|
||||
import { baseResponseSchema, commonResponseDataSchema } from './response';
|
||||
|
||||
const oneBotHttpApiUser = {
|
||||
'/set_qq_profile': {
|
||||
@@ -9,11 +9,11 @@ const oneBotHttpApiUser = {
|
||||
request: z.object({
|
||||
nickname: z.string().describe('昵称'),
|
||||
personal_note: z.string().describe('个性签名'),
|
||||
sex: z.string().optional().describe('性别')
|
||||
sex: z.string().optional().describe('性别'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/ArkSharePeer': {
|
||||
description: '获取推荐好友/群聊卡片',
|
||||
@@ -27,39 +27,39 @@ const oneBotHttpApiUser = {
|
||||
.union([z.string(), z.number()])
|
||||
.optional()
|
||||
.describe('用户ID,与 group_id 二选一'),
|
||||
phoneNumber: z.string().optional().describe('对方手机号码')
|
||||
phoneNumber: z.string().optional().describe('对方手机号码'),
|
||||
})
|
||||
.refine(
|
||||
(data) =>
|
||||
(data.group_id && !data.user_id) || (!data.group_id && data.user_id),
|
||||
{
|
||||
message: 'group_id 和 user_id 必须二选一,且不能同时存在或同时为空',
|
||||
path: ['group_id', 'user_id'] // 错误路径
|
||||
path: ['group_id', 'user_id'], // 错误路径
|
||||
}
|
||||
),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
errCode: z.number(),
|
||||
errMsg: z.string(),
|
||||
arkJson: z.string()
|
||||
})
|
||||
})
|
||||
arkJson: z.string(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/ArkShareGroup': {
|
||||
description: '获取推荐群聊卡片',
|
||||
request: z.object({
|
||||
group_id: z.union([z.string(), z.number()]).describe('群聊ID')
|
||||
group_id: z.union([z.string(), z.number()]).describe('群聊ID'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.string()
|
||||
})
|
||||
data: z.string(),
|
||||
}),
|
||||
},
|
||||
'/set_online_status': {
|
||||
description: '设置在线状态',
|
||||
request: z.object({
|
||||
data: onlineStatusDataSchema
|
||||
data: onlineStatusDataSchema,
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/get_friends_with_category': {
|
||||
description: '获取好友分组列表',
|
||||
@@ -92,60 +92,60 @@ const oneBotHttpApiUser = {
|
||||
remark: z.string(),
|
||||
user_id: z.number(),
|
||||
nickname: z.string(),
|
||||
level: z.number()
|
||||
level: z.number(),
|
||||
})
|
||||
)
|
||||
),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/set_qq_avatar': {
|
||||
description: '设置头像',
|
||||
request: z.object({
|
||||
file: z.string().describe('图片文件路径(服务器本地或者远程均可)')
|
||||
file: z.string().describe('图片文件路径(服务器本地或者远程均可)'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/send_like': {
|
||||
description: '点赞',
|
||||
request: z.object({
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号'),
|
||||
times: z.number().describe('点赞次数')
|
||||
times: z.number().describe('点赞次数'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/create_collection': {
|
||||
description: '创建收藏',
|
||||
request: z.object({
|
||||
rawData: z.string().describe('收藏内容'),
|
||||
brief: z.string().describe('收藏简介')
|
||||
brief: z.string().describe('收藏简介'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/set_friend_add_request': {
|
||||
description: '处理好友请求',
|
||||
request: z.object({
|
||||
flag: z.string().describe('请求ID'),
|
||||
approve: z.boolean().describe('是否同意'),
|
||||
remark: z.string().describe('好友备注')
|
||||
remark: z.string().describe('好友备注'),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/set_self_longnick': {
|
||||
description: '设置个性签名',
|
||||
request: z.object({
|
||||
longNick: z.string().describe('签名内容')
|
||||
longNick: z.string().describe('签名内容'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/get_stranger_info': {
|
||||
description: '获取账号信息',
|
||||
request: z.object({
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号')
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
@@ -164,14 +164,14 @@ const oneBotHttpApiUser = {
|
||||
vip_level: z.number(),
|
||||
remark: z.string(),
|
||||
status: z.number(),
|
||||
login_days: z.number()
|
||||
})
|
||||
})
|
||||
login_days: z.number(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/get_friend_list': {
|
||||
description: '获取好友列表',
|
||||
request: z.object({
|
||||
no_cache: z.boolean().describe('是否不使用缓存')
|
||||
no_cache: z.boolean().describe('是否不使用缓存'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(
|
||||
@@ -194,10 +194,10 @@ const oneBotHttpApiUser = {
|
||||
remark: z.string(),
|
||||
user_id: z.number(),
|
||||
nickname: z.string(),
|
||||
level: z.number()
|
||||
level: z.number(),
|
||||
})
|
||||
)
|
||||
})
|
||||
),
|
||||
}),
|
||||
},
|
||||
'/get_profile_like': {
|
||||
description: '获取点赞列表',
|
||||
@@ -225,29 +225,29 @@ const oneBotHttpApiUser = {
|
||||
isFriend: z.boolean(),
|
||||
isvip: z.boolean(),
|
||||
isSvip: z.boolean(),
|
||||
uin: z.number()
|
||||
uin: z.number(),
|
||||
})
|
||||
)
|
||||
})
|
||||
})
|
||||
),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
'/fetch_custom_face': {
|
||||
description: '获取收藏表情',
|
||||
request: z.object({
|
||||
count: z.number().optional().describe('获取数量')
|
||||
count: z.number().optional().describe('获取数量'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.array(z.string())
|
||||
})
|
||||
data: z.array(z.string()),
|
||||
}),
|
||||
},
|
||||
'/upload_private_file': {
|
||||
description: '上传私聊文件',
|
||||
request: z.object({
|
||||
user_id: z.union([z.string(), z.number()]),
|
||||
file: z.string(),
|
||||
name: z.string()
|
||||
name: z.string(),
|
||||
}),
|
||||
response: baseResponseSchema
|
||||
response: baseResponseSchema,
|
||||
},
|
||||
'/delete_friend': {
|
||||
description: '删除好友',
|
||||
@@ -255,24 +255,24 @@ const oneBotHttpApiUser = {
|
||||
user_id: z.union([z.string(), z.number()]).describe('自己QQ号?'),
|
||||
friend_id: z.union([z.string(), z.number()]).describe('好友QQ号'),
|
||||
temp_block: z.boolean().describe('是否加入黑名单'),
|
||||
temp_both_del: z.boolean().describe('是否双向删除')
|
||||
temp_both_del: z.boolean().describe('是否双向删除'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: commonResponseDataSchema
|
||||
})
|
||||
data: commonResponseDataSchema,
|
||||
}),
|
||||
},
|
||||
'/nc_get_user_status': {
|
||||
description: '获取用户在线状态',
|
||||
request: z.object({
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号')
|
||||
user_id: z.union([z.string(), z.number()]).describe('对方QQ号'),
|
||||
}),
|
||||
response: baseResponseSchema.extend({
|
||||
data: z.object({
|
||||
status: z.number(),
|
||||
ext_status: z.number()
|
||||
})
|
||||
})
|
||||
}
|
||||
} as const
|
||||
ext_status: z.number(),
|
||||
}),
|
||||
}),
|
||||
},
|
||||
} as const;
|
||||
|
||||
export default oneBotHttpApiUser
|
||||
export default oneBotHttpApiUser;
|
||||
@@ -1,6 +1,6 @@
|
||||
import heroui from './themes/heroui'
|
||||
import nc_pink from './themes/nc_pink'
|
||||
import heroui from './themes/heroui';
|
||||
import nc_pink from './themes/nc_pink';
|
||||
|
||||
const themes: ThemeInfo[] = [nc_pink, heroui]
|
||||
const themes: ThemeInfo[] = [nc_pink, heroui];
|
||||
|
||||
export default themes
|
||||
export default themes;
|
||||
@@ -121,7 +121,7 @@ const theme: ThemeConfig = {
|
||||
'0px 0px 15px 0px rgba(0, 0, 0, .06), 0px 2px 30px 0px rgba(0, 0, 0, .22), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)',
|
||||
'--heroui-box-shadow-large':
|
||||
'0px 0px 30px 0px rgba(0, 0, 0, .07), 0px 30px 60px 0px rgba(0, 0, 0, .26), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)',
|
||||
'--heroui-hover-opacity': '.9'
|
||||
'--heroui-hover-opacity': '.9',
|
||||
},
|
||||
light: {
|
||||
'--heroui-background': '0 0% 100%',
|
||||
@@ -245,12 +245,12 @@ const theme: ThemeConfig = {
|
||||
'0px 0px 15px 0px rgba(0, 0, 0, .03), 0px 2px 30px 0px rgba(0, 0, 0, .08), 0px 0px 1px 0px rgba(0, 0, 0, .3)',
|
||||
'--heroui-box-shadow-large':
|
||||
'0px 0px 30px 0px rgba(0, 0, 0, .04), 0px 30px 60px 0px rgba(0, 0, 0, .12), 0px 0px 1px 0px rgba(0, 0, 0, .3)',
|
||||
'--heroui-hover-opacity': '.8'
|
||||
}
|
||||
}
|
||||
'--heroui-hover-opacity': '.8',
|
||||
},
|
||||
};
|
||||
export default {
|
||||
theme,
|
||||
author: 'HeroUI',
|
||||
name: 'heroui',
|
||||
description: 'HeroUI Default Theme'
|
||||
} satisfies ThemeInfo
|
||||
description: 'HeroUI Default Theme',
|
||||
} satisfies ThemeInfo;
|
||||
@@ -121,7 +121,7 @@ const theme: ThemeConfig = {
|
||||
'0px 0px 15px 0px rgba(0, 0, 0, .06), 0px 2px 30px 0px rgba(0, 0, 0, .22), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)',
|
||||
'--heroui-box-shadow-large':
|
||||
'0px 0px 30px 0px rgba(0, 0, 0, .07), 0px 30px 60px 0px rgba(0, 0, 0, .26), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)',
|
||||
'--heroui-hover-opacity': '.9'
|
||||
'--heroui-hover-opacity': '.9',
|
||||
},
|
||||
light: {
|
||||
'--heroui-background': '0 0% 100%',
|
||||
@@ -245,12 +245,12 @@ const theme: ThemeConfig = {
|
||||
'0px 0px 15px 0px rgba(0, 0, 0, .03), 0px 2px 30px 0px rgba(0, 0, 0, .08), 0px 0px 1px 0px rgba(0, 0, 0, .3)',
|
||||
'--heroui-box-shadow-large':
|
||||
'0px 0px 30px 0px rgba(0, 0, 0, .04), 0px 30px 60px 0px rgba(0, 0, 0, .12), 0px 0px 1px 0px rgba(0, 0, 0, .3)',
|
||||
'--heroui-hover-opacity': '.8'
|
||||
}
|
||||
}
|
||||
'--heroui-hover-opacity': '.8',
|
||||
},
|
||||
};
|
||||
export default {
|
||||
theme,
|
||||
author: 'NapCat',
|
||||
name: 'nc_pink',
|
||||
description: 'NapCat Pink Theme'
|
||||
} satisfies ThemeInfo
|
||||
description: 'NapCat Pink Theme',
|
||||
} satisfies ThemeInfo;
|
||||
Reference in new issue
Block a user