@satorijs/adapter-dingtalk 2.0.2 → 2.0.4

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.
Files changed (55) hide show
  1. package/lib/http.d.ts +4 -2
  2. package/lib/index.js +11 -8
  3. package/lib/index.js.map +1 -2
  4. package/package.json +8 -4
  5. package/src/api/.eslintrc.yml +2 -0
  6. package/src/api/alitrip.ts +467 -0
  7. package/src/api/attendance.ts +81 -0
  8. package/src/api/badge.ts +285 -0
  9. package/src/api/blackboard.ts +28 -0
  10. package/src/api/calendar.ts +817 -0
  11. package/src/api/card.ts +215 -0
  12. package/src/api/conference.ts +561 -0
  13. package/src/api/connector.ts +97 -0
  14. package/src/api/contact.ts +56 -0
  15. package/src/api/convFile.ts +166 -0
  16. package/src/api/crm.ts +830 -0
  17. package/src/api/customerService.ts +156 -0
  18. package/src/api/datacenter.ts +672 -0
  19. package/src/api/devicemng.ts +202 -0
  20. package/src/api/diot.ts +19 -0
  21. package/src/api/doc.ts +232 -0
  22. package/src/api/drive.ts +109 -0
  23. package/src/api/edu.ts +30 -0
  24. package/src/api/esign.ts +44 -0
  25. package/src/api/exclusive.ts +372 -0
  26. package/src/api/h3yun.ts +537 -0
  27. package/src/api/hrm.ts +272 -0
  28. package/src/api/im.ts +978 -0
  29. package/src/api/industry.ts +153 -0
  30. package/src/api/jzcrm.ts +304 -0
  31. package/src/api/link.ts +94 -0
  32. package/src/api/live.ts +162 -0
  33. package/src/api/microApp.ts +309 -0
  34. package/src/api/oapi.ts +4083 -0
  35. package/src/api/oauth2.ts +146 -0
  36. package/src/api/pedia.ts +222 -0
  37. package/src/api/project.ts +1519 -0
  38. package/src/api/resident.ts +133 -0
  39. package/src/api/robot.ts +326 -0
  40. package/src/api/rooms.ts +334 -0
  41. package/src/api/serviceGroup.ts +216 -0
  42. package/src/api/storage.ts +1701 -0
  43. package/src/api/swform.ts +94 -0
  44. package/src/api/todo.ts +220 -0
  45. package/src/api/wiki.ts +231 -0
  46. package/src/api/workbench.ts +73 -0
  47. package/src/api/yida.ts +2165 -0
  48. package/src/bot.ts +111 -0
  49. package/src/http.ts +44 -0
  50. package/src/index.ts +9 -0
  51. package/src/internal.ts +47 -0
  52. package/src/message.ts +141 -0
  53. package/src/types/index.ts +140 -0
  54. package/src/utils.ts +51 -0
  55. package/src/ws.ts +55 -0
