@yanhaidao/wecom 2.3.13 → 2.3.141

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,1500 @@
1
+ const accountIdProperty = {
2
+ type: "string",
3
+ minLength: 1,
4
+ description: "可选:指定企业微信账号 ID;不填时按 agent 账号/默认账号自动选择",
5
+ };
6
+
7
+ const docTypeProperty = {
8
+ oneOf: [
9
+ {
10
+ type: "string",
11
+ enum: ["doc", "spreadsheet", "smart_table"],
12
+ },
13
+ {
14
+ type: "integer",
15
+ enum: [3, 4, 10],
16
+ },
17
+ ],
18
+ default: "doc",
19
+ description: "文档类型:doc=文档,spreadsheet=表格,smart_table=智能表格",
20
+ };
21
+
22
+ const sheetIdProperty = {
23
+ type: "string",
24
+ minLength: 1,
25
+ description: "子表 ID (sheet_id)",
26
+ };
27
+
28
+ const docIdProperty = {
29
+ type: "string",
30
+ minLength: 1,
31
+ description: "文档 docid",
32
+ };
33
+
34
+ const formIdProperty = {
35
+ type: "string",
36
+ minLength: 1,
37
+ description: "收集表 formid",
38
+ };
39
+
40
+ const shareUrlProperty = {
41
+ type: "string",
42
+ minLength: 1,
43
+ description: "企业微信文档分享链接",
44
+ };
45
+
46
+ const genericObjectProperty = {
47
+ type: "object",
48
+ additionalProperties: true,
49
+ };
50
+
51
+ const nonEmptyObjectProperty = {
52
+ ...genericObjectProperty,
53
+ minProperties: 1,
54
+ };
55
+
56
+ // --- Doc Permission Schemas ---
57
+
58
+ const coAuthListProperty = {
59
+ type: "array",
60
+ items: {
61
+ type: "object",
62
+ required: ["departmentid", "auth", "type"],
63
+ properties: {
64
+ departmentid: { type: "integer", description: "特定部门id" },
65
+ auth: { type: "integer", enum: [1, 2], description: "1:只读, 2:读写" },
66
+ type: { type: "integer", const: 2, description: "2:部门" }
67
+ }
68
+ }
69
+ };
70
+
71
+ const docMemberListProperty = {
72
+ type: "array",
73
+ items: {
74
+ type: "object",
75
+ required: ["type", "auth"],
76
+ properties: {
77
+ type: { type: "integer", const: 1, description: "1:用户" },
78
+ userid: { type: "string", description: "企业成员userid" },
79
+ tmp_external_userid: { type: "string", description: "外部用户临时id" },
80
+ auth: { type: "integer", enum: [1, 2, 7], description: "1:只读 2:读写 7:管理员" }
81
+ }
82
+ }
83
+ };
84
+
85
+ const delDocMemberListProperty = {
86
+ type: "array",
87
+ items: {
88
+ type: "object",
89
+ required: ["type"],
90
+ properties: {
91
+ type: { type: "integer", const: 1 },
92
+ userid: { type: "string" },
93
+ tmp_external_userid: { type: "string" }
94
+ }
95
+ }
96
+ };
97
+
98
+ const watermarkProperty = {
99
+ type: "object",
100
+ properties: {
101
+ margin_type: { type: "integer", enum: [1, 2], description: "1:稀疏, 2:紧密" },
102
+ show_visitor_name: { type: "boolean" },
103
+ show_text: { type: "boolean" },
104
+ text: { type: "string" }
105
+ }
106
+ };
107
+
108
+ // --- Smartsheet Permission Schemas ---
109
+
110
+ const fieldRuleListSchema = {
111
+ type: "array",
112
+ items: {
113
+ type: "object",
114
+ required: ["field_id", "can_edit", "can_insert", "can_view"],
115
+ properties: {
116
+ field_id: { type: "string" },
117
+ field_type: { type: "string" },
118
+ can_edit: { type: "boolean" },
119
+ can_insert: { type: "boolean" },
120
+ can_view: { type: "boolean" }
121
+ }
122
+ }
123
+ };
124
+
125
+ const fieldPrivSchema = {
126
+ type: "object",
127
+ required: ["field_range_type", "field_rule_list"],
128
+ properties: {
129
+ field_range_type: { type: "integer", enum: [1, 2], description: "1-所有字段;2-部分字段" },
130
+ field_rule_list: fieldRuleListSchema,
131
+ field_default_rule: {
132
+ type: "object",
133
+ properties: {
134
+ can_edit: { type: "boolean" },
135
+ can_insert: { type: "boolean" },
136
+ can_view: { type: "boolean" }
137
+ }
138
+ }
139
+ }
140
+ };
141
+
142
+ const recordRuleListSchema = {
143
+ type: "array",
144
+ items: {
145
+ type: "object",
146
+ required: ["field_id", "oper_type"],
147
+ properties: {
148
+ field_id: { type: "string" },
149
+ field_type: { type: "string" },
150
+ oper_type: { type: "integer", description: "1-包含自己; 2-包含value; 3-不包含; 4-等于; 5-不等于; 6-为空; 7-非空" },
151
+ value: { type: "array", items: { type: "string" } }
152
+ }
153
+ }
154
+ };
155
+
156
+ const recordPrivSchema = {
157
+ type: "object",
158
+ required: ["record_range_type"],
159
+ properties: {
160
+ record_range_type: { type: "integer", enum: [1, 2, 3], description: "1-全部; 2-任意条件; 3-全部条件" },
161
+ record_rule_list: recordRuleListSchema,
162
+ other_priv: { type: "integer", enum: [1, 2], description: "1-不可编辑; 2-不可查看" }
163
+ }
164
+ };
165
+
166
+ const privListSchema = {
167
+ type: "array",
168
+ items: {
169
+ type: "object",
170
+ required: ["sheet_id", "priv"],
171
+ properties: {
172
+ sheet_id: { type: "string" },
173
+ priv: {
174
+ oneOf: [{ type: "string" }, { type: "integer" }],
175
+ description: "1-全部权限;2-可编辑;3-仅浏览;4-无权限"
176
+ },
177
+ can_insert_record: { type: "boolean" },
178
+ can_delete_record: { type: "boolean" },
179
+ can_create_modify_delete_view: { type: "boolean" },
180
+ field_priv: fieldPrivSchema,
181
+ record_priv: recordPrivSchema,
182
+ clear: { type: "boolean" }
183
+ }
184
+ }
185
+ };
186
+
187
+ const memberRangeSchema = {
188
+ type: "object",
189
+ properties: {
190
+ userid_list: { type: "array", items: { type: "string" } }
191
+ }
192
+ };
193
+
194
+ // --- Doc Content Update Schemas ---
195
+
196
+ const locationProperty = {
197
+ type: "object",
198
+ required: ["index"],
199
+ properties: {
200
+ index: { type: "integer", minimum: 0, description: "位置索引" }
201
+ }
202
+ };
203
+
204
+ const rangeProperty = {
205
+ type: "object",
206
+ required: ["start_index", "length"],
207
+ properties: {
208
+ start_index: { type: "integer", minimum: 0, description: "起始位置" },
209
+ length: { type: "integer", minimum: 1, description: "长度" }
210
+ }
211
+ };
212
+
213
+ const textPropertySchema = {
214
+ type: "object",
215
+ description: "文本属性",
216
+ properties: {
217
+ bold: { type: "boolean" },
218
+ italics: { type: "boolean" },
219
+ underline: { type: "boolean" },
220
+ strike: { type: "boolean" },
221
+ color: { type: "string", pattern: "^[0-9A-Fa-f]{6}$", description: "RRGGBB 格式颜色" },
222
+ background_color: { type: "string", pattern: "^[0-9A-Fa-f]{6}$", description: "RRGGBB 格式背景色" },
223
+ size: { type: "integer", description: "字体大小(half-points)" }
224
+ }
225
+ };
226
+
227
+ const insertTextRequest = {
228
+ type: "object",
229
+ required: ["text", "location"],
230
+ properties: {
231
+ text: { type: "string", minLength: 1 },
232
+ location: locationProperty
233
+ }
234
+ };
235
+
236
+ const replaceTextRequest = {
237
+ type: "object",
238
+ required: ["text", "ranges"],
239
+ properties: {
240
+ text: { type: "string" },
241
+ ranges: { type: "array", items: rangeProperty, minItems: 1 }
242
+ }
243
+ };
244
+
245
+ const deleteContentRequest = {
246
+ type: "object",
247
+ required: ["range"],
248
+ properties: {
249
+ range: rangeProperty
250
+ }
251
+ };
252
+
253
+ const updateTextPropertyRequest = {
254
+ type: "object",
255
+ required: ["text_property", "ranges"],
256
+ properties: {
257
+ text_property: textPropertySchema,
258
+ ranges: { type: "array", items: rangeProperty, minItems: 1 }
259
+ }
260
+ };
261
+
262
+ const insertImageRequest = {
263
+ type: "object",
264
+ required: ["image_id", "location"],
265
+ properties: {
266
+ image_id: { type: "string", description: "上传图片获得的 image_id/url" },
267
+ location: locationProperty,
268
+ width: { type: "integer", description: "宽(px)" },
269
+ height: { type: "integer", description: "高(px)" }
270
+ }
271
+ };
272
+
273
+ const insertPageBreakRequest = {
274
+ type: "object",
275
+ required: ["location"],
276
+ properties: {
277
+ location: locationProperty
278
+ }
279
+ };
280
+
281
+ const insertTableRequest = {
282
+ type: "object",
283
+ required: ["rows", "cols", "location"],
284
+ properties: {
285
+ rows: { type: "integer", minimum: 1, maximum: 100 },
286
+ cols: { type: "integer", minimum: 1, maximum: 60 },
287
+ location: locationProperty
288
+ }
289
+ };
290
+
291
+ const insertParagraphRequest = {
292
+ type: "object",
293
+ description: "在指定位置插入段落。注意:请使用此操作来分段,而不是在 insert_text 中使用换行符。",
294
+ required: ["location"],
295
+ properties: {
296
+ location: locationProperty
297
+ }
298
+ };
299
+
300
+ // --- Spreadsheet Update Schemas ---
301
+
302
+ const addSheetRequest = {
303
+ type: "object",
304
+ required: ["title"],
305
+ properties: {
306
+ title: { type: "string", minLength: 1 },
307
+ row_count: { type: "integer", minimum: 1 },
308
+ column_count: { type: "integer", minimum: 1 }
309
+ }
310
+ };
311
+
312
+ const deleteSheetRequest = {
313
+ type: "object",
314
+ required: ["sheet_id"],
315
+ properties: {
316
+ sheet_id: { type: "string", minLength: 1 }
317
+ }
318
+ };
319
+
320
+ const deleteDimensionRequest = {
321
+ type: "object",
322
+ required: ["sheet_id", "dimension", "start_index", "end_index"],
323
+ properties: {
324
+ sheet_id: { type: "string" },
325
+ dimension: { type: "string", enum: ["ROW", "COLUMN"] },
326
+ start_index: { type: "integer", minimum: 1 },
327
+ end_index: { type: "integer", minimum: 2 }
328
+ }
329
+ };
330
+
331
+ const cellValueSchema = {
332
+ type: "object",
333
+ properties: {
334
+ text: { type: "string" },
335
+ link: {
336
+ type: "object",
337
+ required: ["text", "url"],
338
+ properties: {
339
+ text: { type: "string" },
340
+ url: { type: "string" }
341
+ }
342
+ }
343
+ }
344
+ };
345
+
346
+ const cellFormatSchema = {
347
+ type: "object",
348
+ properties: {
349
+ text_format: {
350
+ type: "object",
351
+ properties: {
352
+ bold: { type: "boolean" },
353
+ italic: { type: "boolean" },
354
+ strikethrough: { type: "boolean" },
355
+ underline: { type: "boolean" },
356
+ color: {
357
+ type: "object",
358
+ required: ["red", "green", "blue"],
359
+ properties: {
360
+ red: { type: "integer", minimum: 0, maximum: 255 },
361
+ green: { type: "integer", minimum: 0, maximum: 255 },
362
+ blue: { type: "integer", minimum: 0, maximum: 255 },
363
+ alpha: { type: "integer", minimum: 0, maximum: 255 }
364
+ }
365
+ },
366
+ font_size: { type: "integer" }
367
+ }
368
+ }
369
+ }
370
+ };
371
+
372
+ const cellDataSchema = {
373
+ type: "object",
374
+ properties: {
375
+ cell_value: cellValueSchema,
376
+ cell_format: cellFormatSchema
377
+ }
378
+ };
379
+
380
+ const rowDataSchema = {
381
+ type: "object",
382
+ required: ["values"],
383
+ properties: {
384
+ values: {
385
+ type: "array",
386
+ items: cellDataSchema
387
+ }
388
+ }
389
+ };
390
+
391
+ const gridDataSchema = {
392
+ type: "object",
393
+ required: ["rows"],
394
+ properties: {
395
+ start_row: { type: "integer", default: 0 },
396
+ start_column: { type: "integer", default: 0 },
397
+ rows: {
398
+ type: "array",
399
+ items: rowDataSchema
400
+ }
401
+ }
402
+ };
403
+
404
+ const updateRangeRequest = {
405
+ type: "object",
406
+ required: ["sheet_id", "grid_data"],
407
+ properties: {
408
+ sheet_id: { type: "string" },
409
+ grid_data: gridDataSchema
410
+ }
411
+ };
412
+
413
+
414
+ const docMemberEntryProperty = {
415
+ oneOf: [
416
+ { type: "string", minLength: 1 },
417
+ { type: "object", additionalProperties: true, minProperties: 1 },
418
+ ],
419
+ };
420
+
421
+ const docMemberEntryArrayProperty = {
422
+ type: "array",
423
+ minItems: 1,
424
+ items: docMemberEntryProperty,
425
+ };
426
+
427
+ export const wecomDocToolSchema = {
428
+ oneOf: [
429
+ {
430
+ type: "object",
431
+ additionalProperties: false,
432
+ required: ["action", "docId"],
433
+ properties: {
434
+ action: { const: "get_doc_security_setting" },
435
+ accountId: accountIdProperty,
436
+ docId: docIdProperty,
437
+ },
438
+ },
439
+ {
440
+ type: "object",
441
+ additionalProperties: false,
442
+ required: ["action", "docId", "setting"],
443
+ properties: {
444
+ action: { const: "mod_doc_security_setting" },
445
+ accountId: accountIdProperty,
446
+ docId: docIdProperty,
447
+ setting: nonEmptyObjectProperty,
448
+ },
449
+ },
450
+ {
451
+ type: "object",
452
+ additionalProperties: false,
453
+ required: ["action", "docName"],
454
+ properties: {
455
+ action: { const: "create" },
456
+ accountId: accountIdProperty,
457
+ docName: {
458
+ type: "string",
459
+ minLength: 1,
460
+ description: "文档名称",
461
+ },
462
+ docType: docTypeProperty,
463
+ spaceId: {
464
+ type: "string",
465
+ minLength: 1,
466
+ description: "可选:文档空间 ID",
467
+ },
468
+ fatherId: {
469
+ type: "string",
470
+ minLength: 1,
471
+ description: "可选:父目录 fileid;传 spaceId 时通常也应传 fatherId",
472
+ },
473
+ adminUsers: {
474
+ type: "array",
475
+ description: "可选:文档管理员 userid 列表",
476
+ items: {
477
+ type: "string",
478
+ minLength: 1,
479
+ },
480
+ },
481
+ viewers: {
482
+ ...docMemberEntryArrayProperty,
483
+ description: "可选:创建后立即授予查看权限的成员列表",
484
+ },
485
+ collaborators: {
486
+ ...docMemberEntryArrayProperty,
487
+ description: "可选:创建后立即授予协作者权限的成员列表",
488
+ },
489
+ init_content: {
490
+ type: "array",
491
+ description: "可选:初始文档内容(段落列表)。插件会自动处理段落分隔,确保标题和正文分离。",
492
+ items: {
493
+ type: "string",
494
+ description: "段落内容",
495
+ },
496
+ },
497
+ },
498
+ },
499
+ {
500
+ type: "object",
501
+ additionalProperties: false,
502
+ required: ["action", "docId", "newName"],
503
+ properties: {
504
+ action: { const: "rename" },
505
+ accountId: accountIdProperty,
506
+ docId: docIdProperty,
507
+ newName: {
508
+ type: "string",
509
+ minLength: 1,
510
+ description: "新文档名",
511
+ },
512
+ },
513
+ },
514
+ {
515
+ type: "object",
516
+ additionalProperties: false,
517
+ required: ["action", "docId"],
518
+ properties: {
519
+ action: { const: "copy" },
520
+ accountId: accountIdProperty,
521
+ docId: docIdProperty,
522
+ newName: {
523
+ type: "string",
524
+ minLength: 1,
525
+ description: "可选:复制后的新文档名",
526
+ },
527
+ spaceId: {
528
+ type: "string",
529
+ minLength: 1,
530
+ description: "可选:目标空间 ID",
531
+ },
532
+ fatherId: {
533
+ type: "string",
534
+ minLength: 1,
535
+ description: "可选:目标父目录 fileid",
536
+ },
537
+ },
538
+ },
539
+ {
540
+ type: "object",
541
+ additionalProperties: false,
542
+ required: ["action", "docId"],
543
+ properties: {
544
+ action: { const: "get_info" },
545
+ accountId: accountIdProperty,
546
+ docId: docIdProperty,
547
+ },
548
+ },
549
+ {
550
+ type: "object",
551
+ additionalProperties: false,
552
+ required: ["action", "docId"],
553
+ properties: {
554
+ action: { const: "share" },
555
+ accountId: accountIdProperty,
556
+ docId: docIdProperty,
557
+ },
558
+ },
559
+ {
560
+ type: "object",
561
+ additionalProperties: false,
562
+ required: ["action", "docId"],
563
+ properties: {
564
+ action: { const: "get_auth" },
565
+ accountId: accountIdProperty,
566
+ docId: docIdProperty,
567
+ },
568
+ },
569
+ {
570
+ type: "object",
571
+ additionalProperties: false,
572
+ required: ["action", "docId", "notified_scope_type"],
573
+ properties: {
574
+ action: { const: "mod_doc_member_notified_scope" },
575
+ accountId: accountIdProperty,
576
+ docId: docIdProperty,
577
+ notified_scope_type: { type: "integer", description: "通知范围类型:0-不通知,1-仅协作者,2-所有人" },
578
+ notified_member_list: { type: "array", items: nonEmptyObjectProperty, description: "指定成员列表" },
579
+ },
580
+ },
581
+ {
582
+ type: "object",
583
+ additionalProperties: false,
584
+ required: ["action", "docId"],
585
+ properties: {
586
+ action: { const: "diagnose_auth" },
587
+ accountId: accountIdProperty,
588
+ docId: docIdProperty,
589
+ },
590
+ },
591
+ {
592
+ type: "object",
593
+ additionalProperties: false,
594
+ required: ["action", "shareUrl"],
595
+ properties: {
596
+ action: { const: "validate_share_link" },
597
+ accountId: accountIdProperty,
598
+ shareUrl: shareUrlProperty,
599
+ },
600
+ },
601
+ {
602
+ type: "object",
603
+ additionalProperties: false,
604
+ required: ["action"],
605
+ anyOf: [{ required: ["docId"] }, { required: ["formId"] }],
606
+ properties: {
607
+ action: { const: "delete" },
608
+ accountId: accountIdProperty,
609
+ docId: docIdProperty,
610
+ formId: formIdProperty,
611
+ },
612
+ },
613
+ {
614
+ type: "object",
615
+ additionalProperties: false,
616
+ required: ["action", "docId", "request"],
617
+ properties: {
618
+ action: { const: "set_join_rule" },
619
+ accountId: accountIdProperty,
620
+ docId: docIdProperty,
621
+ request: {
622
+ type: "object",
623
+ description: "mod_doc_join_rule 请求体。插件会自动补 docid。",
624
+ additionalProperties: false,
625
+ properties: {
626
+ enable_corp_internal: { type: "boolean" },
627
+ corp_internal_auth: { type: "integer", description: "1:只读 2:读写" },
628
+ enable_corp_external: { type: "boolean" },
629
+ corp_external_auth: { type: "integer", description: "1:只读 2:读写" },
630
+ corp_internal_approve_only_by_admin: { type: "boolean" },
631
+ corp_external_approve_only_by_admin: { type: "boolean" },
632
+ ban_share_external: { type: "boolean" },
633
+ update_co_auth_list: { type: "boolean" },
634
+ co_auth_list: coAuthListProperty
635
+ }
636
+ },
637
+ },
638
+ },
639
+ {
640
+ type: "object",
641
+ additionalProperties: false,
642
+ required: ["action", "docId"],
643
+ anyOf: [
644
+ { required: ["viewers"] },
645
+ { required: ["collaborators"] },
646
+ { required: ["removeViewers"] },
647
+ { required: ["removeCollaborators"] },
648
+ ],
649
+ properties: {
650
+ action: { const: "grant_access" },
651
+ accountId: accountIdProperty,
652
+ docId: docIdProperty,
653
+ auth: {
654
+ type: "integer",
655
+ enum: [1, 2, 7],
656
+ description: "权限位:1-查看,2-编辑,7-管理",
657
+ },
658
+ viewers: {
659
+ ...docMemberEntryArrayProperty,
660
+ description: "新增查看成员列表",
661
+ },
662
+ collaborators: {
663
+ ...docMemberEntryArrayProperty,
664
+ description: "新增协作者列表",
665
+ },
666
+ removeViewers: {
667
+ ...docMemberEntryArrayProperty,
668
+ description: "移除查看成员列表",
669
+ },
670
+ removeCollaborators: {
671
+ ...docMemberEntryArrayProperty,
672
+ description: "移除协作者列表",
673
+ },
674
+ },
675
+ },
676
+ {
677
+ type: "object",
678
+ additionalProperties: false,
679
+ required: ["action", "docId", "collaborators"],
680
+ properties: {
681
+ action: { const: "add_collaborators" },
682
+ accountId: accountIdProperty,
683
+ docId: docIdProperty,
684
+ auth: {
685
+ type: "integer",
686
+ enum: [1, 2, 7],
687
+ description: "权限位:1-查看,2-编辑,7-管理;默认为 2 (编辑)",
688
+ },
689
+ collaborators: {
690
+ ...docMemberEntryArrayProperty,
691
+ description: "要添加的协作者列表;字符串会自动按 userid 处理",
692
+ },
693
+ },
694
+ },
695
+ {
696
+ type: "object",
697
+ additionalProperties: false,
698
+ required: ["action", "docId"],
699
+ properties: {
700
+ action: { const: "get_content" },
701
+ accountId: accountIdProperty,
702
+ docId: docIdProperty,
703
+ },
704
+ },
705
+ {
706
+ type: "object",
707
+ additionalProperties: false,
708
+ required: ["action", "docId", "requests"],
709
+ properties: {
710
+ action: { const: "update_content" },
711
+ accountId: accountIdProperty,
712
+ docId: docIdProperty,
713
+ version: {
714
+ type: "integer",
715
+ description: "可选:文档版本号,用于乐观锁",
716
+ },
717
+ requests: {
718
+ type: "array",
719
+ minItems: 1,
720
+ description: "操作列表,必须遵循企业微信 batch_update 格式",
721
+ items: {
722
+ type: "object",
723
+ // additionalProperties: false, // 移除此行,因为 oneOf 验证在空 properties 下会导致验证失败
724
+ oneOf: [
725
+ { required: ["replace_text"], properties: { replace_text: replaceTextRequest } },
726
+ { required: ["insert_text"], properties: { insert_text: insertTextRequest } },
727
+ { required: ["delete_content"], properties: { delete_content: deleteContentRequest } },
728
+ { required: ["update_text_property"], properties: { update_text_property: updateTextPropertyRequest } },
729
+ { required: ["insert_image"], properties: { insert_image: insertImageRequest } },
730
+ { required: ["insert_page_break"], properties: { insert_page_break: insertPageBreakRequest } },
731
+ { required: ["insert_table"], properties: { insert_table: insertTableRequest } },
732
+ { required: ["insert_paragraph"], properties: { insert_paragraph: insertParagraphRequest } }
733
+ ]
734
+ },
735
+ },
736
+ },
737
+ },
738
+ {
739
+ type: "object",
740
+ additionalProperties: false,
741
+ required: ["action", "docId", "request"],
742
+ properties: {
743
+ action: { const: "set_member_auth" },
744
+ accountId: accountIdProperty,
745
+ docId: docIdProperty,
746
+ request: {
747
+ type: "object",
748
+ description: "mod_doc_member 请求体。插件会自动补 docid。",
749
+ additionalProperties: false,
750
+ properties: {
751
+ update_file_member_list: docMemberListProperty,
752
+ del_file_member_list: delDocMemberListProperty
753
+ }
754
+ },
755
+ },
756
+ },
757
+ {
758
+ type: "object",
759
+ additionalProperties: false,
760
+ required: ["action", "docId", "request"],
761
+ properties: {
762
+ action: { const: "set_safety_setting" },
763
+ accountId: accountIdProperty,
764
+ docId: docIdProperty,
765
+ request: {
766
+ type: "object",
767
+ description: "mod_doc_safty_setting 请求体",
768
+ additionalProperties: false,
769
+ properties: {
770
+ enable_readonly_copy: { type: "boolean", description: "是否允许只读成员复制、下载" },
771
+ watermark: watermarkProperty,
772
+ },
773
+ },
774
+ },
775
+ },
776
+ {
777
+ type: "object",
778
+ additionalProperties: false,
779
+ required: ["action", "formInfo"],
780
+ properties: {
781
+ action: { const: "create_collect" },
782
+ accountId: accountIdProperty,
783
+ formInfo: {
784
+ ...nonEmptyObjectProperty,
785
+ description: "收集表 form_info 对象,至少应包含 form_title 等官方字段",
786
+ },
787
+ spaceId: {
788
+ type: "string",
789
+ minLength: 1,
790
+ description: "可选:文档空间 ID",
791
+ },
792
+ fatherId: {
793
+ type: "string",
794
+ minLength: 1,
795
+ description: "可选:父目录 fileid",
796
+ },
797
+ },
798
+ },
799
+ {
800
+ type: "object",
801
+ additionalProperties: false,
802
+ required: ["action", "oper", "formId", "formInfo"],
803
+ properties: {
804
+ action: { const: "modify_collect" },
805
+ accountId: accountIdProperty,
806
+ oper: {
807
+ type: "string",
808
+ minLength: 1,
809
+ description: "修改操作类型,按企业微信官方 modify_collect 定义填写",
810
+ },
811
+ formId: formIdProperty,
812
+ formInfo: {
813
+ ...nonEmptyObjectProperty,
814
+ description: "收集表 form_info 对象",
815
+ },
816
+ },
817
+ },
818
+ {
819
+ type: "object",
820
+ additionalProperties: false,
821
+ required: ["action", "formId"],
822
+ properties: {
823
+ action: { const: "get_form_info" },
824
+ accountId: accountIdProperty,
825
+ formId: formIdProperty,
826
+ },
827
+ },
828
+ {
829
+ type: "object",
830
+ additionalProperties: false,
831
+ required: ["action", "repeatedId"],
832
+ properties: {
833
+ action: { const: "get_form_answer" },
834
+ accountId: accountIdProperty,
835
+ repeatedId: {
836
+ type: "string",
837
+ minLength: 1,
838
+ description: "收集表提交记录 repeated_id",
839
+ },
840
+ answerIds: {
841
+ type: "array",
842
+ description: "可选:答案 ID 列表",
843
+ items: {
844
+ type: "integer",
845
+ },
846
+ },
847
+ },
848
+ },
849
+ {
850
+ type: "object",
851
+ additionalProperties: false,
852
+ required: ["action", "requests"],
853
+ properties: {
854
+ action: { const: "get_form_statistic" },
855
+ accountId: accountIdProperty,
856
+ requests: {
857
+ type: "array",
858
+ minItems: 1,
859
+ description: "统计请求列表;每项按企业微信 get_form_statistic 官方结构填写",
860
+ items: nonEmptyObjectProperty,
861
+ },
862
+ },
863
+ },
864
+ {
865
+ type: "object",
866
+ additionalProperties: false,
867
+ required: ["action", "docId"],
868
+ properties: {
869
+ action: { const: "get_sheet_properties" },
870
+ accountId: accountIdProperty,
871
+ docId: {
872
+ ...docIdProperty,
873
+ description: "在线表格 docid",
874
+ },
875
+ },
876
+ },
877
+ {
878
+ type: "object",
879
+ additionalProperties: false,
880
+ required: ["action", "docId", "sheetId", "gridData"],
881
+ properties: {
882
+ action: { const: "edit_sheet_data" },
883
+ accountId: accountIdProperty,
884
+ docId: {
885
+ ...docIdProperty,
886
+ description: "在线表格 docid",
887
+ },
888
+ sheetId: {
889
+ type: "string",
890
+ minLength: 1,
891
+ description: "工作表 sheet_id",
892
+ },
893
+ startRow: {
894
+ type: "integer",
895
+ minimum: 0,
896
+ description: "起始行号(从 0 开始)",
897
+ },
898
+ startColumn: {
899
+ type: "integer",
900
+ minimum: 0,
901
+ description: "起始列号(从 0 开始)",
902
+ },
903
+ gridData: {
904
+ type: "object",
905
+ description: "表格数据,按企业微信官方 GridData 定义填写",
906
+ additionalProperties: false,
907
+ required: ["rows"],
908
+ properties: {
909
+ startRow: { type: "integer", minimum: 0, description: "起始行号(从 0 开始)" },
910
+ startColumn: { type: "integer", minimum: 0, description: "起始列号(从 0 开始)" },
911
+ rows: {
912
+ type: "array",
913
+ minItems: 1,
914
+ description: "行数据列表",
915
+ items: {
916
+ type: "object",
917
+ additionalProperties: false,
918
+ required: ["values"],
919
+ properties: {
920
+ values: {
921
+ type: "array",
922
+ minItems: 1,
923
+ description: "单元格数据列表(CellData 格式)",
924
+ items: {
925
+ type: "object",
926
+ additionalProperties: false,
927
+ required: ["cell_value"],
928
+ properties: {
929
+ cell_value: {
930
+ type: "object",
931
+ description: "单元格值(text 或 link 二选一)",
932
+ additionalProperties: false,
933
+ oneOf: [
934
+ { required: ["text"], not: { required: ["link"] } },
935
+ { required: ["link"], not: { required: ["text"] } }
936
+ ],
937
+ properties: {
938
+ text: { type: "string", description: "文本内容" },
939
+ link: {
940
+ type: "object",
941
+ description: "超链接内容",
942
+ additionalProperties: false,
943
+ required: ["text", "url"],
944
+ properties: {
945
+ text: { type: "string", description: "链接显示文本" },
946
+ url: { type: "string", description: "链接地址" }
947
+ }
948
+ }
949
+ }
950
+ },
951
+ cell_format: {
952
+ type: "object",
953
+ description: "单元格格式(可选)",
954
+ additionalProperties: false,
955
+ properties: {
956
+ text_format: {
957
+ type: "object",
958
+ description: "文本格式",
959
+ additionalProperties: false,
960
+ properties: {
961
+ font: {
962
+ type: "string",
963
+ description: "字体名称(Microsoft YaHei, SimSun, Arial 等)"
964
+ },
965
+ font_size: {
966
+ type: "integer",
967
+ minimum: 1,
968
+ maximum: 72,
969
+ description: "字体大小(最大 72)"
970
+ },
971
+ bold: {
972
+ type: "boolean",
973
+ description: "加粗"
974
+ },
975
+ italic: {
976
+ type: "boolean",
977
+ description: "斜体"
978
+ },
979
+ strikethrough: {
980
+ type: "boolean",
981
+ description: "删除线"
982
+ },
983
+ underline: {
984
+ type: "boolean",
985
+ description: "下划线"
986
+ },
987
+ color: {
988
+ type: "object",
989
+ description: "字体颜色(RGBA)",
990
+ additionalProperties: false,
991
+ properties: {
992
+ red: {
993
+ type: "integer",
994
+ minimum: 0,
995
+ maximum: 255,
996
+ description: "红色通道"
997
+ },
998
+ green: {
999
+ type: "integer",
1000
+ minimum: 0,
1001
+ maximum: 255,
1002
+ description: "绿色通道"
1003
+ },
1004
+ blue: {
1005
+ type: "integer",
1006
+ minimum: 0,
1007
+ maximum: 255,
1008
+ description: "蓝色通道"
1009
+ },
1010
+ alpha: {
1011
+ type: "integer",
1012
+ minimum: 0,
1013
+ maximum: 255,
1014
+ description: "透明度(255 完全不透明)"
1015
+ }
1016
+ }
1017
+ }
1018
+ }
1019
+ }
1020
+ }
1021
+ }
1022
+ }
1023
+ }
1024
+ }
1025
+ }
1026
+ }
1027
+ }
1028
+ }
1029
+ },
1030
+ },
1031
+ },
1032
+ {
1033
+ type: "object",
1034
+ additionalProperties: false,
1035
+ required: ["action", "docId", "sheetId", "range"],
1036
+ properties: {
1037
+ action: { const: "get_sheet_data" },
1038
+ accountId: accountIdProperty,
1039
+ docId: {
1040
+ ...docIdProperty,
1041
+ description: "在线表格 docid",
1042
+ },
1043
+ sheetId: {
1044
+ type: "string",
1045
+ minLength: 1,
1046
+ description: "工作表 sheet_id",
1047
+ },
1048
+ range: {
1049
+ type: "string",
1050
+ minLength: 1,
1051
+ description: "读取范围,如 A1:E10",
1052
+ },
1053
+ },
1054
+ },
1055
+ // Note: batch_update is the underlying API, but users should use edit_sheet_data action instead
1056
+ // The edit_sheet_data action handles conversion to batch_update format internally
1057
+ {
1058
+ type: "object",
1059
+ additionalProperties: false,
1060
+ required: ["action", "docId", "sheetId", "records"],
1061
+ properties: {
1062
+ action: { const: "smartsheet_add_records" },
1063
+ accountId: accountIdProperty,
1064
+ docId: docIdProperty,
1065
+ sheetId: { type: "string", description: "子表 ID" },
1066
+ records: { type: "array", items: nonEmptyObjectProperty, description: "记录列表" },
1067
+ },
1068
+ },
1069
+ {
1070
+ type: "object",
1071
+ additionalProperties: false,
1072
+ required: ["action", "docId", "sheetId", "records"],
1073
+ properties: {
1074
+ action: { const: "smartsheet_update_records" },
1075
+ accountId: accountIdProperty,
1076
+ docId: docIdProperty,
1077
+ sheetId: { type: "string", description: "子表 ID" },
1078
+ records: { type: "array", items: nonEmptyObjectProperty, description: "更新记录列表,需包含 record_id" },
1079
+ },
1080
+ },
1081
+ {
1082
+ type: "object",
1083
+ additionalProperties: false,
1084
+ required: ["action", "docId", "sheetId", "record_ids"],
1085
+ properties: {
1086
+ action: { const: "smartsheet_del_records" },
1087
+ accountId: accountIdProperty,
1088
+ docId: docIdProperty,
1089
+ sheetId: { type: "string", description: "子表 ID" },
1090
+ record_ids: { type: "array", items: { type: "string" }, description: "记录 ID 列表" },
1091
+ },
1092
+ },
1093
+ {
1094
+ type: "object",
1095
+ additionalProperties: false,
1096
+ required: ["action", "docId", "sheetId"],
1097
+ properties: {
1098
+ action: { const: "smartsheet_get_records" },
1099
+ accountId: accountIdProperty,
1100
+ docId: docIdProperty,
1101
+ sheetId: { type: "string", description: "子表 ID" },
1102
+ record_ids: { type: "array", items: { type: "string" }, description: "可选:指定记录 ID 列表" },
1103
+ offset: { type: "integer" },
1104
+ limit: { type: "integer" },
1105
+ },
1106
+ },
1107
+ {
1108
+ type: "object",
1109
+ additionalProperties: false,
1110
+ required: ["action", "docId", "sheetId"],
1111
+ properties: {
1112
+ action: { const: "smartsheet_get_fields" },
1113
+ accountId: accountIdProperty,
1114
+ docId: docIdProperty,
1115
+ sheetId: { type: "string", description: "子表 ID" },
1116
+ view_id: { type: "string", description: "可选:视图 ID" },
1117
+ },
1118
+ },
1119
+ {
1120
+ type: "object",
1121
+ additionalProperties: false,
1122
+ required: ["action", "docId", "sheetId"],
1123
+ properties: {
1124
+ action: { const: "smartsheet_get_views" },
1125
+ accountId: accountIdProperty,
1126
+ docId: docIdProperty,
1127
+ sheetId: { type: "string", description: "子表 ID" },
1128
+ },
1129
+ },
1130
+ {
1131
+ type: "object",
1132
+ additionalProperties: false,
1133
+ required: ["action", "docId"],
1134
+ properties: {
1135
+ action: { const: "smartsheet_get_sheets" },
1136
+ accountId: accountIdProperty,
1137
+ docId: docIdProperty,
1138
+ },
1139
+ },
1140
+ {
1141
+ type: "object",
1142
+ additionalProperties: false,
1143
+ required: ["action", "docId", "title"],
1144
+ properties: {
1145
+ action: { const: "smartsheet_add_sheet" },
1146
+ accountId: accountIdProperty,
1147
+ docId: docIdProperty,
1148
+ title: { type: "string", description: "子表标题" },
1149
+ index: { type: "integer", description: "可选:子表位置索引" },
1150
+ },
1151
+ },
1152
+ {
1153
+ type: "object",
1154
+ additionalProperties: false,
1155
+ required: ["action", "docId", "sheetId"],
1156
+ properties: {
1157
+ action: { const: "smartsheet_del_sheet" },
1158
+ accountId: accountIdProperty,
1159
+ docId: docIdProperty,
1160
+ sheetId: sheetIdProperty,
1161
+ },
1162
+ },
1163
+ {
1164
+ type: "object",
1165
+ additionalProperties: false,
1166
+ required: ["action", "docId", "sheetId"],
1167
+ properties: {
1168
+ action: { const: "smartsheet_update_sheet" },
1169
+ accountId: accountIdProperty,
1170
+ docId: docIdProperty,
1171
+ sheetId: sheetIdProperty,
1172
+ title: { type: "string", description: "新标题" },
1173
+ },
1174
+ },
1175
+ {
1176
+ type: "object",
1177
+ additionalProperties: false,
1178
+ required: ["action", "docId", "sheetId", "view_title", "view_type"],
1179
+ properties: {
1180
+ action: { const: "smartsheet_add_view" },
1181
+ accountId: accountIdProperty,
1182
+ docId: docIdProperty,
1183
+ sheetId: sheetIdProperty,
1184
+ view_title: { type: "string", description: "视图标题" },
1185
+ view_type: {
1186
+ type: "string",
1187
+ enum: ["VIEW_TYPE_GRID", "VIEW_TYPE_KANBAN", "VIEW_TYPE_GALLERY", "VIEW_TYPE_GANTT", "VIEW_TYPE_CALENDAR"],
1188
+ description: "视图类型"
1189
+ },
1190
+ property_gantt: genericObjectProperty,
1191
+ property_calendar: genericObjectProperty,
1192
+ },
1193
+ },
1194
+ {
1195
+ type: "object",
1196
+ additionalProperties: false,
1197
+ required: ["action", "docId", "sheetId", "view_id"],
1198
+ properties: {
1199
+ action: { const: "smartsheet_update_view" },
1200
+ accountId: accountIdProperty,
1201
+ docId: docIdProperty,
1202
+ sheetId: sheetIdProperty,
1203
+ view_id: { type: "string", description: "视图 ID" },
1204
+ view_title: { type: "string", description: "视图标题" },
1205
+ property_gantt: genericObjectProperty,
1206
+ property_calendar: genericObjectProperty,
1207
+ },
1208
+ },
1209
+ {
1210
+ type: "object",
1211
+ additionalProperties: false,
1212
+ required: ["action", "docId", "sheetId", "view_ids"],
1213
+ properties: {
1214
+ action: { const: "smartsheet_del_view" },
1215
+ accountId: accountIdProperty,
1216
+ docId: docIdProperty,
1217
+ sheetId: sheetIdProperty,
1218
+ view_ids: { type: "array", items: { type: "string" }, description: "视图 ID 列表" },
1219
+ },
1220
+ },
1221
+ {
1222
+ type: "object",
1223
+ additionalProperties: false,
1224
+ required: ["action", "docId", "sheetId", "fields"],
1225
+ properties: {
1226
+ action: { const: "smartsheet_add_fields" },
1227
+ accountId: accountIdProperty,
1228
+ docId: docIdProperty,
1229
+ sheetId: sheetIdProperty,
1230
+ fields: {
1231
+ type: "array",
1232
+ items: nonEmptyObjectProperty,
1233
+ description: "要添加的字段列表,每项包含 field_title, field_type 等"
1234
+ },
1235
+ },
1236
+ },
1237
+ {
1238
+ type: "object",
1239
+ additionalProperties: false,
1240
+ required: ["action", "docId", "sheetId", "field_ids"],
1241
+ properties: {
1242
+ action: { const: "smartsheet_del_fields" },
1243
+ accountId: accountIdProperty,
1244
+ docId: docIdProperty,
1245
+ sheetId: sheetIdProperty,
1246
+ field_ids: { type: "array", items: { type: "string" }, description: "字段 ID 列表" },
1247
+ },
1248
+ },
1249
+ {
1250
+ type: "object",
1251
+ additionalProperties: false,
1252
+ required: ["action", "docId", "sheetId", "fields"],
1253
+ properties: {
1254
+ action: { const: "smartsheet_update_fields" },
1255
+ accountId: accountIdProperty,
1256
+ docId: docIdProperty,
1257
+ sheetId: sheetIdProperty,
1258
+ fields: {
1259
+ type: "array",
1260
+ items: nonEmptyObjectProperty,
1261
+ description: "要更新的字段列表,每项需包含 field_id"
1262
+ },
1263
+ },
1264
+ },
1265
+ {
1266
+ type: "object",
1267
+ additionalProperties: false,
1268
+ required: ["action", "docId", "sheetId", "name"],
1269
+ properties: {
1270
+ action: { const: "smartsheet_add_group" },
1271
+ accountId: accountIdProperty,
1272
+ docId: docIdProperty,
1273
+ sheetId: sheetIdProperty,
1274
+ name: { type: "string", description: "编组名称" },
1275
+ children: { type: "array", items: { type: "string" }, description: "字段 ID 列表" },
1276
+ },
1277
+ },
1278
+ {
1279
+ type: "object",
1280
+ additionalProperties: false,
1281
+ required: ["action", "docId", "sheetId", "field_group_id"],
1282
+ properties: {
1283
+ action: { const: "smartsheet_del_group" },
1284
+ accountId: accountIdProperty,
1285
+ docId: docIdProperty,
1286
+ sheetId: sheetIdProperty,
1287
+ field_group_id: { type: "string", description: "编组 ID" },
1288
+ },
1289
+ },
1290
+ {
1291
+ type: "object",
1292
+ additionalProperties: false,
1293
+ required: ["action", "docId", "sheetId", "field_group_id"],
1294
+ properties: {
1295
+ action: { const: "smartsheet_update_group" },
1296
+ accountId: accountIdProperty,
1297
+ docId: docIdProperty,
1298
+ sheetId: sheetIdProperty,
1299
+ field_group_id: { type: "string", description: "编组 ID" },
1300
+ name: { type: "string" },
1301
+ children: { type: "array", items: { type: "string" } },
1302
+ },
1303
+ },
1304
+ {
1305
+ type: "object",
1306
+ additionalProperties: false,
1307
+ required: ["action", "docId", "sheetId"],
1308
+ properties: {
1309
+ action: { const: "smartsheet_get_groups" },
1310
+ accountId: accountIdProperty,
1311
+ docId: docIdProperty,
1312
+ sheetId: sheetIdProperty,
1313
+ },
1314
+ },
1315
+ {
1316
+ type: "object",
1317
+ additionalProperties: false,
1318
+ required: ["action", "docId", "sheetId", "records"],
1319
+ properties: {
1320
+ action: { const: "smartsheet_add_external_records" },
1321
+ accountId: accountIdProperty,
1322
+ docId: docIdProperty,
1323
+ sheetId: sheetIdProperty,
1324
+ records: { type: "array", items: nonEmptyObjectProperty, description: "记录列表" },
1325
+ },
1326
+ },
1327
+ {
1328
+ type: "object",
1329
+ additionalProperties: false,
1330
+ required: ["action", "docId", "sheetId", "records"],
1331
+ properties: {
1332
+ action: { const: "smartsheet_update_external_records" },
1333
+ accountId: accountIdProperty,
1334
+ docId: docIdProperty,
1335
+ sheetId: sheetIdProperty,
1336
+ records: { type: "array", items: nonEmptyObjectProperty, description: "记录列表" },
1337
+ },
1338
+ },
1339
+ {
1340
+ type: "object",
1341
+ additionalProperties: false,
1342
+ required: ["action", "docId", "sheetId", "records"],
1343
+ properties: {
1344
+ action: { const: "smartsheet_add_records" },
1345
+ accountId: accountIdProperty,
1346
+ docId: docIdProperty,
1347
+ sheetId: { type: "string", description: "子表 ID" },
1348
+ records: { type: "array", items: nonEmptyObjectProperty, description: "记录列表" },
1349
+ },
1350
+ },
1351
+ {
1352
+ type: "object",
1353
+ additionalProperties: false,
1354
+ required: ["action", "docId", "sheetId", "records"],
1355
+ properties: {
1356
+ action: { const: "smartsheet_update_records" },
1357
+ accountId: accountIdProperty,
1358
+ docId: docIdProperty,
1359
+ sheetId: { type: "string", description: "子表 ID" },
1360
+ records: { type: "array", items: nonEmptyObjectProperty, description: "更新记录列表,需包含 record_id" },
1361
+ },
1362
+ },
1363
+ {
1364
+ type: "object",
1365
+ additionalProperties: false,
1366
+ required: ["action", "docId", "sheetId", "record_ids"],
1367
+ properties: {
1368
+ action: { const: "smartsheet_del_records" },
1369
+ accountId: accountIdProperty,
1370
+ docId: docIdProperty,
1371
+ sheetId: { type: "string", description: "子表 ID" },
1372
+ record_ids: { type: "array", items: { type: "string" }, description: "记录 ID 列表" },
1373
+ },
1374
+ },
1375
+ {
1376
+ type: "object",
1377
+ additionalProperties: false,
1378
+ required: ["action", "docId", "sheetId"],
1379
+ properties: {
1380
+ action: { const: "smartsheet_get_records" },
1381
+ accountId: accountIdProperty,
1382
+ docId: docIdProperty,
1383
+ sheetId: { type: "string", description: "子表 ID" },
1384
+ record_ids: { type: "array", items: { type: "string" }, description: "可选:指定记录 ID 列表" },
1385
+ offset: { type: "integer" },
1386
+ limit: { type: "integer" },
1387
+ },
1388
+ },
1389
+ {
1390
+ type: "object",
1391
+ additionalProperties: false,
1392
+ required: ["action", "docId", "type"],
1393
+ properties: {
1394
+ action: { const: "smartsheet_get_sheet_priv" },
1395
+ accountId: accountIdProperty,
1396
+ docId: docIdProperty,
1397
+ type: { type: "integer", enum: [1, 2], description: "规则类型:1-全员权限,2-额外权限" },
1398
+ rule_id_list: { type: "array", items: { type: "integer" }, description: "规则 ID 列表" },
1399
+ },
1400
+ },
1401
+ {
1402
+ type: "object",
1403
+ additionalProperties: false,
1404
+ required: ["action", "docId", "priv_list"],
1405
+ anyOf: [
1406
+ { required: ["rule_id"] },
1407
+ { required: ["name"] }
1408
+ ],
1409
+ properties: {
1410
+ action: { const: "smartsheet_update_sheet_priv" },
1411
+ accountId: accountIdProperty,
1412
+ docId: docIdProperty,
1413
+ type: { type: "integer", enum: [1, 2], const: 2, description: "必须为2 (额外权限) ? 或支持1? 文档update_sheet_priv支持更新全员(type=1)或额外(type=2)" },
1414
+ rule_id: { type: "integer" },
1415
+ name: { type: "string" },
1416
+ priv_list: privListSchema,
1417
+ },
1418
+ },
1419
+ {
1420
+ type: "object",
1421
+ additionalProperties: false,
1422
+ required: ["action", "docId", "name"],
1423
+ properties: {
1424
+ action: { const: "smartsheet_create_rule" },
1425
+ accountId: accountIdProperty,
1426
+ docId: docIdProperty,
1427
+ name: { type: "string", description: "权限规则名称" },
1428
+ },
1429
+ },
1430
+ {
1431
+ type: "object",
1432
+ additionalProperties: false,
1433
+ required: ["action", "docId", "rule_id"],
1434
+ properties: {
1435
+ action: { const: "smartsheet_mod_rule_member" },
1436
+ accountId: accountIdProperty,
1437
+ docId: docIdProperty,
1438
+ rule_id: { type: "integer" },
1439
+ add_member_range: memberRangeSchema,
1440
+ del_member_range: memberRangeSchema
1441
+ },
1442
+ },
1443
+ {
1444
+ type: "object",
1445
+ additionalProperties: false,
1446
+ required: ["action", "docId", "rule_id_list"],
1447
+ properties: {
1448
+ action: { const: "smartsheet_delete_rule" },
1449
+ accountId: accountIdProperty,
1450
+ docId: docIdProperty,
1451
+ rule_id_list: { type: "array", items: { type: "integer" }, description: "规则 ID 列表" },
1452
+ },
1453
+ },
1454
+ {
1455
+ type: "object",
1456
+ additionalProperties: false,
1457
+ required: ["action", "userid_list"],
1458
+ properties: {
1459
+ action: { const: "doc_assign_advanced_account" },
1460
+ accountId: accountIdProperty,
1461
+ userid_list: { type: "array", items: { type: "string" }, description: "成员 ID 列表" },
1462
+ },
1463
+ },
1464
+ {
1465
+ type: "object",
1466
+ additionalProperties: false,
1467
+ required: ["action", "userid_list"],
1468
+ properties: {
1469
+ action: { const: "doc_cancel_advanced_account" },
1470
+ accountId: accountIdProperty,
1471
+ userid_list: { type: "array", items: { type: "string" }, description: "成员 ID 列表" },
1472
+ },
1473
+ },
1474
+ {
1475
+ type: "object",
1476
+ additionalProperties: false,
1477
+ required: ["action"],
1478
+ properties: {
1479
+ action: { const: "doc_get_advanced_account_list" },
1480
+ accountId: accountIdProperty,
1481
+ offset: { type: "integer" },
1482
+ limit: { type: "integer" },
1483
+ },
1484
+ },
1485
+ {
1486
+ type: "object",
1487
+ additionalProperties: false,
1488
+ required: ["action", "file_path", "docId"],
1489
+ properties: {
1490
+ action: { const: "upload_doc_image" },
1491
+ accountId: accountIdProperty,
1492
+ docId: {
1493
+ ...docIdProperty,
1494
+ description: "文档 docid,上传图片需要关联文档",
1495
+ },
1496
+ file_path: { type: "string", description: "本地图片路径" },
1497
+ },
1498
+ },
1499
+ ],
1500
+ } as const;