@fantaibao/ws-protocol 1.1.0

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.
@@ -0,0 +1,1211 @@
1
+ import { z } from 'zod';
2
+ export declare const PlatformSchema: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
3
+ export type Platform = z.infer<typeof PlatformSchema>;
4
+ export declare const PROTOCOL_VERSION = 2;
5
+ export declare const WsMessageTypes: readonly ["auth:request", "auth:accepted", "auth:rejected", "client:info", "account:list", "account:list:result", "account:sync", "account:login", "account:login:result", "account:login:progress", "account:check", "account:check:result", "account:remove", "account:remove:result", "account:reconcile", "account:reconcile:result", "account:remove:sync", "account:remove:sync:result", "data:pull", "data:pull:result", "data:pull-export", "data:pull-export:result", "data:report", "task:submit", "task:submit:result", "task:batch:submit", "task:batch:submit:result", "task:progress", "task:done", "task:download", "task:cancel", "task:cancel:result", "task:list", "task:list:result", "system:status", "system:status:result", "system:error", "file:prepare", "file:prepare:result", "file:progress", "schedule:set", "schedule:set:result"];
6
+ export type WsMessageType = (typeof WsMessageTypes)[number];
7
+ /** 请求消息信封 */
8
+ export declare const WsEnvelopeSchema: z.ZodObject<{
9
+ type: z.ZodString;
10
+ id: z.ZodDefault<z.ZodString>;
11
+ data: z.ZodDefault<z.ZodUnknown>;
12
+ ts: z.ZodDefault<z.ZodNumber>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ type: string;
15
+ id: string;
16
+ ts: number;
17
+ data?: unknown;
18
+ }, {
19
+ type: string;
20
+ id?: string | undefined;
21
+ data?: unknown;
22
+ ts?: number | undefined;
23
+ }>;
24
+ export type WsEnvelope = z.infer<typeof WsEnvelopeSchema>;
25
+ /** 响应消息信封 */
26
+ export declare const WsResponseEnvelopeSchema: z.ZodObject<{
27
+ type: z.ZodString;
28
+ id: z.ZodDefault<z.ZodString>;
29
+ data: z.ZodDefault<z.ZodUnknown>;
30
+ ts: z.ZodDefault<z.ZodNumber>;
31
+ } & {
32
+ replyTo: z.ZodString;
33
+ success: z.ZodBoolean;
34
+ error: z.ZodOptional<z.ZodString>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ type: string;
37
+ id: string;
38
+ ts: number;
39
+ replyTo: string;
40
+ success: boolean;
41
+ data?: unknown;
42
+ error?: string | undefined;
43
+ }, {
44
+ type: string;
45
+ replyTo: string;
46
+ success: boolean;
47
+ id?: string | undefined;
48
+ data?: unknown;
49
+ ts?: number | undefined;
50
+ error?: string | undefined;
51
+ }>;
52
+ export type WsResponseEnvelope = z.infer<typeof WsResponseEnvelopeSchema>;
53
+ /** auth:request — 首条消息鉴权(替代 URL query 传 token) */
54
+ export declare const AuthRequestDataSchema: z.ZodObject<{
55
+ token: z.ZodString;
56
+ protocolVersion: z.ZodDefault<z.ZodNumber>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ token: string;
59
+ protocolVersion: number;
60
+ }, {
61
+ token: string;
62
+ protocolVersion?: number | undefined;
63
+ }>;
64
+ export declare const AuthAcceptedDataSchema: z.ZodObject<{
65
+ clientId: z.ZodString;
66
+ version: z.ZodString;
67
+ protocolVersion: z.ZodNumber;
68
+ }, "strip", z.ZodTypeAny, {
69
+ protocolVersion: number;
70
+ clientId: string;
71
+ version: string;
72
+ }, {
73
+ protocolVersion: number;
74
+ clientId: string;
75
+ version: string;
76
+ }>;
77
+ export declare const AuthRejectedDataSchema: z.ZodObject<{
78
+ reason: z.ZodString;
79
+ }, "strip", z.ZodTypeAny, {
80
+ reason: string;
81
+ }, {
82
+ reason: string;
83
+ }>;
84
+ export declare const ClientInfoDataSchema: z.ZodObject<{
85
+ clientId: z.ZodString;
86
+ appVersion: z.ZodString;
87
+ platform: z.ZodString;
88
+ arch: z.ZodString;
89
+ protocolVersion: z.ZodNumber;
90
+ supportedPlatforms: z.ZodArray<z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>, "many">;
91
+ accounts: z.ZodArray<z.ZodObject<{
92
+ accountId: z.ZodString;
93
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
94
+ /** Plan A(v3.3):业务主键的 uid 部分。 */
95
+ platformUid: z.ZodDefault<z.ZodString>;
96
+ nickname: z.ZodString;
97
+ avatar: z.ZodDefault<z.ZodString>;
98
+ status: z.ZodEnum<["logged_in", "expired", "unknown"]>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ status: "unknown" | "logged_in" | "expired";
101
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
102
+ accountId: string;
103
+ platformUid: string;
104
+ nickname: string;
105
+ avatar: string;
106
+ }, {
107
+ status: "unknown" | "logged_in" | "expired";
108
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
109
+ accountId: string;
110
+ nickname: string;
111
+ platformUid?: string | undefined;
112
+ avatar?: string | undefined;
113
+ }>, "many">;
114
+ }, "strip", z.ZodTypeAny, {
115
+ protocolVersion: number;
116
+ clientId: string;
117
+ appVersion: string;
118
+ platform: string;
119
+ arch: string;
120
+ supportedPlatforms: ("weixin" | "douyin" | "xhs" | "kuaishou")[];
121
+ accounts: {
122
+ status: "unknown" | "logged_in" | "expired";
123
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
124
+ accountId: string;
125
+ platformUid: string;
126
+ nickname: string;
127
+ avatar: string;
128
+ }[];
129
+ }, {
130
+ protocolVersion: number;
131
+ clientId: string;
132
+ appVersion: string;
133
+ platform: string;
134
+ arch: string;
135
+ supportedPlatforms: ("weixin" | "douyin" | "xhs" | "kuaishou")[];
136
+ accounts: {
137
+ status: "unknown" | "logged_in" | "expired";
138
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
139
+ accountId: string;
140
+ nickname: string;
141
+ platformUid?: string | undefined;
142
+ avatar?: string | undefined;
143
+ }[];
144
+ }>;
145
+ export type ClientInfoData = z.infer<typeof ClientInfoDataSchema>;
146
+ /**
147
+ * 平台健康/诊断状态枚举(与 base.ts 的 PlatformHealthStatus 对齐)
148
+ * normal 平台体检正常
149
+ * warning 平台显示警告/限流
150
+ * restricted 平台严重受限
151
+ * unknown 没检测到 / 默认
152
+ */
153
+ export declare const PlatformHealthStatusSchema: z.ZodEnum<["normal", "warning", "restricted", "unknown"]>;
154
+ export type PlatformHealthStatusWs = z.infer<typeof PlatformHealthStatusSchema>;
155
+ export declare const WsAccountInfoSchema: z.ZodObject<{
156
+ accountId: z.ZodString;
157
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
158
+ /** Plan A(v3.3):业务主键的 uid 部分。 */
159
+ platformUid: z.ZodDefault<z.ZodString>;
160
+ nickname: z.ZodString;
161
+ avatar: z.ZodDefault<z.ZodString>;
162
+ status: z.ZodEnum<["logged_in", "expired", "unknown"]>;
163
+ updatedAt: z.ZodString;
164
+ /** 平台健康状态(与 status 正交);缺失视为 'unknown' */
165
+ healthStatus: z.ZodOptional<z.ZodEnum<["normal", "warning", "restricted", "unknown"]>>;
166
+ healthMessage: z.ZodOptional<z.ZodString>;
167
+ healthCheckedAt: z.ZodOptional<z.ZodString>;
168
+ }, "strip", z.ZodTypeAny, {
169
+ status: "unknown" | "logged_in" | "expired";
170
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
171
+ accountId: string;
172
+ platformUid: string;
173
+ nickname: string;
174
+ avatar: string;
175
+ updatedAt: string;
176
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
177
+ healthMessage?: string | undefined;
178
+ healthCheckedAt?: string | undefined;
179
+ }, {
180
+ status: "unknown" | "logged_in" | "expired";
181
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
182
+ accountId: string;
183
+ nickname: string;
184
+ updatedAt: string;
185
+ platformUid?: string | undefined;
186
+ avatar?: string | undefined;
187
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
188
+ healthMessage?: string | undefined;
189
+ healthCheckedAt?: string | undefined;
190
+ }>;
191
+ export type WsAccountInfo = z.infer<typeof WsAccountInfoSchema>;
192
+ export declare const AccountListDataSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
193
+ export declare const AccountListResultDataSchema: z.ZodObject<{
194
+ accounts: z.ZodArray<z.ZodObject<{
195
+ accountId: z.ZodString;
196
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
197
+ /** Plan A(v3.3):业务主键的 uid 部分。 */
198
+ platformUid: z.ZodDefault<z.ZodString>;
199
+ nickname: z.ZodString;
200
+ avatar: z.ZodDefault<z.ZodString>;
201
+ status: z.ZodEnum<["logged_in", "expired", "unknown"]>;
202
+ updatedAt: z.ZodString;
203
+ /** 平台健康状态(与 status 正交);缺失视为 'unknown' */
204
+ healthStatus: z.ZodOptional<z.ZodEnum<["normal", "warning", "restricted", "unknown"]>>;
205
+ healthMessage: z.ZodOptional<z.ZodString>;
206
+ healthCheckedAt: z.ZodOptional<z.ZodString>;
207
+ }, "strip", z.ZodTypeAny, {
208
+ status: "unknown" | "logged_in" | "expired";
209
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
210
+ accountId: string;
211
+ platformUid: string;
212
+ nickname: string;
213
+ avatar: string;
214
+ updatedAt: string;
215
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
216
+ healthMessage?: string | undefined;
217
+ healthCheckedAt?: string | undefined;
218
+ }, {
219
+ status: "unknown" | "logged_in" | "expired";
220
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
221
+ accountId: string;
222
+ nickname: string;
223
+ updatedAt: string;
224
+ platformUid?: string | undefined;
225
+ avatar?: string | undefined;
226
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
227
+ healthMessage?: string | undefined;
228
+ healthCheckedAt?: string | undefined;
229
+ }>, "many">;
230
+ }, "strip", z.ZodTypeAny, {
231
+ accounts: {
232
+ status: "unknown" | "logged_in" | "expired";
233
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
234
+ accountId: string;
235
+ platformUid: string;
236
+ nickname: string;
237
+ avatar: string;
238
+ updatedAt: string;
239
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
240
+ healthMessage?: string | undefined;
241
+ healthCheckedAt?: string | undefined;
242
+ }[];
243
+ }, {
244
+ accounts: {
245
+ status: "unknown" | "logged_in" | "expired";
246
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
247
+ accountId: string;
248
+ nickname: string;
249
+ updatedAt: string;
250
+ platformUid?: string | undefined;
251
+ avatar?: string | undefined;
252
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
253
+ healthMessage?: string | undefined;
254
+ healthCheckedAt?: string | undefined;
255
+ }[];
256
+ }>;
257
+ export declare const AccountSyncDataSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
258
+ action: z.ZodEnum<["added", "updated", "removed"]>;
259
+ account: z.ZodObject<{
260
+ accountId: z.ZodString;
261
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
262
+ platformUid: z.ZodOptional<z.ZodString>;
263
+ serverAccountId: z.ZodOptional<z.ZodNumber>;
264
+ localId: z.ZodOptional<z.ZodString>;
265
+ nickname: z.ZodOptional<z.ZodString>;
266
+ avatar: z.ZodOptional<z.ZodString>;
267
+ status: z.ZodOptional<z.ZodEnum<["logged_in", "expired", "unknown"]>>;
268
+ updatedAt: z.ZodOptional<z.ZodString>;
269
+ healthStatus: z.ZodOptional<z.ZodEnum<["normal", "warning", "restricted", "unknown"]>>;
270
+ healthMessage: z.ZodOptional<z.ZodString>;
271
+ healthCheckedAt: z.ZodOptional<z.ZodString>;
272
+ }, "strip", z.ZodTypeAny, {
273
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
274
+ accountId: string;
275
+ status?: "unknown" | "logged_in" | "expired" | undefined;
276
+ platformUid?: string | undefined;
277
+ nickname?: string | undefined;
278
+ avatar?: string | undefined;
279
+ updatedAt?: string | undefined;
280
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
281
+ healthMessage?: string | undefined;
282
+ healthCheckedAt?: string | undefined;
283
+ serverAccountId?: number | undefined;
284
+ localId?: string | undefined;
285
+ }, {
286
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
287
+ accountId: string;
288
+ status?: "unknown" | "logged_in" | "expired" | undefined;
289
+ platformUid?: string | undefined;
290
+ nickname?: string | undefined;
291
+ avatar?: string | undefined;
292
+ updatedAt?: string | undefined;
293
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
294
+ healthMessage?: string | undefined;
295
+ healthCheckedAt?: string | undefined;
296
+ serverAccountId?: number | undefined;
297
+ localId?: string | undefined;
298
+ }>;
299
+ }, "strip", z.ZodTypeAny, {
300
+ action: "added" | "updated" | "removed";
301
+ account: {
302
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
303
+ accountId: string;
304
+ status?: "unknown" | "logged_in" | "expired" | undefined;
305
+ platformUid?: string | undefined;
306
+ nickname?: string | undefined;
307
+ avatar?: string | undefined;
308
+ updatedAt?: string | undefined;
309
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
310
+ healthMessage?: string | undefined;
311
+ healthCheckedAt?: string | undefined;
312
+ serverAccountId?: number | undefined;
313
+ localId?: string | undefined;
314
+ };
315
+ }, {
316
+ action: "added" | "updated" | "removed";
317
+ account: {
318
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
319
+ accountId: string;
320
+ status?: "unknown" | "logged_in" | "expired" | undefined;
321
+ platformUid?: string | undefined;
322
+ nickname?: string | undefined;
323
+ avatar?: string | undefined;
324
+ updatedAt?: string | undefined;
325
+ healthStatus?: "unknown" | "normal" | "warning" | "restricted" | undefined;
326
+ healthMessage?: string | undefined;
327
+ healthCheckedAt?: string | undefined;
328
+ serverAccountId?: number | undefined;
329
+ localId?: string | undefined;
330
+ };
331
+ }>, z.ZodObject<{
332
+ action: z.ZodLiteral<"missing">;
333
+ accounts: z.ZodArray<z.ZodObject<{
334
+ accountId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
335
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
336
+ platformUid: z.ZodString;
337
+ nickname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
338
+ avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
339
+ status: z.ZodOptional<z.ZodNullable<z.ZodEnum<["logged_in", "expired", "unknown"]>>>;
340
+ }, "strip", z.ZodTypeAny, {
341
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
342
+ platformUid: string;
343
+ status?: "unknown" | "logged_in" | "expired" | null | undefined;
344
+ accountId?: number | null | undefined;
345
+ nickname?: string | null | undefined;
346
+ avatar?: string | null | undefined;
347
+ }, {
348
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
349
+ platformUid: string;
350
+ status?: "unknown" | "logged_in" | "expired" | null | undefined;
351
+ accountId?: number | null | undefined;
352
+ nickname?: string | null | undefined;
353
+ avatar?: string | null | undefined;
354
+ }>, "many">;
355
+ }, "strip", z.ZodTypeAny, {
356
+ accounts: {
357
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
358
+ platformUid: string;
359
+ status?: "unknown" | "logged_in" | "expired" | null | undefined;
360
+ accountId?: number | null | undefined;
361
+ nickname?: string | null | undefined;
362
+ avatar?: string | null | undefined;
363
+ }[];
364
+ action: "missing";
365
+ }, {
366
+ accounts: {
367
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
368
+ platformUid: string;
369
+ status?: "unknown" | "logged_in" | "expired" | null | undefined;
370
+ accountId?: number | null | undefined;
371
+ nickname?: string | null | undefined;
372
+ avatar?: string | null | undefined;
373
+ }[];
374
+ action: "missing";
375
+ }>]>;
376
+ /** account:login — 异步模式:立即返回 sessionId,完成后推送 account:login:result */
377
+ export declare const AccountLoginDataSchema: z.ZodObject<{
378
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
379
+ /** 当前 Web 侧商户上下文;用于桌面端切换/核对本地账号归属。 */
380
+ merchantId: z.ZodOptional<z.ZodNumber>;
381
+ /** 本次扫码绑定的明确目标商户;服务端以此避免复用旧商户账号。 */
382
+ targetMerchantId: z.ZodOptional<z.ZodNumber>;
383
+ }, "strip", z.ZodTypeAny, {
384
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
385
+ merchantId?: number | undefined;
386
+ targetMerchantId?: number | undefined;
387
+ }, {
388
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
389
+ merchantId?: number | undefined;
390
+ targetMerchantId?: number | undefined;
391
+ }>;
392
+ export declare const AccountLoginResultDataSchema: z.ZodObject<{
393
+ sessionId: z.ZodString;
394
+ status: z.ZodEnum<["started", "completed", "failed", "timeout", "cancelled"]>;
395
+ accountId: z.ZodOptional<z.ZodString>;
396
+ /** Plan A(v3.3):登录完成时回显新账号的业务主键。 */
397
+ platformUid: z.ZodOptional<z.ZodString>;
398
+ /** 服务端账号主键,供 Web 立即刷新/定位后端记录。 */
399
+ serverAccountId: z.ZodOptional<z.ZodNumber>;
400
+ /** 本次绑定目标商户回显,便于 Web/日志排查商户归属。 */
401
+ targetMerchantId: z.ZodOptional<z.ZodNumber>;
402
+ nickname: z.ZodOptional<z.ZodString>;
403
+ avatar: z.ZodOptional<z.ZodString>;
404
+ message: z.ZodOptional<z.ZodString>;
405
+ }, "strip", z.ZodTypeAny, {
406
+ status: "started" | "completed" | "failed" | "timeout" | "cancelled";
407
+ sessionId: string;
408
+ message?: string | undefined;
409
+ accountId?: string | undefined;
410
+ platformUid?: string | undefined;
411
+ nickname?: string | undefined;
412
+ avatar?: string | undefined;
413
+ serverAccountId?: number | undefined;
414
+ targetMerchantId?: number | undefined;
415
+ }, {
416
+ status: "started" | "completed" | "failed" | "timeout" | "cancelled";
417
+ sessionId: string;
418
+ message?: string | undefined;
419
+ accountId?: string | undefined;
420
+ platformUid?: string | undefined;
421
+ nickname?: string | undefined;
422
+ avatar?: string | undefined;
423
+ serverAccountId?: number | undefined;
424
+ targetMerchantId?: number | undefined;
425
+ }>;
426
+ /** account:login:progress — 登录过程中推送 */
427
+ export declare const AccountLoginProgressDataSchema: z.ZodObject<{
428
+ sessionId: z.ZodString;
429
+ phase: z.ZodEnum<["init", "waiting_scan", "confirming", "done", "failed", "timeout"]>;
430
+ message: z.ZodDefault<z.ZodString>;
431
+ }, "strip", z.ZodTypeAny, {
432
+ message: string;
433
+ sessionId: string;
434
+ phase: "failed" | "timeout" | "init" | "waiting_scan" | "confirming" | "done";
435
+ }, {
436
+ sessionId: string;
437
+ phase: "failed" | "timeout" | "init" | "waiting_scan" | "confirming" | "done";
438
+ message?: string | undefined;
439
+ }>;
440
+ /**
441
+ * account:check — 检查账号登录态。
442
+ * Plan A(v3.3):主键切换为 (platform, platformUid),accountId 字段已废弃。
443
+ */
444
+ export declare const AccountCheckDataSchema: z.ZodObject<{
445
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
446
+ platformUid: z.ZodString;
447
+ }, "strip", z.ZodTypeAny, {
448
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
449
+ platformUid: string;
450
+ }, {
451
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
452
+ platformUid: string;
453
+ }>;
454
+ export declare const AccountCheckResultDataSchema: z.ZodObject<{
455
+ /** Desktop 本地不透明 id,供 Web 关联 UI 行。 */
456
+ accountId: z.ZodString;
457
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
458
+ platformUid: z.ZodString;
459
+ status: z.ZodEnum<["logged_in", "expired", "unknown"]>;
460
+ checkedAt: z.ZodString;
461
+ }, "strip", z.ZodTypeAny, {
462
+ status: "unknown" | "logged_in" | "expired";
463
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
464
+ accountId: string;
465
+ platformUid: string;
466
+ checkedAt: string;
467
+ }, {
468
+ status: "unknown" | "logged_in" | "expired";
469
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
470
+ accountId: string;
471
+ platformUid: string;
472
+ checkedAt: string;
473
+ }>;
474
+ /**
475
+ * account:remove — SaaS 远程删除账号。
476
+ * Plan A(v3.3):主键切换为 (platform, platformUid),accountId 字段已废弃。
477
+ */
478
+ export declare const AccountRemoveDataSchema: z.ZodObject<{
479
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
480
+ platformUid: z.ZodString;
481
+ }, "strip", z.ZodTypeAny, {
482
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
483
+ platformUid: string;
484
+ }, {
485
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
486
+ platformUid: string;
487
+ }>;
488
+ export declare const AccountRemoveResultDataSchema: z.ZodObject<{
489
+ accountId: z.ZodString;
490
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
491
+ platformUid: z.ZodString;
492
+ removed: z.ZodBoolean;
493
+ }, "strip", z.ZodTypeAny, {
494
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
495
+ accountId: string;
496
+ platformUid: string;
497
+ removed: boolean;
498
+ }, {
499
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
500
+ accountId: string;
501
+ platformUid: string;
502
+ removed: boolean;
503
+ }>;
504
+ export declare const DataPullModuleSchema: z.ZodEnum<["overview", "contents", "fansTrend", "trend"]>;
505
+ export declare const DataPullDataSchema: z.ZodObject<{
506
+ accountId: z.ZodString;
507
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
508
+ modules: z.ZodOptional<z.ZodArray<z.ZodEnum<["overview", "contents", "fansTrend", "trend"]>, "many">>;
509
+ /** 分页:内容列表每页条数,默认 50,最大 200 */
510
+ contentsLimit: z.ZodDefault<z.ZodNumber>;
511
+ /** 分页:内容列表偏移游标(上次返回的 lastCursor) */
512
+ contentsCursor: z.ZodOptional<z.ZodString>;
513
+ }, "strip", z.ZodTypeAny, {
514
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
515
+ accountId: string;
516
+ contentsLimit: number;
517
+ modules?: ("overview" | "contents" | "fansTrend" | "trend")[] | undefined;
518
+ contentsCursor?: string | undefined;
519
+ }, {
520
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
521
+ accountId: string;
522
+ modules?: ("overview" | "contents" | "fansTrend" | "trend")[] | undefined;
523
+ contentsLimit?: number | undefined;
524
+ contentsCursor?: string | undefined;
525
+ }>;
526
+ export declare const DataPullResultDataSchema: z.ZodObject<{
527
+ platform: z.ZodString;
528
+ accountId: z.ZodString;
529
+ overview: z.ZodOptional<z.ZodUnknown>;
530
+ contents: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
531
+ fansTrend: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
532
+ fetchedAt: z.ZodString;
533
+ /** 内容分页:下一页游标,null 表示没有更多 */
534
+ nextCursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
535
+ /** 内容总数 */
536
+ contentsTotal: z.ZodOptional<z.ZodNumber>;
537
+ }, "strip", z.ZodTypeAny, {
538
+ platform: string;
539
+ accountId: string;
540
+ fetchedAt: string;
541
+ overview?: unknown;
542
+ contents?: unknown[] | undefined;
543
+ fansTrend?: unknown;
544
+ nextCursor?: string | null | undefined;
545
+ contentsTotal?: number | undefined;
546
+ }, {
547
+ platform: string;
548
+ accountId: string;
549
+ fetchedAt: string;
550
+ overview?: unknown;
551
+ contents?: unknown[] | undefined;
552
+ fansTrend?: unknown;
553
+ nextCursor?: string | null | undefined;
554
+ contentsTotal?: number | undefined;
555
+ }>;
556
+ export declare const TaskKindSchema: z.ZodEnum<["check", "upload", "login"]>;
557
+ export declare const TaskSubmitDataSchema: z.ZodObject<{
558
+ kind: z.ZodEnum<["check", "upload", "login"]>;
559
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
560
+ accountId: z.ZodString;
561
+ params: z.ZodOptional<z.ZodObject<{
562
+ videoPath: z.ZodString;
563
+ title: z.ZodString;
564
+ description: z.ZodDefault<z.ZodString>;
565
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
566
+ coverPath: z.ZodDefault<z.ZodString>;
567
+ /** 定时发布,ms 时间戳,与 rpa/types.ts 的 UploadParams.publishAt 一致 */
568
+ publishAt: z.ZodOptional<z.ZodNumber>;
569
+ extra: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
570
+ }, "strip", z.ZodTypeAny, {
571
+ videoPath: string;
572
+ title: string;
573
+ description: string;
574
+ tags: string[];
575
+ coverPath: string;
576
+ extra: Record<string, unknown>;
577
+ publishAt?: number | undefined;
578
+ }, {
579
+ videoPath: string;
580
+ title: string;
581
+ description?: string | undefined;
582
+ tags?: string[] | undefined;
583
+ coverPath?: string | undefined;
584
+ publishAt?: number | undefined;
585
+ extra?: Record<string, unknown> | undefined;
586
+ }>>;
587
+ }, "strip", z.ZodTypeAny, {
588
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
589
+ accountId: string;
590
+ kind: "check" | "upload" | "login";
591
+ params?: {
592
+ videoPath: string;
593
+ title: string;
594
+ description: string;
595
+ tags: string[];
596
+ coverPath: string;
597
+ extra: Record<string, unknown>;
598
+ publishAt?: number | undefined;
599
+ } | undefined;
600
+ }, {
601
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
602
+ accountId: string;
603
+ kind: "check" | "upload" | "login";
604
+ params?: {
605
+ videoPath: string;
606
+ title: string;
607
+ description?: string | undefined;
608
+ tags?: string[] | undefined;
609
+ coverPath?: string | undefined;
610
+ publishAt?: number | undefined;
611
+ extra?: Record<string, unknown> | undefined;
612
+ } | undefined;
613
+ }>;
614
+ export declare const TaskSubmitResultDataSchema: z.ZodObject<{
615
+ taskId: z.ZodString;
616
+ }, "strip", z.ZodTypeAny, {
617
+ taskId: string;
618
+ }, {
619
+ taskId: string;
620
+ }>;
621
+ export declare const TaskBatchSubmitDataSchema: z.ZodUnion<[z.ZodObject<{
622
+ batchId: z.ZodString;
623
+ backendBatchId: z.ZodOptional<z.ZodNumber>;
624
+ mode: z.ZodLiteral<"matrix">;
625
+ videos: z.ZodArray<z.ZodObject<{
626
+ videoId: z.ZodNullable<z.ZodNumber>;
627
+ videoUrl: z.ZodString;
628
+ title: z.ZodString;
629
+ description: z.ZodDefault<z.ZodString>;
630
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
631
+ coverUrl: z.ZodDefault<z.ZodString>;
632
+ location: z.ZodOptional<z.ZodString>;
633
+ enableMerchandise: z.ZodOptional<z.ZodBoolean>;
634
+ }, "strip", z.ZodTypeAny, {
635
+ title: string;
636
+ description: string;
637
+ tags: string[];
638
+ videoId: number | null;
639
+ videoUrl: string;
640
+ coverUrl: string;
641
+ location?: string | undefined;
642
+ enableMerchandise?: boolean | undefined;
643
+ }, {
644
+ title: string;
645
+ videoId: number | null;
646
+ videoUrl: string;
647
+ description?: string | undefined;
648
+ tags?: string[] | undefined;
649
+ coverUrl?: string | undefined;
650
+ location?: string | undefined;
651
+ enableMerchandise?: boolean | undefined;
652
+ }>, "many">;
653
+ accounts: z.ZodArray<z.ZodObject<{
654
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
655
+ platformUid: z.ZodString;
656
+ /** 后端 numeric PK,仅作为审计/对账辅助字段(日志、ack 回填),不参与查找。 */
657
+ backendAccountId: z.ZodOptional<z.ZodNumber>;
658
+ override: z.ZodOptional<z.ZodObject<{
659
+ title: z.ZodOptional<z.ZodString>;
660
+ description: z.ZodOptional<z.ZodString>;
661
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
662
+ location: z.ZodOptional<z.ZodString>;
663
+ enableMerchandise: z.ZodOptional<z.ZodBoolean>;
664
+ }, "strip", z.ZodTypeAny, {
665
+ title?: string | undefined;
666
+ description?: string | undefined;
667
+ tags?: string[] | undefined;
668
+ location?: string | undefined;
669
+ enableMerchandise?: boolean | undefined;
670
+ }, {
671
+ title?: string | undefined;
672
+ description?: string | undefined;
673
+ tags?: string[] | undefined;
674
+ location?: string | undefined;
675
+ enableMerchandise?: boolean | undefined;
676
+ }>>;
677
+ }, "strip", z.ZodTypeAny, {
678
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
679
+ platformUid: string;
680
+ backendAccountId?: number | undefined;
681
+ override?: {
682
+ title?: string | undefined;
683
+ description?: string | undefined;
684
+ tags?: string[] | undefined;
685
+ location?: string | undefined;
686
+ enableMerchandise?: boolean | undefined;
687
+ } | undefined;
688
+ }, {
689
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
690
+ platformUid: string;
691
+ backendAccountId?: number | undefined;
692
+ override?: {
693
+ title?: string | undefined;
694
+ description?: string | undefined;
695
+ tags?: string[] | undefined;
696
+ location?: string | undefined;
697
+ enableMerchandise?: boolean | undefined;
698
+ } | undefined;
699
+ }>, "many">;
700
+ scheduleAt: z.ZodOptional<z.ZodNumber>;
701
+ }, "strip", z.ZodTypeAny, {
702
+ accounts: {
703
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
704
+ platformUid: string;
705
+ backendAccountId?: number | undefined;
706
+ override?: {
707
+ title?: string | undefined;
708
+ description?: string | undefined;
709
+ tags?: string[] | undefined;
710
+ location?: string | undefined;
711
+ enableMerchandise?: boolean | undefined;
712
+ } | undefined;
713
+ }[];
714
+ batchId: string;
715
+ mode: "matrix";
716
+ videos: {
717
+ title: string;
718
+ description: string;
719
+ tags: string[];
720
+ videoId: number | null;
721
+ videoUrl: string;
722
+ coverUrl: string;
723
+ location?: string | undefined;
724
+ enableMerchandise?: boolean | undefined;
725
+ }[];
726
+ backendBatchId?: number | undefined;
727
+ scheduleAt?: number | undefined;
728
+ }, {
729
+ accounts: {
730
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
731
+ platformUid: string;
732
+ backendAccountId?: number | undefined;
733
+ override?: {
734
+ title?: string | undefined;
735
+ description?: string | undefined;
736
+ tags?: string[] | undefined;
737
+ location?: string | undefined;
738
+ enableMerchandise?: boolean | undefined;
739
+ } | undefined;
740
+ }[];
741
+ batchId: string;
742
+ mode: "matrix";
743
+ videos: {
744
+ title: string;
745
+ videoId: number | null;
746
+ videoUrl: string;
747
+ description?: string | undefined;
748
+ tags?: string[] | undefined;
749
+ coverUrl?: string | undefined;
750
+ location?: string | undefined;
751
+ enableMerchandise?: boolean | undefined;
752
+ }[];
753
+ backendBatchId?: number | undefined;
754
+ scheduleAt?: number | undefined;
755
+ }>, z.ZodObject<{
756
+ batchId: z.ZodString;
757
+ backendBatchId: z.ZodOptional<z.ZodNumber>;
758
+ mode: z.ZodLiteral<"pairs">;
759
+ pairs: z.ZodArray<z.ZodObject<{
760
+ /** 后端分配的 task id */
761
+ taskId: z.ZodNumber;
762
+ videoId: z.ZodNullable<z.ZodNumber>;
763
+ videoUrl: z.ZodString;
764
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
765
+ platformUid: z.ZodString;
766
+ /** 后端 numeric PK,仅作为审计/对账辅助字段,不参与查找。 */
767
+ backendAccountId: z.ZodOptional<z.ZodNumber>;
768
+ title: z.ZodString;
769
+ description: z.ZodDefault<z.ZodString>;
770
+ tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
771
+ coverUrl: z.ZodDefault<z.ZodString>;
772
+ publishAt: z.ZodOptional<z.ZodNumber>;
773
+ location: z.ZodOptional<z.ZodString>;
774
+ enableMerchandise: z.ZodOptional<z.ZodBoolean>;
775
+ }, "strip", z.ZodTypeAny, {
776
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
777
+ platformUid: string;
778
+ title: string;
779
+ description: string;
780
+ tags: string[];
781
+ taskId: number;
782
+ videoId: number | null;
783
+ videoUrl: string;
784
+ coverUrl: string;
785
+ publishAt?: number | undefined;
786
+ location?: string | undefined;
787
+ enableMerchandise?: boolean | undefined;
788
+ backendAccountId?: number | undefined;
789
+ }, {
790
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
791
+ platformUid: string;
792
+ title: string;
793
+ taskId: number;
794
+ videoId: number | null;
795
+ videoUrl: string;
796
+ description?: string | undefined;
797
+ tags?: string[] | undefined;
798
+ publishAt?: number | undefined;
799
+ coverUrl?: string | undefined;
800
+ location?: string | undefined;
801
+ enableMerchandise?: boolean | undefined;
802
+ backendAccountId?: number | undefined;
803
+ }>, "many">;
804
+ }, "strip", z.ZodTypeAny, {
805
+ batchId: string;
806
+ mode: "pairs";
807
+ pairs: {
808
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
809
+ platformUid: string;
810
+ title: string;
811
+ description: string;
812
+ tags: string[];
813
+ taskId: number;
814
+ videoId: number | null;
815
+ videoUrl: string;
816
+ coverUrl: string;
817
+ publishAt?: number | undefined;
818
+ location?: string | undefined;
819
+ enableMerchandise?: boolean | undefined;
820
+ backendAccountId?: number | undefined;
821
+ }[];
822
+ backendBatchId?: number | undefined;
823
+ }, {
824
+ batchId: string;
825
+ mode: "pairs";
826
+ pairs: {
827
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
828
+ platformUid: string;
829
+ title: string;
830
+ taskId: number;
831
+ videoId: number | null;
832
+ videoUrl: string;
833
+ description?: string | undefined;
834
+ tags?: string[] | undefined;
835
+ publishAt?: number | undefined;
836
+ coverUrl?: string | undefined;
837
+ location?: string | undefined;
838
+ enableMerchandise?: boolean | undefined;
839
+ backendAccountId?: number | undefined;
840
+ }[];
841
+ backendBatchId?: number | undefined;
842
+ }>]>;
843
+ export declare const TaskBatchSubmitResultDataSchema: z.ZodObject<{
844
+ batchId: z.ZodString;
845
+ tasks: z.ZodArray<z.ZodObject<{
846
+ taskId: z.ZodOptional<z.ZodString>;
847
+ backendTaskId: z.ZodOptional<z.ZodNumber>;
848
+ videoId: z.ZodNullable<z.ZodNumber>;
849
+ /** Plan A(v3.3):账号身份回显。 */
850
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
851
+ platformUid: z.ZodString;
852
+ /** Desktop 本地不透明 id,供 Web 关联 UI。 */
853
+ accountId: z.ZodOptional<z.ZodString>;
854
+ backendAccountId: z.ZodOptional<z.ZodNumber>;
855
+ status: z.ZodEnum<["queued", "rejected"]>;
856
+ reason: z.ZodOptional<z.ZodString>;
857
+ }, "strip", z.ZodTypeAny, {
858
+ status: "queued" | "rejected";
859
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
860
+ platformUid: string;
861
+ videoId: number | null;
862
+ reason?: string | undefined;
863
+ accountId?: string | undefined;
864
+ taskId?: string | undefined;
865
+ backendAccountId?: number | undefined;
866
+ backendTaskId?: number | undefined;
867
+ }, {
868
+ status: "queued" | "rejected";
869
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
870
+ platformUid: string;
871
+ videoId: number | null;
872
+ reason?: string | undefined;
873
+ accountId?: string | undefined;
874
+ taskId?: string | undefined;
875
+ backendAccountId?: number | undefined;
876
+ backendTaskId?: number | undefined;
877
+ }>, "many">;
878
+ }, "strip", z.ZodTypeAny, {
879
+ batchId: string;
880
+ tasks: {
881
+ status: "queued" | "rejected";
882
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
883
+ platformUid: string;
884
+ videoId: number | null;
885
+ reason?: string | undefined;
886
+ accountId?: string | undefined;
887
+ taskId?: string | undefined;
888
+ backendAccountId?: number | undefined;
889
+ backendTaskId?: number | undefined;
890
+ }[];
891
+ }, {
892
+ batchId: string;
893
+ tasks: {
894
+ status: "queued" | "rejected";
895
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
896
+ platformUid: string;
897
+ videoId: number | null;
898
+ reason?: string | undefined;
899
+ accountId?: string | undefined;
900
+ taskId?: string | undefined;
901
+ backendAccountId?: number | undefined;
902
+ backendTaskId?: number | undefined;
903
+ }[];
904
+ }>;
905
+ export declare const TaskPhaseSchema: z.ZodEnum<["init", "login", "navigating", "filling", "uploading", "verifying", "publishing", "confirming", "done", "failed"]>;
906
+ export declare const TaskProgressDataSchema: z.ZodObject<{
907
+ taskId: z.ZodString;
908
+ accountId: z.ZodString;
909
+ phase: z.ZodEnum<["init", "login", "navigating", "filling", "uploading", "verifying", "publishing", "confirming", "done", "failed"]>;
910
+ percent: z.ZodNumber;
911
+ message: z.ZodDefault<z.ZodString>;
912
+ /** 消息序号,单调递增,Client 用于排序防乱序 */
913
+ seq: z.ZodNumber;
914
+ }, "strip", z.ZodTypeAny, {
915
+ message: string;
916
+ accountId: string;
917
+ phase: "failed" | "init" | "confirming" | "done" | "login" | "navigating" | "filling" | "uploading" | "verifying" | "publishing";
918
+ taskId: string;
919
+ percent: number;
920
+ seq: number;
921
+ }, {
922
+ accountId: string;
923
+ phase: "failed" | "init" | "confirming" | "done" | "login" | "navigating" | "filling" | "uploading" | "verifying" | "publishing";
924
+ taskId: string;
925
+ percent: number;
926
+ seq: number;
927
+ message?: string | undefined;
928
+ }>;
929
+ export declare const TaskDoneDataSchema: z.ZodObject<{
930
+ taskId: z.ZodString;
931
+ status: z.ZodEnum<["completed", "failed", "cancelled"]>;
932
+ result: z.ZodObject<{
933
+ success: z.ZodBoolean;
934
+ contentId: z.ZodOptional<z.ZodString>;
935
+ contentUrl: z.ZodOptional<z.ZodString>;
936
+ message: z.ZodString;
937
+ errorCode: z.ZodOptional<z.ZodString>;
938
+ durationMs: z.ZodOptional<z.ZodNumber>;
939
+ }, "strip", z.ZodTypeAny, {
940
+ message: string;
941
+ success: boolean;
942
+ contentId?: string | undefined;
943
+ contentUrl?: string | undefined;
944
+ errorCode?: string | undefined;
945
+ durationMs?: number | undefined;
946
+ }, {
947
+ message: string;
948
+ success: boolean;
949
+ contentId?: string | undefined;
950
+ contentUrl?: string | undefined;
951
+ errorCode?: string | undefined;
952
+ durationMs?: number | undefined;
953
+ }>;
954
+ }, "strip", z.ZodTypeAny, {
955
+ status: "completed" | "failed" | "cancelled";
956
+ taskId: string;
957
+ result: {
958
+ message: string;
959
+ success: boolean;
960
+ contentId?: string | undefined;
961
+ contentUrl?: string | undefined;
962
+ errorCode?: string | undefined;
963
+ durationMs?: number | undefined;
964
+ };
965
+ }, {
966
+ status: "completed" | "failed" | "cancelled";
967
+ taskId: string;
968
+ result: {
969
+ message: string;
970
+ success: boolean;
971
+ contentId?: string | undefined;
972
+ contentUrl?: string | undefined;
973
+ errorCode?: string | undefined;
974
+ durationMs?: number | undefined;
975
+ };
976
+ }>;
977
+ export declare const TaskCancelDataSchema: z.ZodObject<{
978
+ taskId: z.ZodString;
979
+ }, "strip", z.ZodTypeAny, {
980
+ taskId: string;
981
+ }, {
982
+ taskId: string;
983
+ }>;
984
+ export declare const TaskCancelResultDataSchema: z.ZodObject<{
985
+ taskId: z.ZodString;
986
+ cancelled: z.ZodBoolean;
987
+ }, "strip", z.ZodTypeAny, {
988
+ cancelled: boolean;
989
+ taskId: string;
990
+ }, {
991
+ cancelled: boolean;
992
+ taskId: string;
993
+ }>;
994
+ export declare const TaskListDataSchema: z.ZodObject<{
995
+ status: z.ZodOptional<z.ZodEnum<["pending", "running", "completed", "failed", "cancelled"]>>;
996
+ limit: z.ZodDefault<z.ZodNumber>;
997
+ offset: z.ZodDefault<z.ZodNumber>;
998
+ }, "strip", z.ZodTypeAny, {
999
+ limit: number;
1000
+ offset: number;
1001
+ status?: "completed" | "failed" | "cancelled" | "pending" | "running" | undefined;
1002
+ }, {
1003
+ status?: "completed" | "failed" | "cancelled" | "pending" | "running" | undefined;
1004
+ limit?: number | undefined;
1005
+ offset?: number | undefined;
1006
+ }>;
1007
+ export declare const TaskListResultDataSchema: z.ZodObject<{
1008
+ tasks: z.ZodArray<z.ZodObject<{
1009
+ taskId: z.ZodString;
1010
+ kind: z.ZodEnum<["check", "upload", "login"]>;
1011
+ platform: z.ZodEnum<["weixin", "douyin", "xhs", "kuaishou"]>;
1012
+ accountId: z.ZodString;
1013
+ status: z.ZodEnum<["pending", "running", "completed", "failed", "cancelled"]>;
1014
+ phase: z.ZodOptional<z.ZodString>;
1015
+ percent: z.ZodOptional<z.ZodNumber>;
1016
+ createdAt: z.ZodString;
1017
+ updatedAt: z.ZodString;
1018
+ }, "strip", z.ZodTypeAny, {
1019
+ status: "completed" | "failed" | "cancelled" | "pending" | "running";
1020
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
1021
+ accountId: string;
1022
+ updatedAt: string;
1023
+ kind: "check" | "upload" | "login";
1024
+ taskId: string;
1025
+ createdAt: string;
1026
+ phase?: string | undefined;
1027
+ percent?: number | undefined;
1028
+ }, {
1029
+ status: "completed" | "failed" | "cancelled" | "pending" | "running";
1030
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
1031
+ accountId: string;
1032
+ updatedAt: string;
1033
+ kind: "check" | "upload" | "login";
1034
+ taskId: string;
1035
+ createdAt: string;
1036
+ phase?: string | undefined;
1037
+ percent?: number | undefined;
1038
+ }>, "many">;
1039
+ total: z.ZodNumber;
1040
+ }, "strip", z.ZodTypeAny, {
1041
+ tasks: {
1042
+ status: "completed" | "failed" | "cancelled" | "pending" | "running";
1043
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
1044
+ accountId: string;
1045
+ updatedAt: string;
1046
+ kind: "check" | "upload" | "login";
1047
+ taskId: string;
1048
+ createdAt: string;
1049
+ phase?: string | undefined;
1050
+ percent?: number | undefined;
1051
+ }[];
1052
+ total: number;
1053
+ }, {
1054
+ tasks: {
1055
+ status: "completed" | "failed" | "cancelled" | "pending" | "running";
1056
+ platform: "weixin" | "douyin" | "xhs" | "kuaishou";
1057
+ accountId: string;
1058
+ updatedAt: string;
1059
+ kind: "check" | "upload" | "login";
1060
+ taskId: string;
1061
+ createdAt: string;
1062
+ phase?: string | undefined;
1063
+ percent?: number | undefined;
1064
+ }[];
1065
+ total: number;
1066
+ }>;
1067
+ export declare const SystemStatusDataSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1068
+ export declare const SystemStatusResultDataSchema: z.ZodObject<{
1069
+ uptime: z.ZodNumber;
1070
+ activeTaskCount: z.ZodNumber;
1071
+ connectedClients: z.ZodNumber;
1072
+ accounts: z.ZodNumber;
1073
+ browserReady: z.ZodBoolean;
1074
+ appVersion: z.ZodString;
1075
+ }, "strip", z.ZodTypeAny, {
1076
+ appVersion: string;
1077
+ accounts: number;
1078
+ uptime: number;
1079
+ activeTaskCount: number;
1080
+ connectedClients: number;
1081
+ browserReady: boolean;
1082
+ }, {
1083
+ appVersion: string;
1084
+ accounts: number;
1085
+ uptime: number;
1086
+ activeTaskCount: number;
1087
+ connectedClients: number;
1088
+ browserReady: boolean;
1089
+ }>;
1090
+ export declare const SystemErrorDataSchema: z.ZodObject<{
1091
+ code: z.ZodString;
1092
+ message: z.ZodString;
1093
+ fatal: z.ZodDefault<z.ZodBoolean>;
1094
+ }, "strip", z.ZodTypeAny, {
1095
+ code: string;
1096
+ message: string;
1097
+ fatal: boolean;
1098
+ }, {
1099
+ code: string;
1100
+ message: string;
1101
+ fatal?: boolean | undefined;
1102
+ }>;
1103
+ /** file:prepare — URL 白名单由 Server 端校验 */
1104
+ export declare const FilePrepareDataSchema: z.ZodObject<{
1105
+ url: z.ZodString;
1106
+ filename: z.ZodString;
1107
+ }, "strip", z.ZodTypeAny, {
1108
+ url: string;
1109
+ filename: string;
1110
+ }, {
1111
+ url: string;
1112
+ filename: string;
1113
+ }>;
1114
+ export declare const FilePrepareResultDataSchema: z.ZodObject<{
1115
+ localPath: z.ZodString;
1116
+ size: z.ZodNumber;
1117
+ }, "strip", z.ZodTypeAny, {
1118
+ localPath: string;
1119
+ size: number;
1120
+ }, {
1121
+ localPath: string;
1122
+ size: number;
1123
+ }>;
1124
+ /** file:progress — 下载进度推送 */
1125
+ export declare const FileProgressDataSchema: z.ZodObject<{
1126
+ filename: z.ZodString;
1127
+ percent: z.ZodNumber;
1128
+ downloadedBytes: z.ZodNumber;
1129
+ totalBytes: z.ZodNumber;
1130
+ }, "strip", z.ZodTypeAny, {
1131
+ percent: number;
1132
+ filename: string;
1133
+ downloadedBytes: number;
1134
+ totalBytes: number;
1135
+ }, {
1136
+ percent: number;
1137
+ filename: string;
1138
+ downloadedBytes: number;
1139
+ totalBytes: number;
1140
+ }>;
1141
+ export declare const ScheduleSetDataSchema: z.ZodObject<{
1142
+ type: z.ZodEnum<["data_pull", "account_check"]>;
1143
+ interval: z.ZodNumber;
1144
+ accounts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1145
+ }, "strip", z.ZodTypeAny, {
1146
+ type: "data_pull" | "account_check";
1147
+ interval: number;
1148
+ accounts?: string[] | undefined;
1149
+ }, {
1150
+ type: "data_pull" | "account_check";
1151
+ interval: number;
1152
+ accounts?: string[] | undefined;
1153
+ }>;
1154
+ export declare const ScheduleSetResultDataSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
1155
+ export type AuthRequestData = z.infer<typeof AuthRequestDataSchema>;
1156
+ export type AuthAcceptedData = z.infer<typeof AuthAcceptedDataSchema>;
1157
+ export type AuthRejectedData = z.infer<typeof AuthRejectedDataSchema>;
1158
+ export type AccountListRequest = z.infer<typeof AccountListDataSchema>;
1159
+ export type AccountListResult = z.infer<typeof AccountListResultDataSchema>;
1160
+ export type AccountSyncData = z.infer<typeof AccountSyncDataSchema>;
1161
+ export type AccountLoginRequest = z.infer<typeof AccountLoginDataSchema>;
1162
+ export type AccountLoginResult = z.infer<typeof AccountLoginResultDataSchema>;
1163
+ export type AccountLoginProgress = z.infer<typeof AccountLoginProgressDataSchema>;
1164
+ export type AccountCheckRequest = z.infer<typeof AccountCheckDataSchema>;
1165
+ export type AccountCheckResult = z.infer<typeof AccountCheckResultDataSchema>;
1166
+ export type AccountRemoveRequest = z.infer<typeof AccountRemoveDataSchema>;
1167
+ export type AccountRemoveResult = z.infer<typeof AccountRemoveResultDataSchema>;
1168
+ export type DataPullModule = z.infer<typeof DataPullModuleSchema>;
1169
+ export type DataPullRequest = z.infer<typeof DataPullDataSchema>;
1170
+ export type DataPullResult = z.infer<typeof DataPullResultDataSchema>;
1171
+ export type TaskKind = z.infer<typeof TaskKindSchema>;
1172
+ export type TaskPhase = z.infer<typeof TaskPhaseSchema>;
1173
+ export type TaskSubmitRequest = z.infer<typeof TaskSubmitDataSchema>;
1174
+ export type TaskSubmitResult = z.infer<typeof TaskSubmitResultDataSchema>;
1175
+ export type TaskBatchSubmitRequest = z.infer<typeof TaskBatchSubmitDataSchema>;
1176
+ export type TaskBatchSubmitResult = z.infer<typeof TaskBatchSubmitResultDataSchema>;
1177
+ export type TaskProgressData = z.infer<typeof TaskProgressDataSchema>;
1178
+ export type TaskDoneData = z.infer<typeof TaskDoneDataSchema>;
1179
+ export type TaskCancelRequest = z.infer<typeof TaskCancelDataSchema>;
1180
+ export type TaskCancelResult = z.infer<typeof TaskCancelResultDataSchema>;
1181
+ export type TaskListRequest = z.infer<typeof TaskListDataSchema>;
1182
+ export type TaskListResult = z.infer<typeof TaskListResultDataSchema>;
1183
+ export type SystemStatusRequest = z.infer<typeof SystemStatusDataSchema>;
1184
+ export type SystemStatusResult = z.infer<typeof SystemStatusResultDataSchema>;
1185
+ export type SystemErrorData = z.infer<typeof SystemErrorDataSchema>;
1186
+ export type FilePrepareRequest = z.infer<typeof FilePrepareDataSchema>;
1187
+ export type FilePrepareResult = z.infer<typeof FilePrepareResultDataSchema>;
1188
+ export type FileProgressData = z.infer<typeof FileProgressDataSchema>;
1189
+ export type ScheduleSetRequest = z.infer<typeof ScheduleSetDataSchema>;
1190
+ export type ScheduleSetResult = z.infer<typeof ScheduleSetResultDataSchema>;
1191
+ /**
1192
+ * 只映射「入站消息」(Client → Server)的 data schema。
1193
+ * 出站消息由代码构造,类型安全由 TypeScript 保证。
1194
+ */
1195
+ export declare const InboundDataSchemas: Partial<Record<string, z.ZodTypeAny>>;
1196
+ export declare class WsCodec {
1197
+ /**
1198
+ * 解码:raw string → 校验后的 WsEnvelope
1199
+ * 失败抛 Error,调用方 catch 后返回错误响应
1200
+ */
1201
+ static decode(raw: string): WsEnvelope;
1202
+ /** 编码请求消息 */
1203
+ static encodeMessage<T>(type: WsMessageType, data: T, id?: string): string;
1204
+ /** 编码成功响应 */
1205
+ static encodeOk<T>(replyTo: string, type: WsMessageType, data: T): string;
1206
+ /** 编码失败响应 */
1207
+ static encodeError(replyTo: string, type: WsMessageType, error: string): string;
1208
+ /** 编码推送消息(无 replyTo) */
1209
+ static encodePush<T>(type: WsMessageType, data: T): string;
1210
+ }
1211
+ //# sourceMappingURL=index.d.ts.map