package/src/api/im.ts ADDED
@@ -0,0 +1,978 @@
1
+ import { Internal } from '../internal'
2
+ // GENERATED CONTENT
3
+
4
+ export interface QuerySceneGroupTemplateRobotQuery {
5
+ /** 机器人的编码。 */
6
+ robotCode?: string
7
+ /** 群会话ID。 */
8
+ openConversationId?: string
9
+ }
10
+
11
+ export interface QuerySceneGroupTemplateRobotResponse {
12
+ success?: unknown
13
+ result?: {
14
+ userId?: string
15
+ unionId?: string
16
+ }
17
+ }
18
+
19
+ export interface BatchQueryGroupMemberParams {
20
+ /** 开放群ID。 */
21
+ openConversationId: string
22
+ /** 群应用编码。 */
23
+ coolAppCode?: string
24
+ /** 本次读取的最大数据记录数量(该入参传入值小于钉钉阈值时返回全部)。 */
25
+ maxResults: number
26
+ /** 标记当前开始读取的位置,置空表示从头开始。 */
27
+ nextToken?: string
28
+ }
29
+
30
+ export interface BatchQueryGroupMemberResponse {
31
+ success?: unknown
32
+ memberUserIds?: string[]
33
+ hasMore?: unknown
34
+ nextToken?: string
35
+ }
36
+
37
+ export interface QueryGroupMuteStatusQuery {
38
+ /** 群成员userId。 */
39
+ userId: string
40
+ /** 开放的会话ID,可通过[创建场景群](https://open.dingtalk.com/document/group/create-a-scene-group-v2)接口获取。 */
41
+ openConversationId: string
42
+ }
43
+
44
+ export interface QueryGroupMuteStatusResponse {
45
+ groupMuteMode: unknown
46
+ userMuteResult: {
47
+ userMuteMode: number
48
+ muteStartTime: number
49
+ muteEndTime: number
50
+ }
51
+ }
52
+
53
+ export interface UpdateMemberBanWordsParams {
54
+ /** 群成员id列表。 */
55
+ userIdList: string[]
56
+ /** 开放群id,可通过[创建场景群](https://open.dingtalk.com/document/group/create-a-scene-group-v2)接口获取。 */
57
+ openConversationId: string
58
+ /** 禁言状态: */
59
+ muteStatus: number
60
+ /** 禁言持续时长,单位:毫秒。 */
61
+ muteDuration: number
62
+ }
63
+
64
+ export interface GetSceneGroupInfoParams {
65
+ /** 群ID: */
66
+ openConversationId: string
67
+ /** 群聊酷应用编码: */
68
+ coolAppCode?: string
69
+ }
70
+
71
+ export interface GetSceneGroupInfoResponse {
72
+ success?: unknown
73
+ openConversationId?: string
74
+ templateId?: string
75
+ title?: string
76
+ ownerUserId?: string
77
+ icon?: string
78
+ groupUrl?: string
79
+ status?: number
80
+ }
81
+
82
+ export interface UpdateGroupSubAdminParams {
83
+ /** 场景群群ID。 */
84
+ openConversationId: string
85
+ /** 用户userid列表。 */
86
+ userIds: string[]
87
+ /** 群成员类型: */
88
+ role: number
89
+ }
90
+
91
+ export interface UpdateGroupSubAdminResponse {
92
+ success: unknown
93
+ }
94
+
95
+ export interface UpdateMemberGroupNickParams {
96
+ /** 场景群群ID,可以调用[创建场景群](https://open.dingtalk.com/document/chatgroup/create-a-scene-group-v2)接口获取。 */
97
+ openConversationId: string
98
+ /** 用户的userid。 */
99
+ userId: string
100
+ /** 用户群昵称。 */
101
+ groupNick: string
102
+ }
103
+
104
+ export interface UpdateMemberGroupNickResponse {
105
+ success?: unknown
106
+ }
107
+
108
+ export interface SendTemplateInteractiveCardParams {
109
+ /** 卡片内容模板ID,响应模板目前有: */
110
+ cardTemplateId: string
111
+ /** 接收卡片的加密群ID,特指多人群会话(非单聊)。 */
112
+ openConversationId?: string
113
+ /** 单聊会话接收者json字符串。 */
114
+ singleChatReceiver?: string
115
+ /** 唯一标识一张卡片的外部ID。 */
116
+ outTrackId: string
117
+ /** 机器人代码。 */
118
+ robotCode: string
119
+ /** 可控制卡片回调的URL。 */
120
+ callbackUrl?: string
121
+ /** 卡片模板,文本内容参数、 */
122
+ cardData: string
123
+ /** 互动卡片发送选项。 */
124
+ sendOptions?: unknown
125
+ }
126
+
127
+ export interface SendTemplateInteractiveCardResponse {
128
+ processQueryKey?: string
129
+ }
130
+
131
+ export interface UpdateInteractiveCardParams {
132
+ /** 唯一标示卡片的外部编码 */
133
+ outTrackId?: string
134
+ /** 卡片数据 */
135
+ cardData?: unknown
136
+ /** 卡片用户私有差异部分数据(如卡片不同人显示不同按钮;key:用户userId;value:用户数据变量) */
137
+ privateData?: unknown
138
+ userIdType?: number
139
+ cardOptions?: unknown
140
+ }
141
+
142
+ export interface UpdateInteractiveCardResponse {
143
+ success?: string
144
+ }
145
+
146
+ export interface SendInteractiveCardParams {
147
+ /** 互动卡片的消息模板ID: */
148
+ cardTemplateId: string
149
+ /** 群ID: */
150
+ openConversationId?: string
151
+ /** 接收人userId列表。 */
152
+ receiverUserIdList?: string[]
153
+ /** 唯一标示卡片的外部编码。 */
154
+ outTrackId: string
155
+ /** 机器人的编码。 */
156
+ robotCode?: string
157
+ /** 发送的会话类型: */
158
+ conversationType: number
159
+ /** 卡片回调时的路由Key,用于查询注册的**callbackUrl**。 */
160
+ callbackRouteKey?: string
161
+ /** 卡片公有数据。 */
162
+ cardData: unknown
163
+ /** 卡片私有数据。 */
164
+ privateData?: unknown
165
+ /** 企业机器人ID,填写企业内部开发-机器人的AppKey。 */
166
+ chatBotId?: string
167
+ /** 用户ID类型: */
168
+ userIdType?: number
169
+ /** 消息@人。格式:`{"key":"value"}`。 */
170
+ atOpenIds?: unknown
171
+ /** 卡片操作。 */
172
+ cardOptions?: unknown
173
+ /** 是否开启卡片纯拉模式。 */
174
+ pullStrategy?: unknown
175
+ }
176
+
177
+ export interface SendInteractiveCardResponse {
178
+ success?: unknown
179
+ result?: {
180
+ processQueryKey: string
181
+ }
182
+ }
183
+
184
+ export interface UpdateRobotInteractiveCardParams {
185
+ /** 唯一标识一张卡片的外部ID(卡片幂等ID,可用于更新或重复发送同一卡片到多个群会话)【备注:同一个outTrackId重复创建,卡片数据不覆盖更新】 */
186
+ cardBizId: string
187
+ /** 卡片模板-文本内容参数(卡片json结构体) */
188
+ cardData?: string
189
+ /** 卡片模板-userId差异用户参数(json结构体) */
190
+ userIdPrivateDataMap?: string
191
+ /** 卡片模板-userId差异用户参数(json结构体) */
192
+ unionIdPrivateDataMap?: string
193
+ /** 互动卡片更新选项 */
194
+ updateOptions?: unknown
195
+ }
196
+
197
+ export interface UpdateRobotInteractiveCardResponse {
198
+ processQueryKey?: string
199
+ }
200
+
201
+ export interface SendRobotInteractiveCardParams {
202
+ /** 卡片搭建平台模板ID,固定值填写为StandardCard。 */
203
+ cardTemplateId: string
204
+ /** 接收卡片的加密群ID,特指多人群会话(非单聊)。 */
205
+ openConversationId?: string
206
+ /** 单聊会话接收者json串。 */
207
+ singleChatReceiver?: string
208
+ /** 唯一标识一张卡片的外部ID,卡片幂等ID,可用于更新或重复发送同一卡片到多个群会话。 */
209
+ cardBizId: string
210
+ /** 机器人代码ID。 */
211
+ robotCode: string
212
+ /** 可控制卡片回调的URL,不填则无需回调。 */
213
+ callbackUrl?: string
214
+ /** 卡片模板文本内容参数,卡片json结构体。 */
215
+ cardData: string
216
+ /** 卡片模板userId差异用户参数,json结构体。 */
217
+ userIdPrivateDataMap?: string
218
+ /** 卡片模板unionId差异用户参数,json结构体。 */
219
+ unionIdPrivateDataMap?: string
220
+ /** 互动卡片发送选项。 */
221
+ sendOptions?: unknown
222
+ /** 是否开启卡片纯拉模式。 */
223
+ pullStrategy?: unknown
224
+ }
225
+
226
+ export interface SendRobotInteractiveCardResponse {
227
+ processQueryKey?: string
228
+ }
229
+
230
+ export interface ChatIdToOpenConversationIdResponse {
231
+ openConversationId: string
232
+ }
233
+
234
+ export interface ChatSubAdminUpdateParams {
235
+ /** 开放群ID。可以调用[创建群会话](https://open.dingtalk.com/document/orgapp-server/create-group-session)接口获取openConversationId参数值。 */
236
+ openConversationId: string
237
+ /** 企业员工userid列表。可以调用[获取用户userid列表](https://open.dingtalk.com/document/orgapp-server/query-the-list-of-department-userids)接口获取userid_list参数值。 */
238
+ userIds: string[]
239
+ /** 设置类型,取值: */
240
+ role: number
241
+ }
242
+
243
+ export interface ChatSubAdminUpdateResponse {
244
+ success: string
245
+ }
246
+
247
+ export interface ImCreateGroupParams {
248
+ /** 群名称,长度限制为1~64个字符。例如:客户群。 */
249
+ groupName: string
250
+ /** 群头像地址,长度限制为1~1024个字符。例如:http://***.png。 */
251
+ groupAvatar?: string
252
+ /** 群模板Id,来源自钉钉客联工作台,通过群模板可以为群配置群机器人、群工具栏、常用语、欢迎语。长度限制为1~32个字符。例如:8d42****nkld。 */
253
+ groupTemplateId: string
254
+ /** 群成员信息。 */
255
+ users: object[]
256
+ /** 操作者在业务系统内的唯一标识。 */
257
+ operatorId?: string
258
+ }
259
+
260
+ export interface ImCreateGroupResponse {
261
+ openConversationId?: string
262
+ conversationId?: string
263
+ appUserIds?: string[]
264
+ userIds?: string[]
265
+ }
266
+
267
+ export interface CreateCoupleGroupParams {
268
+ /** 群模板Id,来源自钉钉客联工作台,通过群模板可以为群配置群机器人、群工具栏、常用语、欢迎语。长度限制为1~32个字符。例如:8d42****nkld。 */
269
+ groupTemplateId: string
270
+ /** 群成员信息。 */
271
+ users?: object[]
272
+ /** 操作者在业务系统内的唯一标识。 */
273
+ operatorId?: string
274
+ }
275
+
276
+ export interface CreateCoupleGroupResponse {
277
+ openConversationId?: string
278
+ conversationId?: string
279
+ appUserIds?: string[]
280
+ userIds?: string[]
281
+ }
282
+
283
+ export interface ChangeGroupOwnerParams {
284
+ /** 群会话openConversationId。 */
285
+ openConversationId: string
286
+ /** 群主Id。 */
287
+ groupOwnerId: string
288
+ /** 群主类型,取值: */
289
+ groupOwnerType: number
290
+ }
291
+
292
+ export interface ChangeGroupOwnerResponse {
293
+ newGroupOwnerId?: string
294
+ newGroupOwnerType?: number
295
+ }
296
+
297
+ export interface DismissGroupConversationParams {
298
+ /** 需要被解散的群会话openConversationId。 */
299
+ openConversationId: string
300
+ }
301
+
302
+ export interface DismissGroupConversationResponse {
303
+ openConversationId?: string
304
+ }
305
+
306
+ export interface SendRobotMessageParams {
307
+ /** 群会话openConversationId,长度限制为1~32个字符。 */
308
+ openConversationIds: string[]
309
+ /** 机器人robotId(robotCode),指定哪个机器人发送消息,获取来源:在客联应用的机器人管理中获取robotCode。 */
310
+ robotCode?: string
311
+ /** 消息类型,取值: */
312
+ msgType: string
313
+ /** 消息体内容,请参考本文消息格式说明。 */
314
+ msgContent: string
315
+ /** 钉内账号userId,长度限制为1~64个字符,例如:1745****8777。 */
316
+ atDingUserId?: string
317
+ /** 钉外账号在业务系统内的唯一标志,长度限制为1~64个字符,例如:1107****2120。 */
318
+ atAppUserId?: string
319
+ /** 是否@群所有人: */
320
+ atAll?: unknown
321
+ }
322
+
323
+ export interface SendRobotMessageResponse {
324
+ success?: unknown
325
+ }
326
+
327
+ export interface CreateStoreGroupConversationParams {
328
+ /** 群名称。 */
329
+ groupName: string
330
+ /** 群头像。 */
331
+ groupAvatar?: string
332
+ /** 群模板Id。 */
333
+ groupTemplateId: string
334
+ /** 钉外用户在业务系统内的标识。 */
335
+ appUserId: string
336
+ /** 外部业务唯一标识(店铺唯一标识)。 */
337
+ businessUniqueKey: string
338
+ /** 钉内用户userId。 */
339
+ userIds?: string[]
340
+ /** 操作者在业务系统内的唯一标识。 */
341
+ operatorId: string
342
+ }
343
+
344
+ export interface CreateStoreGroupConversationResponse {
345
+ openConversationId: string
346
+ conversationId: string
347
+ }
348
+
349
+ export interface CreateCoupleGroupConversationParams {
350
+ /** 群名称。 */
351
+ groupName: string
352
+ /** 群头像链接地址。 */
353
+ groupAvatar?: string
354
+ /** 群模板Id。 */
355
+ groupTemplateId: string
356
+ /** 群主在业务系统内的标识。 */
357
+ groupOwnerId: string
358
+ /** 钉外用户在业务系统内的标识。 */
359
+ appUserId: string
360
+ /** 操作者在业务系统内的唯一标识。 */
361
+ operatorId: string
362
+ }
363
+
364
+ export interface CreateCoupleGroupConversationResponse {
365
+ openConversationId: string
366
+ conversationId: string
367
+ }
368
+
369
+ export interface UpdateGroupNameParams {
370
+ /** 需要修改名称的群会话openConversationId。 */
371
+ openConversationId: string
372
+ /** 新的群名称。 */
373
+ groupName: string
374
+ }
375
+
376
+ export interface UpdateGroupNameResponse {
377
+ newGroupName?: string
378
+ }
379
+
380
+ export interface UpdateGroupAvatarParams {
381
+ /** 需要更新群头像的群会话openConversationId。 */
382
+ openConversationId: string
383
+ /** 新的群头像地址。 */
384
+ groupAvatar: string
385
+ }
386
+
387
+ export interface UpdateGroupAvatarResponse {
388
+ newGroupAvatar: string
389
+ }
390
+
391
+ export interface QuerySingleGroupParams {
392
+ /** 群模版Id。 */
393
+ groupTemplateId: string
394
+ /** 群成员列表,最大值20。 */
395
+ groupMembers: object[]
396
+ }
397
+
398
+ export interface QuerySingleGroupResponse {
399
+ openConversations: {
400
+ openConversationId?: string
401
+ appUserId: string
402
+ userId: string
403
+ }[]
404
+ }
405
+
406
+ export interface QueryGroupMemberQuery {
407
+ /** 群会话openConversationId。 */
408
+ openConversationId: string
409
+ }
410
+
411
+ export interface QueryGroupMemberResponse {
412
+ openConversationId: string
413
+ groupMembers: {
414
+ groupMemberId?: string
415
+ groupMemberName: string
416
+ groupMemberType: number
417
+ groupMemberAvatar?: string
418
+ groupMemberDynamics?: string
419
+ }[]
420
+ }
421
+
422
+ export interface QueryUnReadMessageParams {
423
+ /** 钉外用户在业务系统内的标识。 */
424
+ appUserId: string
425
+ /** 群会话openConversationIds列表,最大值100。 */
426
+ openConversationIds?: string[]
427
+ }
428
+
429
+ export interface QueryUnReadMessageResponse {
430
+ unReadCount: number
431
+ unReadItems?: {
432
+ openConversationId?: string
433
+ unReadCount?: number
434
+ }[]
435
+ }
436
+
437
+ export interface SendMessageParams {
438
+ /** 钉外用户在业务系统内的标识,长度限制为1~64个字符。 */
439
+ senderId: string
440
+ /** 钉内用户userId。 */
441
+ receiverId?: string
442
+ /** 群会话openConversationId。 */
443
+ openConversationId?: string
444
+ /** 消息类型,取值: */
445
+ messageType: string
446
+ /** 消息内容。 */
447
+ message: string
448
+ /** 渠道信息。 */
449
+ sourceInfos?: unknown
450
+ }
451
+
452
+ export interface SendMessageResponse {
453
+ requestId: string
454
+ }
455
+
456
+ export interface RemoveGroupMemberParams {
457
+ /** 群会话openConversationId。 */
458
+ openConversationId: string
459
+ /** 需要被移除的钉外用户在业务系统内的标识列表。 */
460
+ appUserIds?: string[]
461
+ /** 需要被移除的钉内用户的userId列表。 */
462
+ userIds?: string[]
463
+ /** 操作者在业务系统内的唯一标识。 */
464
+ operatorId: string
465
+ }
466
+
467
+ export interface RemoveGroupMemberResponse {
468
+ message: string
469
+ }
470
+
471
+ export interface AddGroupMemberParams {
472
+ /** 群会话openConversationId。 */
473
+ openConversationId: string
474
+ /** 钉外用户在业务系统内的标识列表。 */
475
+ appUserIds?: string[]
476
+ /** 钉内用户userId。 */
477
+ userIds?: string[]
478
+ /** 操作者在业务系统内的唯一标识。 */
479
+ operatorId: string
480
+ }
481
+
482
+ export interface AddGroupMemberResponse {
483
+ appUserIds: string[]
484
+ userIds: string[]
485
+ }
486
+
487
+ export interface CreateGroupConversationParams {
488
+ /** 群名称。 */
489
+ groupName: string
490
+ /** 群头像。 */
491
+ groupAvatar?: string
492
+ /** 群模板Id。 */
493
+ groupTemplateId: string
494
+ /** 群主在业务系统内的唯一标识。 */
495
+ groupOwnerId: string
496
+ /** 群主类型,取值: */
497
+ groupOwnerType?: number
498
+ /** 钉外用户ID列表。 */
499
+ appUserIds?: string[]
500
+ /** 钉内用户userId列表。 */
501
+ userIds?: string[]
502
+ /** 操作者在业务系统内的唯一标识。 */
503
+ operatorId: string
504
+ }
505
+
506
+ export interface CreateGroupConversationResponse {
507
+ openConversationId: string
508
+ conversationId: string
509
+ appUserIds: string[]
510
+ userIds: string[]
511
+ }
512
+
513
+ export interface SendDingMessageParams {
514
+ /** 消息发送者userId,即钉内用户userId。 */
515
+ senderId: string
516
+ /** 钉外用户在业务系统内的唯一标识。 */
517
+ receiverId?: string
518
+ /** 群会话openConversationId。 */
519
+ openConversationId?: string
520
+ /** 消息类型,取值: */
521
+ messageType: string
522
+ /** 消息内容。 */
523
+ message: string
524
+ /** 发送者在钉钉客联应用内的个人授权码。 */
525
+ code: string
526
+ }
527
+
528
+ export interface SendDingMessageResponse {
529
+ requestId: string
530
+ }
531
+
532
+ export interface GetConversationUrlParams {
533
+ /** 钉外用户在业务系统内的标识,长度限制为1~64个字符。 */
534
+ appUserId: string
535
+ /** 钉内用户userId。 */
536
+ userId?: string
537
+ /** 群会话openConversationId。 */
538
+ openConversationId?: string
539
+ /** 渠道code。 */
540
+ channelCode: string
541
+ /** 钉外用户设备信息,用于安全性校验,自定义参数。 */
542
+ sourceCode: string
543
+ }
544
+
545
+ export interface GetConversationUrlResponse {
546
+ url: string
547
+ }
548
+
549
+ export interface CreateInterconnectionParams {
550
+ /** 钉内用户与钉外用户关系。 */
551
+ interconnections: object[]
552
+ }
553
+
554
+ export interface CreateInterconnectionResponse {
555
+ results?: {
556
+ appUserId?: string
557
+ userId?: string
558
+ message?: string
559
+ }[]
560
+ }
561
+
562
+ export interface SendOTOInteractiveCardParams {
563
+ /** 卡片模板ID,可通过[卡片平台](https://open-dev.dingtalk.com/fe/card)创建消息卡片,参见[创建消息模板](https://open.dingtalk.com/document/orgapp/create-message-template)。 */
564
+ cardTemplateId: string
565
+ /** 会话ID。 */
566
+ openConversationId?: string
567
+ /** 用户ID列表。 */
568
+ receiverUserIdList?: string[]
569
+ /** 唯一标示卡片的外部编码。 */
570
+ outTrackId: string
571
+ /** 机器人编码。 */
572
+ robotCode?: string
573
+ /** 卡片回调时的路由Key,用于查询注册的callbackUrl。 */
574
+ callbackRouteKey?: string
575
+ /** 卡片模板内容。 */
576
+ cardData: unknown
577
+ /** 指定用户可见的按钮列表: */
578
+ privateData?: unknown
579
+ /** 用户ID类型: */
580
+ userIdType?: number
581
+ /** 消息@人。格式:`{"key":"value"}`。 */
582
+ atOpenIds?: unknown
583
+ /** 卡片属性。 */
584
+ cardOptions?: unknown
585
+ /** 是否开启卡片纯拉模式: */
586
+ pullStrategy?: unknown
587
+ }
588
+
589
+ export interface SendOTOInteractiveCardResponse {
590
+ success?: unknown
591
+ result?: {
592
+ processQueryKey: string
593
+ }
594
+ }
595
+
596
+ export interface CloseTopboxParams {
597
+ /** 唯一标识一张卡片的外部ID,最大长度64。 */
598
+ outTrackId: string
599
+ /** 会话类型: */
600
+ conversationType: number
601
+ /** 会话id: */
602
+ openConversationId?: string
603
+ /** 用户userId: */
604
+ userId?: string
605
+ /** 用户unionId: */
606
+ unoinId?: string
607
+ /** 机器人编码: */
608
+ robotCode?: string
609
+ /** 酷应用编码: */
610
+ coolAppCode?: string
611
+ /** 群模板id: */
612
+ groupTemplateId?: string
613
+ }
614
+
615
+ export interface CloseTopboxResponse {
616
+ success?: unknown
617
+ }
618
+
619
+ export interface CreateTopboxParams {
620
+ /** 互动卡片的消息模板ID,详情参见[创建消息模板](https://open.dingtalk.com/document/group/create-message-template)后可获取模板ID。 */
621
+ cardTemplateId: string
622
+ /** 唯一标识一张卡片的外部ID,最大长度64。 */
623
+ outTrackId: string
624
+ /** 可控制卡片回调时的路由Key,用于指定特定的callbackUrl,调用[注册互动卡片回调地址](https://open.dingtalk.com/document/group/registration-card-interaction-callback-address-1)接口,获取参数callbackRouteKey。 */
625
+ callbackRouteKey?: string
626
+ /** 卡片数据。 */
627
+ cardData: unknown
628
+ /** 卡片模板userId差异用户参数。 */
629
+ userIdPrivateDataMap?: unknown
630
+ /** 卡片模板unionId差异用户参数。 */
631
+ unionIdPrivateDataMap?: unknown
632
+ /** 卡片设置项。 */
633
+ cardSettings?: unknown
634
+ /** 会话类型: */
635
+ conversationType: number
636
+ /** 会话id: */
637
+ openConversationId?: string
638
+ /** 用户userId: */
639
+ userId?: string
640
+ /** 用户unionId: */
641
+ unoinId?: string
642
+ /** 机器人编码: */
643
+ robotCode?: string
644
+ /** 酷应用编码: */
645
+ coolAppCode?: string
646
+ /** 群模板id: */
647
+ groupTemplateId?: string
648
+ /** 吊顶可见者userId,最多可传100个userId: */
649
+ receiverUserIdList?: string[]
650
+ /** 吊顶可见者unionId,最多可传100个unionId: */
651
+ receiverUnionIdList?: string[]
652
+ /** 吊顶的过期时间,毫秒级时间戳。 */
653
+ expiredTime?: number
654
+ /** 期望吊顶的端,如果有多个用“|”分隔。 例如:ios|mac|android|win表示iOS、MAC、安卓和windows端。 */
655
+ platforms?: string
656
+ }
657
+
658
+ export interface CreateTopboxResponse {
659
+ success?: unknown
660
+ }
661
+
662
+ // funcName: isOldApi
663
+ Internal.define({
664
+ '/im/sceneGroups/templates/robots': {
665
+ GET: { querySceneGroupTemplateRobot: false },
666
+ },
667
+ '/im/sceneGroups/members/batchQuery': {
668
+ POST: { batchQueryGroupMember: false },
669
+ },
670
+ '/im/sceneGroups/muteSettings': { GET: { queryGroupMuteStatus: false } },
671
+ '/im/sceneGroups/muteMembers/set': { POST: { updateMemberBanWords: false } },
672
+ '/im/sceneGroups/query': { POST: { getSceneGroupInfo: false } },
673
+ '/im/sceneGroups/subAdmins': { PUT: { updateGroupSubAdmin: false } },
674
+ '/im/sceneGroups/members/groupNicks': {
675
+ PUT: { updateMemberGroupNick: false },
676
+ },
677
+ '/im/interactiveCards/templates/send': {
678
+ POST: { sendTemplateInteractiveCard: false },
679
+ },
680
+ '/im/interactiveCards': { PUT: { updateInteractiveCard: false } },
681
+ '/im/interactiveCards/send': { POST: { sendInteractiveCard: false } },
682
+ '/im/robots/interactiveCards': { PUT: { updateRobotInteractiveCard: false } },
683
+ '/im/v1.0/robot/interactiveCards/send': {
684
+ POST: { sendRobotInteractiveCard: false },
685
+ },
686
+ '/im/chat/{chatId}/convertToOpenConversationId': {
687
+ POST: { chatIdToOpenConversationId: false },
688
+ },
689
+ '/im/subAdministrators': { POST: { chatSubAdminUpdate: false } },
690
+ '/im/interconnections/groups': { POST: { createGroupConversation: false } },
691
+ '/im/interconnections/couples/groups': { POST: { createCoupleGroup: false } },
692
+ '/im/interconnections/groups/owners': { PUT: { changeGroupOwner: false } },
693
+ '/im/interconnections/groups/dismiss': {
694
+ POST: { dismissGroupConversation: false },
695
+ },
696
+ '/im/interconnections/robotMessages/send': {
697
+ POST: { sendRobotMessage: false },
698
+ },
699
+ '/im/interconnections/storeGroups': {
700
+ POST: { createStoreGroupConversation: false },
701
+ },
702
+ '/im/interconnections/coupleGroups': {
703
+ POST: { createCoupleGroupConversation: false },
704
+ },
705
+ '/im/interconnections/groups/names': { PUT: { updateGroupName: false } },
706
+ '/im/interconnections/groups/avatars': { PUT: { updateGroupAvatar: false } },
707
+ '/im/interconnections/doubleGroups/query': {
708
+ POST: { querySingleGroup: false },
709
+ },
710
+ '/im/interconnections/conversations/members': {
711
+ GET: { queryGroupMember: false },
712
+ },
713
+ '/im/interconnections/unReadMsgs/query': {
714
+ POST: { queryUnReadMessage: false },
715
+ },
716
+ '/im/interconnections/messages/send': { POST: { sendMessage: false } },
717
+ '/im/interconnections/groups/members/remove': {
718
+ POST: { removeGroupMember: false },
719
+ },
720
+ '/im/interconnections/groups/members': { POST: { addGroupMember: false } },
721
+ '/im/interconnections/dingMessages/send': {
722
+ POST: { sendDingMessage: false },
723
+ },
724
+ '/im/conversations/urls': { POST: { getConversationUrl: false } },
725
+ '/im/interconnections': { POST: { createInterconnection: false } },
726
+ '/im/privateChat/interactiveCards/send': {
727
+ POST: { sendOTOInteractiveCard: false },
728
+ },
729
+ '/im/topBoxes/close': { POST: { closeTopbox: false } },
730
+ '/im/topBoxes': { POST: { createTopbox: false } },
731
+ })
732
+
733
+ declare module '../internal' {
734
+ interface Internal {
735
+ /**
736
+ * 查询群内群模板机器人
737
+ * @see https://open.dingtalk.com/document/isvapp/query-intra-group-template-robot
738
+ */
739
+ querySceneGroupTemplateRobot(
740
+ query: QuerySceneGroupTemplateRobotQuery,
741
+ ): Promise<QuerySceneGroupTemplateRobotResponse>
742
+ /**
743
+ * 查询群成员
744
+ * @see https://open.dingtalk.com/document/orgapp/query-group-members
745
+ */
746
+ batchQueryGroupMember(
747
+ params: BatchQueryGroupMemberParams,
748
+ ): Promise<BatchQueryGroupMemberResponse>
749
+ /**
750
+ * 查询群禁言状态
751
+ * @see https://open.dingtalk.com/document/orgapp/query-group-silence-status
752
+ */
753
+ queryGroupMuteStatus(
754
+ query: QueryGroupMuteStatusQuery,
755
+ ): Promise<QueryGroupMuteStatusResponse>
756
+ /**
757
+ * 设置群成员禁言状态
758
+ * @see https://open.dingtalk.com/document/orgapp/set-group-members-access-control
759
+ */
760
+ updateMemberBanWords(params: UpdateMemberBanWordsParams): Promise<void>
761
+ /**
762
+ * 查询群简要信息
763
+ * @see https://open.dingtalk.com/document/isvapp/query-group-brief-information
764
+ */
765
+ getSceneGroupInfo(
766
+ params: GetSceneGroupInfoParams,
767
+ ): Promise<GetSceneGroupInfoResponse>
768
+ /**
769
+ * 更新群管理员
770
+ * @see https://open.dingtalk.com/document/isvapp/update-group-administrator
771
+ */
772
+ updateGroupSubAdmin(
773
+ params: UpdateGroupSubAdminParams,
774
+ ): Promise<UpdateGroupSubAdminResponse>
775
+ /**
776
+ * 更新群成员的群昵称
777
+ * @see https://open.dingtalk.com/document/isvapp/update-group-nicknames-for-group-members
778
+ */
779
+ updateMemberGroupNick(
780
+ params: UpdateMemberGroupNickParams,
781
+ ): Promise<UpdateMemberGroupNickResponse>
782
+ /**
783
+ * 发送模板响应式可交互式卡片
784
+ * @see https://open.dingtalk.com/document/orgapp/send-lightweight-interactive-cards
785
+ */
786
+ sendTemplateInteractiveCard(
787
+ params: SendTemplateInteractiveCardParams,
788
+ ): Promise<SendTemplateInteractiveCardResponse>
789
+ /**
790
+ * 更新钉钉互动卡片
791
+ * @see https://open.dingtalk.com/document/orgapp/update-dingtalk-interactive-cards-1
792
+ */
793
+ updateInteractiveCard(
794
+ params: UpdateInteractiveCardParams,
795
+ ): Promise<UpdateInteractiveCardResponse>
796
+ /**
797
+ * 发送可交互式动态卡片
798
+ * @see https://open.dingtalk.com/document/orgapp/send-interactive-dynamic-cards-1
799
+ */
800
+ sendInteractiveCard(
801
+ params: SendInteractiveCardParams,
802
+ ): Promise<SendInteractiveCardResponse>
803
+ /**
804
+ * 更新机器人发送互动卡片
805
+ * @see https://open.dingtalk.com/document/orgapp/update-the-robot-to-send-interactive-cards
806
+ */
807
+ updateRobotInteractiveCard(
808
+ params: UpdateRobotInteractiveCardParams,
809
+ ): Promise<UpdateRobotInteractiveCardResponse>
810
+ /**
811
+ * 机器人发送互动卡片(普通版)
812
+ * @see https://open.dingtalk.com/document/orgapp/robots-send-interactive-cards
813
+ */
814
+ sendRobotInteractiveCard(
815
+ params: SendRobotInteractiveCardParams,
816
+ ): Promise<SendRobotInteractiveCardResponse>
817
+ /**
818
+ * 获取群会话的OpenConversationId
819
+ * @see https://open.dingtalk.com/document/orgapp/obtain-group-openconversationid
820
+ */
821
+ chatIdToOpenConversationId(
822
+ chatId: string,
823
+ ): Promise<ChatIdToOpenConversationIdResponse>
824
+ /**
825
+ * 设置群管理员
826
+ * @see https://open.dingtalk.com/document/orgapp/batch-setup-group-administrator
827
+ */
828
+ chatSubAdminUpdate(
829
+ params: ChatSubAdminUpdateParams,
830
+ ): Promise<ChatSubAdminUpdateResponse>
831
+ /**
832
+ * 创建普通群
833
+ * @see https://open.dingtalk.com/document/app/create-common-group-new-version
834
+ */
835
+ imCreateGroup(params: ImCreateGroupParams): Promise<ImCreateGroupResponse>
836
+ /**
837
+ * 创建两人群
838
+ * @see https://open.dingtalk.com/document/app/creating-two-groups-of-people
839
+ */
840
+ createCoupleGroup(
841
+ params: CreateCoupleGroupParams,
842
+ ): Promise<CreateCoupleGroupResponse>
843
+ /**
844
+ * 更换群主
845
+ * @see https://open.dingtalk.com/document/isvapp/change-group-owner
846
+ */
847
+ changeGroupOwner(
848
+ params: ChangeGroupOwnerParams,
849
+ ): Promise<ChangeGroupOwnerResponse>
850
+ /**
851
+ * 解散互通群
852
+ * @see https://open.dingtalk.com/document/isvapp/disband-bc-interconnection-group
853
+ */
854
+ dismissGroupConversation(
855
+ params: DismissGroupConversationParams,
856
+ ): Promise<DismissGroupConversationResponse>
857
+ /**
858
+ * 机器人发送消息
859
+ * @see https://open.dingtalk.com/document/app/group-robots-send-messages
860
+ */
861
+ sendRobotMessage(
862
+ params: SendRobotMessageParams,
863
+ ): Promise<SendRobotMessageResponse>
864
+ /**
865
+ * 创建店铺群
866
+ * @see https://open.dingtalk.com/document/isvapp/create-a-store-group
867
+ */
868
+ createStoreGroupConversation(
869
+ params: CreateStoreGroupConversationParams,
870
+ ): Promise<CreateStoreGroupConversationResponse>
871
+ /**
872
+ * 创建钉外两人群
873
+ * @see https://open.dingtalk.com/document/isvapp/create-two-people-outside-the-nail
874
+ */
875
+ createCoupleGroupConversation(
876
+ params: CreateCoupleGroupConversationParams,
877
+ ): Promise<CreateCoupleGroupConversationResponse>
878
+ /**
879
+ * 修改群名称
880
+ * @see https://open.dingtalk.com/document/isvapp/modify-the-group-name
881
+ */
882
+ updateGroupName(
883
+ params: UpdateGroupNameParams,
884
+ ): Promise<UpdateGroupNameResponse>
885
+ /**
886
+ * 修改群头像
887
+ * @see https://open.dingtalk.com/document/isvapp/modify-the-avatar-of-a-communication-group
888
+ */
889
+ updateGroupAvatar(
890
+ params: UpdateGroupAvatarParams,
891
+ ): Promise<UpdateGroupAvatarResponse>
892
+ /**
893
+ * 批量查询群信息
894
+ * @see https://open.dingtalk.com/document/isvapp/batch-query-cross-nail-two-group-list
895
+ */
896
+ querySingleGroup(
897
+ params: QuerySingleGroupParams,
898
+ ): Promise<QuerySingleGroupResponse>
899
+ /**
900
+ * 查询群成员列表
901
+ * @see https://open.dingtalk.com/document/isvapp/query-the-group-member-list
902
+ */
903
+ queryGroupMember(
904
+ query: QueryGroupMemberQuery,
905
+ ): Promise<QueryGroupMemberResponse>
906
+ /**
907
+ * 批量查询未读消息数
908
+ * @see https://open.dingtalk.com/document/isvapp/query-the-number-of-unread-messages-for-users-outside-of
909
+ */
910
+ queryUnReadMessage(
911
+ params: QueryUnReadMessageParams,
912
+ ): Promise<QueryUnReadMessageResponse>
913
+ /**
914
+ * 发送ToB消息
915
+ * @see https://open.dingtalk.com/document/isvapp/a-user-outside-the-dingtalk-sends-a-message-to-the
916
+ */
917
+ sendMessage(params: SendMessageParams): Promise<SendMessageResponse>
918
+ /**
919
+ * 移除群成员
920
+ * @see https://open.dingtalk.com/document/isvapp/remove-a-connected-group-member
921
+ */
922
+ removeGroupMember(
923
+ params: RemoveGroupMemberParams,
924
+ ): Promise<RemoveGroupMemberResponse>
925
+ /**
926
+ * 添加群成员
927
+ * @see https://open.dingtalk.com/document/isvapp/add-group-members
928
+ */
929
+ addGroupMember(
930
+ params: AddGroupMemberParams,
931
+ ): Promise<AddGroupMemberResponse>
932
+ /**
933
+ * 创建互通群(支持普通互通群、跨钉两人群)
934
+ * @see https://open.dingtalk.com/document/isvapp/create-a-common-group-or-cross-nail-group
935
+ */
936
+ createGroupConversation(
937
+ params: CreateGroupConversationParams,
938
+ ): Promise<CreateGroupConversationResponse>
939
+ /**
940
+ * 发送ToC消息
941
+ * @see https://open.dingtalk.com/document/isvapp/dingtalk-users-send-messages-to-the-group-or-dingtalk-users
942
+ */
943
+ sendDingMessage(
944
+ params: SendDingMessageParams,
945
+ ): Promise<SendDingMessageResponse>
946
+ /**
947
+ * 创建ToB会话地址
948
+ * @see https://open.dingtalk.com/document/isvapp/obtain-the-session-address
949
+ */
950
+ getConversationUrl(
951
+ params: GetConversationUrlParams,
952
+ ): Promise<GetConversationUrlResponse>
953
+ /**
954
+ * 创建钉外账号
955
+ * @see https://open.dingtalk.com/document/isvapp/create-bc-account-association
956
+ */
957
+ createInterconnection(
958
+ params: CreateInterconnectionParams,
959
+ ): Promise<CreateInterconnectionResponse>
960
+ /**
961
+ * 人与人会话中机器人发送互动卡片
962
+ * @see https://open.dingtalk.com/document/orgapp/send-dingtalk-interactive-cards-to-person-to-person-chat-sessions
963
+ */
964
+ sendOTOInteractiveCard(
965
+ params: SendOTOInteractiveCardParams,
966
+ ): Promise<SendOTOInteractiveCardResponse>
967
+ /**
968
+ * 关闭互动卡片吊顶
969
+ * @see https://open.dingtalk.com/document/orgapp/close-interactive-card-ceiling
970
+ */
971
+ closeTopbox(params: CloseTopboxParams): Promise<CloseTopboxResponse>
972
+ /**
973
+ * 创建并开启互动卡片吊顶
974
+ * @see https://open.dingtalk.com/document/orgapp/create-and-open-an-interactive-card-ceiling
975
+ */
976
+ createTopbox(params: CreateTopboxParams): Promise<CreateTopboxResponse>
977
+ }
978
+ }