@satorijs/adapter-dingtalk 2.0.3 → 2.0.5

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 (56) hide show
  1. package/lib/bot.d.ts +1 -1
  2. package/lib/http.d.ts +3 -2
  3. package/lib/index.js +35 -14
  4. package/lib/index.js.map +2 -3
  5. package/package.json +8 -4
  6. package/src/api/.eslintrc.yml +2 -0
  7. package/src/api/alitrip.ts +467 -0
  8. package/src/api/attendance.ts +81 -0
  9. package/src/api/badge.ts +285 -0
  10. package/src/api/blackboard.ts +28 -0
  11. package/src/api/calendar.ts +817 -0
  12. package/src/api/card.ts +215 -0
  13. package/src/api/conference.ts +561 -0
  14. package/src/api/connector.ts +97 -0
  15. package/src/api/contact.ts +56 -0
  16. package/src/api/convFile.ts +166 -0
  17. package/src/api/crm.ts +830 -0
  18. package/src/api/customerService.ts +156 -0
  19. package/src/api/datacenter.ts +672 -0
  20. package/src/api/devicemng.ts +202 -0
  21. package/src/api/diot.ts +19 -0
  22. package/src/api/doc.ts +232 -0
  23. package/src/api/drive.ts +109 -0
  24. package/src/api/edu.ts +30 -0
  25. package/src/api/esign.ts +44 -0
  26. package/src/api/exclusive.ts +372 -0
  27. package/src/api/h3yun.ts +537 -0
  28. package/src/api/hrm.ts +272 -0
  29. package/src/api/im.ts +978 -0
  30. package/src/api/industry.ts +153 -0
  31. package/src/api/jzcrm.ts +304 -0
  32. package/src/api/link.ts +94 -0
  33. package/src/api/live.ts +162 -0
  34. package/src/api/microApp.ts +309 -0
  35. package/src/api/oapi.ts +4083 -0
  36. package/src/api/oauth2.ts +146 -0
  37. package/src/api/pedia.ts +222 -0
  38. package/src/api/project.ts +1519 -0
  39. package/src/api/resident.ts +133 -0
  40. package/src/api/robot.ts +326 -0
  41. package/src/api/rooms.ts +334 -0
  42. package/src/api/serviceGroup.ts +216 -0
  43. package/src/api/storage.ts +1701 -0
  44. package/src/api/swform.ts +94 -0
  45. package/src/api/todo.ts +220 -0
  46. package/src/api/wiki.ts +231 -0
  47. package/src/api/workbench.ts +73 -0
  48. package/src/api/yida.ts +2165 -0
  49. package/src/bot.ts +129 -0
  50. package/src/http.ts +44 -0
  51. package/src/index.ts +9 -0
  52. package/src/internal.ts +47 -0
  53. package/src/message.ts +141 -0
  54. package/src/types/index.ts +140 -0
  55. package/src/utils.ts +53 -0
  56. package/src/ws.ts +55 -0
