@saltify/milky-types 1.1.0-rc.2 → 1.1.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-endpoints.d.mts +19 -0
- package/dist/api-endpoints.mjs +422 -0
- package/dist/api-endpoints.mjs.map +1 -0
- package/dist/index-DDpuCo8n.d.mts +3358 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +908 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/api-endpoints.d.ts +0 -18
- package/dist/api-endpoints.js +0 -423
- package/dist/api-endpoints.js.map +0 -1
- package/dist/index-BYP4VNOL.d.ts +0 -3479
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1142
- package/dist/index.js.map +0 -1
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,908 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/scalar.ts
|
|
4
|
+
const ZInt32 = z.number().int().positive().meta({ scalarType: "int32" });
|
|
5
|
+
const ZInt64 = z.number().int().positive().meta({ scalarType: "int64" });
|
|
6
|
+
const ZBoolean = z.boolean().meta({ scalarType: "boolean" });
|
|
7
|
+
const ZString = z.string().meta({ scalarType: "string" });
|
|
8
|
+
const ZUin = z.number().int().min(10001).max(4294967295).meta({ scalarType: "int64" });
|
|
9
|
+
const ZInt32WithDefault = (defaultValue) => z.number().int().positive().nullish().default(defaultValue).transform((v) => v ?? defaultValue).meta({ scalarType: "int32" });
|
|
10
|
+
const ZInt64WithDefault = (defaultValue) => z.number().int().positive().nullish().default(defaultValue).transform((v) => v ?? defaultValue).meta({ scalarType: "int64" });
|
|
11
|
+
const ZBooleanWithDefault = (defaultValue) => z.boolean().nullish().default(defaultValue).transform((v) => v ?? defaultValue).meta({ scalarType: "boolean" });
|
|
12
|
+
const ZStringWithDefault = (defaultValue) => z.string().nullish().default(defaultValue).transform((v) => v ?? defaultValue).meta({ scalarType: "string" });
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/common.ts
|
|
16
|
+
const UserEntityBase = z.object({
|
|
17
|
+
user_id: ZUin.describe("用户 QQ 号"),
|
|
18
|
+
nickname: ZString.describe("用户昵称"),
|
|
19
|
+
sex: z.enum([
|
|
20
|
+
"male",
|
|
21
|
+
"female",
|
|
22
|
+
"unknown"
|
|
23
|
+
]).describe("用户性别")
|
|
24
|
+
}).describe("基础用户实体");
|
|
25
|
+
const FriendCategoryEntity = z.object({
|
|
26
|
+
category_id: ZInt32.describe("好友分组 ID"),
|
|
27
|
+
category_name: ZString.describe("好友分组名称")
|
|
28
|
+
}).describe("好友分组实体");
|
|
29
|
+
const FriendEntity = UserEntityBase.extend({
|
|
30
|
+
qid: ZString.describe("用户 QID"),
|
|
31
|
+
remark: ZString.describe("好友备注"),
|
|
32
|
+
category: z.lazy(() => FriendCategoryEntity).describe("好友分组")
|
|
33
|
+
}).describe("好友实体");
|
|
34
|
+
const GroupEntity = z.object({
|
|
35
|
+
group_id: ZUin.describe("群号"),
|
|
36
|
+
group_name: ZString.describe("群名称"),
|
|
37
|
+
member_count: ZInt32.describe("群成员数量"),
|
|
38
|
+
max_member_count: ZInt32.describe("群容量")
|
|
39
|
+
}).describe("群实体");
|
|
40
|
+
const GroupMemberEntity = UserEntityBase.extend({
|
|
41
|
+
group_id: ZUin.describe("群号"),
|
|
42
|
+
card: ZString.describe("成员备注"),
|
|
43
|
+
title: ZString.describe("专属头衔"),
|
|
44
|
+
level: ZInt32.describe("群等级,注意和 QQ 等级区分"),
|
|
45
|
+
role: z.enum([
|
|
46
|
+
"owner",
|
|
47
|
+
"admin",
|
|
48
|
+
"member"
|
|
49
|
+
]).describe("权限等级"),
|
|
50
|
+
join_time: ZInt64.describe("入群时间,Unix 时间戳(秒)"),
|
|
51
|
+
last_sent_time: ZInt64.describe("最后发言时间,Unix 时间戳(秒)"),
|
|
52
|
+
shut_up_end_time: ZInt64.nullish().describe("禁言结束时间,Unix 时间戳(秒)")
|
|
53
|
+
}).describe("群成员实体");
|
|
54
|
+
const GroupAnnouncementEntity = z.object({
|
|
55
|
+
group_id: ZUin.describe("群号"),
|
|
56
|
+
announcement_id: ZString.describe("公告 ID"),
|
|
57
|
+
user_id: ZUin.describe("发送者 QQ 号"),
|
|
58
|
+
time: ZInt64.describe("Unix 时间戳(秒)"),
|
|
59
|
+
content: ZString.describe("公告内容"),
|
|
60
|
+
image_url: ZString.nullish().describe("公告图片 URL")
|
|
61
|
+
}).describe("群公告实体");
|
|
62
|
+
const GroupFileEntity = z.object({
|
|
63
|
+
group_id: ZUin.describe("群号"),
|
|
64
|
+
file_id: ZString.describe("文件 ID"),
|
|
65
|
+
file_name: ZString.describe("文件名称"),
|
|
66
|
+
parent_folder_id: ZString.describe("父文件夹 ID"),
|
|
67
|
+
file_size: ZInt64.describe("文件大小(字节)"),
|
|
68
|
+
uploaded_time: ZInt64.describe("上传时的 Unix 时间戳(秒)"),
|
|
69
|
+
expire_time: ZInt64.nullish().describe("过期时的 Unix 时间戳(秒)"),
|
|
70
|
+
uploader_id: ZUin.describe("上传者 QQ 号"),
|
|
71
|
+
downloaded_times: ZInt32.describe("下载次数")
|
|
72
|
+
}).describe("群文件实体");
|
|
73
|
+
const GroupFolderEntity = z.object({
|
|
74
|
+
group_id: ZUin.describe("群号"),
|
|
75
|
+
folder_id: ZString.describe("文件夹 ID"),
|
|
76
|
+
parent_folder_id: ZString.describe("父文件夹 ID"),
|
|
77
|
+
folder_name: ZString.describe("文件夹名称"),
|
|
78
|
+
created_time: ZInt64.describe("创建时的 Unix 时间戳(秒)"),
|
|
79
|
+
last_modified_time: ZInt64.describe("最后修改时的 Unix 时间戳(秒)"),
|
|
80
|
+
creator_id: ZUin.describe("创建者 QQ 号"),
|
|
81
|
+
file_count: ZInt32.describe("文件数量")
|
|
82
|
+
}).describe("群文件夹实体");
|
|
83
|
+
const FriendRequest = z.object({
|
|
84
|
+
time: ZInt64.describe("请求发起时的 Unix 时间戳(秒)"),
|
|
85
|
+
initiator_id: ZUin.describe("请求发起者 QQ 号"),
|
|
86
|
+
initiator_uid: ZString.describe("请求发起者 UID"),
|
|
87
|
+
target_user_id: ZUin.describe("目标用户 QQ 号"),
|
|
88
|
+
target_user_uid: ZString.describe("目标用户 UID"),
|
|
89
|
+
state: z.enum([
|
|
90
|
+
"pending",
|
|
91
|
+
"accepted",
|
|
92
|
+
"rejected",
|
|
93
|
+
"ignored"
|
|
94
|
+
]).describe("请求状态"),
|
|
95
|
+
comment: ZString.describe("申请附加信息"),
|
|
96
|
+
via: ZString.describe("申请来源"),
|
|
97
|
+
is_filtered: ZBoolean.describe("请求是否被过滤(发起自风险账户)")
|
|
98
|
+
}).describe("好友请求实体");
|
|
99
|
+
const GroupNotification = z.discriminatedUnion("type", [
|
|
100
|
+
z.object({
|
|
101
|
+
type: z.literal("join_request"),
|
|
102
|
+
group_id: ZUin.describe("群号"),
|
|
103
|
+
notification_seq: ZInt64.describe("通知序列号"),
|
|
104
|
+
is_filtered: ZBoolean.describe("请求是否被过滤(发起自风险账户)"),
|
|
105
|
+
initiator_id: ZUin.describe("发起者 QQ 号"),
|
|
106
|
+
state: z.enum([
|
|
107
|
+
"pending",
|
|
108
|
+
"accepted",
|
|
109
|
+
"rejected",
|
|
110
|
+
"ignored"
|
|
111
|
+
]).describe("请求状态"),
|
|
112
|
+
operator_id: ZUin.nullish().describe("处理请求的管理员 QQ 号"),
|
|
113
|
+
comment: ZString.describe("入群请求附加信息")
|
|
114
|
+
}).describe("用户入群请求"),
|
|
115
|
+
z.object({
|
|
116
|
+
type: z.literal("admin_change"),
|
|
117
|
+
group_id: ZUin.describe("群号"),
|
|
118
|
+
notification_seq: ZInt64.describe("通知序列号"),
|
|
119
|
+
target_user_id: ZUin.describe("被设置/取消用户 QQ 号"),
|
|
120
|
+
is_set: ZBoolean.describe("是否被设置为管理员,`false` 表示被取消管理员"),
|
|
121
|
+
operator_id: ZUin.describe("操作者(群主)QQ 号")
|
|
122
|
+
}).describe("群管理员变更通知"),
|
|
123
|
+
z.object({
|
|
124
|
+
type: z.literal("kick"),
|
|
125
|
+
group_id: ZUin.describe("群号"),
|
|
126
|
+
notification_seq: ZInt64.describe("通知序列号"),
|
|
127
|
+
target_user_id: ZUin.describe("被移除用户 QQ 号"),
|
|
128
|
+
operator_id: ZUin.describe("移除用户的管理员 QQ 号")
|
|
129
|
+
}).describe("群成员被移除通知"),
|
|
130
|
+
z.object({
|
|
131
|
+
type: z.literal("quit"),
|
|
132
|
+
group_id: ZUin.describe("群号"),
|
|
133
|
+
notification_seq: ZInt64.describe("通知序列号"),
|
|
134
|
+
target_user_id: ZUin.describe("退群用户 QQ 号")
|
|
135
|
+
}).describe("群成员退群通知"),
|
|
136
|
+
z.object({
|
|
137
|
+
type: z.literal("invited_join_request"),
|
|
138
|
+
group_id: ZUin.describe("群号"),
|
|
139
|
+
notification_seq: ZInt64.describe("通知序列号"),
|
|
140
|
+
initiator_id: ZUin.describe("邀请者 QQ 号"),
|
|
141
|
+
target_user_id: ZUin.describe("被邀请用户 QQ 号"),
|
|
142
|
+
state: z.enum([
|
|
143
|
+
"pending",
|
|
144
|
+
"accepted",
|
|
145
|
+
"rejected",
|
|
146
|
+
"ignored"
|
|
147
|
+
]).describe("请求状态"),
|
|
148
|
+
operator_id: ZUin.nullish().describe("处理请求的管理员 QQ 号")
|
|
149
|
+
}).describe("群成员邀请他人入群请求")
|
|
150
|
+
]).describe("群通知实体");
|
|
151
|
+
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/message.ts
|
|
154
|
+
const IncomingResourceSegmentBase = z.object({
|
|
155
|
+
resource_id: ZString.describe("资源 ID"),
|
|
156
|
+
temp_url: ZString.describe("临时 URL")
|
|
157
|
+
});
|
|
158
|
+
const OutgoingResourceSegmentBase = z.object({ uri: ZString.describe("文件 URI,支持 `file://` `http(s)://` `base64://` 三种格式") });
|
|
159
|
+
const IncomingSegment = z.discriminatedUnion("type", [
|
|
160
|
+
z.object({
|
|
161
|
+
type: z.literal("text"),
|
|
162
|
+
data: z.object({ text: ZString.describe("文本内容") })
|
|
163
|
+
}).describe("文本消息段"),
|
|
164
|
+
z.object({
|
|
165
|
+
type: z.literal("mention"),
|
|
166
|
+
data: z.object({ user_id: ZUin.describe("提及的 QQ 号") })
|
|
167
|
+
}).describe("提及消息段"),
|
|
168
|
+
z.object({
|
|
169
|
+
type: z.literal("mention_all"),
|
|
170
|
+
data: z.object({})
|
|
171
|
+
}).describe("提及全体消息段"),
|
|
172
|
+
z.object({
|
|
173
|
+
type: z.literal("face"),
|
|
174
|
+
data: z.object({
|
|
175
|
+
face_id: ZString.describe("表情 ID"),
|
|
176
|
+
is_large: ZBoolean.describe("是否为超级表情")
|
|
177
|
+
})
|
|
178
|
+
}).describe("表情消息段"),
|
|
179
|
+
z.object({
|
|
180
|
+
type: z.literal("reply"),
|
|
181
|
+
data: z.object({ message_seq: ZInt64.describe("被引用的消息序列号") })
|
|
182
|
+
}).describe("回复消息段"),
|
|
183
|
+
z.object({
|
|
184
|
+
type: z.literal("image"),
|
|
185
|
+
data: IncomingResourceSegmentBase.extend({
|
|
186
|
+
width: ZInt32.describe("图片宽度"),
|
|
187
|
+
height: ZInt32.describe("图片高度"),
|
|
188
|
+
summary: ZString.describe("图片预览文本"),
|
|
189
|
+
sub_type: z.enum(["normal", "sticker"]).describe("图片类型")
|
|
190
|
+
})
|
|
191
|
+
}).describe("图片消息段"),
|
|
192
|
+
z.object({
|
|
193
|
+
type: z.literal("record"),
|
|
194
|
+
data: IncomingResourceSegmentBase.extend({ duration: ZInt32.describe("语音时长(秒)") })
|
|
195
|
+
}).describe("语音消息段"),
|
|
196
|
+
z.object({
|
|
197
|
+
type: z.literal("video"),
|
|
198
|
+
data: IncomingResourceSegmentBase.extend({
|
|
199
|
+
width: ZInt32.describe("视频宽度"),
|
|
200
|
+
height: ZInt32.describe("视频高度"),
|
|
201
|
+
duration: ZInt32.describe("视频时长(秒)")
|
|
202
|
+
})
|
|
203
|
+
}).describe("视频消息段"),
|
|
204
|
+
z.object({
|
|
205
|
+
type: z.literal("file"),
|
|
206
|
+
data: z.object({
|
|
207
|
+
file_id: ZString.describe("文件 ID"),
|
|
208
|
+
file_name: ZString.describe("文件名称"),
|
|
209
|
+
file_size: ZInt64.describe("文件大小(字节)"),
|
|
210
|
+
file_hash: ZString.nullish().describe("文件的 TriSHA1 哈希值,仅在私聊文件中存在")
|
|
211
|
+
})
|
|
212
|
+
}).describe("文件消息段"),
|
|
213
|
+
z.object({
|
|
214
|
+
type: z.literal("forward"),
|
|
215
|
+
data: z.object({
|
|
216
|
+
forward_id: ZString.describe("合并转发 ID"),
|
|
217
|
+
title: ZString.describe("合并转发标题"),
|
|
218
|
+
preview: z.array(ZString).describe("合并转发预览文本"),
|
|
219
|
+
summary: ZString.describe("合并转发摘要")
|
|
220
|
+
})
|
|
221
|
+
}).describe("合并转发消息段"),
|
|
222
|
+
z.object({
|
|
223
|
+
type: z.literal("market_face"),
|
|
224
|
+
data: z.object({
|
|
225
|
+
emoji_package_id: ZInt32.describe("市场表情包 ID"),
|
|
226
|
+
emoji_id: ZString.describe("市场表情 ID"),
|
|
227
|
+
key: ZString.describe("市场表情 Key"),
|
|
228
|
+
summary: ZString.describe("市场表情预览文本"),
|
|
229
|
+
url: ZString.describe("市场表情 URL")
|
|
230
|
+
})
|
|
231
|
+
}).describe("市场表情消息段"),
|
|
232
|
+
z.object({
|
|
233
|
+
type: z.literal("light_app"),
|
|
234
|
+
data: z.object({
|
|
235
|
+
app_name: ZString.describe("小程序名称"),
|
|
236
|
+
json_payload: ZString.describe("小程序 JSON 数据")
|
|
237
|
+
})
|
|
238
|
+
}).describe("小程序消息段"),
|
|
239
|
+
z.object({
|
|
240
|
+
type: z.literal("xml"),
|
|
241
|
+
data: z.object({
|
|
242
|
+
service_id: ZInt32.describe("服务 ID"),
|
|
243
|
+
xml_payload: ZString.describe("XML 数据")
|
|
244
|
+
})
|
|
245
|
+
}).describe("XML 消息段")
|
|
246
|
+
]).describe("接收消息段");
|
|
247
|
+
const IncomingForwardedMessage = z.object({
|
|
248
|
+
sender_name: ZString.describe("发送者名称"),
|
|
249
|
+
avatar_url: ZString.describe("发送者头像 URL"),
|
|
250
|
+
time: ZInt64.describe("消息 Unix 时间戳(秒)"),
|
|
251
|
+
segments: z.array(z.lazy(() => IncomingSegment)).describe("消息段列表")
|
|
252
|
+
}).describe("接收转发消息");
|
|
253
|
+
const OutgoingSegment = z.discriminatedUnion("type", [
|
|
254
|
+
z.object({
|
|
255
|
+
type: z.literal("text"),
|
|
256
|
+
data: z.object({ text: ZString.describe("文本内容") })
|
|
257
|
+
}).describe("文本消息段"),
|
|
258
|
+
z.object({
|
|
259
|
+
type: z.literal("mention"),
|
|
260
|
+
data: z.object({ user_id: ZUin.describe("提及的 QQ 号") })
|
|
261
|
+
}).describe("提及消息段"),
|
|
262
|
+
z.object({
|
|
263
|
+
type: z.literal("mention_all"),
|
|
264
|
+
data: z.object({})
|
|
265
|
+
}).describe("提及全体消息段"),
|
|
266
|
+
z.object({
|
|
267
|
+
type: z.literal("face"),
|
|
268
|
+
data: z.object({
|
|
269
|
+
face_id: ZString.describe("表情 ID"),
|
|
270
|
+
is_large: ZBoolean.default(false).describe("是否为超级表情")
|
|
271
|
+
})
|
|
272
|
+
}).describe("表情消息段"),
|
|
273
|
+
z.object({
|
|
274
|
+
type: z.literal("reply"),
|
|
275
|
+
data: z.object({ message_seq: ZInt64.describe("被引用的消息序列号") })
|
|
276
|
+
}).describe("回复消息段"),
|
|
277
|
+
z.object({
|
|
278
|
+
type: z.literal("image"),
|
|
279
|
+
data: OutgoingResourceSegmentBase.extend({
|
|
280
|
+
sub_type: z.enum(["normal", "sticker"]).default("normal").describe("图片类型"),
|
|
281
|
+
summary: ZString.nullish().describe("图片预览文本")
|
|
282
|
+
})
|
|
283
|
+
}).describe("图片消息段"),
|
|
284
|
+
z.object({
|
|
285
|
+
type: z.literal("record"),
|
|
286
|
+
data: OutgoingResourceSegmentBase
|
|
287
|
+
}).describe("语音消息段"),
|
|
288
|
+
z.object({
|
|
289
|
+
type: z.literal("video"),
|
|
290
|
+
data: OutgoingResourceSegmentBase.extend({ thumb_uri: ZString.nullish().describe("封面图片 URI") })
|
|
291
|
+
}).describe("视频消息段"),
|
|
292
|
+
z.object({
|
|
293
|
+
type: z.literal("forward"),
|
|
294
|
+
data: z.object({ get messages() {
|
|
295
|
+
return z.array(z.lazy(() => OutgoingForwardedMessage)).describe("合并转发消息段");
|
|
296
|
+
} })
|
|
297
|
+
}).describe("合并转发消息段")
|
|
298
|
+
]).describe("发送消息段");
|
|
299
|
+
const OutgoingForwardedMessage = z.object({
|
|
300
|
+
user_id: ZUin.describe("发送者 QQ 号"),
|
|
301
|
+
sender_name: ZString.describe("发送者名称"),
|
|
302
|
+
segments: z.array(z.lazy(() => OutgoingSegment)).describe("消息段列表")
|
|
303
|
+
}).describe("发送转发消息");
|
|
304
|
+
const IncomingMessage = z.discriminatedUnion("message_scene", [
|
|
305
|
+
z.object({
|
|
306
|
+
message_scene: z.literal("friend"),
|
|
307
|
+
peer_id: ZUin.describe("好友 QQ 号或群号"),
|
|
308
|
+
message_seq: ZInt64.describe("消息序列号"),
|
|
309
|
+
sender_id: ZUin.describe("发送者 QQ 号"),
|
|
310
|
+
time: ZInt64.describe("消息 Unix 时间戳(秒)"),
|
|
311
|
+
segments: z.array(z.lazy(() => IncomingSegment)).describe("消息段列表"),
|
|
312
|
+
friend: z.lazy(() => FriendEntity).describe("好友信息")
|
|
313
|
+
}).describe("好友消息"),
|
|
314
|
+
z.object({
|
|
315
|
+
message_scene: z.literal("group"),
|
|
316
|
+
peer_id: ZUin.describe("好友 QQ 号或群号"),
|
|
317
|
+
message_seq: ZInt64.describe("消息序列号"),
|
|
318
|
+
sender_id: ZUin.describe("发送者 QQ 号"),
|
|
319
|
+
time: ZInt64.describe("消息 Unix 时间戳(秒)"),
|
|
320
|
+
segments: z.array(z.lazy(() => IncomingSegment)).describe("消息段列表"),
|
|
321
|
+
group: z.lazy(() => GroupEntity).describe("群信息"),
|
|
322
|
+
group_member: z.lazy(() => GroupMemberEntity).describe("群成员信息")
|
|
323
|
+
}).describe("群消息"),
|
|
324
|
+
z.object({
|
|
325
|
+
message_scene: z.literal("temp"),
|
|
326
|
+
peer_id: ZUin.describe("好友 QQ 号或群号"),
|
|
327
|
+
message_seq: ZInt64.describe("消息序列号"),
|
|
328
|
+
sender_id: ZUin.describe("发送者 QQ 号"),
|
|
329
|
+
time: ZInt64.describe("消息 Unix 时间戳(秒)"),
|
|
330
|
+
segments: z.array(z.lazy(() => IncomingSegment)).describe("消息段列表"),
|
|
331
|
+
group: z.lazy(() => GroupEntity).nullish().describe("临时会话发送者的所在的群信息")
|
|
332
|
+
}).describe("临时会话消息")
|
|
333
|
+
]).describe("接收消息");
|
|
334
|
+
const GroupEssenceMessage = z.object({
|
|
335
|
+
group_id: ZUin.describe("群号"),
|
|
336
|
+
message_seq: ZInt64.describe("消息序列号"),
|
|
337
|
+
message_time: ZInt64.describe("消息发送时的 Unix 时间戳(秒)"),
|
|
338
|
+
sender_id: ZUin.describe("发送者 QQ 号"),
|
|
339
|
+
sender_name: ZString.describe("发送者名称"),
|
|
340
|
+
operator_id: ZUin.describe("设置精华的操作者 QQ 号"),
|
|
341
|
+
operator_name: ZString.describe("设置精华的操作者名称"),
|
|
342
|
+
operation_time: ZInt64.describe("消息被设置精华时的 Unix 时间戳(秒)"),
|
|
343
|
+
segments: z.array(z.lazy(() => IncomingSegment)).describe("消息段列表")
|
|
344
|
+
}).describe("群精华消息");
|
|
345
|
+
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/event.ts
|
|
348
|
+
const BotOfflineEvent = z.object({ reason: ZString.describe("下线原因") });
|
|
349
|
+
const MessageRecallEvent = z.object({
|
|
350
|
+
message_scene: z.enum([
|
|
351
|
+
"friend",
|
|
352
|
+
"group",
|
|
353
|
+
"temp"
|
|
354
|
+
]).describe("消息场景"),
|
|
355
|
+
peer_id: ZUin.describe("好友 QQ 号或群号"),
|
|
356
|
+
message_seq: ZInt64.describe("消息序列号"),
|
|
357
|
+
sender_id: ZUin.describe("被撤回的消息的发送者 QQ 号"),
|
|
358
|
+
operator_id: ZUin.describe("操作者 QQ 号"),
|
|
359
|
+
display_suffix: ZString.describe("撤回提示的后缀文本")
|
|
360
|
+
});
|
|
361
|
+
const FriendRequestEvent = z.object({
|
|
362
|
+
initiator_id: ZUin.describe("申请好友的用户 QQ 号"),
|
|
363
|
+
initiator_uid: ZString.describe("用户 UID"),
|
|
364
|
+
comment: ZString.describe("申请附加信息"),
|
|
365
|
+
via: ZString.describe("申请来源")
|
|
366
|
+
});
|
|
367
|
+
const GroupJoinRequestEvent = z.object({
|
|
368
|
+
group_id: ZUin.describe("群号"),
|
|
369
|
+
notification_seq: ZInt64.describe("请求对应的通知序列号"),
|
|
370
|
+
is_filtered: ZBoolean.describe("请求是否被过滤(发起自风险账户)"),
|
|
371
|
+
initiator_id: ZUin.describe("申请入群的用户 QQ 号"),
|
|
372
|
+
comment: ZString.describe("申请附加信息")
|
|
373
|
+
});
|
|
374
|
+
const GroupInvitedJoinRequestEvent = z.object({
|
|
375
|
+
group_id: ZUin.describe("群号"),
|
|
376
|
+
notification_seq: ZInt64.describe("请求对应的通知序列号"),
|
|
377
|
+
initiator_id: ZUin.describe("邀请者 QQ 号"),
|
|
378
|
+
target_user_id: ZUin.describe("被邀请者 QQ 号")
|
|
379
|
+
});
|
|
380
|
+
const GroupInvitationEvent = z.object({
|
|
381
|
+
group_id: ZUin.describe("群号"),
|
|
382
|
+
invitation_seq: ZInt64.describe("邀请序列号"),
|
|
383
|
+
initiator_id: ZUin.describe("邀请者 QQ 号")
|
|
384
|
+
});
|
|
385
|
+
const FriendNudgeEvent = z.object({
|
|
386
|
+
user_id: ZUin.describe("好友 QQ 号"),
|
|
387
|
+
is_self_send: ZBoolean.describe("是否是自己发送的戳一戳"),
|
|
388
|
+
is_self_receive: ZBoolean.describe("是否是自己接收的戳一戳"),
|
|
389
|
+
display_action: ZString.describe("戳一戳提示的动作文本"),
|
|
390
|
+
display_suffix: ZString.describe("戳一戳提示的后缀文本"),
|
|
391
|
+
display_action_img_url: ZString.describe("戳一戳提示的动作图片 URL,用于取代动作提示文本")
|
|
392
|
+
});
|
|
393
|
+
const FriendFileUploadEvent = z.object({
|
|
394
|
+
user_id: ZUin.describe("好友 QQ 号"),
|
|
395
|
+
file_id: ZString.describe("文件 ID"),
|
|
396
|
+
file_name: ZString.describe("文件名称"),
|
|
397
|
+
file_size: ZInt64.describe("文件大小(字节)"),
|
|
398
|
+
file_hash: ZString.describe("文件的 TriSHA1 哈希值"),
|
|
399
|
+
is_self: ZBoolean.describe("是否是自己发送的文件")
|
|
400
|
+
});
|
|
401
|
+
const GroupAdminChangeEvent = z.object({
|
|
402
|
+
group_id: ZUin.describe("群号"),
|
|
403
|
+
user_id: ZUin.describe("发生变更的用户 QQ 号"),
|
|
404
|
+
operator_id: ZUin.describe("操作者 QQ 号"),
|
|
405
|
+
is_set: ZBoolean.describe("是否被设置为管理员,`false` 表示被取消管理员")
|
|
406
|
+
});
|
|
407
|
+
const GroupEssenceMessageChangeEvent = z.object({
|
|
408
|
+
group_id: ZUin.describe("群号"),
|
|
409
|
+
message_seq: ZInt64.describe("发生变更的消息序列号"),
|
|
410
|
+
operator_id: ZUin.describe("操作者 QQ 号"),
|
|
411
|
+
is_set: ZBoolean.describe("是否被设置为精华,`false` 表示被取消精华")
|
|
412
|
+
});
|
|
413
|
+
const GroupMemberIncreaseEvent = z.object({
|
|
414
|
+
group_id: ZUin.describe("群号"),
|
|
415
|
+
user_id: ZUin.describe("发生变更的用户 QQ 号"),
|
|
416
|
+
operator_id: ZUin.nullish().describe("管理员 QQ 号,如果是管理员同意入群"),
|
|
417
|
+
invitor_id: ZUin.nullish().describe("邀请者 QQ 号,如果是邀请入群")
|
|
418
|
+
});
|
|
419
|
+
const GroupMemberDecreaseEvent = z.object({
|
|
420
|
+
group_id: ZUin.describe("群号"),
|
|
421
|
+
user_id: ZUin.describe("发生变更的用户 QQ 号"),
|
|
422
|
+
operator_id: ZUin.nullish().describe("管理员 QQ 号,如果是管理员踢出")
|
|
423
|
+
});
|
|
424
|
+
const GroupNameChangeEvent = z.object({
|
|
425
|
+
group_id: ZUin.describe("群号"),
|
|
426
|
+
new_group_name: ZString.describe("新的群名称"),
|
|
427
|
+
operator_id: ZUin.describe("操作者 QQ 号")
|
|
428
|
+
});
|
|
429
|
+
const GroupMessageReactionEvent = z.object({
|
|
430
|
+
group_id: ZUin.describe("群号"),
|
|
431
|
+
user_id: ZUin.describe("发送回应者 QQ 号"),
|
|
432
|
+
message_seq: ZInt64.describe("消息序列号"),
|
|
433
|
+
face_id: ZString.describe("表情 ID"),
|
|
434
|
+
is_add: ZBoolean.describe("是否为添加,`false` 表示取消回应")
|
|
435
|
+
});
|
|
436
|
+
const GroupMuteEvent = z.object({
|
|
437
|
+
group_id: ZUin.describe("群号"),
|
|
438
|
+
user_id: ZUin.describe("发生变更的用户 QQ 号"),
|
|
439
|
+
operator_id: ZUin.describe("操作者 QQ 号"),
|
|
440
|
+
duration: ZInt32.describe("禁言时长(秒),为 0 表示取消禁言")
|
|
441
|
+
});
|
|
442
|
+
const GroupWholeMuteEvent = z.object({
|
|
443
|
+
group_id: ZUin.describe("群号"),
|
|
444
|
+
operator_id: ZUin.describe("操作者 QQ 号"),
|
|
445
|
+
is_mute: ZBoolean.describe("是否全员禁言,`false` 表示取消全员禁言")
|
|
446
|
+
});
|
|
447
|
+
const GroupNudgeEvent = z.object({
|
|
448
|
+
group_id: ZUin.describe("群号"),
|
|
449
|
+
sender_id: ZUin.describe("发送者 QQ 号"),
|
|
450
|
+
receiver_id: ZUin.describe("接收者 QQ 号"),
|
|
451
|
+
display_action: ZString.describe("戳一戳提示的动作文本"),
|
|
452
|
+
display_suffix: ZString.describe("戳一戳提示的后缀文本"),
|
|
453
|
+
display_action_img_url: ZString.describe("戳一戳提示的动作图片 URL,用于取代动作提示文本")
|
|
454
|
+
});
|
|
455
|
+
const GroupFileUploadEvent = z.object({
|
|
456
|
+
group_id: ZUin.describe("群号"),
|
|
457
|
+
user_id: ZUin.describe("发送者 QQ 号"),
|
|
458
|
+
file_id: ZString.describe("文件 ID"),
|
|
459
|
+
file_name: ZString.describe("文件名称"),
|
|
460
|
+
file_size: ZInt64.describe("文件大小(字节)")
|
|
461
|
+
});
|
|
462
|
+
const Event = z.discriminatedUnion("event_type", [
|
|
463
|
+
z.object({
|
|
464
|
+
event_type: z.literal("bot_offline"),
|
|
465
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
466
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
467
|
+
data: BotOfflineEvent
|
|
468
|
+
}).describe("机器人离线事件"),
|
|
469
|
+
z.object({
|
|
470
|
+
event_type: z.literal("message_receive"),
|
|
471
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
472
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
473
|
+
data: IncomingMessage
|
|
474
|
+
}).describe("消息接收事件"),
|
|
475
|
+
z.object({
|
|
476
|
+
event_type: z.literal("message_recall"),
|
|
477
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
478
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
479
|
+
data: MessageRecallEvent
|
|
480
|
+
}).describe("消息撤回事件"),
|
|
481
|
+
z.object({
|
|
482
|
+
event_type: z.literal("friend_request"),
|
|
483
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
484
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
485
|
+
data: FriendRequestEvent
|
|
486
|
+
}).describe("好友请求事件"),
|
|
487
|
+
z.object({
|
|
488
|
+
event_type: z.literal("group_join_request"),
|
|
489
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
490
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
491
|
+
data: GroupJoinRequestEvent
|
|
492
|
+
}).describe("入群请求事件"),
|
|
493
|
+
z.object({
|
|
494
|
+
event_type: z.literal("group_invited_join_request"),
|
|
495
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
496
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
497
|
+
data: GroupInvitedJoinRequestEvent
|
|
498
|
+
}).describe("群成员邀请他人入群请求事件"),
|
|
499
|
+
z.object({
|
|
500
|
+
event_type: z.literal("group_invitation"),
|
|
501
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
502
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
503
|
+
data: GroupInvitationEvent
|
|
504
|
+
}).describe("他人邀请自身入群事件"),
|
|
505
|
+
z.object({
|
|
506
|
+
event_type: z.literal("friend_nudge"),
|
|
507
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
508
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
509
|
+
data: FriendNudgeEvent
|
|
510
|
+
}).describe("好友戳一戳事件"),
|
|
511
|
+
z.object({
|
|
512
|
+
event_type: z.literal("friend_file_upload"),
|
|
513
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
514
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
515
|
+
data: FriendFileUploadEvent
|
|
516
|
+
}).describe("好友文件上传事件"),
|
|
517
|
+
z.object({
|
|
518
|
+
event_type: z.literal("group_admin_change"),
|
|
519
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
520
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
521
|
+
data: GroupAdminChangeEvent
|
|
522
|
+
}).describe("群管理员变更事件"),
|
|
523
|
+
z.object({
|
|
524
|
+
event_type: z.literal("group_essence_message_change"),
|
|
525
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
526
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
527
|
+
data: GroupEssenceMessageChangeEvent
|
|
528
|
+
}).describe("群精华消息变更事件"),
|
|
529
|
+
z.object({
|
|
530
|
+
event_type: z.literal("group_member_increase"),
|
|
531
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
532
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
533
|
+
data: GroupMemberIncreaseEvent
|
|
534
|
+
}).describe("群成员增加事件"),
|
|
535
|
+
z.object({
|
|
536
|
+
event_type: z.literal("group_member_decrease"),
|
|
537
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
538
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
539
|
+
data: GroupMemberDecreaseEvent
|
|
540
|
+
}).describe("群成员减少事件"),
|
|
541
|
+
z.object({
|
|
542
|
+
event_type: z.literal("group_name_change"),
|
|
543
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
544
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
545
|
+
data: GroupNameChangeEvent
|
|
546
|
+
}).describe("群名称变更事件"),
|
|
547
|
+
z.object({
|
|
548
|
+
event_type: z.literal("group_message_reaction"),
|
|
549
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
550
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
551
|
+
data: GroupMessageReactionEvent
|
|
552
|
+
}).describe("群消息表情回应事件"),
|
|
553
|
+
z.object({
|
|
554
|
+
event_type: z.literal("group_mute"),
|
|
555
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
556
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
557
|
+
data: GroupMuteEvent
|
|
558
|
+
}).describe("群禁言事件"),
|
|
559
|
+
z.object({
|
|
560
|
+
event_type: z.literal("group_whole_mute"),
|
|
561
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
562
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
563
|
+
data: GroupWholeMuteEvent
|
|
564
|
+
}).describe("群全体禁言事件"),
|
|
565
|
+
z.object({
|
|
566
|
+
event_type: z.literal("group_nudge"),
|
|
567
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
568
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
569
|
+
data: GroupNudgeEvent
|
|
570
|
+
}).describe("群戳一戳事件"),
|
|
571
|
+
z.object({
|
|
572
|
+
event_type: z.literal("group_file_upload"),
|
|
573
|
+
time: ZInt64.describe("事件 Unix 时间戳(秒)"),
|
|
574
|
+
self_id: ZUin.describe("机器人 QQ 号"),
|
|
575
|
+
data: GroupFileUploadEvent
|
|
576
|
+
}).describe("群文件上传事件")
|
|
577
|
+
]).describe("事件");
|
|
578
|
+
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region package.json
|
|
581
|
+
var version = "1.1.0-rc.3";
|
|
582
|
+
|
|
583
|
+
//#endregion
|
|
584
|
+
//#region src/constants.ts
|
|
585
|
+
const milkyPackageVersion = version;
|
|
586
|
+
const milkyVersion = milkyPackageVersion.split(".").slice(0, 2).join(".");
|
|
587
|
+
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region src/api/system.ts
|
|
590
|
+
const CachedApiBase = z.object({ no_cache: ZBooleanWithDefault(false).describe("是否强制不使用缓存") });
|
|
591
|
+
const GetLoginInfoOutput = z.object({
|
|
592
|
+
uin: ZUin.describe("登录 QQ 号"),
|
|
593
|
+
nickname: ZString.describe("登录昵称")
|
|
594
|
+
});
|
|
595
|
+
const GetImplInfoOutput = z.object({
|
|
596
|
+
impl_name: ZString.describe("协议端名称"),
|
|
597
|
+
impl_version: ZString.describe("协议端版本"),
|
|
598
|
+
qq_protocol_version: ZString.describe("协议端使用的 QQ 协议版本"),
|
|
599
|
+
qq_protocol_type: z.enum([
|
|
600
|
+
"windows",
|
|
601
|
+
"linux",
|
|
602
|
+
"macos",
|
|
603
|
+
"android_pad",
|
|
604
|
+
"android_phone",
|
|
605
|
+
"ipad",
|
|
606
|
+
"iphone",
|
|
607
|
+
"harmony",
|
|
608
|
+
"watch"
|
|
609
|
+
]).describe("协议端使用的 QQ 协议平台"),
|
|
610
|
+
milky_version: ZString.describe(`协议端实现的 Milky 协议版本,目前为 "${milkyVersion}"`)
|
|
611
|
+
});
|
|
612
|
+
const GetUserProfileInput = z.object({ user_id: ZUin.describe("用户 QQ 号") });
|
|
613
|
+
const GetUserProfileOutput = z.object({
|
|
614
|
+
nickname: ZString.describe("昵称"),
|
|
615
|
+
qid: ZString.describe("QID"),
|
|
616
|
+
age: ZInt32.describe("年龄"),
|
|
617
|
+
sex: z.enum([
|
|
618
|
+
"male",
|
|
619
|
+
"female",
|
|
620
|
+
"unknown"
|
|
621
|
+
]).describe("性别"),
|
|
622
|
+
remark: ZString.describe("备注"),
|
|
623
|
+
bio: ZString.describe("个性签名"),
|
|
624
|
+
level: ZInt32.describe("QQ 等级"),
|
|
625
|
+
country: ZString.describe("国家或地区"),
|
|
626
|
+
city: ZString.describe("城市"),
|
|
627
|
+
school: ZString.describe("学校")
|
|
628
|
+
});
|
|
629
|
+
const GetFriendListInput = CachedApiBase;
|
|
630
|
+
const GetFriendListOutput = z.object({ friends: z.array(z.lazy(() => FriendEntity)).describe("好友列表") });
|
|
631
|
+
const GetFriendInfoInput = z.object({ user_id: ZUin.describe("好友 QQ 号") }).extend(CachedApiBase.shape);
|
|
632
|
+
const GetFriendInfoOutput = z.object({ friend: z.lazy(() => FriendEntity).describe("好友信息") });
|
|
633
|
+
const GetGroupListInput = CachedApiBase;
|
|
634
|
+
const GetGroupListOutput = z.object({ groups: z.array(z.lazy(() => GroupEntity)).describe("群列表") });
|
|
635
|
+
const GetGroupInfoInput = z.object({ group_id: ZUin.describe("群号") }).extend(CachedApiBase.shape);
|
|
636
|
+
const GetGroupInfoOutput = z.object({ group: z.lazy(() => GroupEntity).describe("群信息") });
|
|
637
|
+
const GetGroupMemberListInput = z.object({ group_id: ZUin.describe("群号") }).extend(CachedApiBase.shape);
|
|
638
|
+
const GetGroupMemberListOutput = z.object({ members: z.array(z.lazy(() => GroupMemberEntity)).describe("群成员列表") });
|
|
639
|
+
const GetGroupMemberInfoInput = z.object({
|
|
640
|
+
group_id: ZUin.describe("群号"),
|
|
641
|
+
user_id: ZUin.describe("群成员 QQ 号")
|
|
642
|
+
}).extend(CachedApiBase.shape);
|
|
643
|
+
const GetGroupMemberInfoOutput = z.object({ member: z.lazy(() => GroupMemberEntity).describe("群成员信息") });
|
|
644
|
+
const SetAvatarInput = z.object({ uri: ZString.describe("头像文件 URI,支持 `file://` `http(s)://` `base64://` 三种格式") });
|
|
645
|
+
const SetNicknameInput = z.object({ new_card: ZString.describe("新昵称") });
|
|
646
|
+
const SetBioInput = z.object({ new_bio: ZString.describe("新个性签名") });
|
|
647
|
+
const GetCustomFaceUrlListOutput = z.object({ urls: z.array(ZString).describe("自定义表情 URL 列表") });
|
|
648
|
+
const GetCookiesInput = z.object({ domain: ZString.describe("需要获取 Cookies 的域名") });
|
|
649
|
+
const GetCookiesOutput = z.object({ cookies: ZString.describe("域名对应的 Cookies 字符串") });
|
|
650
|
+
const GetCSRFTokenOutput = z.object({ csrf_token: ZString.describe("CSRF Token") });
|
|
651
|
+
|
|
652
|
+
//#endregion
|
|
653
|
+
//#region src/api/message.ts
|
|
654
|
+
const SendMessageApiBase = z.object({ message: z.array(z.lazy(() => OutgoingSegment)).describe("消息内容") });
|
|
655
|
+
const SendMessageApiCommonOutput = z.object({
|
|
656
|
+
message_seq: ZInt64.describe("消息序列号"),
|
|
657
|
+
time: ZInt64.describe("消息发送时间")
|
|
658
|
+
});
|
|
659
|
+
const SendPrivateMessageInput = z.object({ user_id: ZUin.describe("好友 QQ 号") }).extend(SendMessageApiBase.shape);
|
|
660
|
+
const SendPrivateMessageOutput = SendMessageApiCommonOutput;
|
|
661
|
+
const SendGroupMessageInput = z.object({ group_id: ZUin.describe("群号") }).extend(SendMessageApiBase.shape);
|
|
662
|
+
const SendGroupMessageOutput = SendMessageApiCommonOutput;
|
|
663
|
+
const RecallPrivateMessageInput = z.object({
|
|
664
|
+
user_id: ZUin.describe("好友 QQ 号"),
|
|
665
|
+
message_seq: ZInt64.describe("消息序列号")
|
|
666
|
+
});
|
|
667
|
+
const RecallGroupMessageInput = z.object({
|
|
668
|
+
group_id: ZUin.describe("群号"),
|
|
669
|
+
message_seq: ZInt64.describe("消息序列号")
|
|
670
|
+
});
|
|
671
|
+
const GetMessageInput = z.object({
|
|
672
|
+
message_scene: z.enum([
|
|
673
|
+
"friend",
|
|
674
|
+
"group",
|
|
675
|
+
"temp"
|
|
676
|
+
]).describe("消息场景"),
|
|
677
|
+
peer_id: ZUin.describe("好友 QQ 号或群号"),
|
|
678
|
+
message_seq: ZInt64.describe("消息序列号")
|
|
679
|
+
});
|
|
680
|
+
const GetMessageOutput = z.object({ message: z.lazy(() => IncomingMessage).describe("消息内容") });
|
|
681
|
+
const GetHistoryMessagesInput = z.object({
|
|
682
|
+
message_scene: z.enum([
|
|
683
|
+
"friend",
|
|
684
|
+
"group",
|
|
685
|
+
"temp"
|
|
686
|
+
]).describe("消息场景"),
|
|
687
|
+
peer_id: ZUin.describe("好友 QQ 号或群号"),
|
|
688
|
+
start_message_seq: ZInt64.nullish().describe("起始消息序列号,由此开始从新到旧查询,不提供则从最新消息开始"),
|
|
689
|
+
limit: z.number().int().min(1).max(30).nullish().default(20).transform((v) => v ?? 20).meta({ scalarType: "int32" }).describe("期望获取到的消息数量,最多 30 条")
|
|
690
|
+
});
|
|
691
|
+
const GetHistoryMessagesOutput = z.object({
|
|
692
|
+
messages: z.array(z.lazy(() => IncomingMessage)).describe("获取到的消息(message_seq 升序排列),部分消息可能不存在,如撤回的消息"),
|
|
693
|
+
next_message_seq: ZInt64.nullish().describe("下一页起始消息序列号")
|
|
694
|
+
});
|
|
695
|
+
const GetResourceTempUrlInput = z.object({ resource_id: ZString.describe("资源 ID") });
|
|
696
|
+
const GetResourceTempUrlOutput = z.object({ url: ZString.describe("临时资源链接") });
|
|
697
|
+
const GetForwardedMessagesInput = z.object({ forward_id: ZString.describe("转发消息 ID") });
|
|
698
|
+
const GetForwardedMessagesOutput = z.object({ messages: z.array(z.lazy(() => IncomingForwardedMessage)).describe("转发消息内容") });
|
|
699
|
+
const MarkMessageAsReadInput = z.object({
|
|
700
|
+
message_scene: z.enum([
|
|
701
|
+
"friend",
|
|
702
|
+
"group",
|
|
703
|
+
"temp"
|
|
704
|
+
]).describe("消息场景"),
|
|
705
|
+
peer_id: ZUin.describe("好友 QQ 号或群号"),
|
|
706
|
+
message_seq: ZInt64.describe("标为已读的消息序列号,该消息及更早的消息将被标记为已读")
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
//#endregion
|
|
710
|
+
//#region src/api/friend.ts
|
|
711
|
+
const SendFriendNudgeInput = z.object({
|
|
712
|
+
user_id: ZUin.describe("好友 QQ 号"),
|
|
713
|
+
is_self: ZBooleanWithDefault(false).describe("是否戳自己")
|
|
714
|
+
});
|
|
715
|
+
const SendProfileLikeInput = z.object({
|
|
716
|
+
user_id: ZUin.describe("好友 QQ 号"),
|
|
717
|
+
count: ZInt32WithDefault(1).describe("点赞数量")
|
|
718
|
+
});
|
|
719
|
+
const DeleteFriendInput = z.object({ user_id: ZUin.describe("好友 QQ 号") });
|
|
720
|
+
const GetFriendRequestsInput = z.object({
|
|
721
|
+
limit: ZInt32WithDefault(20).describe("获取的最大请求数量"),
|
|
722
|
+
is_filtered: ZBooleanWithDefault(false).describe("`true` 表示只获取被过滤(由风险账号发起)的通知,`false` 表示只获取未被过滤的通知")
|
|
723
|
+
});
|
|
724
|
+
const GetFriendRequestsOutput = z.object({ requests: z.array(z.lazy(() => FriendRequest)).describe("好友请求列表") });
|
|
725
|
+
const AcceptFriendRequestInput = z.object({
|
|
726
|
+
initiator_uid: ZString.describe("请求发起者 UID"),
|
|
727
|
+
is_filtered: ZBooleanWithDefault(false).describe("是否是被过滤的请求")
|
|
728
|
+
});
|
|
729
|
+
const RejectFriendRequestInput = z.object({
|
|
730
|
+
initiator_uid: ZString.describe("请求发起者 UID"),
|
|
731
|
+
is_filtered: ZBooleanWithDefault(false).describe("是否是被过滤的请求"),
|
|
732
|
+
reason: ZString.nullish().describe("拒绝理由")
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
//#endregion
|
|
736
|
+
//#region src/api/group.ts
|
|
737
|
+
const SetGroupNameInput = z.object({
|
|
738
|
+
group_id: ZUin.describe("群号"),
|
|
739
|
+
new_group_name: ZString.describe("新群名称")
|
|
740
|
+
});
|
|
741
|
+
const SetGroupAvatarInput = z.object({
|
|
742
|
+
group_id: ZUin.describe("群号"),
|
|
743
|
+
image_uri: ZString.describe("头像文件 URI,支持 `file://` `http(s)://` `base64://` 三种格式")
|
|
744
|
+
});
|
|
745
|
+
const SetGroupMemberCardInput = z.object({
|
|
746
|
+
group_id: ZUin.describe("群号"),
|
|
747
|
+
user_id: ZUin.describe("被设置的群成员 QQ 号"),
|
|
748
|
+
card: ZString.describe("新群名片")
|
|
749
|
+
});
|
|
750
|
+
const SetGroupMemberSpecialTitleInput = z.object({
|
|
751
|
+
group_id: ZUin.describe("群号"),
|
|
752
|
+
user_id: ZUin.describe("被设置的群成员 QQ 号"),
|
|
753
|
+
special_title: ZString.describe("新专属头衔")
|
|
754
|
+
});
|
|
755
|
+
const SetGroupMemberAdminInput = z.object({
|
|
756
|
+
group_id: ZUin.describe("群号"),
|
|
757
|
+
user_id: ZUin.describe("被设置的 QQ 号"),
|
|
758
|
+
is_set: ZBooleanWithDefault(true).describe("是否设置为管理员,`false` 表示取消管理员")
|
|
759
|
+
});
|
|
760
|
+
const SetGroupMemberMuteInput = z.object({
|
|
761
|
+
group_id: ZUin.describe("群号"),
|
|
762
|
+
user_id: ZUin.describe("被设置的 QQ 号"),
|
|
763
|
+
duration: ZInt64WithDefault(0).describe("禁言持续时间(秒),设为 `0` 为取消禁言")
|
|
764
|
+
});
|
|
765
|
+
const SetGroupWholeMuteInput = z.object({
|
|
766
|
+
group_id: ZUin.describe("群号"),
|
|
767
|
+
is_mute: ZBooleanWithDefault(true).describe("是否开启全员禁言,`false` 表示取消全员禁言")
|
|
768
|
+
});
|
|
769
|
+
const KickGroupMemberInput = z.object({
|
|
770
|
+
group_id: ZUin.describe("群号"),
|
|
771
|
+
user_id: ZUin.describe("被踢的 QQ 号"),
|
|
772
|
+
reject_add_request: ZBooleanWithDefault(false).describe("是否拒绝加群申请,`false` 表示不拒绝")
|
|
773
|
+
});
|
|
774
|
+
const GetGroupAnnouncementsInput = z.object({ group_id: ZUin.describe("群号") });
|
|
775
|
+
const GetGroupAnnouncementsOutput = z.object({ announcements: z.array(z.lazy(() => GroupAnnouncementEntity)).describe("群公告列表") });
|
|
776
|
+
const SendGroupAnnouncementInput = z.object({
|
|
777
|
+
group_id: ZUin.describe("群号"),
|
|
778
|
+
content: ZString.describe("公告内容"),
|
|
779
|
+
image_uri: ZString.nullish().describe("公告附带图像文件 URI,支持 `file://` `http(s)://` `base64://` 三种格式")
|
|
780
|
+
});
|
|
781
|
+
const DeleteGroupAnnouncementInput = z.object({
|
|
782
|
+
group_id: ZUin.describe("群号"),
|
|
783
|
+
announcement_id: ZString.describe("公告 ID")
|
|
784
|
+
});
|
|
785
|
+
const GetGroupEssenceMessagesInput = z.object({
|
|
786
|
+
group_id: ZUin.describe("群号"),
|
|
787
|
+
page_index: ZInt32.describe("页码索引,从 0 开始"),
|
|
788
|
+
page_size: ZInt32.describe("每页包含的精华消息数量")
|
|
789
|
+
});
|
|
790
|
+
const GetGroupEssenceMessagesOutput = z.object({
|
|
791
|
+
messages: z.array(z.lazy(() => GroupEssenceMessage)).describe("精华消息列表"),
|
|
792
|
+
is_end: ZBoolean.describe("是否已到最后一页")
|
|
793
|
+
});
|
|
794
|
+
const SetGroupEssenceMessageInput = z.object({
|
|
795
|
+
group_id: ZUin.describe("群号"),
|
|
796
|
+
message_seq: ZInt64.describe("消息序列号"),
|
|
797
|
+
is_set: ZBooleanWithDefault(true).describe("是否设置为精华消息,`false` 表示取消精华")
|
|
798
|
+
});
|
|
799
|
+
const QuitGroupInput = z.object({ group_id: ZUin.describe("群号") });
|
|
800
|
+
const SendGroupMessageReactionInput = z.object({
|
|
801
|
+
group_id: ZUin.describe("群号"),
|
|
802
|
+
message_seq: ZInt64.describe("要回应的消息序列号"),
|
|
803
|
+
reaction: ZString.describe("表情 ID"),
|
|
804
|
+
is_add: ZBooleanWithDefault(true).describe("是否添加表情,`false` 表示取消")
|
|
805
|
+
});
|
|
806
|
+
const SendGroupNudgeInput = z.object({
|
|
807
|
+
group_id: ZUin.describe("群号"),
|
|
808
|
+
user_id: ZUin.describe("被戳的群成员 QQ 号")
|
|
809
|
+
});
|
|
810
|
+
const GetGroupNotificationsInput = z.object({
|
|
811
|
+
start_notification_seq: ZInt64.nullish().describe("起始通知序列号"),
|
|
812
|
+
is_filtered: ZBooleanWithDefault(false).describe("`true` 表示只获取被过滤(由风险账号发起)的通知,`false` 表示只获取未被过滤的通知"),
|
|
813
|
+
limit: ZInt32WithDefault(20).describe("获取的最大通知数量")
|
|
814
|
+
});
|
|
815
|
+
const GetGroupNotificationsOutput = z.object({
|
|
816
|
+
notifications: z.array(z.lazy(() => GroupNotification)).describe("获取到的群通知(notification_seq 降序排列),序列号不一定连续"),
|
|
817
|
+
next_notification_seq: ZInt64.nullish().describe("下一页起始通知序列号")
|
|
818
|
+
});
|
|
819
|
+
const AcceptGroupRequestInput = z.object({
|
|
820
|
+
notification_seq: ZInt64.describe("请求对应的通知序列号"),
|
|
821
|
+
notification_type: z.enum(["join_request", "invited_join_request"]).describe("请求对应的通知类型"),
|
|
822
|
+
group_id: ZUin.describe("请求所在的群号"),
|
|
823
|
+
is_filtered: ZBooleanWithDefault(false).describe("是否是被过滤的请求")
|
|
824
|
+
});
|
|
825
|
+
const RejectGroupRequestInput = z.object({
|
|
826
|
+
notification_seq: ZInt64.describe("请求对应的通知序列号"),
|
|
827
|
+
notification_type: z.enum(["join_request", "invited_join_request"]).describe("请求对应的通知类型"),
|
|
828
|
+
group_id: ZUin.describe("请求所在的群号"),
|
|
829
|
+
is_filtered: ZBooleanWithDefault(false).describe("是否是被过滤的请求"),
|
|
830
|
+
reason: ZString.nullish().describe("拒绝理由")
|
|
831
|
+
});
|
|
832
|
+
const AcceptGroupInvitationInput = z.object({
|
|
833
|
+
group_id: ZUin.describe("群号"),
|
|
834
|
+
invitation_seq: ZInt64.describe("邀请序列号")
|
|
835
|
+
});
|
|
836
|
+
const RejectGroupInvitationInput = z.object({
|
|
837
|
+
group_id: ZUin.describe("群号"),
|
|
838
|
+
invitation_seq: ZInt64.describe("邀请序列号")
|
|
839
|
+
});
|
|
840
|
+
|
|
841
|
+
//#endregion
|
|
842
|
+
//#region src/api/file.ts
|
|
843
|
+
const UploadPrivateFileInput = z.object({
|
|
844
|
+
user_id: ZUin.describe("好友 QQ 号"),
|
|
845
|
+
file_uri: ZString.describe("文件 URI,支持 `file://` `http(s)://` `base64://` 三种格式"),
|
|
846
|
+
file_name: ZString.describe("文件名称")
|
|
847
|
+
});
|
|
848
|
+
const UploadPrivateFileOutput = z.object({ file_id: ZString.describe("文件 ID") });
|
|
849
|
+
const UploadGroupFileInput = z.object({
|
|
850
|
+
group_id: ZUin.describe("群号"),
|
|
851
|
+
parent_folder_id: ZStringWithDefault("/").describe("目标文件夹 ID"),
|
|
852
|
+
file_uri: ZString.describe("文件 URI,支持 `file://` `http(s)://` `base64://` 三种格式"),
|
|
853
|
+
file_name: ZString.describe("文件名称")
|
|
854
|
+
});
|
|
855
|
+
const UploadGroupFileOutput = z.object({ file_id: ZString.describe("文件 ID") });
|
|
856
|
+
const GetPrivateFileDownloadUrlInput = z.object({
|
|
857
|
+
user_id: ZUin.describe("好友 QQ 号"),
|
|
858
|
+
file_id: ZString.describe("文件 ID"),
|
|
859
|
+
file_hash: ZString.describe("文件的 TriSHA1 哈希值")
|
|
860
|
+
});
|
|
861
|
+
const GetPrivateFileDownloadUrlOutput = z.object({ download_url: ZString.describe("文件下载链接") });
|
|
862
|
+
const GetGroupFileDownloadUrlInput = z.object({
|
|
863
|
+
group_id: ZUin.describe("群号"),
|
|
864
|
+
file_id: ZString.describe("文件 ID")
|
|
865
|
+
});
|
|
866
|
+
const GetGroupFileDownloadUrlOutput = z.object({ download_url: ZString.describe("文件下载链接") });
|
|
867
|
+
const GetGroupFilesInput = z.object({
|
|
868
|
+
group_id: ZUin.describe("群号"),
|
|
869
|
+
parent_folder_id: ZStringWithDefault("/").describe("父文件夹 ID")
|
|
870
|
+
});
|
|
871
|
+
const GetGroupFilesOutput = z.object({
|
|
872
|
+
files: z.array(z.lazy(() => GroupFileEntity)).describe("文件列表"),
|
|
873
|
+
folders: z.array(z.lazy(() => GroupFolderEntity)).describe("文件夹列表")
|
|
874
|
+
});
|
|
875
|
+
const MoveGroupFileInput = z.object({
|
|
876
|
+
group_id: ZUin.describe("群号"),
|
|
877
|
+
file_id: ZString.describe("文件 ID"),
|
|
878
|
+
parent_folder_id: ZStringWithDefault("/").describe("文件所在的文件夹 ID"),
|
|
879
|
+
target_folder_id: ZStringWithDefault("/").describe("目标文件夹 ID")
|
|
880
|
+
});
|
|
881
|
+
const RenameGroupFileInput = z.object({
|
|
882
|
+
group_id: ZUin.describe("群号"),
|
|
883
|
+
file_id: ZString.describe("文件 ID"),
|
|
884
|
+
parent_folder_id: ZStringWithDefault("/").describe("文件所在的文件夹 ID"),
|
|
885
|
+
new_file_name: ZString.describe("新文件名称")
|
|
886
|
+
});
|
|
887
|
+
const DeleteGroupFileInput = z.object({
|
|
888
|
+
group_id: ZUin.describe("群号"),
|
|
889
|
+
file_id: ZString.describe("文件 ID")
|
|
890
|
+
});
|
|
891
|
+
const CreateGroupFolderInput = z.object({
|
|
892
|
+
group_id: ZUin.describe("群号"),
|
|
893
|
+
folder_name: ZString.describe("文件夹名称")
|
|
894
|
+
});
|
|
895
|
+
const CreateGroupFolderOutput = z.object({ folder_id: ZString.describe("文件夹 ID") });
|
|
896
|
+
const RenameGroupFolderInput = z.object({
|
|
897
|
+
group_id: ZUin.describe("群号"),
|
|
898
|
+
folder_id: ZString.describe("文件夹 ID"),
|
|
899
|
+
new_folder_name: ZString.describe("新文件夹名")
|
|
900
|
+
});
|
|
901
|
+
const DeleteGroupFolderInput = z.object({
|
|
902
|
+
group_id: ZUin.describe("群号"),
|
|
903
|
+
folder_id: ZString.describe("文件夹 ID")
|
|
904
|
+
});
|
|
905
|
+
|
|
906
|
+
//#endregion
|
|
907
|
+
export { AcceptFriendRequestInput, AcceptGroupInvitationInput, AcceptGroupRequestInput, BotOfflineEvent, CreateGroupFolderInput, CreateGroupFolderOutput, DeleteFriendInput, DeleteGroupAnnouncementInput, DeleteGroupFileInput, DeleteGroupFolderInput, Event, FriendCategoryEntity, FriendEntity, FriendFileUploadEvent, FriendNudgeEvent, FriendRequest, FriendRequestEvent, GetCSRFTokenOutput, GetCookiesInput, GetCookiesOutput, GetCustomFaceUrlListOutput, GetForwardedMessagesInput, GetForwardedMessagesOutput, GetFriendInfoInput, GetFriendInfoOutput, GetFriendListInput, GetFriendListOutput, GetFriendRequestsInput, GetFriendRequestsOutput, GetGroupAnnouncementsInput, GetGroupAnnouncementsOutput, GetGroupEssenceMessagesInput, GetGroupEssenceMessagesOutput, GetGroupFileDownloadUrlInput, GetGroupFileDownloadUrlOutput, GetGroupFilesInput, GetGroupFilesOutput, GetGroupInfoInput, GetGroupInfoOutput, GetGroupListInput, GetGroupListOutput, GetGroupMemberInfoInput, GetGroupMemberInfoOutput, GetGroupMemberListInput, GetGroupMemberListOutput, GetGroupNotificationsInput, GetGroupNotificationsOutput, GetHistoryMessagesInput, GetHistoryMessagesOutput, GetImplInfoOutput, GetLoginInfoOutput, GetMessageInput, GetMessageOutput, GetPrivateFileDownloadUrlInput, GetPrivateFileDownloadUrlOutput, GetResourceTempUrlInput, GetResourceTempUrlOutput, GetUserProfileInput, GetUserProfileOutput, GroupAdminChangeEvent, GroupAnnouncementEntity, GroupEntity, GroupEssenceMessage, GroupEssenceMessageChangeEvent, GroupFileEntity, GroupFileUploadEvent, GroupFolderEntity, GroupInvitationEvent, GroupInvitedJoinRequestEvent, GroupJoinRequestEvent, GroupMemberDecreaseEvent, GroupMemberEntity, GroupMemberIncreaseEvent, GroupMessageReactionEvent, GroupMuteEvent, GroupNameChangeEvent, GroupNotification, GroupNudgeEvent, GroupWholeMuteEvent, IncomingForwardedMessage, IncomingMessage, IncomingResourceSegmentBase, IncomingSegment, KickGroupMemberInput, MarkMessageAsReadInput, MessageRecallEvent, MoveGroupFileInput, OutgoingForwardedMessage, OutgoingResourceSegmentBase, OutgoingSegment, QuitGroupInput, RecallGroupMessageInput, RecallPrivateMessageInput, RejectFriendRequestInput, RejectGroupInvitationInput, RejectGroupRequestInput, RenameGroupFileInput, RenameGroupFolderInput, SendFriendNudgeInput, SendGroupAnnouncementInput, SendGroupMessageInput, SendGroupMessageOutput, SendGroupMessageReactionInput, SendGroupNudgeInput, SendPrivateMessageInput, SendPrivateMessageOutput, SendProfileLikeInput, SetAvatarInput, SetBioInput, SetGroupAvatarInput, SetGroupEssenceMessageInput, SetGroupMemberAdminInput, SetGroupMemberCardInput, SetGroupMemberMuteInput, SetGroupMemberSpecialTitleInput, SetGroupNameInput, SetGroupWholeMuteInput, SetNicknameInput, UploadGroupFileInput, UploadGroupFileOutput, UploadPrivateFileInput, UploadPrivateFileOutput, ZBoolean, ZBooleanWithDefault, ZInt32, ZInt32WithDefault, ZInt64, ZInt64WithDefault, ZString, ZStringWithDefault, ZUin, milkyPackageVersion, milkyVersion };
|
|
908
|
+
//# sourceMappingURL=index.mjs.map
|