@satorijs/adapter-lark 3.8.6 → 3.9.1

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 (121) hide show
  1. package/lib/bot.d.ts +1 -1
  2. package/lib/content.d.ts +433 -0
  3. package/lib/http.d.ts +1 -1
  4. package/lib/index.cjs +2792 -1719
  5. package/lib/index.d.ts +4 -2
  6. package/lib/internal.d.ts +37 -0
  7. package/lib/message.d.ts +2 -0
  8. package/lib/types/acs.d.ts +177 -0
  9. package/lib/types/admin.d.ts +270 -0
  10. package/lib/types/aily.d.ts +221 -0
  11. package/lib/types/apaas.d.ts +499 -0
  12. package/lib/types/application.d.ts +406 -0
  13. package/lib/types/approval.d.ts +779 -0
  14. package/lib/types/attendance.d.ts +957 -0
  15. package/lib/types/auth.d.ts +86 -0
  16. package/lib/types/authen.d.ts +191 -0
  17. package/lib/types/baike.d.ts +239 -0
  18. package/lib/types/bitable.d.ts +691 -0
  19. package/lib/types/board.d.ts +19 -0
  20. package/lib/types/calendar.d.ts +653 -0
  21. package/lib/types/cardkit.d.ts +139 -0
  22. package/lib/types/compensation.d.ts +54 -0
  23. package/lib/types/contact.d.ts +1137 -0
  24. package/lib/types/corehr.d.ts +4391 -0
  25. package/lib/types/docs.d.ts +23 -0
  26. package/lib/types/document_ai.d.ts +257 -0
  27. package/lib/types/docx.d.ts +380 -0
  28. package/lib/types/drive.d.ts +1053 -0
  29. package/lib/types/ehr.d.ts +32 -0
  30. package/lib/types/event.d.ts +9 -18
  31. package/lib/types/helpdesk.d.ts +746 -0
  32. package/lib/types/hire.d.ts +3150 -0
  33. package/lib/types/human_authentication.d.ts +27 -0
  34. package/lib/types/im.d.ts +1300 -0
  35. package/lib/types/index.d.ts +16432 -34
  36. package/lib/types/lingo.d.ts +254 -0
  37. package/lib/types/mail.d.ts +680 -0
  38. package/lib/types/mdm.d.ts +42 -0
  39. package/lib/types/minutes.d.ts +31 -0
  40. package/lib/types/moments.d.ts +18 -0
  41. package/lib/types/okr.d.ts +205 -0
  42. package/lib/types/optical_char_recognition.d.ts +17 -0
  43. package/lib/types/passport.d.ts +45 -0
  44. package/lib/types/payroll.d.ts +50 -0
  45. package/lib/types/performance.d.ts +413 -0
  46. package/lib/types/personal_settings.d.ts +87 -0
  47. package/lib/types/report.d.ts +57 -0
  48. package/lib/types/search.d.ts +216 -0
  49. package/lib/types/security_and_compliance.d.ts +24 -0
  50. package/lib/types/sheets.d.ts +326 -0
  51. package/lib/types/speech_to_text.d.ts +39 -0
  52. package/lib/types/task.d.ts +1153 -0
  53. package/lib/types/tenant.d.ts +23 -0
  54. package/lib/types/translation.d.ts +37 -0
  55. package/lib/types/vc.d.ts +948 -0
  56. package/lib/types/verification.d.ts +14 -0
  57. package/lib/types/wiki.d.ts +240 -0
  58. package/lib/types/workplace.d.ts +43 -0
  59. package/lib/utils.d.ts +143 -7
  60. package/package.json +6 -4
  61. package/src/bot.ts +19 -3
  62. package/src/{types/message/content.ts → content.ts} +1 -0
  63. package/src/http.ts +1 -3
  64. package/src/index.ts +4 -2
  65. package/src/internal.ts +143 -0
  66. package/src/message.ts +13 -11
  67. package/src/types/acs.ts +236 -0
  68. package/src/types/admin.ts +328 -0
  69. package/src/types/aily.ts +288 -0
  70. package/src/types/apaas.ts +646 -0
  71. package/src/types/application.ts +520 -0
  72. package/src/types/approval.ts +924 -0
  73. package/src/types/attendance.ts +1153 -0
  74. package/src/types/auth.ts +114 -0
  75. package/src/types/authen.ts +220 -0
  76. package/src/types/baike.ts +306 -0
  77. package/src/types/bitable.ts +879 -0
  78. package/src/types/board.ts +31 -0
  79. package/src/types/calendar.ts +817 -0
  80. package/src/types/cardkit.ts +182 -0
  81. package/src/types/compensation.ts +79 -0
  82. package/src/types/contact.ts +1411 -0
  83. package/src/types/corehr.ts +5297 -0
  84. package/src/types/docs.ts +33 -0
  85. package/src/types/document_ai.ts +352 -0
  86. package/src/types/docx.ts +471 -0
  87. package/src/types/drive.ts +1321 -0
  88. package/src/types/ehr.ts +43 -0
  89. package/src/types/event.ts +15 -21
  90. package/src/types/helpdesk.ts +925 -0
  91. package/src/types/hire.ts +3918 -0
  92. package/src/types/human_authentication.ts +38 -0
  93. package/src/types/im.ts +1605 -0
  94. package/src/types/index.ts +17754 -39
  95. package/src/types/lingo.ts +321 -0
  96. package/src/types/mail.ts +851 -0
  97. package/src/types/mdm.ts +57 -0
  98. package/src/types/minutes.ts +46 -0
  99. package/src/types/moments.ts +28 -0
  100. package/src/types/okr.ts +261 -0
  101. package/src/types/optical_char_recognition.ts +27 -0
  102. package/src/types/passport.ts +61 -0
  103. package/src/types/payroll.ts +69 -0
  104. package/src/types/performance.ts +524 -0
  105. package/src/types/personal_settings.ts +116 -0
  106. package/src/types/report.ts +77 -0
  107. package/src/types/search.ts +268 -0
  108. package/src/types/security_and_compliance.ts +33 -0
  109. package/src/types/sheets.ts +425 -0
  110. package/src/types/speech_to_text.ts +54 -0
  111. package/src/types/task.ts +1464 -0
  112. package/src/types/tenant.ts +36 -0
  113. package/src/types/translation.ts +52 -0
  114. package/src/types/vc.ts +1197 -0
  115. package/src/types/verification.ts +23 -0
  116. package/src/types/wiki.ts +313 -0
  117. package/src/types/workplace.ts +59 -0
  118. package/src/utils.ts +160 -8
  119. package/src/types/api.ts +0 -30848
  120. package/src/types/internal.ts +0 -84
  121. package/src/types/message/index.ts +0 -97