@@ -0,0 +1,537 @@
1
+ import { Internal } from '../internal'
2
+ // GENERATED CONTENT
3
+
4
+ export interface GetUploadUrlQuery {
5
+ /** 表单编码。 */
6
+ schemaCode: string
7
+ /** 业务数据实例ID。 */
8
+ bizObjectId: string
9
+ /** 文件上传至目标控件的字段名。 */
10
+ fieldName: string
11
+ /** 是否覆盖,取值: */
12
+ isOverwrite: unknown
13
+ }
14
+
15
+ export interface GetUploadUrlResponse {
16
+ code: string
17
+ message: string
18
+ data?: {
19
+ uploadUrl?: string
20
+ }
21
+ }
22
+
23
+ export interface QueryAppFunctionNodesQuery {
24
+ /** 应用编码。 */
25
+ appCode: string
26
+ }
27
+
28
+ export interface QueryAppFunctionNodesResponse {
29
+ code: string
30
+ message: string
31
+ data?: {
32
+ schemaCode?: string
33
+ appCode?: string
34
+ parentCode?: string
35
+ displayName?: string
36
+ nodeVisibleType?: string
37
+ nodeType?: string
38
+ state?: string
39
+ sortKey?: number
40
+ isSystem?: number
41
+ }[]
42
+ }
43
+
44
+ export interface CreateProcessesInstanceParams {
45
+ /** 流程表单编码。 */
46
+ schemaCode: string
47
+ /** 业务数据实例ID。 */
48
+ bizObjectId: string
49
+ /** 操作者的ID。 */
50
+ opUserId: string
51
+ }
52
+
53
+ export interface CreateProcessesInstanceResponse {
54
+ code: string
55
+ message: string
56
+ data?: {
57
+ processInstanceId?: string
58
+ }
59
+ }
60
+
61
+ export interface DeleteProcessesInstanceQuery {
62
+ /** 流程实例ID。可以调用[查询流程实例](https://open.dingtalk.com/document/orgapp-server/query-flow-instances)接口获取。 */
63
+ processInstanceId: string
64
+ /** 删除成功后,是否需要更新业务表单关联的流程实例ID。 */
65
+ isAutoUpdateBizObject: unknown
66
+ }
67
+
68
+ export interface DeleteProcessesInstanceResponse {
69
+ code: string
70
+ message: string
71
+ }
72
+
73
+ export interface LoadBizFieldsQuery {
74
+ /** 表单编码。 */
75
+ schemaCode: string
76
+ }
77
+
78
+ export interface LoadBizFieldsResponse {
79
+ code: string
80
+ message: string
81
+ data?: {
82
+ schemaCode?: string
83
+ formName?: string
84
+ fields?: number
85
+ childForms?: number
86
+ }
87
+ }
88
+
89
+ export interface QueryProcessesWorkItemsQuery {
90
+ /** 流程实例ID。 */
91
+ processInstanceId: string
92
+ }
93
+
94
+ export interface QueryProcessesWorkItemsResponse {
95
+ code: string
96
+ message: string
97
+ data?: {
98
+ workItemId?: string
99
+ workItemType?: string
100
+ processInstanceId?: string
101
+ appCode?: string
102
+ schemaCode?: string
103
+ bizObjectId?: string
104
+ processVersion?: string
105
+ activityCode?: string
106
+ activityName?: string
107
+ displayName?: string
108
+ state?: string
109
+ isFinish?: number
110
+ receiveTimeGMT?: string
111
+ startTimeGMT?: string
112
+ finishTimeGMT?: string
113
+ comment?: string
114
+ isApproval?: number
115
+ participant?: number
116
+ finisher?: number
117
+ receiptor?: number
118
+ }[]
119
+ }
120
+
121
+ export interface BatchInsertBizObjectParams {
122
+ /** 表单编码。 */
123
+ schemaCode: string
124
+ /** 操作用户ID。 */
125
+ opUserId: string
126
+ /** 待新增的业对象json数组。JSON数组的key只可以调用[获取表单对象结构](https://open.dingtalk.com/document/orgapp-server/gets-the-form-object-structure)接口获取。 */
127
+ bizObjectJsonArray: string[]
128
+ /** 是否是草稿,取值: */
129
+ isDraft: unknown
130
+ }
131
+
132
+ export interface BatchInsertBizObjectResponse {
133
+ code: string
134
+ message: string
135
+ data?: {
136
+ bizObjectIds?: number
137
+ processIds?: number
138
+ failedDatas?: number
139
+ failedMessages?: number
140
+ }
141
+ }
142
+
143
+ export interface DeleteBizObjectQuery {
144
+ /** 表单编码。 */
145
+ schemaCode: string
146
+ /** 业务数据ID。 */
147
+ bizObjectId: string
148
+ }
149
+
150
+ export interface DeleteBizObjectResponse {
151
+ code: string
152
+ message: string
153
+ }
154
+
155
+ export interface CancelProcessInstanceParams {
156
+ /** 流程实例ID。可以调用[查询流程实例](https://open.dingtalk.com/document/orgapp-server/query-flow-instances)接口获取。 */
157
+ processInstanceId: string
158
+ }
159
+
160
+ export interface CancelProcessInstanceResponse {
161
+ code: string
162
+ message: string
163
+ }
164
+
165
+ export interface CreateBizObjectParams {
166
+ /** 表单编码。 */
167
+ schemaCode: string
168
+ /** 操作用户ID。 */
169
+ opUserId: string
170
+ /** json格式的业务数据。JSON数组的key只可以调用[获取表单对象结构](https://open.dingtalk.com/document/orgapp-server/gets-the-form-object-structure)接口获取。 */
171
+ bizObjectJson: string
172
+ /** 是否是草稿,取值: */
173
+ isDraft: unknown
174
+ }
175
+
176
+ export interface CreateBizObjectResponse {
177
+ code: string
178
+ message: string
179
+ data?: {
180
+ schemaCode?: string
181
+ formUsageType?: string
182
+ bizObjectId?: string
183
+ processInstanceId?: string
184
+ }
185
+ }
186
+
187
+ export interface QueryProcessesInstanceQuery {
188
+ /** 流程表单编码。 */
189
+ schemaCode: string
190
+ /** 业务数据ID。 */
191
+ bizObjectId: string
192
+ }
193
+
194
+ export interface QueryProcessesInstanceResponse {
195
+ code: string
196
+ message: string
197
+ data?: {
198
+ processInstanceId?: string
199
+ dingTalkProcessId?: string
200
+ processDisplayName?: string
201
+ processVersion?: number
202
+ schemaCode?: string
203
+ bizObjectId?: string
204
+ appCode?: string
205
+ state?: string
206
+ originator?: number
207
+ createdTimeGMT?: string
208
+ startTimeGMT?: string
209
+ finishTimeGMT?: string
210
+ }[]
211
+ }
212
+
213
+ export interface UpdateBizObjectParams {
214
+ /** 表单编码。 */
215
+ schemaCode: string
216
+ /** 业务数据ID。 */
217
+ bizObjectId: string
218
+ /** 待修改的json格式业务数据。 */
219
+ bizObjectJson: string
220
+ }
221
+
222
+ export interface UpdateBizObjectResponse {
223
+ code: string
224
+ message: string
225
+ }
226
+
227
+ export interface LoadBizObjectQuery {
228
+ /** 表单编码或流程表单编码。 */
229
+ schemaCode: string
230
+ /** 业务对象实例ID。 */
231
+ bizObjectId: string
232
+ }
233
+
234
+ export interface LoadBizObjectResponse {
235
+ code: string
236
+ message: string
237
+ data?: unknown
238
+ }
239
+
240
+ export interface LoadBizObjectsParams {
241
+ /** 表单编码。 */
242
+ schemaCode: string
243
+ /** 分页页码。 */
244
+ pageNumber: number
245
+ /** 分页页大小,最大值500。 */
246
+ pageSize: number
247
+ /** 需要返回的字段名,仅支持传入主表的字段。 */
248
+ returnFields?: string[]
249
+ /** 排序字段结构列表。 */
250
+ sortByFields?: object[]
251
+ /** json格式的动态条件过滤器。 */
252
+ matcherJson?: string
253
+ }
254
+
255
+ export interface LoadBizObjectsResponse {
256
+ code: string
257
+ message: string
258
+ data?: {
259
+ pageNumber?: number
260
+ pageSize?: number
261
+ totalCount?: number
262
+ bizObjects?: number
263
+ }
264
+ }
265
+
266
+ export interface GetAttachmentTemporaryUrlQuery {
267
+ /** 附件ID。 */
268
+ attachmentId: string
269
+ }
270
+
271
+ export interface GetAttachmentTemporaryUrlResponse {
272
+ code: string
273
+ message: string
274
+ data?: {
275
+ attachmentUrl?: string
276
+ }
277
+ }
278
+
279
+ export interface GetRoleUsersQuery {
280
+ /** 角色ID。 */
281
+ roleId: string
282
+ }
283
+
284
+ export interface GetRoleUsersResponse {
285
+ code: string
286
+ message: string
287
+ data?: {
288
+ userId?: string
289
+ name?: string
290
+ code?: string
291
+ sex?: string
292
+ description?: string
293
+ mobile?: string
294
+ email?: string
295
+ departmentId?: string
296
+ departmentName?: string
297
+ domainType?: string
298
+ partDepartmentIds?: number
299
+ sortKey?: number
300
+ }[]
301
+ }
302
+
303
+ export interface GetRolesResponse {
304
+ code: string
305
+ message: string
306
+ data?: {
307
+ roleGroups?: number
308
+ roles?: number
309
+ }
310
+ }
311
+
312
+ export interface GetUsersQuery {
313
+ /** 部门ID。 */
314
+ departmentId: string
315
+ /** 是否递归获取子级部门下的用户。 */
316
+ isRecursive?: unknown
317
+ }
318
+
319
+ export interface GetUsersResponse {
320
+ code: string
321
+ message: string
322
+ data?: {
323
+ id?: string
324
+ name?: string
325
+ code?: string
326
+ sex?: string
327
+ description?: string
328
+ mobile?: string
329
+ email?: string
330
+ departmentId?: string
331
+ departmentName?: string
332
+ domainType?: string
333
+ partDepartmentIds?: number
334
+ sortKey?: number
335
+ }[]
336
+ }
337
+
338
+ export interface GetAppsParams {
339
+ /** 查询类型,取值: */
340
+ queryType: string
341
+ /** 待查询条件数组。 */
342
+ values?: string[]
343
+ }
344
+
345
+ export interface GetAppsResponse {
346
+ code: string
347
+ message: string
348
+ data?: {
349
+ appCode?: string
350
+ displayName?: string
351
+ appSource?: string
352
+ appState?: string
353
+ solution?: string
354
+ }[]
355
+ }
356
+
357
+ export interface GetOrganizationsQuery {
358
+ /** 部门ID。 */
359
+ departmentId?: string
360
+ }
361
+
362
+ export interface GetOrganizationsResponse {
363
+ code: string
364
+ message: string
365
+ data?: {
366
+ id?: string
367
+ parentId?: string
368
+ name?: string
369
+ code?: string
370
+ unitType?: string
371
+ sortKey?: number
372
+ description?: string
373
+ }[]
374
+ }
375
+
376
+ // funcName: isOldApi
377
+ Internal.define({
378
+ '/h3yun/attachments/uploadUrls': { GET: { getUploadUrl: false } },
379
+ '/h3yun/apps/functionNodes': { GET: { queryAppFunctionNodes: false } },
380
+ '/h3yun/processes/instances': {
381
+ POST: { createProcessesInstance: false },
382
+ DELETE: { deleteProcessesInstance: false },
383
+ GET: { queryProcessesInstance: false },
384
+ },
385
+ '/h3yun/forms/loadBizFields': { GET: { loadBizFields: false } },
386
+ '/h3yun/processes/workItems': { GET: { queryProcessesWorkItems: false } },
387
+ '/h3yun/forms/instances/batch': { POST: { batchInsertBizObject: false } },
388
+ '/h3yun/forms/instances': {
389
+ DELETE: { deleteBizObject: false },
390
+ POST: { createBizObject: false },
391
+ PUT: { updateBizObject: false },
392
+ },
393
+ '/h3yun/processes/instances/cancel': {
394
+ POST: { cancelProcessInstance: false },
395
+ },
396
+ '/h3yun/forms/instances/loadInstances': { GET: { loadBizObject: false } },
397
+ '/h3yun/forms/instances/search': { POST: { loadBizObjects: false } },
398
+ '/h3yun/attachments/temporaryUrls': {
399
+ GET: { getAttachmentTemporaryUrl: false },
400
+ },
401
+ '/h3yun/roles/roleUsers': { GET: { getRoleUsers: false } },
402
+ '/h3yun/roles': { GET: { getRoles: false } },
403
+ '/h3yun/users': { GET: { getUsers: false } },
404
+ '/h3yun/apps/search': { POST: { getApps: false } },
405
+ '/h3yun/departments': { GET: { getOrganizations: false } },
406
+ })
407
+
408
+ declare module '../internal' {
409
+ interface Internal {
410
+ /**
411
+ * 获取文件上传地址
412
+ * @see https://open.dingtalk.com/document/isvapp/obtain-the-upload-url-of-a-file-2
413
+ */
414
+ getUploadUrl(query: GetUploadUrlQuery): Promise<GetUploadUrlResponse>
415
+ /**
416
+ * 获取应用功能节点
417
+ * @see https://open.dingtalk.com/document/isvapp/queries-the-application-feature-nodes
418
+ */
419
+ queryAppFunctionNodes(
420
+ query: QueryAppFunctionNodesQuery,
421
+ ): Promise<QueryAppFunctionNodesResponse>
422
+ /**
423
+ * 创建流程实例
424
+ * @see https://open.dingtalk.com/document/isvapp/create-a-process-instance
425
+ */
426
+ createProcessesInstance(
427
+ params: CreateProcessesInstanceParams,
428
+ ): Promise<CreateProcessesInstanceResponse>
429
+ /**
430
+ * 删除流程实例数据
431
+ * @see https://open.dingtalk.com/document/isvapp/delete-process-instance-data
432
+ */
433
+ deleteProcessesInstance(
434
+ query: DeleteProcessesInstanceQuery,
435
+ ): Promise<DeleteProcessesInstanceResponse>
436
+ /**
437
+ * 获取表单对象结构
438
+ * @see https://open.dingtalk.com/document/isvapp/gets-the-form-object-structure
439
+ */
440
+ loadBizFields(query: LoadBizFieldsQuery): Promise<LoadBizFieldsResponse>
441
+ /**
442
+ * 获取流程实例节点工作项
443
+ * @see https://open.dingtalk.com/document/isvapp/query-flow-instance-node-work-items
444
+ */
445
+ queryProcessesWorkItems(
446
+ query: QueryProcessesWorkItemsQuery,
447
+ ): Promise<QueryProcessesWorkItemsResponse>
448
+ /**
449
+ * 批量新增表单业务数据
450
+ * @see https://open.dingtalk.com/document/isvapp/batch-add-form-business-data
451
+ */
452
+ batchInsertBizObject(
453
+ params: BatchInsertBizObjectParams,
454
+ ): Promise<BatchInsertBizObjectResponse>
455
+ /**
456
+ * 删除业务对象
457
+ * @see https://open.dingtalk.com/document/isvapp/delete-a-business-object
458
+ */
459
+ deleteBizObject(
460
+ query: DeleteBizObjectQuery,
461
+ ): Promise<DeleteBizObjectResponse>
462
+ /**
463
+ * 取消流程实例
464
+ * @see https://open.dingtalk.com/document/isvapp/cancel-a-process-instance
465
+ */
466
+ cancelProcessInstance(
467
+ params: CancelProcessInstanceParams,
468
+ ): Promise<CancelProcessInstanceResponse>
469
+ /**
470
+ * 创建表单业务数据
471
+ * @see https://open.dingtalk.com/document/isvapp/create-form-business-data
472
+ */
473
+ createBizObject(
474
+ params: CreateBizObjectParams,
475
+ ): Promise<CreateBizObjectResponse>
476
+ /**
477
+ * 查询流程实例
478
+ * @see https://open.dingtalk.com/document/isvapp/query-flow-instances
479
+ */
480
+ queryProcessesInstance(
481
+ query: QueryProcessesInstanceQuery,
482
+ ): Promise<QueryProcessesInstanceResponse>
483
+ /**
484
+ * 修改表单业务对象数据
485
+ * @see https://open.dingtalk.com/document/isvapp/modify-form-business-object-data
486
+ */
487
+ updateBizObject(
488
+ params: UpdateBizObjectParams,
489
+ ): Promise<UpdateBizObjectResponse>
490
+ /**
491
+ * 获取业务实例信息
492
+ * @see https://open.dingtalk.com/document/isvapp/queries-business-instance-information
493
+ */
494
+ loadBizObject(query: LoadBizObjectQuery): Promise<LoadBizObjectResponse>
495
+ /**
496
+ * 查询表单业务数据列表
497
+ * @see https://open.dingtalk.com/document/isvapp/querying-form-business-data
498
+ */
499
+ loadBizObjects(
500
+ params: LoadBizObjectsParams,
501
+ ): Promise<LoadBizObjectsResponse>
502
+ /**
503
+ * 获取附件临时免登地址
504
+ * @see https://open.dingtalk.com/document/isvapp/obtain-the-temporary-attachment-free-address
505
+ */
506
+ getAttachmentTemporaryUrl(
507
+ query: GetAttachmentTemporaryUrlQuery,
508
+ ): Promise<GetAttachmentTemporaryUrlResponse>
509
+ /**
510
+ * 获取角色用户数据
511
+ * @see https://open.dingtalk.com/document/isvapp/obtain-role-data-1
512
+ */
513
+ getRoleUsers(query: GetRoleUsersQuery): Promise<GetRoleUsersResponse>
514
+ /**
515
+ * 获取角色数据
516
+ * @see https://open.dingtalk.com/document/isvapp/obtain-role-data
517
+ */
518
+ getRoles(): Promise<GetRolesResponse>
519
+ /**
520
+ * 获取用户数据
521
+ * @see https://open.dingtalk.com/document/isvapp/obtain-user-data
522
+ */
523
+ getUsers(query: GetUsersQuery): Promise<GetUsersResponse>
524
+ /**
525
+ * 获取应用列表
526
+ * @see https://open.dingtalk.com/document/isvapp/queries-applications
527
+ */
528
+ getApps(params: GetAppsParams): Promise<GetAppsResponse>
529
+ /**
530
+ * 获取组织数据
531
+ * @see https://open.dingtalk.com/document/isvapp/queries-organization-data
532
+ */
533
+ getOrganizations(
534
+ query: GetOrganizationsQuery,
535
+ ): Promise<GetOrganizationsResponse>
536
+ }
537
+ }