@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
@@ -0,0 +1,133 @@
1
+ import { Internal } from '../internal'
2
+ // GENERATED CONTENT
3
+
4
+ export interface AddPointQuery {
5
+ /** 是否查询全员圈积分规则,取值: */
6
+ isCircle: unknown
7
+ /** 加减积分的唯一幂等标志,由调用方自己生成。 */
8
+ uuid: string
9
+ /** 用户userid,可以调用[通过免登码获取用户信息](https://open.dingtalk.com/document/app/obtain-the-userid-of-a-user-by-using-the-log-free)接口获取。 */
10
+ userId: string
11
+ /** 规则代码。可以为空。 */
12
+ ruleCode?: string
13
+ /** 规则名字。 */
14
+ ruleName: string
15
+ /** 增加积分的时间戳,单位毫秒。 */
16
+ actionTime?: number
17
+ /** 本次增加积分。 */
18
+ score: number
19
+ }
20
+
21
+ export interface PagePointHistoryQuery {
22
+ /** 是否查询全员圈积分记录,否则查询积分管理积分记录,取值: */
23
+ isCircle: unknown
24
+ /** 用户userid。 */
25
+ userId?: string
26
+ /** 分页游标,第一次请求传0,后续取值是上一次调用此API返回的nextToken参数。 */
27
+ nextToken: number
28
+ /** 本次读取的最大数据记录数量,最大值20。 */
29
+ maxResults: number
30
+ /** 起始时间Unix时间戳,单位毫秒。 */
31
+ startTime?: number
32
+ /** 结束时间Unix时间戳(不包含),单位毫秒。 */
33
+ endTime?: number
34
+ }
35
+
36
+ export interface PagePointHistoryResponse {
37
+ pointRecordList: {
38
+ userId: string
39
+ score: number
40
+ createAt: number
41
+ uuid: string
42
+ ruleCode?: string
43
+ ruleName: string
44
+ }[]
45
+ hasMore: unknown
46
+ nextToken: number
47
+ totalCount: number
48
+ }
49
+
50
+ export interface ListPointRulesQuery {
51
+ /** 是否查询全员圈积分规则,否则查询积分管理积分规则,取值: */
52
+ isCircle: unknown
53
+ }
54
+
55
+ export interface ListPointRulesResponse {
56
+ pointRuleList: {
57
+ score: number
58
+ dayLimitTimes: number
59
+ status: number
60
+ ruleCode?: string
61
+ ruleName: string
62
+ extension: string
63
+ groupId: number
64
+ orderId: number
65
+ }[]
66
+ }
67
+
68
+ export interface ListIndustryRoleUsersQuery {
69
+ /** 行业角色编码,有以下取值: */
70
+ tagCode: string
71
+ }
72
+
73
+ export interface ListIndustryRoleUsersResponse {
74
+ userIdList?: string[]
75
+ }
76
+
77
+ export interface ListUserIndustryRolesQuery {
78
+ /** 用户userId。 */
79
+ userId: string
80
+ }
81
+
82
+ export interface ListUserIndustryRolesResponse {
83
+ roleList?: {
84
+ roleId?: number
85
+ roleName?: string
86
+ tagCode?: string
87
+ }[]
88
+ }
89
+
90
+ // funcName: isOldApi
91
+ Internal.define({
92
+ '/resident/points': { POST: { addPoint: false } },
93
+ '/resident/points/records': { GET: { pagePointHistory: false } },
94
+ '/resident/points/rules': { GET: { listPointRules: false } },
95
+ '/resident/industryRoles/users': { GET: { listIndustryRoleUsers: false } },
96
+ '/resident/users/industryRoles': { GET: { listUserIndustryRoles: false } },
97
+ })
98
+
99
+ declare module '../internal' {
100
+ interface Internal {
101
+ /**
102
+ * 增加或减少居民积分
103
+ * @see https://open.dingtalk.com/document/isvapp/increase-or-decrease-resident-points
104
+ */
105
+ addPoint(query: AddPointQuery): Promise<void>
106
+ /**
107
+ * 查询数字区县居民积分流水
108
+ * @see https://open.dingtalk.com/document/isvapp/query-the-integral-flow-records-by-page
109
+ */
110
+ pagePointHistory(
111
+ query: PagePointHistoryQuery,
112
+ ): Promise<PagePointHistoryResponse>
113
+ /**
114
+ * 查询组织维度配置的的积分规则
115
+ * @see https://open.dingtalk.com/document/isvapp/query-all-credit-rules
116
+ */
117
+ listPointRules(query: ListPointRulesQuery): Promise<ListPointRulesResponse>
118
+ /**
119
+ * 获取行业角色下的用户列表
120
+ * @see https://open.dingtalk.com/document/isvapp/obtains-a-list-of-users-under-an-industry-role
121
+ */
122
+ listIndustryRoleUsers(
123
+ query: ListIndustryRoleUsersQuery,
124
+ ): Promise<ListIndustryRoleUsersResponse>
125
+ /**
126
+ * 获取用户所在的行业角色信息
127
+ * @see https://open.dingtalk.com/document/isvapp/obtains-information-about-the-industry-role-to-which-the-user
128
+ */
129
+ listUserIndustryRoles(
130
+ query: ListUserIndustryRolesQuery,
131
+ ): Promise<ListUserIndustryRolesResponse>
132
+ }
133
+ }
@@ -0,0 +1,326 @@
1
+ import { Internal } from '../internal'
2
+ // GENERATED CONTENT
3
+
4
+ export interface GetBotListInGroupParams {
5
+ /** 群ID: */
6
+ openConversationId: string
7
+ }
8
+
9
+ export interface GetBotListInGroupResponse {
10
+ chatbotInstanceVOList?: {
11
+ robotCode?: string
12
+ name?: string
13
+ downloadIconURL?: string
14
+ openRobotType?: number
15
+ }[]
16
+ }
17
+
18
+ export interface RobotMessageFileDownloadParams {
19
+ /** 用户向机器人发送文件消息后,机器人回调给开发者消息中的下载码。 */
20
+ downloadCode: string
21
+ /** 机器人的编码: */
22
+ robotCode: string
23
+ }
24
+
25
+ export interface RobotMessageFileDownloadResponse {
26
+ downloadUrl: string
27
+ }
28
+
29
+ export interface ClearRobotPluginParams {
30
+ /** 机器人的编码,参见[机器人名词表-robotCode](https://open.dingtalk.com/document/orgapp/robot-overview#title-ed9-e7b-epe)内容,获取`robotCode`。 */
31
+ robotCode: string
32
+ }
33
+
34
+ export interface ClearRobotPluginResponse {
35
+ result?: unknown
36
+ }
37
+
38
+ export interface SetRobotPluginParams {
39
+ /** 机器人的编码,参见[机器人名词表-robotCode](https://open.dingtalk.com/document/orgapp/robot-overview#title-ed9-e7b-epe)内容,获取`robotCode`。 */
40
+ robotCode?: string
41
+ /** 插件信息。 */
42
+ pluginInfoList?: object[]
43
+ }
44
+
45
+ export interface SetRobotPluginResponse {
46
+ result?: unknown
47
+ }
48
+
49
+ export interface QueryRobotPluginParams {
50
+ /** 机器人的编码,参见[机器人名词表-robotCode](https://open.dingtalk.com/document/orgapp/robot-overview#title-ed9-e7b-epe)内容,获取`robotCode`。 */
51
+ robotCode: string
52
+ }
53
+
54
+ export interface QueryRobotPluginResponse {
55
+ pluginInfoList?: {
56
+ name?: string
57
+ icon?: string
58
+ pcUrl?: string
59
+ mobileUrl?: string
60
+ }[]
61
+ }
62
+
63
+ export interface OrgGroupRecallParams {
64
+ /** 开放的群ID。 */
65
+ openConversationId: string
66
+ /** 机器人的编码。 */
67
+ robotCode: string
68
+ processQueryKeys: string[]
69
+ }
70
+
71
+ export interface OrgGroupRecallResponse {
72
+ successResult: string[]
73
+ failedResult: unknown
74
+ }
75
+
76
+ export interface OrgGroupQueryParams {
77
+ /** 开放的群id。 */
78
+ openConversationId?: string
79
+ /** 机器人的robotCode。 */
80
+ robotCode?: string
81
+ /** 机器人在群内安装后,群内机器人的webhook属性中中的access_token部分的值。 */
82
+ token?: string
83
+ /** 发送消息返回的加密消息id。 */
84
+ processQueryKey: string
85
+ /** 分页查询每页的数量。 */
86
+ maxResults?: number
87
+ /** 一次查询后返回的加密的分页凭证,首次查询不填。 */
88
+ nextToken?: string
89
+ }
90
+
91
+ export interface OrgGroupQueryResponse {
92
+ sendStatus?: string
93
+ readUserIds?: string[]
94
+ nextToken?: string
95
+ hasMore?: unknown
96
+ }
97
+
98
+ export interface OrgGroupSendParams {
99
+ /** 消息模板参数。 */
100
+ msgParam: string
101
+ /** 消息模板key。 */
102
+ msgKey: string
103
+ /** 群id: */
104
+ openConversationId?: string
105
+ /** 机器人的编码。 */
106
+ robotCode?: string
107
+ /** 机器人在群内安装后,群内机器人的webhook属性中中的`access_token`的参数值。 */
108
+ token?: string
109
+ /** 群聊酷应用编码。 */
110
+ coolAppCode?: string
111
+ }
112
+
113
+ export interface OrgGroupSendResponse {
114
+ processQueryKey: string
115
+ }
116
+
117
+ export interface BatchRecallOTOParams {
118
+ /** 机器人的编码。 */
119
+ robotCode: string
120
+ processQueryKeys: string[]
121
+ }
122
+
123
+ export interface BatchRecallOTOResponse {
124
+ successResult?: string[]
125
+ failedResult?: unknown
126
+ }
127
+
128
+ export interface BatchOTOQueryQuery {
129
+ /** - 企业内部开发-机器人,此处为企业自建应用的appKey。 */
130
+ robotCode: string
131
+ /** 加密的消息id,可通过调用[发送批量单聊信息](https://open.dingtalk.com/document/group/chatbots-send-one-on-one-chat-messages-in-batches)接口获取。 */
132
+ processQueryKey: string
133
+ }
134
+
135
+ export interface BatchOTOQueryResponse {
136
+ sendStatus?: string
137
+ messageReadInfoList?: {
138
+ name: string
139
+ userId: string
140
+ readStatus: string
141
+ readTimestamp: number
142
+ }[]
143
+ }
144
+
145
+ export interface BatchSendOTOParams {
146
+ /** 机器人的编码。 */
147
+ robotCode: string
148
+ /** 用户的userid。 */
149
+ userIds: string[]
150
+ /** 消息的msgKey。 */
151
+ msgKey: string
152
+ /** 消息体。 */
153
+ msgParam: string
154
+ }
155
+
156
+ export interface BatchSendOTOResponse {
157
+ processQueryKey?: string
158
+ invalidStaffIdList?: string[]
159
+ flowControlledStaffIdList?: string[]
160
+ }
161
+
162
+ export interface PrivateChatSendParams {
163
+ /** 消息体。 */
164
+ msgParam: string
165
+ /** 消息类型的key。 */
166
+ msgKey: string
167
+ /** 会话ID。 */
168
+ openConversationId?: string
169
+ /** 机器人编码。 */
170
+ robotCode?: string
171
+ /** 酷应用的code。 */
172
+ coolAppCode?: string
173
+ }
174
+
175
+ export interface PrivateChatSendResponse {
176
+ processQueryKey: string
177
+ }
178
+
179
+ export interface PrivateChatQueryParams {
180
+ /** 人与人单聊开放会话ID: */
181
+ openConversationId?: string
182
+ /** 机器人的编码,参见[机器人名词表-robotCode](https://open.dingtalk.com/document/group/robot-overview)内容,获取`robotCode`。 */
183
+ robotCode?: string
184
+ /** 发送消息返回的加密消息id */
185
+ processQueryKey: string
186
+ /** 分页查询每页的数量 */
187
+ maxResults?: number
188
+ /** 一次查询后返回的加密的分页凭证,首次查询不填 */
189
+ nextToken?: string
190
+ }
191
+
192
+ export interface PrivateChatQueryResponse {
193
+ sendStatus?: string
194
+ readUserIds?: string[]
195
+ nextToken?: string
196
+ hasMore?: unknown
197
+ }
198
+
199
+ export interface BatchRecallPrivateChatParams {
200
+ /** 人与人单聊开放会话ID: */
201
+ openConversationId: string
202
+ /** 机器人的编码,参见[机器人名词表-robotCode](https://open.dingtalk.com/document/group/robot-overview)内容,获取`robotCode`。 */
203
+ robotCode: string
204
+ /** 消息id */
205
+ processQueryKeys: string[]
206
+ }
207
+
208
+ export interface BatchRecallPrivateChatResponse {
209
+ successResult: string[]
210
+ failedResult: unknown
211
+ }
212
+
213
+ // funcName: isOldApi
214
+ Internal.define({
215
+ '/robot/groups/robots/query': { POST: { getBotListInGroup: false } },
216
+ '/robot/messageFiles/download': { POST: { robotMessageFileDownload: false } },
217
+ '/robot/plugins/clear': { POST: { clearRobotPlugin: false } },
218
+ '/robot/plugins/set': { POST: { setRobotPlugin: false } },
219
+ '/robot/plugins/query': { POST: { queryRobotPlugin: false } },
220
+ '/robot/groupMessages/recall': { POST: { orgGroupRecall: false } },
221
+ '/robot/groupMessages/query': { POST: { orgGroupQuery: false } },
222
+ '/robot/groupMessages/send': { POST: { orgGroupSend: false } },
223
+ '/robot/otoMessages/batchRecall': { POST: { batchRecallOTO: false } },
224
+ '/robot/oToMessages/readStatus': { GET: { batchOTOQuery: false } },
225
+ '/robot/oToMessages/batchSend': { POST: { batchSendOTO: false } },
226
+ '/robot/privateChatMessages/send': { POST: { privateChatSend: false } },
227
+ '/robot/privateChatMessages/query': { POST: { privateChatQuery: false } },
228
+ '/robot/privateChatMessages/batchRecall': {
229
+ POST: { batchRecallPrivateChat: false },
230
+ },
231
+ })
232
+
233
+ declare module '../internal' {
234
+ interface Internal {
235
+ /**
236
+ * 查询群内的机器人列表
237
+ * @see https://open.dingtalk.com/document/orgapp/obtain-the-list-of-robots-in-the-group
238
+ */
239
+ getBotListInGroup(
240
+ params: GetBotListInGroupParams,
241
+ ): Promise<GetBotListInGroupResponse>
242
+ /**
243
+ * 获取机器人消息中文件下载链接
244
+ * @see https://open.dingtalk.com/document/isvapp/download-the-file-content-of-the-robot-receiving-message
245
+ */
246
+ robotMessageFileDownload(
247
+ params: RobotMessageFileDownloadParams,
248
+ ): Promise<RobotMessageFileDownloadResponse>
249
+ /**
250
+ * 清空单聊机器人快捷入口
251
+ * @see https://open.dingtalk.com/document/orgapp/clear-single-chat-robot-quick-entry
252
+ */
253
+ clearRobotPlugin(
254
+ params: ClearRobotPluginParams,
255
+ ): Promise<ClearRobotPluginResponse>
256
+ /**
257
+ * 设置单聊机器人快捷入口
258
+ * @see https://open.dingtalk.com/document/orgapp/set-robot-quick-entrance
259
+ */
260
+ setRobotPlugin(
261
+ params: SetRobotPluginParams,
262
+ ): Promise<SetRobotPluginResponse>
263
+ /**
264
+ * 查询单聊机器人快捷入口
265
+ * @see https://open.dingtalk.com/document/orgapp/quick-entrance-of-inquiry-single-chat-robot
266
+ */
267
+ queryRobotPlugin(
268
+ params: QueryRobotPluginParams,
269
+ ): Promise<QueryRobotPluginResponse>
270
+ /**
271
+ * 企业机器人撤回内部群消息
272
+ * @see https://open.dingtalk.com/document/orgapp/enterprise-chatbot-withdraws-internal-group-messages
273
+ */
274
+ orgGroupRecall(
275
+ params: OrgGroupRecallParams,
276
+ ): Promise<OrgGroupRecallResponse>
277
+ /**
278
+ * 查询企业机器人群聊消息用户已读状态
279
+ * @see https://open.dingtalk.com/document/orgapp/chatbot-queries-the-read-status-of-a-message
280
+ */
281
+ orgGroupQuery(params: OrgGroupQueryParams): Promise<OrgGroupQueryResponse>
282
+ /**
283
+ * 机器人发送群聊消息
284
+ * @see https://open.dingtalk.com/document/orgapp/the-robot-sends-a-group-message
285
+ */
286
+ orgGroupSend(params: OrgGroupSendParams): Promise<OrgGroupSendResponse>
287
+ /**
288
+ * 批量撤回人与机器人会话中机器人消息
289
+ * @see https://open.dingtalk.com/document/orgapp/batch-message-recall-chat
290
+ */
291
+ batchRecallOTO(
292
+ params: BatchRecallOTOParams,
293
+ ): Promise<BatchRecallOTOResponse>
294
+ /**
295
+ * 批量查询人与机器人会话机器人消息是否已读
296
+ * @see https://open.dingtalk.com/document/orgapp/chatbot-batch-query-the-read-status-of-messages
297
+ */
298
+ batchOTOQuery(query: BatchOTOQueryQuery): Promise<BatchOTOQueryResponse>
299
+ /**
300
+ * 批量发送人与机器人会话中机器人消息
301
+ * @see https://open.dingtalk.com/document/orgapp/chatbots-send-one-on-one-chat-messages-in-batches
302
+ */
303
+ batchSendOTO(params: BatchSendOTOParams): Promise<BatchSendOTOResponse>
304
+ /**
305
+ * 人与人会话中机器人发送普通消息
306
+ * @see https://open.dingtalk.com/document/orgapp/the-robot-sends-ordinary-messages-in-a-person-to-person-conversation
307
+ */
308
+ privateChatSend(
309
+ params: PrivateChatSendParams,
310
+ ): Promise<PrivateChatSendResponse>
311
+ /**
312
+ * 查询人与人会话中机器人已读消息
313
+ * @see https://open.dingtalk.com/document/orgapp/query-the-read-list-of-robot-messages-in-person-to-person-conversations
314
+ */
315
+ privateChatQuery(
316
+ params: PrivateChatQueryParams,
317
+ ): Promise<PrivateChatQueryResponse>
318
+ /**
319
+ * 批量撤回人与人会话中机器人消息
320
+ * @see https://open.dingtalk.com/document/orgapp/batch-withdrawal-of-single-chat-robot-messages-in-person-to-person-conversations
321
+ */
322
+ batchRecallPrivateChat(
323
+ params: BatchRecallPrivateChatParams,
324
+ ): Promise<BatchRecallPrivateChatResponse>
325
+ }
326
+ }