@@ -0,0 +1,328 @@
1
+ import { AdminDeptStat, AdminUserStat, AuditInfo, Badge, Grant, I18n, Password, RuleDetail } from '.'
2
+ import { Internal, Pagination } from '../internal'
3
+
4
+ declare module '../internal' {
5
+ interface Internal {
6
+ /**
7
+ * 重置用户的企业邮箱密码
8
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/password/reset
9
+ */
10
+ resetAdminPassword(body: ResetAdminPasswordRequest, query?: ResetAdminPasswordQuery): Promise<void>
11
+ /**
12
+ * 获取部门维度的用户活跃和功能使用数据
13
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_dept_stat/list
14
+ */
15
+ listAdminAdminDeptStat(query?: ListAdminAdminDeptStatQuery): Paginated<AdminDeptStat>
16
+ /**
17
+ * 获取用户维度的用户活跃和功能使用数据
18
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/admin_user_stat/list
19
+ */
20
+ listAdminAdminUserStat(query?: ListAdminAdminUserStatQuery): Paginated<AdminUserStat>
21
+ /**
22
+ * 创建勋章
23
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/create
24
+ */
25
+ createAdminBadge(body: CreateAdminBadgeRequest): Promise<CreateAdminBadgeResponse>
26
+ /**
27
+ * 修改勋章信息
28
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/update
29
+ */
30
+ updateAdminBadge(badge_id: string, body: UpdateAdminBadgeRequest): Promise<UpdateAdminBadgeResponse>
31
+ /**
32
+ * 上传勋章图片
33
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge_image/create
34
+ */
35
+ createAdminBadgeImage(form: CreateAdminBadgeImageForm): Promise<CreateAdminBadgeImageResponse>
36
+ /**
37
+ * 获取勋章列表
38
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/list
39
+ */
40
+ listAdminBadge(query?: ListAdminBadgeQuery): Paginated<Badge, 'badges'>
41
+ /**
42
+ * 获取勋章详情
43
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge/get
44
+ */
45
+ getAdminBadge(badge_id: string): Promise<GetAdminBadgeResponse>
46
+ /**
47
+ * 创建授予名单
48
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/create
49
+ */
50
+ createAdminBadgeGrant(badge_id: string, body: CreateAdminBadgeGrantRequest, query?: CreateAdminBadgeGrantQuery): Promise<CreateAdminBadgeGrantResponse>
51
+ /**
52
+ * 删除授予名单
53
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/delete
54
+ */
55
+ deleteAdminBadgeGrant(badge_id: string, grant_id: string): Promise<void>
56
+ /**
57
+ * 修改授予名单
58
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/update
59
+ */
60
+ updateAdminBadgeGrant(badge_id: string, grant_id: string, body: UpdateAdminBadgeGrantRequest, query?: UpdateAdminBadgeGrantQuery): Promise<UpdateAdminBadgeGrantResponse>
61
+ /**
62
+ * 获取授予名单列表
63
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/list
64
+ */
65
+ listAdminBadgeGrant(badge_id: string, query?: ListAdminBadgeGrantQuery): Paginated<Grant, 'grants'>
66
+ /**
67
+ * 获取授予名单详情
68
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/admin-v1/badge-grant/get
69
+ */
70
+ getAdminBadgeGrant(badge_id: string, grant_id: string, query?: GetAdminBadgeGrantQuery): Promise<GetAdminBadgeGrantResponse>
71
+ /**
72
+ * 获取行为审计日志数据
73
+ * @see https://open.feishu.cn/document/ukTMukTMukTM/uQjM5YjL0ITO24CNykjN/audit_log/audit_data_get
74
+ */
75
+ listAdminAuditInfo(query?: ListAdminAuditInfoQuery): Paginated<AuditInfo>
76
+ }
77
+ }
78
+
79
+ export interface ResetAdminPasswordRequest {
80
+ /** 需要重置的密码参数,不少于8个字符,字母、数字和符号,至少三选二 */
81
+ password: Password
82
+ /** 待修改密码的用户ID,只针对邮箱登录凭证与企业邮箱(包括别名)相等的用户生效 */
83
+ user_id: string
84
+ }
85
+
86
+ export interface ResetAdminPasswordQuery {
87
+ /** 用户ID类型 */
88
+ user_id_type: 'open_id' | 'union_id' | 'user_id'
89
+ }
90
+
91
+ export interface ListAdminAdminDeptStatQuery extends Pagination {
92
+ /** 部门ID类型 */
93
+ department_id_type: 'department_id' | 'open_department_id'
94
+ /** 起始日期(包含),格式是YYYY-mm-dd */
95
+ start_date: string
96
+ /** 终止日期(包含),格式是YYYY-mm-dd,起止日期之间相差不能超过91天(包含91天) */
97
+ end_date: string
98
+ /** 部门的 ID,取决于department_id_type,仅支持根部门及其下前4级子部门 */
99
+ department_id: string
100
+ /** 是否包含子部门,如果该值为false,则只查出本部门直属用户活跃和功能使用数据;如果该值为true,则查出该部门以及其子部门(子部门层级最多不超过根部门下的前4级)的用户活跃和功能使用数据 */
101
+ contains_child_dept: boolean
102
+ /** 跨域访问的geo */
103
+ target_geo?: string
104
+ /** 是否返回分产品版本数据 */
105
+ with_product_version?: boolean
106
+ }
107
+
108
+ export interface ListAdminAdminUserStatQuery extends Pagination {
109
+ /** 此次调用中使用的用户ID的类型 */
110
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
111
+ /** 部门ID类型 */
112
+ department_id_type?: 'department_id' | 'open_department_id'
113
+ /** 起始日期(包含),格式是YYYY-mm-dd */
114
+ start_date: string
115
+ /** 终止日期(包含),格式是YYYY-mm-dd。起止日期之间相差不能超过31天(包含31天) */
116
+ end_date: string
117
+ /** 部门的 ID,取决于department_id_type */
118
+ department_id?: string
119
+ /** 用户的open_id,user_id或者union_id,取决于user_id_type */
120
+ user_id?: string
121
+ /** 跨域访问的geo */
122
+ target_geo?: string
123
+ }
124
+
125
+ export interface CreateAdminBadgeRequest {
126
+ /** 租户内唯一的勋章名称,最多30个字符。 */
127
+ name: string
128
+ /** 勋章的描述文案,最多100个字符。 */
129
+ explanation?: string
130
+ /** 企业勋章的详情图Key。1.权限校验:非本租户上传的图片key,不能直接使用;2.时效校验:创建勋章,或者修改勋章图片key时,需使用1h内上传的图片key。 */
131
+ detail_image: string
132
+ /** 企业勋章的头像挂饰图Key。1.权限校验:非本租户上传的图片key,不能直接使用;2.时效校验:创建勋章,或者修改勋章图片key时,需使用1h内上传的图片key。 */
133
+ show_image: string
134
+ /** 勋章的多语言名称,同name字段限制,最多30个字符。 */
135
+ i18n_name?: I18n
136
+ /** 勋章的多语言描述文案,同explanation字段限制,最多100个字符。 */
137
+ i18n_explanation?: I18n
138
+ }
139
+
140
+ export interface UpdateAdminBadgeRequest {
141
+ /** 租户内唯一的勋章名称,最多30个字符。 */
142
+ name: string
143
+ /** 勋章的描述文案,最多100个字符。 */
144
+ explanation?: string
145
+ /** 企业勋章的详情图Key。1.权限校验:非本租户上传的图片key,不能直接使用;2.时效校验:创建勋章,或者修改勋章图片key时,需使用1h内上传的图片key。 */
146
+ detail_image: string
147
+ /** 企业勋章的头像挂饰图Key。1.权限校验:非本租户上传的图片key,不能直接使用;2.时效校验:创建勋章,或者修改勋章图片key时,需使用1h内上传的图片key。 */
148
+ show_image: string
149
+ /** 勋章的多语言名称,同name字段限制,最多30个字符。 */
150
+ i18n_name?: I18n
151
+ /** 勋章的多语言描述文案,同explanation字段限制,最多100个字符。 */
152
+ i18n_explanation?: I18n
153
+ }
154
+
155
+ export interface CreateAdminBadgeImageForm {
156
+ /** 勋章图片的文件,仅支持 PNG 格式,320 x 320 像素,大小不超过 1024 KB。 */
157
+ image_file: Blob
158
+ /** 图片的类型 */
159
+ image_type: 1 | 2
160
+ }
161
+
162
+ export interface ListAdminBadgeQuery extends Pagination {
163
+ /** 租户内唯一的勋章名称,精确匹配。 */
164
+ name?: string
165
+ }
166
+
167
+ export interface CreateAdminBadgeGrantRequest {
168
+ /** 授予名单名称,最多100个字符。 */
169
+ name: string
170
+ /** 勋章下唯一的授予事项 */
171
+ grant_type: 0 | 1
172
+ /** 授予名单的生效时间对应的时区,用于检查RuleDetail的时间戳的取值是否规范,取值范围为TZ database name */
173
+ time_zone: string
174
+ /** 规则详情 */
175
+ rule_detail: RuleDetail
176
+ /** 是否授予给全员。1.为false时,需要关联1~500个用户群体。2.为true时,不可关联用户、用户组、部门。 */
177
+ is_grant_all: boolean
178
+ /** 授予的用户ID列表,授予名单列表接口返回结果中不返回该字段,只在详情接口返回 */
179
+ user_ids?: string[]
180
+ /** 授予的部门ID列表,授予名单列表接口返回结果中不返回该字段,只在详情接口返回 */
181
+ department_ids?: string[]
182
+ /** 授予的用户组ID列表,授予名单列表接口返回结果中不返回该字段,只在详情接口返回 */
183
+ group_ids?: string[]
184
+ }
185
+
186
+ export interface CreateAdminBadgeGrantQuery {
187
+ /** 用户 ID 类型 */
188
+ user_id_type?: 'open_id' | 'union_id' | 'user_id'
189
+ /** 此次调用中使用的部门ID的类型。 */
190
+ department_id_type?: 'department_id' | 'open_department_id'
191
+ }
192
+
193
+ export interface UpdateAdminBadgeGrantRequest {
194
+ /** 授予名单名称,最多100个字符。 */
195
+ name: string
196
+ /** 勋章下唯一的授予事项 */
197
+ grant_type: 0 | 1
198
+ /** 授予名单的生效时间对应的时区,用于检查RuleDetail的时间戳的取值是否规范,取值范围为TZ database name */
199
+ time_zone: string
200
+ /** 规则详情 */
201
+ rule_detail: RuleDetail
202
+ /** 是否授予给全员。1.为false时,需要关联1~500个用户群体。2.为true时,不可关联用户、用户组、部门。 */
203
+ is_grant_all: boolean
204
+ /** 授予的用户ID列表,授予名单列表接口返回结果中不返回该字段,只在详情接口返回 */
205
+ user_ids?: string[]
206
+ /** 授予的部门ID列表,授予名单列表接口返回结果中不返回该字段,只在详情接口返回 */
207
+ department_ids?: string[]
208
+ /** 授予的用户组ID列表,授予名单列表接口返回结果中不返回该字段,只在详情接口返回 */
209
+ group_ids?: string[]
210
+ }
211
+
212
+ export interface UpdateAdminBadgeGrantQuery {
213
+ /** 用户 ID 类型 */
214
+ user_id_type?: 'open_id' | 'union_id' | 'user_id'
215
+ /** 此次调用中使用的部门ID的类型。 */
216
+ department_id_type?: 'department_id' | 'open_department_id'
217
+ }
218
+
219
+ export interface ListAdminBadgeGrantQuery extends Pagination {
220
+ /** 用户 ID 类型 */
221
+ user_id_type?: 'open_id' | 'union_id' | 'user_id'
222
+ /** 此次调用中使用的部门ID的类型。 */
223
+ department_id_type?: 'department_id' | 'open_department_id'
224
+ /** 授予名单名称,精确匹配。 */
225
+ name?: string
226
+ }
227
+
228
+ export interface GetAdminBadgeGrantQuery {
229
+ /** 用户 ID 类型 */
230
+ user_id_type?: 'open_id' | 'union_id' | 'user_id'
231
+ /** 此次调用中使用的部门ID的类型。 */
232
+ department_id_type?: 'department_id' | 'open_department_id'
233
+ }
234
+
235
+ export interface ListAdminAuditInfoQuery extends Pagination {
236
+ /** 此次调用中使用的用户ID的类型 */
237
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
238
+ /** 日志时间范围: 结束时间. 格式: 秒级时间戳. 默认值: 此刻 */
239
+ latest?: number
240
+ /** 日志时间范围: 起始时间. 格式: 秒级时间戳. 默认值: 30日前此刻 */
241
+ oldest?: number
242
+ /** 事件名称 */
243
+ event_name?: string
244
+ /** 过滤操作者: 操作者类型. 与 operator_value 配合使用 */
245
+ operator_type?: 'user' | 'bot'
246
+ /** 过滤操作者: 操作者ID. 与 operator_type 配合使用 */
247
+ operator_value?: string
248
+ /** 过滤模块 */
249
+ event_module?: number
250
+ /** 过滤用户类型. 仅当 operator_type=user 时生效 */
251
+ user_type?: 0 | 1 | 2
252
+ /** 过滤操作对象: 操作对象类型. 与object_value配合使用 */
253
+ object_type?: number
254
+ /** 过滤操作对象: 操作对象ID. 与object_type配合使用 */
255
+ object_value?: string
256
+ /** 增强过滤操作对象: 操作对象ID,支持云文档侧泛token过滤。会覆盖object_type和object_value查询条件 */
257
+ ext_filter_object_by_ccm_token?: string
258
+ }
259
+
260
+ export interface CreateAdminBadgeResponse {
261
+ /** 勋章的信息 */
262
+ badge?: Badge
263
+ }
264
+
265
+ export interface UpdateAdminBadgeResponse {
266
+ /** 勋章信息 */
267
+ badge?: Badge
268
+ }
269
+
270
+ export interface CreateAdminBadgeImageResponse {
271
+ /** 图片的key */
272
+ image_key?: string
273
+ }
274
+
275
+ export interface GetAdminBadgeResponse {
276
+ /** 勋章信息 */
277
+ badge?: Badge
278
+ }
279
+
280
+ export interface CreateAdminBadgeGrantResponse {
281
+ /** 授予名单的信息 */
282
+ grant?: Grant
283
+ }
284
+
285
+ export interface UpdateAdminBadgeGrantResponse {
286
+ /** 授予名单 */
287
+ grant?: Grant
288
+ }
289
+
290
+ export interface GetAdminBadgeGrantResponse {
291
+ /** 授予名单信息 */
292
+ grant?: Grant
293
+ }
294
+
295
+ Internal.define({
296
+ '/admin/v1/password/reset': {
297
+ POST: 'resetAdminPassword',
298
+ },
299
+ '/admin/v1/admin_dept_stats': {
300
+ GET: { name: 'listAdminAdminDeptStat', pagination: { argIndex: 0 } },
301
+ },
302
+ '/admin/v1/admin_user_stats': {
303
+ GET: { name: 'listAdminAdminUserStat', pagination: { argIndex: 0 } },
304
+ },
305
+ '/admin/v1/badges': {
306
+ POST: 'createAdminBadge',
307
+ GET: { name: 'listAdminBadge', pagination: { argIndex: 0, itemsKey: 'badges' } },
308
+ },
309
+ '/admin/v1/badges/{badge_id}': {
310
+ PUT: 'updateAdminBadge',
311
+ GET: 'getAdminBadge',
312
+ },
313
+ '/admin/v1/badge_images': {
314
+ POST: { name: 'createAdminBadgeImage', multipart: true },
315
+ },
316
+ '/admin/v1/badges/{badge_id}/grants': {
317
+ POST: 'createAdminBadgeGrant',
318
+ GET: { name: 'listAdminBadgeGrant', pagination: { argIndex: 1, itemsKey: 'grants' } },
319
+ },
320
+ '/admin/v1/badges/{badge_id}/grants/{grant_id}': {
321
+ DELETE: 'deleteAdminBadgeGrant',
322
+ PUT: 'updateAdminBadgeGrant',
323
+ GET: 'getAdminBadgeGrant',
324
+ },
325
+ '/admin/v1/audit_infos': {
326
+ GET: { name: 'listAdminAuditInfo', pagination: { argIndex: 0 } },
327
+ },
328
+ })
@@ -0,0 +1,288 @@
1
+ import { AilyKnowledgeAskProcessData, AilyKnowledgeFaq, AilyKnowledgeMessage, AilyMention, AilyMessage, AilyMessageContentType, AilySession, DataAsset, DataAssetTag, Run, Skill, SkillGlobalVariable } from '.'
2
+ import { Internal, Pagination } from '../internal'
3
+
4
+ declare module '../internal' {
5
+ interface Internal {
6
+ /**
7
+ * 创建会话
8
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session/create
9
+ */
10
+ createAilyAilySession(body: CreateAilyAilySessionRequest): Promise<CreateAilyAilySessionResponse>
11
+ /**
12
+ * 更新会话
13
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session/update
14
+ */
15
+ updateAilyAilySession(aily_session_id: string, body: UpdateAilyAilySessionRequest): Promise<UpdateAilyAilySessionResponse>
16
+ /**
17
+ * 获取会话
18
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session/get
19
+ */
20
+ getAilyAilySession(aily_session_id: string): Promise<GetAilyAilySessionResponse>
21
+ /**
22
+ * 删除会话
23
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session/delete
24
+ */
25
+ deleteAilyAilySession(aily_session_id: string): Promise<void>
26
+ /**
27
+ * 发送智能伙伴消息
28
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session-aily_message/create
29
+ */
30
+ createAilyAilySessionAilyMessage(aily_session_id: string, body: CreateAilyAilySessionAilyMessageRequest): Promise<CreateAilyAilySessionAilyMessageResponse>
31
+ /**
32
+ * 获取智能伙伴消息
33
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session-aily_message/get
34
+ */
35
+ getAilyAilySessionAilyMessage(aily_session_id: string, aily_message_id: string): Promise<GetAilyAilySessionAilyMessageResponse>
36
+ /**
37
+ * 列出智能伙伴消息
38
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session-aily_message/list
39
+ */
40
+ listAilyAilySessionAilyMessage(aily_session_id: string, query?: ListAilyAilySessionAilyMessageQuery): Paginated<AilyMessage, 'messages'>
41
+ /**
42
+ * 创建运行
43
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session-run/create
44
+ */
45
+ createAilyAilySessionRun(aily_session_id: string, body: CreateAilyAilySessionRunRequest): Promise<CreateAilyAilySessionRunResponse>
46
+ /**
47
+ * 获取运行
48
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session-run/get
49
+ */
50
+ getAilyAilySessionRun(aily_session_id: string, run_id: string): Promise<GetAilyAilySessionRunResponse>
51
+ /**
52
+ * 列出运行
53
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session-run/list
54
+ */
55
+ listAilyAilySessionRun(aily_session_id: string, query?: Pagination): Paginated<Run, 'runs'>
56
+ /**
57
+ * 取消运行
58
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/aily_session-run/cancel
59
+ */
60
+ cancelAilyAilySessionRun(aily_session_id: string, run_id: string): Promise<CancelAilyAilySessionRunResponse>
61
+ /**
62
+ * 调用技能
63
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/app-skill/start
64
+ */
65
+ startAilyAppSkill(app_id: string, skill_id: string, body: StartAilyAppSkillRequest): Promise<StartAilyAppSkillResponse>
66
+ /**
67
+ * 获取技能信息
68
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/app-skill/get
69
+ */
70
+ getAilyAppSkill(app_id: string, skill_id: string): Promise<GetAilyAppSkillResponse>
71
+ /**
72
+ * 查询技能列表
73
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/app-skill/list
74
+ */
75
+ listAilyAppSkill(app_id: string, query?: Pagination): Paginated<Skill, 'skills'>
76
+ /**
77
+ * 执行数据知识问答
78
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/app-knowledge/ask
79
+ */
80
+ askAilyAppKnowledge(app_id: string, body: AskAilyAppKnowledgeRequest): Promise<AskAilyAppKnowledgeResponse>
81
+ /**
82
+ * 查询数据知识列表
83
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/app-data_asset/list
84
+ */
85
+ listAilyAppDataAsset(app_id: string, query?: ListAilyAppDataAssetQuery): Paginated<DataAsset>
86
+ /**
87
+ * 获取数据知识分类列表
88
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/aily-v1/app-data_asset_tag/list
89
+ */
90
+ listAilyAppDataAssetTag(app_id: string, query?: ListAilyAppDataAssetTagQuery): Paginated<DataAssetTag>
91
+ }
92
+ }
93
+
94
+ export interface CreateAilyAilySessionRequest {
95
+ /** 渠道上下文 */
96
+ channel_context?: string
97
+ /** 其他透传信息 */
98
+ metadata?: string
99
+ }
100
+
101
+ export interface UpdateAilyAilySessionRequest {
102
+ /** 渠道上下文 */
103
+ channel_context?: string
104
+ /** 其他透传信息 */
105
+ metadata?: string
106
+ }
107
+
108
+ export interface CreateAilyAilySessionAilyMessageRequest {
109
+ /** 幂等id,同一 session 下相同的幂等 id 算一条消息,有效期72h */
110
+ idempotent_id: string
111
+ /** 消息内容类型 */
112
+ content_type: AilyMessageContentType
113
+ /** 消息内容 */
114
+ content: string
115
+ /** 消息中包含的文件 ID 列表 */
116
+ file_ids?: string[]
117
+ /** 引用的消息 ID */
118
+ quote_message_id?: string
119
+ /** 被@的实体 */
120
+ mentions?: AilyMention[]
121
+ }
122
+
123
+ export interface ListAilyAilySessionAilyMessageQuery extends Pagination {
124
+ /** 运行 ID */
125
+ run_id?: string
126
+ /** 返回生成中的消息 */
127
+ with_partial_message?: boolean
128
+ }
129
+
130
+ export interface CreateAilyAilySessionRunRequest {
131
+ /** 应用 ID */
132
+ app_id: string
133
+ /** 技能 ID */
134
+ skill_id?: string
135
+ /** 指定技能 ID 时可以同时指定技能输入 */
136
+ skill_input?: string
137
+ /** 其他透传信息 */
138
+ metadata?: string
139
+ }
140
+
141
+ export interface StartAilyAppSkillRequest {
142
+ /** 技能的全局变量 */
143
+ global_variable?: SkillGlobalVariable
144
+ /** 技能的自定义变量 */
145
+ input?: string
146
+ }
147
+
148
+ export interface AskAilyAppKnowledgeRequest {
149
+ /** 输入消息(当前仅支持纯文本输入) */
150
+ message: AilyKnowledgeMessage
151
+ /** 控制知识问答所依据的数据知识范围 */
152
+ data_asset_ids?: string[]
153
+ /** 控制知识问答所依据的数据知识分类范围 */
154
+ data_asset_tag_ids?: string[]
155
+ }
156
+
157
+ export interface ListAilyAppDataAssetQuery extends Pagination {
158
+ /** 模糊匹配关键词 */
159
+ keyword?: string
160
+ /** 根据数据知识 ID 进行过滤 */
161
+ data_asset_ids?: string[]
162
+ /** 根据数据知识分类 ID 进行过滤 */
163
+ data_asset_tag_ids?: string[]
164
+ /** 结果是否包含数据与知识项目 */
165
+ with_data_asset_item?: boolean
166
+ /** 结果是否包含数据连接状态 */
167
+ with_connect_status?: boolean
168
+ }
169
+
170
+ export interface ListAilyAppDataAssetTagQuery extends Pagination {
171
+ /** 模糊匹配分类名称 */
172
+ keyword?: string
173
+ /** 模糊匹配分类名称 */
174
+ data_asset_tag_ids?: string[]
175
+ }
176
+
177
+ export interface CreateAilyAilySessionResponse {
178
+ /** 创建的会话信息 */
179
+ session?: AilySession
180
+ }
181
+
182
+ export interface UpdateAilyAilySessionResponse {
183
+ /** 会话信息 */
184
+ session?: AilySession
185
+ }
186
+
187
+ export interface GetAilyAilySessionResponse {
188
+ /** 会话信息 */
189
+ session?: AilySession
190
+ }
191
+
192
+ export interface CreateAilyAilySessionAilyMessageResponse {
193
+ /** 消息信息 */
194
+ message?: AilyMessage
195
+ }
196
+
197
+ export interface GetAilyAilySessionAilyMessageResponse {
198
+ /** 消息信息 */
199
+ message?: AilyMessage
200
+ }
201
+
202
+ export interface CreateAilyAilySessionRunResponse {
203
+ /** 运行信息 */
204
+ run?: Run
205
+ }
206
+
207
+ export interface GetAilyAilySessionRunResponse {
208
+ /** 运行信息 */
209
+ run?: Run
210
+ }
211
+
212
+ export interface CancelAilyAilySessionRunResponse {
213
+ /** 运行信息 */
214
+ run?: Run
215
+ }
216
+
217
+ export interface StartAilyAppSkillResponse {
218
+ /** 技能的输出 */
219
+ output?: string
220
+ /** 技能的执行状态 */
221
+ status?: string
222
+ }
223
+
224
+ export interface GetAilyAppSkillResponse {
225
+ /** 技能信息 */
226
+ skill?: Skill
227
+ }
228
+
229
+ export interface AskAilyAppKnowledgeResponse {
230
+ /** 响应状态,枚举值 */
231
+ status?: 'processing' | 'finished'
232
+ /** 结束类型,枚举值 */
233
+ finish_type?: 'qa' | 'faq'
234
+ /** 响应消息 */
235
+ message?: AilyKnowledgeMessage
236
+ /** 知识问答运行过程结构化数据,status=finished 且 finish_type=qa 时返回 */
237
+ process_data?: AilyKnowledgeAskProcessData
238
+ /** 匹配标准问答对结果,status=finished 且 finish_type=faq时返回 */
239
+ faq_result?: AilyKnowledgeFaq
240
+ /** 是否有结果,true 则 代表 message 中的内容是通过配置知识而生成的 */
241
+ has_answer?: boolean
242
+ }
243
+
244
+ Internal.define({
245
+ '/aily/v1/sessions': {
246
+ POST: 'createAilyAilySession',
247
+ },
248
+ '/aily/v1/sessions/{aily_session_id}': {
249
+ PUT: 'updateAilyAilySession',
250
+ GET: 'getAilyAilySession',
251
+ DELETE: 'deleteAilyAilySession',
252
+ },
253
+ '/aily/v1/sessions/{aily_session_id}/messages': {
254
+ POST: 'createAilyAilySessionAilyMessage',
255
+ GET: { name: 'listAilyAilySessionAilyMessage', pagination: { argIndex: 1, itemsKey: 'messages' } },
256
+ },
257
+ '/aily/v1/sessions/{aily_session_id}/messages/{aily_message_id}': {
258
+ GET: 'getAilyAilySessionAilyMessage',
259
+ },
260
+ '/aily/v1/sessions/{aily_session_id}/runs': {
261
+ POST: 'createAilyAilySessionRun',
262
+ GET: { name: 'listAilyAilySessionRun', pagination: { argIndex: 1, itemsKey: 'runs' } },
263
+ },
264
+ '/aily/v1/sessions/{aily_session_id}/runs/{run_id}': {
265
+ GET: 'getAilyAilySessionRun',
266
+ },
267
+ '/aily/v1/sessions/{aily_session_id}/runs/{run_id}/cancel': {
268
+ POST: 'cancelAilyAilySessionRun',
269
+ },
270
+ '/aily/v1/apps/{app_id}/skills/{skill_id}/start': {
271
+ POST: 'startAilyAppSkill',
272
+ },
273
+ '/aily/v1/apps/{app_id}/skills/{skill_id}': {
274
+ GET: 'getAilyAppSkill',
275
+ },
276
+ '/aily/v1/apps/{app_id}/skills': {
277
+ GET: { name: 'listAilyAppSkill', pagination: { argIndex: 1, itemsKey: 'skills' } },
278
+ },
279
+ '/aily/v1/apps/{app_id}/knowledges/ask': {
280
+ POST: 'askAilyAppKnowledge',
281
+ },
282
+ '/aily/v1/apps/{app_id}/data_assets': {
283
+ GET: { name: 'listAilyAppDataAsset', pagination: { argIndex: 1 } },
284
+ },
285
+ '/aily/v1/apps/{app_id}/data_asset_tags': {
286
+ GET: { name: 'listAilyAppDataAssetTag', pagination: { argIndex: 1 } },
287
+ },
288
+ })