@yanhaidao/wecom 2.3.160 → 2.3.180
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/README.md +235 -399
- package/SKILLS_CAL.md +895 -0
- package/SKILLS_DOC.md +2136 -0
- package/changelog/v2.3.18.md +22 -0
- package/index.ts +39 -3
- package/package.json +2 -3
- package/src/agent/handler.event-filter.test.ts +11 -0
- package/src/agent/handler.ts +732 -643
- package/src/app/account-runtime.ts +46 -20
- package/src/app/index.ts +19 -1
- package/src/capability/calendar/SKILLS_CHECKLIST.md +251 -0
- package/src/capability/calendar/client.ts +815 -0
- package/src/capability/calendar/index.ts +3 -0
- package/src/capability/calendar/schema.ts +417 -0
- package/src/capability/calendar/tool.ts +417 -0
- package/src/capability/calendar/types.ts +309 -0
- package/src/capability/doc/client.ts +567 -62
- package/src/capability/doc/schema.ts +419 -318
- package/src/capability/doc/tool.ts +1510 -1178
- package/src/capability/doc/types.ts +130 -14
- package/src/capability/mcp/index.ts +10 -0
- package/src/capability/mcp/schema.ts +107 -0
- package/src/capability/mcp/tool.ts +170 -0
- package/src/capability/mcp/transport.ts +394 -0
- package/src/channel.ts +70 -28
- package/src/config/schema.ts +71 -102
- package/src/outbound.test.ts +91 -14
- package/src/outbound.ts +143 -30
- package/src/runtime/reply-orchestrator.test.ts +35 -2
- package/src/runtime/reply-orchestrator.ts +14 -2
- package/src/runtime/session-manager.ts +20 -6
- package/src/runtime/source-registry.ts +165 -0
- package/src/transport/bot-ws/media.ts +269 -0
- package/src/transport/bot-ws/reply.test.ts +85 -17
- package/src/transport/bot-ws/reply.ts +109 -21
- package/src/transport/bot-ws/sdk-adapter.test.ts +64 -1
- package/src/transport/bot-ws/sdk-adapter.ts +88 -12
- package/.claude/settings.local.json +0 -11
- package/docs/update-content-fix.md +0 -135
|
@@ -1,427 +1,479 @@
|
|
|
1
1
|
const accountIdProperty = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
type: "string",
|
|
3
|
+
minLength: 1,
|
|
4
|
+
description:
|
|
5
|
+
"可选:指定企业微信账号 ID;不填时按 agent 账号/默认账号自动选择",
|
|
5
6
|
};
|
|
6
7
|
|
|
7
8
|
const docTypeProperty = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
oneOf: [
|
|
10
|
+
{
|
|
11
|
+
type: "string",
|
|
12
|
+
enum: ["doc", "spreadsheet", "smart_table"],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
type: "integer",
|
|
16
|
+
enum: [3, 4, 10],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
default: "doc",
|
|
20
|
+
description: "文档类型:doc=文档,spreadsheet=表格,smart_table=智能表格",
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
const sheetIdProperty = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
type: "string",
|
|
25
|
+
minLength: 1,
|
|
26
|
+
description: "子表 ID (sheet_id)",
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
const docIdProperty = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
type: "string",
|
|
31
|
+
minLength: 1,
|
|
32
|
+
description: "文档 docid",
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
const formIdProperty = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
type: "string",
|
|
37
|
+
minLength: 1,
|
|
38
|
+
description: "收集表 formid",
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
const shareUrlProperty = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
type: "string",
|
|
43
|
+
minLength: 1,
|
|
44
|
+
description: "企业微信文档分享链接",
|
|
44
45
|
};
|
|
45
46
|
|
|
46
47
|
const genericObjectProperty = {
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
type: "object",
|
|
49
|
+
additionalProperties: true,
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
const nonEmptyObjectProperty = {
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
...genericObjectProperty,
|
|
54
|
+
minProperties: 1,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// --- Form Statistics Schema ---
|
|
58
|
+
|
|
59
|
+
const formStatisticRequestSchema = {
|
|
60
|
+
type: "object",
|
|
61
|
+
required: ["req_type", "repeated_id"],
|
|
62
|
+
properties: {
|
|
63
|
+
req_type: {
|
|
64
|
+
type: "integer",
|
|
65
|
+
enum: [1, 2, 3],
|
|
66
|
+
description: "统计类型:1-仅获取统计结果,2-获取已提交列表(需 start_time 和 end_time),3-获取未提交列表"
|
|
67
|
+
},
|
|
68
|
+
repeated_id: { type: "string", description: "收集表 repeated_id" },
|
|
69
|
+
start_time: { type: "integer", description: "可选:开始时间戳(毫秒),req_type=2 时必填" },
|
|
70
|
+
end_time: { type: "integer", description: "可选:结束时间戳(毫秒),req_type=2 时必填" },
|
|
71
|
+
limit: { type: "integer", description: "可选:分页大小,最大 10000" },
|
|
72
|
+
cursor: { type: "integer", description: "可选:分页游标" },
|
|
73
|
+
},
|
|
54
74
|
};
|
|
55
75
|
|
|
56
76
|
// --- Doc Permission Schemas ---
|
|
57
77
|
|
|
58
78
|
const coAuthListProperty = {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
type: "array",
|
|
80
|
+
items: {
|
|
81
|
+
type: "object",
|
|
82
|
+
required: ["departmentid", "auth", "type"],
|
|
83
|
+
properties: {
|
|
84
|
+
departmentid: { type: "integer", description: "特定部门id" },
|
|
85
|
+
auth: { type: "integer", enum: [1, 2], description: "1:只读, 2:读写" },
|
|
86
|
+
type: { type: "integer", const: 2, description: "2:部门" },
|
|
87
|
+
},
|
|
88
|
+
},
|
|
69
89
|
};
|
|
70
90
|
|
|
71
91
|
const docMemberListProperty = {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
type: "array",
|
|
93
|
+
items: {
|
|
94
|
+
type: "object",
|
|
95
|
+
required: ["type", "auth"],
|
|
96
|
+
properties: {
|
|
97
|
+
type: { type: "integer", const: 1, description: "1:用户" },
|
|
98
|
+
userid: { type: "string", description: "企业成员userid" },
|
|
99
|
+
tmp_external_userid: { type: "string", description: "外部用户临时id" },
|
|
100
|
+
auth: {
|
|
101
|
+
type: "integer",
|
|
102
|
+
enum: [1, 2, 7],
|
|
103
|
+
description: "1:只读 2:读写 7:管理员",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
83
107
|
};
|
|
84
108
|
|
|
85
109
|
const delDocMemberListProperty = {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
type: "array",
|
|
111
|
+
items: {
|
|
112
|
+
type: "object",
|
|
113
|
+
required: ["type"],
|
|
114
|
+
properties: {
|
|
115
|
+
type: { type: "integer", const: 1 },
|
|
116
|
+
userid: { type: "string" },
|
|
117
|
+
tmp_external_userid: { type: "string" },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
96
120
|
};
|
|
97
121
|
|
|
98
122
|
const watermarkProperty = {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
123
|
+
type: "object",
|
|
124
|
+
properties: {
|
|
125
|
+
margin_type: {
|
|
126
|
+
type: "integer",
|
|
127
|
+
enum: [1, 2],
|
|
128
|
+
description: "1:稀疏, 2:紧密",
|
|
129
|
+
},
|
|
130
|
+
show_visitor_name: { type: "boolean" },
|
|
131
|
+
show_text: { type: "boolean" },
|
|
132
|
+
text: { type: "string" },
|
|
133
|
+
},
|
|
106
134
|
};
|
|
107
135
|
|
|
108
136
|
// --- Smartsheet Permission Schemas ---
|
|
109
137
|
|
|
110
138
|
const fieldRuleListSchema = {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
139
|
+
type: "array",
|
|
140
|
+
items: {
|
|
141
|
+
type: "object",
|
|
142
|
+
required: ["field_id", "can_edit", "can_insert", "can_view"],
|
|
143
|
+
properties: {
|
|
144
|
+
field_id: { type: "string" },
|
|
145
|
+
field_type: { type: "string" },
|
|
146
|
+
can_edit: { type: "boolean" },
|
|
147
|
+
can_insert: { type: "boolean" },
|
|
148
|
+
can_view: { type: "boolean" },
|
|
149
|
+
},
|
|
150
|
+
},
|
|
123
151
|
};
|
|
124
152
|
|
|
125
153
|
const fieldPrivSchema = {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
154
|
+
type: "object",
|
|
155
|
+
required: ["field_range_type", "field_rule_list"],
|
|
156
|
+
properties: {
|
|
157
|
+
field_range_type: {
|
|
158
|
+
type: "integer",
|
|
159
|
+
enum: [1, 2],
|
|
160
|
+
description: "1-所有字段;2-部分字段",
|
|
161
|
+
},
|
|
162
|
+
field_rule_list: fieldRuleListSchema,
|
|
163
|
+
field_default_rule: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
can_edit: { type: "boolean" },
|
|
167
|
+
can_insert: { type: "boolean" },
|
|
168
|
+
can_view: { type: "boolean" },
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
140
172
|
};
|
|
141
173
|
|
|
142
174
|
const recordRuleListSchema = {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
175
|
+
type: "array",
|
|
176
|
+
items: {
|
|
177
|
+
type: "object",
|
|
178
|
+
required: ["field_id", "oper_type"],
|
|
179
|
+
properties: {
|
|
180
|
+
field_id: { type: "string" },
|
|
181
|
+
field_type: { type: "string" },
|
|
182
|
+
oper_type: {
|
|
183
|
+
type: "integer",
|
|
184
|
+
description:
|
|
185
|
+
"1-包含自己; 2-包含value; 3-不包含; 4-等于; 5-不等于; 6-为空; 7-非空",
|
|
186
|
+
},
|
|
187
|
+
value: { type: "array", items: { type: "string" } },
|
|
188
|
+
},
|
|
189
|
+
},
|
|
154
190
|
};
|
|
155
191
|
|
|
156
192
|
const recordPrivSchema = {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
193
|
+
type: "object",
|
|
194
|
+
required: ["record_range_type"],
|
|
195
|
+
properties: {
|
|
196
|
+
record_range_type: {
|
|
197
|
+
type: "integer",
|
|
198
|
+
enum: [1, 2, 3],
|
|
199
|
+
description: "1-全部; 2-任意条件; 3-全部条件",
|
|
200
|
+
},
|
|
201
|
+
record_rule_list: recordRuleListSchema,
|
|
202
|
+
other_priv: {
|
|
203
|
+
type: "integer",
|
|
204
|
+
enum: [1, 2],
|
|
205
|
+
description: "1-不可编辑; 2-不可查看",
|
|
206
|
+
},
|
|
207
|
+
},
|
|
164
208
|
};
|
|
165
209
|
|
|
166
210
|
const privListSchema = {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
211
|
+
type: "array",
|
|
212
|
+
items: {
|
|
213
|
+
type: "object",
|
|
214
|
+
required: ["sheet_id", "priv"],
|
|
215
|
+
properties: {
|
|
216
|
+
sheet_id: { type: "string" },
|
|
217
|
+
priv: {
|
|
218
|
+
oneOf: [{ type: "string" }, { type: "integer" }],
|
|
219
|
+
description: "1-全部权限;2-可编辑;3-仅浏览;4-无权限",
|
|
220
|
+
},
|
|
221
|
+
can_insert_record: { type: "boolean" },
|
|
222
|
+
can_delete_record: { type: "boolean" },
|
|
223
|
+
can_create_modify_delete_view: { type: "boolean" },
|
|
224
|
+
field_priv: fieldPrivSchema,
|
|
225
|
+
record_priv: recordPrivSchema,
|
|
226
|
+
clear: { type: "boolean" },
|
|
227
|
+
},
|
|
228
|
+
},
|
|
185
229
|
};
|
|
186
230
|
|
|
187
231
|
const memberRangeSchema = {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
232
|
+
type: "object",
|
|
233
|
+
properties: {
|
|
234
|
+
userid_list: { type: "array", items: { type: "string" } },
|
|
235
|
+
},
|
|
192
236
|
};
|
|
193
237
|
|
|
194
238
|
// --- Doc Content Update Schemas ---
|
|
195
239
|
|
|
196
240
|
const locationProperty = {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
241
|
+
type: "object",
|
|
242
|
+
required: ["index"],
|
|
243
|
+
properties: {
|
|
244
|
+
index: { type: "integer", minimum: 0, description: "位置索引" },
|
|
245
|
+
},
|
|
202
246
|
};
|
|
203
247
|
|
|
204
248
|
const rangeProperty = {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
249
|
+
type: "object",
|
|
250
|
+
required: ["start_index", "length"],
|
|
251
|
+
properties: {
|
|
252
|
+
start_index: { type: "integer", minimum: 0, description: "起始位置" },
|
|
253
|
+
length: { type: "integer", minimum: 1, description: "长度" },
|
|
254
|
+
},
|
|
211
255
|
};
|
|
212
256
|
|
|
213
257
|
const textPropertySchema = {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
258
|
+
type: "object",
|
|
259
|
+
description: "文本属性",
|
|
260
|
+
properties: {
|
|
261
|
+
bold: { type: "boolean" },
|
|
262
|
+
italics: { type: "boolean" },
|
|
263
|
+
underline: { type: "boolean" },
|
|
264
|
+
strike: { type: "boolean" },
|
|
265
|
+
color: {
|
|
266
|
+
type: "string",
|
|
267
|
+
pattern: "^[0-9A-Fa-f]{6}$",
|
|
268
|
+
description: "RRGGBB 格式颜色",
|
|
269
|
+
},
|
|
270
|
+
background_color: {
|
|
271
|
+
type: "string",
|
|
272
|
+
pattern: "^[0-9A-Fa-f]{6}$",
|
|
273
|
+
description: "RRGGBB 格式背景色",
|
|
274
|
+
},
|
|
275
|
+
size: { type: "integer", description: "字体大小(half-points)" },
|
|
276
|
+
},
|
|
225
277
|
};
|
|
226
278
|
|
|
227
279
|
const insertTextRequest = {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
280
|
+
type: "object",
|
|
281
|
+
required: ["text", "location"],
|
|
282
|
+
properties: {
|
|
283
|
+
text: { type: "string", minLength: 1 },
|
|
284
|
+
location: locationProperty,
|
|
285
|
+
},
|
|
234
286
|
};
|
|
235
287
|
|
|
236
288
|
const replaceTextRequest = {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
289
|
+
type: "object",
|
|
290
|
+
required: ["text", "ranges"],
|
|
291
|
+
properties: {
|
|
292
|
+
text: { type: "string" },
|
|
293
|
+
ranges: { type: "array", items: rangeProperty, minItems: 1 },
|
|
294
|
+
},
|
|
243
295
|
};
|
|
244
296
|
|
|
245
297
|
const deleteContentRequest = {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
298
|
+
type: "object",
|
|
299
|
+
required: ["range"],
|
|
300
|
+
properties: {
|
|
301
|
+
range: rangeProperty,
|
|
302
|
+
},
|
|
251
303
|
};
|
|
252
304
|
|
|
253
305
|
const updateTextPropertyRequest = {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
306
|
+
type: "object",
|
|
307
|
+
required: ["text_property", "ranges"],
|
|
308
|
+
properties: {
|
|
309
|
+
text_property: textPropertySchema,
|
|
310
|
+
ranges: { type: "array", items: rangeProperty, minItems: 1 },
|
|
311
|
+
},
|
|
260
312
|
};
|
|
261
313
|
|
|
262
314
|
const insertImageRequest = {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
315
|
+
type: "object",
|
|
316
|
+
required: ["image_id", "location"],
|
|
317
|
+
properties: {
|
|
318
|
+
image_id: { type: "string", description: "上传图片获得的 image_id/url" },
|
|
319
|
+
location: locationProperty,
|
|
320
|
+
width: { type: "integer", description: "宽(px)" },
|
|
321
|
+
height: { type: "integer", description: "高(px)" },
|
|
322
|
+
},
|
|
271
323
|
};
|
|
272
324
|
|
|
273
325
|
const insertPageBreakRequest = {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
326
|
+
type: "object",
|
|
327
|
+
required: ["location"],
|
|
328
|
+
properties: {
|
|
329
|
+
location: locationProperty,
|
|
330
|
+
},
|
|
279
331
|
};
|
|
280
332
|
|
|
281
333
|
const insertTableRequest = {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
334
|
+
type: "object",
|
|
335
|
+
required: ["rows", "cols", "location"],
|
|
336
|
+
properties: {
|
|
337
|
+
rows: { type: "integer", minimum: 1, maximum: 100 },
|
|
338
|
+
cols: { type: "integer", minimum: 1, maximum: 60 },
|
|
339
|
+
location: locationProperty,
|
|
340
|
+
},
|
|
289
341
|
};
|
|
290
342
|
|
|
291
343
|
const insertParagraphRequest = {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
344
|
+
type: "object",
|
|
345
|
+
description:
|
|
346
|
+
"在指定位置插入段落。注意:请使用此操作来分段,而不是在 insert_text 中使用换行符。",
|
|
347
|
+
required: ["location"],
|
|
348
|
+
properties: {
|
|
349
|
+
location: locationProperty,
|
|
350
|
+
},
|
|
298
351
|
};
|
|
299
352
|
|
|
300
353
|
// --- Spreadsheet Update Schemas ---
|
|
301
354
|
|
|
302
355
|
const addSheetRequest = {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
356
|
+
type: "object",
|
|
357
|
+
required: ["title"],
|
|
358
|
+
properties: {
|
|
359
|
+
title: { type: "string", minLength: 1 },
|
|
360
|
+
row_count: { type: "integer", minimum: 1 },
|
|
361
|
+
column_count: { type: "integer", minimum: 1 },
|
|
362
|
+
},
|
|
310
363
|
};
|
|
311
364
|
|
|
312
365
|
const deleteSheetRequest = {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
366
|
+
type: "object",
|
|
367
|
+
required: ["sheet_id"],
|
|
368
|
+
properties: {
|
|
369
|
+
sheet_id: { type: "string", minLength: 1 },
|
|
370
|
+
},
|
|
318
371
|
};
|
|
319
372
|
|
|
320
373
|
const deleteDimensionRequest = {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
374
|
+
type: "object",
|
|
375
|
+
required: ["sheet_id", "dimension", "start_index", "end_index"],
|
|
376
|
+
properties: {
|
|
377
|
+
sheet_id: { type: "string" },
|
|
378
|
+
dimension: { type: "string", enum: ["ROW", "COLUMN"] },
|
|
379
|
+
start_index: { type: "integer", minimum: 1 },
|
|
380
|
+
end_index: { type: "integer", minimum: 2 },
|
|
381
|
+
},
|
|
329
382
|
};
|
|
330
383
|
|
|
331
384
|
const cellValueSchema = {
|
|
332
|
-
|
|
333
|
-
|
|
385
|
+
type: "object",
|
|
386
|
+
properties: {
|
|
387
|
+
text: { type: "string" },
|
|
388
|
+
link: {
|
|
389
|
+
type: "object",
|
|
390
|
+
required: ["text", "url"],
|
|
391
|
+
properties: {
|
|
334
392
|
text: { type: "string" },
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
text: { type: "string" },
|
|
340
|
-
url: { type: "string" }
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
393
|
+
url: { type: "string" },
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
},
|
|
344
397
|
};
|
|
345
398
|
|
|
346
399
|
const cellFormatSchema = {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
400
|
+
type: "object",
|
|
401
|
+
properties: {
|
|
402
|
+
text_format: {
|
|
403
|
+
type: "object",
|
|
404
|
+
properties: {
|
|
405
|
+
bold: { type: "boolean" },
|
|
406
|
+
italic: { type: "boolean" },
|
|
407
|
+
strikethrough: { type: "boolean" },
|
|
408
|
+
underline: { type: "boolean" },
|
|
409
|
+
color: {
|
|
410
|
+
type: "object",
|
|
411
|
+
required: ["red", "green", "blue"],
|
|
412
|
+
properties: {
|
|
413
|
+
red: { type: "integer", minimum: 0, maximum: 255 },
|
|
414
|
+
green: { type: "integer", minimum: 0, maximum: 255 },
|
|
415
|
+
blue: { type: "integer", minimum: 0, maximum: 255 },
|
|
416
|
+
alpha: { type: "integer", minimum: 0, maximum: 255 },
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
font_size: { type: "integer" },
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
},
|
|
370
423
|
};
|
|
371
424
|
|
|
372
425
|
const cellDataSchema = {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
426
|
+
type: "object",
|
|
427
|
+
properties: {
|
|
428
|
+
cell_value: cellValueSchema,
|
|
429
|
+
cell_format: cellFormatSchema,
|
|
430
|
+
},
|
|
378
431
|
};
|
|
379
432
|
|
|
380
433
|
const rowDataSchema = {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
434
|
+
type: "object",
|
|
435
|
+
required: ["values"],
|
|
436
|
+
properties: {
|
|
437
|
+
values: {
|
|
438
|
+
type: "array",
|
|
439
|
+
items: cellDataSchema,
|
|
440
|
+
},
|
|
441
|
+
},
|
|
389
442
|
};
|
|
390
443
|
|
|
391
444
|
const gridDataSchema = {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
445
|
+
type: "object",
|
|
446
|
+
required: ["rows"],
|
|
447
|
+
properties: {
|
|
448
|
+
start_row: { type: "integer", default: 0 },
|
|
449
|
+
start_column: { type: "integer", default: 0 },
|
|
450
|
+
rows: {
|
|
451
|
+
type: "array",
|
|
452
|
+
items: rowDataSchema,
|
|
453
|
+
},
|
|
454
|
+
},
|
|
402
455
|
};
|
|
403
456
|
|
|
404
457
|
const updateRangeRequest = {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
458
|
+
type: "object",
|
|
459
|
+
required: ["sheet_id", "grid_data"],
|
|
460
|
+
properties: {
|
|
461
|
+
sheet_id: { type: "string" },
|
|
462
|
+
grid_data: gridDataSchema,
|
|
463
|
+
},
|
|
411
464
|
};
|
|
412
465
|
|
|
413
|
-
|
|
414
466
|
const docMemberEntryProperty = {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
467
|
+
oneOf: [
|
|
468
|
+
{ type: "string", minLength: 1 },
|
|
469
|
+
{ type: "object", additionalProperties: true, minProperties: 1 },
|
|
470
|
+
],
|
|
419
471
|
};
|
|
420
472
|
|
|
421
473
|
const docMemberEntryArrayProperty = {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
474
|
+
type: "array",
|
|
475
|
+
minItems: 1,
|
|
476
|
+
items: docMemberEntryProperty,
|
|
425
477
|
};
|
|
426
478
|
|
|
427
479
|
export const wecomDocToolSchema = {
|
|
@@ -798,7 +850,7 @@ export const wecomDocToolSchema = {
|
|
|
798
850
|
additionalProperties: false,
|
|
799
851
|
required: ["action", "formInfo"],
|
|
800
852
|
properties: {
|
|
801
|
-
action: { const: "
|
|
853
|
+
action: { const: "create_form" },
|
|
802
854
|
accountId: accountIdProperty,
|
|
803
855
|
formInfo: {
|
|
804
856
|
...nonEmptyObjectProperty,
|
|
@@ -821,12 +873,12 @@ export const wecomDocToolSchema = {
|
|
|
821
873
|
additionalProperties: false,
|
|
822
874
|
required: ["action", "oper", "formId", "formInfo"],
|
|
823
875
|
properties: {
|
|
824
|
-
action: { const: "
|
|
876
|
+
action: { const: "modify_form" },
|
|
825
877
|
accountId: accountIdProperty,
|
|
826
878
|
oper: {
|
|
827
879
|
type: "string",
|
|
828
880
|
minLength: 1,
|
|
829
|
-
description: "
|
|
881
|
+
description: "修改操作类型:1=全量修改问题,2=全量修改设置(按企业微信官方 modify_form 定义)",
|
|
830
882
|
},
|
|
831
883
|
formId: formIdProperty,
|
|
832
884
|
formInfo: {
|
|
@@ -876,8 +928,8 @@ export const wecomDocToolSchema = {
|
|
|
876
928
|
requests: {
|
|
877
929
|
type: "array",
|
|
878
930
|
minItems: 1,
|
|
879
|
-
description: "
|
|
880
|
-
items:
|
|
931
|
+
description: "统计请求列表",
|
|
932
|
+
items: formStatisticRequestSchema,
|
|
881
933
|
},
|
|
882
934
|
},
|
|
883
935
|
},
|
|
@@ -1119,9 +1171,16 @@ export const wecomDocToolSchema = {
|
|
|
1119
1171
|
accountId: accountIdProperty,
|
|
1120
1172
|
docId: docIdProperty,
|
|
1121
1173
|
sheetId: { type: "string", description: "子表 ID" },
|
|
1174
|
+
view_id: { type: "string", description: "可选:视图 ID" },
|
|
1122
1175
|
record_ids: { type: "array", items: { type: "string" }, description: "可选:指定记录 ID 列表" },
|
|
1123
|
-
|
|
1124
|
-
|
|
1176
|
+
key_type: { type: "string", enum: ["CELL_VALUE_KEY_TYPE_FIELD_TITLE", "CELL_VALUE_KEY_TYPE_FIELD_ID"], description: "可选:返回记录中单元格的 key 类型" },
|
|
1177
|
+
field_titles: { type: "array", items: { type: "string" }, description: "可选:返回指定列(字段标题),key_type 为 FIELD_TITLE 时有效" },
|
|
1178
|
+
field_ids: { type: "array", items: { type: "string" }, description: "可选:返回指定列(字段 ID),key_type 为 FIELD_ID 时有效" },
|
|
1179
|
+
sort: { type: "array", items: { type: "object" }, description: "可选:对返回记录进行排序" },
|
|
1180
|
+
offset: { type: "integer", description: "可选:偏移量,初始值为 0" },
|
|
1181
|
+
limit: { type: "integer", description: "可选:分页大小,最大 1000" },
|
|
1182
|
+
ver: { type: "integer", description: "可选:版本号" },
|
|
1183
|
+
filter_spec: { type: "object", description: "可选:过滤设置,不支持和 sort 一起使用" },
|
|
1125
1184
|
},
|
|
1126
1185
|
},
|
|
1127
1186
|
{
|
|
@@ -1134,6 +1193,10 @@ export const wecomDocToolSchema = {
|
|
|
1134
1193
|
docId: docIdProperty,
|
|
1135
1194
|
sheetId: { type: "string", description: "子表 ID" },
|
|
1136
1195
|
view_id: { type: "string", description: "可选:视图 ID" },
|
|
1196
|
+
field_ids: { type: "array", items: { type: "string" }, description: "可选:由字段 ID 组成的数组" },
|
|
1197
|
+
field_titles: { type: "array", items: { type: "string" }, description: "可选:由字段标题组成的数组" },
|
|
1198
|
+
offset: { type: "integer", description: "可选:偏移量,初始值为 0" },
|
|
1199
|
+
limit: { type: "integer", maximum: 1000, description: "可选:分页大小,最大 1000" },
|
|
1137
1200
|
},
|
|
1138
1201
|
},
|
|
1139
1202
|
{
|
|
@@ -1145,6 +1208,9 @@ export const wecomDocToolSchema = {
|
|
|
1145
1208
|
accountId: accountIdProperty,
|
|
1146
1209
|
docId: docIdProperty,
|
|
1147
1210
|
sheetId: { type: "string", description: "子表 ID" },
|
|
1211
|
+
view_ids: { type: "array", items: { type: "string" }, description: "可选:需要查询的视图 ID 数组" },
|
|
1212
|
+
offset: { type: "integer", description: "可选:偏移量,初始值为 0" },
|
|
1213
|
+
limit: { type: "integer", description: "可选:分页大小,最大 1000" },
|
|
1148
1214
|
},
|
|
1149
1215
|
},
|
|
1150
1216
|
{
|
|
@@ -1155,6 +1221,8 @@ export const wecomDocToolSchema = {
|
|
|
1155
1221
|
action: { const: "smartsheet_get_sheets" },
|
|
1156
1222
|
accountId: accountIdProperty,
|
|
1157
1223
|
docId: docIdProperty,
|
|
1224
|
+
sheet_id: { type: "string", description: "可选:指定子表 ID 查询" },
|
|
1225
|
+
need_all_type_sheet: { type: "boolean", description: "可选:获取所有类型子表(包含仪表盘和说明页)" },
|
|
1158
1226
|
},
|
|
1159
1227
|
},
|
|
1160
1228
|
{
|
|
@@ -1194,7 +1262,7 @@ export const wecomDocToolSchema = {
|
|
|
1194
1262
|
},
|
|
1195
1263
|
{
|
|
1196
1264
|
type: "object",
|
|
1197
|
-
additionalProperties:
|
|
1265
|
+
additionalProperties: true,
|
|
1198
1266
|
required: ["action", "docId", "sheetId", "view_title", "view_type"],
|
|
1199
1267
|
properties: {
|
|
1200
1268
|
action: { const: "smartsheet_add_view" },
|
|
@@ -1207,13 +1275,26 @@ export const wecomDocToolSchema = {
|
|
|
1207
1275
|
enum: ["VIEW_TYPE_GRID", "VIEW_TYPE_KANBAN", "VIEW_TYPE_GALLERY", "VIEW_TYPE_GANTT", "VIEW_TYPE_CALENDAR"],
|
|
1208
1276
|
description: "视图类型"
|
|
1209
1277
|
},
|
|
1210
|
-
|
|
1211
|
-
|
|
1278
|
+
property: {
|
|
1279
|
+
type: "object",
|
|
1280
|
+
description: "视图属性(ViewProperty),包含 sort_spec, filter_spec, group_spec 等",
|
|
1281
|
+
additionalProperties: true,
|
|
1282
|
+
},
|
|
1283
|
+
property_gantt: {
|
|
1284
|
+
type: "object",
|
|
1285
|
+
description: "甘特视图属性(已废弃,请使用 property)",
|
|
1286
|
+
additionalProperties: true,
|
|
1287
|
+
},
|
|
1288
|
+
property_calendar: {
|
|
1289
|
+
type: "object",
|
|
1290
|
+
description: "日历视图属性(已废弃,请使用 property)",
|
|
1291
|
+
additionalProperties: true,
|
|
1292
|
+
},
|
|
1212
1293
|
},
|
|
1213
1294
|
},
|
|
1214
1295
|
{
|
|
1215
1296
|
type: "object",
|
|
1216
|
-
additionalProperties:
|
|
1297
|
+
additionalProperties: true,
|
|
1217
1298
|
required: ["action", "docId", "sheetId", "view_id"],
|
|
1218
1299
|
properties: {
|
|
1219
1300
|
action: { const: "smartsheet_update_view" },
|
|
@@ -1221,9 +1302,22 @@ export const wecomDocToolSchema = {
|
|
|
1221
1302
|
docId: docIdProperty,
|
|
1222
1303
|
sheetId: sheetIdProperty,
|
|
1223
1304
|
view_id: { type: "string", description: "视图 ID" },
|
|
1224
|
-
view_title: { type: "string", description: "
|
|
1225
|
-
|
|
1226
|
-
|
|
1305
|
+
view_title: { type: "string", description: "视图标题(可选)" },
|
|
1306
|
+
property: {
|
|
1307
|
+
type: "object",
|
|
1308
|
+
description: "视图属性(ViewProperty),包含 sort_spec, filter_spec, group_spec, color_config 等",
|
|
1309
|
+
additionalProperties: true,
|
|
1310
|
+
},
|
|
1311
|
+
property_gantt: {
|
|
1312
|
+
type: "object",
|
|
1313
|
+
description: "甘特视图属性(已废弃,请使用 property)",
|
|
1314
|
+
additionalProperties: true,
|
|
1315
|
+
},
|
|
1316
|
+
property_calendar: {
|
|
1317
|
+
type: "object",
|
|
1318
|
+
description: "日历视图属性(已废弃,请使用 property)",
|
|
1319
|
+
additionalProperties: true,
|
|
1320
|
+
},
|
|
1227
1321
|
},
|
|
1228
1322
|
},
|
|
1229
1323
|
{
|
|
@@ -1394,16 +1488,23 @@ export const wecomDocToolSchema = {
|
|
|
1394
1488
|
},
|
|
1395
1489
|
{
|
|
1396
1490
|
type: "object",
|
|
1397
|
-
additionalProperties:
|
|
1491
|
+
additionalProperties: true,
|
|
1398
1492
|
required: ["action", "docId", "sheetId"],
|
|
1399
1493
|
properties: {
|
|
1400
1494
|
action: { const: "smartsheet_get_records" },
|
|
1401
1495
|
accountId: accountIdProperty,
|
|
1402
1496
|
docId: docIdProperty,
|
|
1403
1497
|
sheetId: { type: "string", description: "子表 ID" },
|
|
1498
|
+
view_id: { type: "string", description: "可选:视图 ID" },
|
|
1404
1499
|
record_ids: { type: "array", items: { type: "string" }, description: "可选:指定记录 ID 列表" },
|
|
1405
|
-
|
|
1406
|
-
|
|
1500
|
+
key_type: { type: "string", enum: ["CELL_VALUE_KEY_TYPE_FIELD_TITLE", "CELL_VALUE_KEY_TYPE_FIELD_ID"], description: "可选:返回记录中单元格的 key 类型" },
|
|
1501
|
+
field_titles: { type: "array", items: { type: "string" }, description: "可选:返回指定列(字段标题)" },
|
|
1502
|
+
field_ids: { type: "array", items: { type: "string" }, description: "可选:返回指定列(字段 ID)" },
|
|
1503
|
+
sort: { type: "array", items: { type: "object" }, description: "可选:对返回记录进行排序" },
|
|
1504
|
+
offset: { type: "integer", description: "可选:偏移量,初始值为 0" },
|
|
1505
|
+
limit: { type: "integer", description: "可选:分页大小,最大 1000" },
|
|
1506
|
+
ver: { type: "integer", description: "可选:版本号" },
|
|
1507
|
+
filter_spec: { type: "object", description: "可选:过滤设置,不支持和 sort 一起使用" },
|
|
1407
1508
|
},
|
|
1408
1509
|
},
|
|
1409
1510
|
{
|
|
@@ -1430,9 +1531,9 @@ export const wecomDocToolSchema = {
|
|
|
1430
1531
|
action: { const: "smartsheet_update_sheet_priv" },
|
|
1431
1532
|
accountId: accountIdProperty,
|
|
1432
1533
|
docId: docIdProperty,
|
|
1433
|
-
type: { type: "integer", enum: [1, 2],
|
|
1434
|
-
rule_id: { type: "integer" },
|
|
1435
|
-
name: { type: "string" },
|
|
1534
|
+
type: { type: "integer", enum: [1, 2], description: "权限规则类型:1-全员权限,2-额外权限" },
|
|
1535
|
+
rule_id: { type: "integer", description: "当 type=2 时必填(额外权限规则 ID)" },
|
|
1536
|
+
name: { type: "string", description: "权限规则名称(仅 type=2 时有效)" },
|
|
1436
1537
|
priv_list: privListSchema,
|
|
1437
1538
|
},
|
|
1438
1539
|
},
|
|
@@ -1498,7 +1599,7 @@ export const wecomDocToolSchema = {
|
|
|
1498
1599
|
properties: {
|
|
1499
1600
|
action: { const: "doc_get_advanced_account_list" },
|
|
1500
1601
|
accountId: accountIdProperty,
|
|
1501
|
-
|
|
1602
|
+
cursor: { type: "integer", description: "分页游标(从 0 开始)" },
|
|
1502
1603
|
limit: { type: "integer" },
|
|
1503
1604
|
},
|
|
1504
1605
|
},
|