@satorijs/adapter-lark 3.12.4 → 3.12.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.
@@ -9,8 +9,13 @@ declare module '../internal' {
9
9
 
10
10
  export namespace Application {
11
11
  export interface Methods {
12
+ appAvatar: AppAvatar.Methods
12
13
  owner: Owner.Methods
13
14
  collaborators: Collaborators.Methods
15
+ base: Base.Methods
16
+ ability: Ability.Methods
17
+ config: Config.Methods
18
+ publish: Publish.Methods
14
19
  appVersion: AppVersion.Methods
15
20
  scope: Scope.Methods
16
21
  contactsRange: ContactsRange.Methods
@@ -186,6 +191,32 @@ export namespace Application {
186
191
  app_list?: Lark.Application[]
187
192
  }
188
193
 
194
+ export namespace AppAvatar {
195
+ export interface Methods {
196
+ upload: Upload.Methods
197
+ }
198
+
199
+ export namespace Upload {
200
+ export interface Methods {
201
+ /**
202
+ * 上传应用图标
203
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v7/application-v7/app_avatar-upload/create
204
+ */
205
+ create(form: CreateForm): Promise<CreateResponse>
206
+ }
207
+
208
+ export interface CreateForm {
209
+ /** 图片 */
210
+ avatar: Blob
211
+ }
212
+
213
+ export interface CreateResponse {
214
+ /** 图片 URL,给创建/更新应用使用 */
215
+ url?: string
216
+ }
217
+ }
218
+ }
219
+
189
220
  export namespace Owner {
190
221
  export interface Methods {
191
222
  /**
@@ -243,6 +274,106 @@ export namespace Application {
243
274
  }
244
275
  }
245
276
 
277
+ export namespace Base {
278
+ export interface Methods {
279
+ /**
280
+ * 更新应用基础信息配置
281
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v7/application-v7/application-base/patch
282
+ */
283
+ patch(app_id: string, body: PatchRequest): Promise<void>
284
+ }
285
+
286
+ export interface PatchRequest {
287
+ /** 应用名称描述多语种 */
288
+ i18ns?: Lark.AppI18nInfo[]
289
+ /** 应用icon图片链接 */
290
+ avatar_url?: string
291
+ /** 应用管理后台url链接 */
292
+ homepage_url?: string
293
+ }
294
+ }
295
+
296
+ export namespace Ability {
297
+ export interface Methods {
298
+ /**
299
+ * 更新应用能力配置
300
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v7/application-v7/application-ability/patch
301
+ */
302
+ patch(app_id: string, body: PatchRequest): Promise<void>
303
+ }
304
+
305
+ export interface PatchRequest {
306
+ /** 网页应用 */
307
+ web_app?: Lark.AppAbilityWeb
308
+ /** 机器人 */
309
+ bot?: Lark.AppAbilityBot
310
+ }
311
+ }
312
+
313
+ export namespace Config {
314
+ export interface Methods {
315
+ /**
316
+ * 更新应用开发配置
317
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v7/application-v7/application-config/patch
318
+ */
319
+ patch(app_id: string, body: PatchRequest, query?: PatchQuery): Promise<void>
320
+ }
321
+
322
+ export interface PatchRequest {
323
+ /** 权限配置 */
324
+ scope?: Lark.AppConfigScope
325
+ /** 事件配置 */
326
+ event?: Lark.AppConfigEvent
327
+ /** 安全配置 */
328
+ security?: Lark.AppConfigSecurity
329
+ /** 可见性范围配置 */
330
+ visibility?: Lark.AppConfigVisibility
331
+ /** 通讯录权限范围配置 */
332
+ contacts?: Lark.AppConfigContactsRange
333
+ /** 事件与回调加密策略 */
334
+ event_and_callback_encrypt_strategy?: Lark.EventAndCallbackEncryptStrategy
335
+ /** 回调配置 */
336
+ callback?: Lark.AppConfigCallback
337
+ }
338
+
339
+ export interface PatchQuery {
340
+ /** 部门id 类型 */
341
+ department_id_type?: 'open_department_id' | 'department_id'
342
+ /** open_id 类型 */
343
+ user_id_type?: 'open_id' | 'user_id' | 'union_id'
344
+ }
345
+ }
346
+
347
+ export namespace Publish {
348
+ export interface Methods {
349
+ /**
350
+ * 提交发布自建应用
351
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/application-v7/application-v7/application-publish/create
352
+ */
353
+ create(app_id: string, body: CreateRequest): Promise<CreateResponse>
354
+ }
355
+
356
+ export interface CreateRequest {
357
+ /** 移动端默认能力 */
358
+ mobile_default_ability?: 'gadget' | 'web_app' | 'bot'
359
+ /** PC端默认能力 */
360
+ pc_default_ability?: 'gadget' | 'web_app' | 'bot'
361
+ /** 申请理由 */
362
+ remark: string
363
+ /** 更新描述 */
364
+ changelog: string
365
+ /** 应用版本号 */
366
+ version?: string
367
+ }
368
+
369
+ export interface CreateResponse {
370
+ /** 应用版本ID */
371
+ version_id?: string
372
+ /** 应用版本号 */
373
+ version?: string
374
+ }
375
+ }
376
+
246
377
  export namespace AppVersion {
247
378
  export interface Methods {
248
379
  /**
@@ -678,6 +809,9 @@ export namespace Application {
678
809
  }
679
810
 
680
811
  Internal.define({
812
+ '/application/v7/app_avatar/upload': {
813
+ POST: { name: 'application.appAvatar.upload.create', multipart: true },
814
+ },
681
815
  '/application/v6/applications/{app_id}/owner': {
682
816
  PUT: 'application.owner.update',
683
817
  },
@@ -685,6 +819,18 @@ Internal.define({
685
819
  PUT: 'application.collaborators.update',
686
820
  GET: 'application.collaborators.get',
687
821
  },
822
+ '/application/v7/applications/{app_id}/base': {
823
+ PATCH: 'application.base.patch',
824
+ },
825
+ '/application/v7/applications/{app_id}/ability': {
826
+ PATCH: 'application.ability.patch',
827
+ },
828
+ '/application/v7/applications/{app_id}/config': {
829
+ PATCH: 'application.config.patch',
830
+ },
831
+ '/application/v7/applications/{app_id}/publish': {
832
+ POST: 'application.publish.create',
833
+ },
688
834
  '/application/v6/applications/{app_id}': {
689
835
  GET: 'application.get',
690
836
  PATCH: 'application.patch',
@@ -14,6 +14,7 @@ export namespace Approval {
14
14
  externalApproval: ExternalApproval.Methods
15
15
  externalInstance: ExternalInstance.Methods
16
16
  externalTask: ExternalTask.Methods
17
+ district: District.Methods
17
18
  /**
18
19
  * 创建审批定义
19
20
  * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/approval/create
@@ -913,6 +914,56 @@ export namespace Approval {
913
914
  status?: 'PENDING' | 'APPROVED' | 'REJECTED' | 'TRANSFERRED' | 'DONE'
914
915
  }
915
916
  }
917
+
918
+ export namespace District {
919
+ export interface Methods {
920
+ /**
921
+ * 查询地理库信息
922
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/district/list
923
+ */
924
+ list(query?: ListQuery): Promise<ListResponse>
925
+ /**
926
+ * 搜索地理库信息
927
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/approval-v4/district/search
928
+ */
929
+ search(body: SearchRequest, query?: SearchQuery): Promise<SearchResponse>
930
+ }
931
+
932
+ export interface ListQuery extends Pagination {
933
+ /** 指定根节点,仅遍历该节点下的数据,默认遍历根节点,返回值内容与list_type 参数有关 */
934
+ root_district_id?: string
935
+ /** 遍历类型,不同的类型内容会有差异 */
936
+ list_type?: 'sub_level' | 'leaf_level'
937
+ /** 返回指定语言的内容,默认返回英文数据 */
938
+ locale?: 'zh-CN' | 'en-US'
939
+ }
940
+
941
+ export interface ListResponse {
942
+ /** 地理库的版本,地理库更新时版本会同步更新,如果应用将地理数据存在本地,需要定时判断版本,在变化以及时更新本地数据 */
943
+ version?: string
944
+ has_more?: boolean
945
+ page_token?: string
946
+ /** 区域列表 */
947
+ items?: Lark.District[]
948
+ }
949
+
950
+ export interface SearchRequest {
951
+ /** 根据ID查询指定区域的信息 */
952
+ district_ids?: string[]
953
+ /** 关键字,用于模糊查询符合条件的地址信息 */
954
+ keyword?: string
955
+ }
956
+
957
+ export interface SearchQuery {
958
+ /** 语言 */
959
+ locale?: 'zh-CN' | 'en-US'
960
+ }
961
+
962
+ export interface SearchResponse {
963
+ /** 区域列表 */
964
+ items?: Lark.District[]
965
+ }
966
+ }
916
967
  }
917
968
 
918
969
  Internal.define({
@@ -999,4 +1050,10 @@ Internal.define({
999
1050
  '/approval/v4/approvals/{approval_code}/unsubscribe': {
1000
1051
  POST: 'approval.unsubscribe',
1001
1052
  },
1053
+ '/approval/v4/districts': {
1054
+ GET: 'approval.district.list',
1055
+ },
1056
+ '/approval/v4/districts/search': {
1057
+ POST: 'approval.district.search',
1058
+ },
1002
1059
  })
@@ -18,6 +18,7 @@ export namespace Bitable {
18
18
  dashboard: Dashboard.Methods
19
19
  role: Role.Methods
20
20
  workflow: Workflow.Methods
21
+ blockWorkflow: BlockWorkflow.Methods
21
22
  /**
22
23
  * 创建多维表格
23
24
  * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/create
@@ -88,6 +89,7 @@ export namespace Bitable {
88
89
  view: View.Methods
89
90
  record: Record.Methods
90
91
  field: Field.Methods
92
+ fieldGroup: FieldGroup.Methods
91
93
  form: Form.Methods
92
94
  /**
93
95
  * 新增一个数据表
@@ -679,9 +681,34 @@ export namespace Bitable {
679
681
  }
680
682
  }
681
683
 
684
+ export namespace FieldGroup {
685
+ export interface Methods {
686
+ /**
687
+ * 创建字段编组
688
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-field_group/create
689
+ */
690
+ create(app_token: string, table_id: string, body: CreateRequest): Promise<CreateResponse>
691
+ }
692
+
693
+ export interface CreateRequest {
694
+ /** 要新增字段编组列表 */
695
+ field_groups: Lark.FieldGroup[]
696
+ }
697
+
698
+ export interface CreateResponse {
699
+ /** 字段编组的内容 */
700
+ field_groups?: string
701
+ }
702
+ }
703
+
682
704
  export namespace Form {
683
705
  export interface Methods {
684
706
  field: Field.Methods
707
+ /**
708
+ * 升级表单
709
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/upgrade
710
+ */
711
+ upgrade(app_token: string, table_id: string, form_id: string, body: UpgradeRequest): Promise<UpgradeResponse>
685
712
  /**
686
713
  * 更新表单元数据
687
714
  * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table-form/patch
@@ -694,6 +721,22 @@ export namespace Bitable {
694
721
  get(app_token: string, table_id: string, form_id: string): Promise<GetResponse>
695
722
  }
696
723
 
724
+ export interface UpgradeRequest {
725
+ /** 升级后的表单名称 */
726
+ form_name: string
727
+ /**
728
+ * 表单布局模式。可选值
729
+ * - traditional:传统布局
730
+ * - one_question_per_page:一页一题布局:
731
+ */
732
+ display_mode: Lark.FormDisplayMode
733
+ }
734
+
735
+ export interface UpgradeResponse {
736
+ /** 升级后的表单 */
737
+ form?: Lark.UpgradedForm
738
+ }
739
+
697
740
  export interface PatchRequest {
698
741
  /** 表单名称 */
699
742
  name?: string
@@ -943,6 +986,21 @@ export namespace Bitable {
943
986
  status: string
944
987
  }
945
988
  }
989
+
990
+ export namespace BlockWorkflow {
991
+ export interface Methods {
992
+ /**
993
+ * 列出工作流
994
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-block_workflow/list
995
+ */
996
+ list(app_token: string): Promise<ListResponse>
997
+ }
998
+
999
+ export interface ListResponse {
1000
+ /** 工作流列表 */
1001
+ workflows?: Lark.BlockWorkflow[]
1002
+ }
1003
+ }
946
1004
  }
947
1005
  }
948
1006
 
@@ -1012,12 +1070,18 @@ Internal.define({
1012
1070
  PUT: 'bitable.app.table.field.update',
1013
1071
  DELETE: 'bitable.app.table.field.delete',
1014
1072
  },
1073
+ '/bitable/v1/apps/{app_token}/tables/{table_id}/field_groups': {
1074
+ POST: 'bitable.app.table.fieldGroup.create',
1075
+ },
1015
1076
  '/bitable/v1/apps/{app_token}/dashboards/{block_id}/copy': {
1016
1077
  POST: 'bitable.app.dashboard.copy',
1017
1078
  },
1018
1079
  '/bitable/v1/apps/{app_token}/dashboards': {
1019
1080
  GET: { name: 'bitable.app.dashboard.list', pagination: { argIndex: 1, itemsKey: 'dashboards' } },
1020
1081
  },
1082
+ '/bitable/v1/apps/{app_token}/tables/{table_id}/forms/{form_id}/upgrade': {
1083
+ POST: 'bitable.app.table.form.upgrade',
1084
+ },
1021
1085
  '/bitable/v1/apps/{app_token}/tables/{table_id}/forms/{form_id}': {
1022
1086
  PATCH: 'bitable.app.table.form.patch',
1023
1087
  GET: 'bitable.app.table.form.get',
@@ -1051,6 +1115,9 @@ Internal.define({
1051
1115
  '/bitable/v1/apps/{app_token}/workflows/{workflow_id}': {
1052
1116
  PUT: 'bitable.app.workflow.update',
1053
1117
  },
1118
+ '/bitable/v1/apps/{app_token}/block_workflows': {
1119
+ GET: 'bitable.app.blockWorkflow.list',
1120
+ },
1054
1121
  '/bitable/v1/apps/{app_token}/roles': {
1055
1122
  POST: 'bitable.app.role.create',
1056
1123
  GET: { name: 'bitable.app.role.list', pagination: { argIndex: 1 } },
@@ -75,6 +75,11 @@ export namespace Contact {
75
75
  * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/get
76
76
  */
77
77
  get(user_id: string, query?: GetQuery): Promise<GetResponse>
78
+ /**
79
+ * 通过 ID 获取用户姓名
80
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/basic_batch
81
+ */
82
+ basicBatch(body: BasicBatchRequest, query?: BasicBatchQuery): Promise<BasicBatchResponse>
78
83
  /**
79
84
  * 批量获取用户信息
80
85
  * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/contact-v3/user/batch
@@ -293,6 +298,21 @@ export namespace Contact {
293
298
  user?: Lark.User
294
299
  }
295
300
 
301
+ export interface BasicBatchRequest {
302
+ /** 用户ID */
303
+ user_ids: string[]
304
+ }
305
+
306
+ export interface BasicBatchQuery {
307
+ /** 此次调用中使用的用户ID的类型 */
308
+ user_id_type?: 'user_id' | 'union_id' | 'open_id'
309
+ }
310
+
311
+ export interface BasicBatchResponse {
312
+ /** 用户信息 */
313
+ users?: Lark.BasicUser[]
314
+ }
315
+
296
316
  export interface BatchQuery {
297
317
  /** 要查询的用户ID列表 */
298
318
  user_ids: string[]
@@ -1473,6 +1493,9 @@ Internal.define({
1473
1493
  '/contact/v3/users/{user_id}/update_user_id': {
1474
1494
  PATCH: 'contact.user.updateUserId',
1475
1495
  },
1496
+ '/contact/v3/users/basic_batch': {
1497
+ POST: 'contact.user.basicBatch',
1498
+ },
1476
1499
  '/contact/v3/users/batch': {
1477
1500
  GET: 'contact.user.batch',
1478
1501
  },