@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.
@@ -17,6 +17,11 @@ export namespace Minutes {
17
17
  media: Media.Methods
18
18
  transcript: Transcript.Methods
19
19
  statistics: Statistics.Methods
20
+ /**
21
+ * 获取妙记AI产物
22
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/minutes-v1/minute/artifacts
23
+ */
24
+ artifacts(minute_token: string): Promise<ArtifactsResponse>
20
25
  /**
21
26
  * 获取妙记信息
22
27
  * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/minutes-v1/minute/get
@@ -24,6 +29,15 @@ export namespace Minutes {
24
29
  get(minute_token: string, query?: GetQuery): Promise<GetResponse>
25
30
  }
26
31
 
32
+ export interface ArtifactsResponse {
33
+ /** 妙记总结 */
34
+ summary?: string
35
+ /** 妙记章节 */
36
+ minute_chapters?: Lark.MinuteChapter[]
37
+ /** 妙记待办 */
38
+ minute_todos?: Lark.MinuteTodo[]
39
+ }
40
+
27
41
  export interface GetQuery {
28
42
  /** 此次调用中使用的用户ID的类型 */
29
43
  user_id_type?: 'user_id' | 'union_id' | 'open_id'
@@ -100,6 +114,9 @@ Internal.define({
100
114
  '/minutes/v1/minutes/{minute_token}/statistics': {
101
115
  GET: 'minutes.minute.statistics.get',
102
116
  },
117
+ '/minutes/v1/minutes/{minute_token}/artifacts': {
118
+ GET: 'minutes.minute.artifacts',
119
+ },
103
120
  '/minutes/v1/minutes/{minute_token}': {
104
121
  GET: 'minutes.minute.get',
105
122
  },
@@ -12,6 +12,8 @@ export namespace SecurityAndCompliance {
12
12
  deviceRecord: DeviceRecord.Methods
13
13
  deviceApplyRecord: DeviceApplyRecord.Methods
14
14
  openapiLog: OpenapiLog.Methods
15
+ multiGeoEntity: MultiGeoEntity.Methods
16
+ userMigration: UserMigration.Methods
15
17
  }
16
18
 
17
19
  export namespace DeviceRecord {
@@ -312,6 +314,104 @@ export namespace SecurityAndCompliance {
312
314
  page_token?: string
313
315
  }
314
316
  }
317
+
318
+ export namespace MultiGeoEntity {
319
+ export interface Methods {
320
+ tenant: Tenant.Methods
321
+ }
322
+
323
+ export namespace Tenant {
324
+ export interface Methods {
325
+ /**
326
+ * 获取地理位置列表
327
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/security_and_compliance-v1/multi_geo_entity-tenant/get
328
+ */
329
+ get(): Promise<GetResponse>
330
+ }
331
+
332
+ export interface GetResponse {
333
+ /** 多地理位置租户信息 */
334
+ tenant?: Lark.Tenant
335
+ }
336
+ }
337
+ }
338
+
339
+ export namespace UserMigration {
340
+ export interface Methods {
341
+ /**
342
+ * 迁移用户
343
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/security_and_compliance-v1/user_migration/create
344
+ */
345
+ create(body: CreateRequest, query?: CreateQuery): Promise<CreateResponse>
346
+ /**
347
+ * 获取单个用户迁移状态
348
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/security_and_compliance-v1/user_migration/get
349
+ */
350
+ get(user_id: string, query?: GetQuery): Promise<GetResponse>
351
+ /**
352
+ * 批量获取用户迁移状态
353
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/security_and_compliance-v1/user_migration/search
354
+ */
355
+ search(body: SearchRequest, query?: SearchQuery): Promise<SearchResponse>
356
+ /**
357
+ * 取消用户迁移
358
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/security_and_compliance-v1/user_migration/cancel
359
+ */
360
+ cancel(body: CancelRequest, query?: CancelQuery): Promise<void>
361
+ }
362
+
363
+ export interface CreateRequest {
364
+ /** 迁移用户 id 列表 */
365
+ user_ids: string[]
366
+ /** 迁移目标地理位置区域 */
367
+ dest_geo: string
368
+ }
369
+
370
+ export interface CreateQuery {
371
+ /** 此次调用中使用的用户 ID 的类型 */
372
+ user_id_type: 'user_id' | 'union_id' | 'open_id'
373
+ }
374
+
375
+ export interface CreateResponse {
376
+ /** 用户迁移列表 */
377
+ user_migrations?: Lark.UserMigration[]
378
+ }
379
+
380
+ export interface GetQuery {
381
+ /** 用户 id 类型 */
382
+ user_id_type: 'user_id' | 'union_id' | 'open_id'
383
+ }
384
+
385
+ export interface GetResponse {
386
+ /** 用户迁移 */
387
+ user_migration?: Lark.UserMigration
388
+ }
389
+
390
+ export interface SearchRequest {
391
+ /** 用户 id 列表 */
392
+ user_ids: string[]
393
+ }
394
+
395
+ export interface SearchQuery {
396
+ /** 此次调用中使用的用户 ID 的类型 */
397
+ user_id_type: 'user_id' | 'union_id' | 'open_id'
398
+ }
399
+
400
+ export interface SearchResponse {
401
+ /** 用户迁移列表 */
402
+ items?: Lark.UserMigration[]
403
+ }
404
+
405
+ export interface CancelRequest {
406
+ /** 取消迁移用户 id 列表 */
407
+ user_ids: string[]
408
+ }
409
+
410
+ export interface CancelQuery {
411
+ /** 此次调用中使用的用户 ID 的类型 */
412
+ user_id_type: 'user_id' | 'union_id' | 'open_id'
413
+ }
414
+ }
315
415
  }
316
416
 
317
417
  Internal.define({
@@ -333,4 +433,19 @@ Internal.define({
333
433
  '/security_and_compliance/v1/openapi_logs/list_data': {
334
434
  POST: 'securityAndCompliance.openapiLog.listData',
335
435
  },
436
+ '/security_and_compliance/v1/multi_geo_entity/tenant': {
437
+ GET: 'securityAndCompliance.multiGeoEntity.tenant.get',
438
+ },
439
+ '/security_and_compliance/v1/user_migrations': {
440
+ POST: 'securityAndCompliance.userMigration.create',
441
+ },
442
+ '/security_and_compliance/v1/user_migrations/{user_id}': {
443
+ GET: 'securityAndCompliance.userMigration.get',
444
+ },
445
+ '/security_and_compliance/v1/user_migrations/search': {
446
+ POST: 'securityAndCompliance.userMigration.search',
447
+ },
448
+ '/security_and_compliance/v1/user_migrations/cancel': {
449
+ POST: 'securityAndCompliance.userMigration.cancel',
450
+ },
336
451
  })
@@ -0,0 +1,432 @@
1
+ import * as Lark from '.'
2
+ import { Internal, Paginated, Pagination } from '../internal'
3
+
4
+ declare module '../internal' {
5
+ interface Internal {
6
+ spark: Spark.Methods
7
+ }
8
+ }
9
+
10
+ export namespace Spark {
11
+ export interface Methods {
12
+ app: App.Methods
13
+ directory: Directory.Methods
14
+ }
15
+
16
+ export namespace App {
17
+ export interface Methods {
18
+ table: Table.Methods
19
+ view: View.Methods
20
+ enum: Enum.Methods
21
+ storage: Storage.Methods
22
+ /**
23
+ * 执行 SQL
24
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app/sql_commands
25
+ */
26
+ sqlCommands(app_id: string, body: SqlCommandsRequest, query?: SqlCommandsQuery): Promise<SqlCommandsResponse>
27
+ }
28
+
29
+ export interface SqlCommandsRequest {
30
+ /** 要执行的 SQL 语句 */
31
+ sql: string
32
+ }
33
+
34
+ export interface SqlCommandsQuery {
35
+ /** 访问的 database 环境,默认为 online(线上环境) */
36
+ env?: string
37
+ }
38
+
39
+ export interface SqlCommandsResponse {
40
+ /** 如果是 SELECT 命令,返回的是查询结果的 JSON 序列化字符串。如果是其他无返回的命令,如 DELETE 等,result 为空 */
41
+ result: string
42
+ }
43
+
44
+ export namespace Table {
45
+ export interface Methods {
46
+ /**
47
+ * 获取数据表列表
48
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-table/get_table_list
49
+ */
50
+ getTableList(app_id: string, query?: GetTableListQuery): Paginated<Lark.AppTable>
51
+ /**
52
+ * 获取数据表详细信息
53
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-table/get_table_detail
54
+ */
55
+ getTableDetail(app_id: string, table_name: string, query?: GetTableDetailQuery): Promise<GetTableDetailResponse>
56
+ /**
57
+ * 查询数据表数据记录
58
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-table/get_table_record_list
59
+ */
60
+ getTableRecordList(app_id: string, table_name: string, query?: GetTableRecordListQuery): Promise<GetTableRecordListResponse>
61
+ /**
62
+ * 向数据表中添加或更新记录
63
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-table/post_table_records
64
+ */
65
+ postTableRecords(app_id: string, table_name: string, body: PostTableRecordsRequest, query?: PostTableRecordsQuery): Promise<PostTableRecordsResponse>
66
+ /**
67
+ * 按条件更新数据表中的记录
68
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-table/patch_table_records
69
+ */
70
+ patchTableRecords(app_id: string, table_name: string, body: PatchTableRecordsRequest, query?: PatchTableRecordsQuery): Promise<PatchTableRecordsResponse>
71
+ /**
72
+ * 批量更新数据表中的记录
73
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-table/batch_update_table_records
74
+ */
75
+ batchUpdateTableRecords(app_id: string, table_name: string, body: BatchUpdateTableRecordsRequest, query?: BatchUpdateTableRecordsQuery): Promise<BatchUpdateTableRecordsResponse>
76
+ /**
77
+ * 删除数据表中的记录
78
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-table/delete_table_records
79
+ */
80
+ deleteTableRecords(app_id: string, table_name: string, query?: DeleteTableRecordsQuery): Promise<void>
81
+ }
82
+
83
+ export interface GetTableListQuery extends Pagination {
84
+ /** 访问的 database 环境,默认为 online(线上环境) */
85
+ env?: string
86
+ }
87
+
88
+ export interface GetTableDetailQuery {
89
+ /** 访问的 database 环境,默认为 online(线上环境) */
90
+ env?: string
91
+ }
92
+
93
+ export interface GetTableDetailResponse {
94
+ /** 数据表名,如 student */
95
+ name: string
96
+ /** 数据表描述 */
97
+ description: string
98
+ /** 数据表列 */
99
+ columns: Lark.AppTableColumn[]
100
+ }
101
+
102
+ export interface GetTableRecordListQuery extends Pagination {
103
+ /**
104
+ * 返回的列,默认为 *,即返回所有列。
105
+ * 遵循 PostgREST 语法,详情可查看 https://docs.postgrest.org/en/v13/references/api/tables_views.html#vertical-filtering
106
+ */
107
+ select?: string
108
+ /** 筛选条件,尊许 PostgREST 语法,详情可查看 https://docs.postgrest.org/en/v13/references/api/tables_views.html#horizontal-filtering */
109
+ filter?: string
110
+ /**
111
+ * 排序条件,如果没指定 asc/desc,默认为 asc,null 值可排在最前或最后。
112
+ * 尊许 PostgREST 语法,详情可查看
113
+ * https://docs.postgrest.org/en/v13/references/api/tables_views.html#ordering
114
+ */
115
+ order?: string
116
+ /** 访问的 database 环境,默认为 online(线上环境) */
117
+ env?: string
118
+ /**
119
+ * 此次调用使用的用户 ID 类型,将使用指定的 ID 来标示某个用户在接口入参和出参中的值。
120
+ * 示例值:`miaoda_user_id`
121
+ * 可选值:
122
+ * - `miaoda_user_id`:标识一个用户在飞书开发套件应用中的身份。示例值:1838493619298330
123
+ * - `open_id`:标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。示例值:ou_bdbbd8f3f919829064b3ffc1b9476105 了解更多:如何获取 Open ID
124
+ * - `union_id`:标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的,在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID,应用开发商可以把同个用户在多个应用中的身份关联起来。示例值:on_b1b44199e8f3def4ebda5355409e2033 了解更多:如何获取 Union ID?
125
+ * 默认值:`miaoda_user_id`
126
+ */
127
+ user_identifier_type?: string
128
+ }
129
+
130
+ export interface GetTableRecordListResponse {
131
+ /** 是否还有更多项 */
132
+ has_more: boolean
133
+ /** 分页标记,当 has_more 为 true 时,会同时返回新的 page_token,否则不返回 page_token */
134
+ page_token: string
135
+ /** 符合条件的记录总数 */
136
+ total: number
137
+ /** 数据记录列表,格式为数组序列化后的 JSONString */
138
+ items: string
139
+ }
140
+
141
+ export interface PostTableRecordsRequest {
142
+ /** 要插入的数据记录列表,单次支持最多 500 条 */
143
+ records: string
144
+ }
145
+
146
+ export interface PostTableRecordsQuery {
147
+ /** UPSERT 时使用,指定列,多列英文逗号拼接 */
148
+ columns?: string
149
+ /**
150
+ * UPSERT 时使用,指定使用哪一个或多个具有唯一约束的字段作为冲突判断依据,默认为表主键。
151
+ * 假设 user_products 表有一个由 user_id 和 product_id 组成的复合唯一约束
152
+ */
153
+ on_conflict?: string
154
+ /** 访问的 database 环境,默认为 online(线上环境) */
155
+ env?: string
156
+ /**
157
+ * 此次调用使用的用户 ID 类型,将使用指定的 ID 来标示某个用户在接口入参和出参中的值。
158
+ * 示例值:`miaoda_user_id`
159
+ * 可选值:
160
+ * - `miaoda_user_id`:标识一个用户在飞书开发套件应用中的身份。示例值:1838493619298330
161
+ * - `open_id`:标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。示例值:ou_bdbbd8f3f919829064b3ffc1b9476105 了解更多:如何获取 Open ID
162
+ * - `union_id`:标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的,在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID,应用开发商可以把同个用户在多个应用中的身份关联起来。示例值:on_b1b44199e8f3def4ebda5355409e2033 了解更多:如何获取 Union ID?
163
+ * 默认值:`miaoda_user_id`
164
+ */
165
+ user_identifier_type?: string
166
+ }
167
+
168
+ export interface PostTableRecordsResponse {
169
+ /** 按照记录顺序创建或更新的记录 ID 列表 */
170
+ record_ids: Lark.Uuid[]
171
+ }
172
+
173
+ export interface PatchTableRecordsRequest {
174
+ /** 要更新的数据记录信息 */
175
+ record: string
176
+ }
177
+
178
+ export interface PatchTableRecordsQuery {
179
+ /** 筛选条件,尊许 PostgREST 语法,详情可查看 https://docs.postgrest.org/en/v13/references/api/tables_views.html#horizontal-filtering */
180
+ filter: string
181
+ /** 访问的 database 环境,默认为 online(线上环境) */
182
+ env?: string
183
+ /**
184
+ * 此次调用使用的用户 ID 类型,将使用指定的 ID 来标示某个用户在接口入参和出参中的值。
185
+ * 示例值:`miaoda_user_id`
186
+ * 可选值:
187
+ * - `miaoda_user_id`:标识一个用户在飞书开发套件应用中的身份。示例值:1838493619298330
188
+ * - `open_id`:标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。示例值:ou_bdbbd8f3f919829064b3ffc1b9476105 了解更多:如何获取 Open ID
189
+ * - `union_id`:标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的,在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID,应用开发商可以把同个用户在多个应用中的身份关联起来。示例值:on_b1b44199e8f3def4ebda5355409e2033 了解更多:如何获取 Union ID?
190
+ * 默认值:`miaoda_user_id`
191
+ */
192
+ user_identifier_type?: string
193
+ }
194
+
195
+ export interface PatchTableRecordsResponse {
196
+ /** 更新的记录唯一ID列表 */
197
+ record_ids: Lark.Uuid[]
198
+ }
199
+
200
+ export interface BatchUpdateTableRecordsRequest {
201
+ /** 要更新的数据记录列表,单次支持最多 500条,每行 record 都必须包含主键 _id,且不同行要更新的字段需保持一致 */
202
+ records: string
203
+ }
204
+
205
+ export interface BatchUpdateTableRecordsQuery {
206
+ /** 访问的 database 环境,默认为 online(线上环境) */
207
+ env?: string
208
+ /**
209
+ * 此次调用使用的用户 ID 类型,将使用指定的 ID 来标示某个用户在接口入参和出参中的值。
210
+ * 示例值:`miaoda_user_id`
211
+ * 可选值:
212
+ * - `miaoda_user_id`:标识一个用户在飞书开发套件应用中的身份。示例值:1838493619298330
213
+ * - `open_id`:标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。示例值:ou_bdbbd8f3f919829064b3ffc1b9476105 了解更多:如何获取 Open ID
214
+ * - `union_id`:标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的,在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID,应用开发商可以把同个用户在多个应用中的身份关联起来。示例值:on_b1b44199e8f3def4ebda5355409e2033 了解更多:如何获取 Union ID?
215
+ * 默认值:`miaoda_user_id`
216
+ */
217
+ user_identifier_type?: string
218
+ }
219
+
220
+ export interface BatchUpdateTableRecordsResponse {
221
+ /** 更新的记录唯一ID列表 */
222
+ record_ids: Lark.Uuid[]
223
+ }
224
+
225
+ export interface DeleteTableRecordsQuery {
226
+ /**
227
+ * 筛选条件,尊许 PostgREST 语法,详情可查看 https://docs.postgrest.org/en/v13/references/api/tables_views.html#horizontal-filtering
228
+ * 此处用法和查询数据记录一致
229
+ */
230
+ filter: string
231
+ /** 访问的 database 环境,默认为 online(线上环境) */
232
+ env?: string
233
+ }
234
+ }
235
+
236
+ export namespace View {
237
+ export interface Methods {
238
+ /**
239
+ * 查询视图数据记录
240
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-view/get_view_record_list
241
+ */
242
+ getViewRecordList(app_id: string, view_name: string, query?: GetViewRecordListQuery): Promise<GetViewRecordListResponse>
243
+ }
244
+
245
+ export interface GetViewRecordListQuery extends Pagination {
246
+ /**
247
+ * 返回的列,默认为 *,即返回所有列。
248
+ * 遵循 PostgREST 语法,详情可查看 https://docs.postgrest.org/en/v13/references/api/tables_views.html#vertical-filtering
249
+ */
250
+ select?: string
251
+ /** 筛选条件,尊许 PostgREST 语法,详情可查看 https://docs.postgrest.org/en/v13/references/api/tables_views.html#horizontal-filtering */
252
+ filter?: string
253
+ /**
254
+ * 排序条件,如果没指定 asc/desc,默认为 asc,null 值可排在最前或最后。
255
+ * 尊许 PostgREST 语法,详情可查看
256
+ * https://docs.postgrest.org/en/v13/references/api/tables_views.html#ordering
257
+ */
258
+ order?: string
259
+ /** 访问的 database 环境,默认为 online(线上环境) */
260
+ env?: string
261
+ /**
262
+ * 此次调用使用的用户 ID 类型,将使用指定的 ID 来标示某个用户在接口入参和出参中的值。
263
+ * 示例值:`miaoda_user_id`
264
+ * 可选值:
265
+ * - `miaoda_user_id`:标识一个用户在飞书开发套件应用中的身份。示例值:1838493619298330
266
+ * - `open_id`:标识一个用户在某个应用中的身份。同一个用户在不同应用中的 Open ID 不同。示例值:ou_bdbbd8f3f919829064b3ffc1b9476105 了解更多:如何获取 Open ID
267
+ * - `union_id`:标识一个用户在某个应用开发商下的身份。同一用户在同一开发商下的应用中的 Union ID 是相同的,在不同开发商下的应用中的 Union ID 是不同的。通过 Union ID,应用开发商可以把同个用户在多个应用中的身份关联起来。示例值:on_b1b44199e8f3def4ebda5355409e2033 了解更多:如何获取 Union ID?
268
+ * 默认值:`miaoda_user_id`
269
+ */
270
+ user_identifier_type?: string
271
+ }
272
+
273
+ export interface GetViewRecordListResponse {
274
+ /** 是否还有更多项 */
275
+ has_more: boolean
276
+ /** 分页标记,当 has_more 为 true 时,会同时返回新的 page_token,否则不返回 page_token */
277
+ page_token: string
278
+ /** 符合条件的记录总数 */
279
+ total: number
280
+ /** 数据记录列表,格式为数组序列化后的 JSONString */
281
+ items: string
282
+ }
283
+ }
284
+
285
+ export namespace Enum {
286
+ export interface Methods {
287
+ /**
288
+ * 获取自定义枚举列表
289
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-enum/get_enum_list
290
+ */
291
+ getEnumList(app_id: string, query?: GetEnumListQuery): Paginated<Lark.AppEnum>
292
+ /**
293
+ * 获取自定义枚举详细信息
294
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-enum/get_enum_detail
295
+ */
296
+ getEnumDetail(app_id: string, enum_name: string, query?: GetEnumDetailQuery): Promise<GetEnumDetailResponse>
297
+ }
298
+
299
+ export interface GetEnumListQuery extends Pagination {
300
+ /** 访问的 database 环境,默认为 online(线上环境) */
301
+ env?: string
302
+ }
303
+
304
+ export interface GetEnumDetailQuery {
305
+ /** 访问的 database 环境,默认为 online(线上环境) */
306
+ env?: string
307
+ }
308
+
309
+ export interface GetEnumDetailResponse {
310
+ /** 枚举名称 */
311
+ name: string
312
+ /** 枚举描述 */
313
+ description: string
314
+ /** 枚举值列表 */
315
+ options: string[]
316
+ /** 创建时间,毫秒时间戳 */
317
+ created_at: string
318
+ }
319
+ }
320
+
321
+ export namespace Storage {
322
+ export interface Methods {
323
+ /**
324
+ * 上传文件
325
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-storage/upload
326
+ */
327
+ upload(app_id: string, form: UploadForm): Promise<UploadResponse>
328
+ /**
329
+ * 下载文件
330
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/app-storage/download
331
+ */
332
+ download(app_id: string, query?: DownloadQuery): Promise<ArrayBuffer>
333
+ }
334
+
335
+ export interface UploadForm {
336
+ /** 文件名称 */
337
+ file_name: string
338
+ /** 文件的十六进制 SHA-256 值,用于文件一致性校验。如果传入此值,服务端会在上传完成后对比接收到文件的 SHA-256 值,如果不一致,会返回上传失败。 */
339
+ check_sum?: string
340
+ /** 文件二进制 */
341
+ file: Blob
342
+ }
343
+
344
+ export interface UploadResponse {
345
+ /** 文件 ID */
346
+ file_key: string
347
+ /** 文件 URL,相对路径 */
348
+ file_url: string
349
+ /** 文件名称 */
350
+ file_name: string
351
+ /** 文件大小,单位字节 */
352
+ file_size: number
353
+ /** 文件 MIME 类型 */
354
+ mime_type: string
355
+ }
356
+
357
+ export interface DownloadQuery {
358
+ /** 文件 ID,ID 和 URL 不能同时为空,都提供的情况下,使用 file_key */
359
+ file_key?: string
360
+ /** 文件 URL,ID 和 URL 不能同时为空 */
361
+ file_url?: string
362
+ }
363
+ }
364
+ }
365
+
366
+ export namespace Directory {
367
+ export interface Methods {
368
+ user: User.Methods
369
+ }
370
+
371
+ export namespace User {
372
+ export interface Methods {
373
+ /**
374
+ * 妙搭和飞书用户 ID 转换
375
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/spark-v1/directory-user/id_convert
376
+ */
377
+ idConvert(body: IdConvertRequest): Promise<IdConvertResponse>
378
+ }
379
+
380
+ export interface IdConvertRequest {
381
+ /** ID 转换类型,枚举 */
382
+ id_convert_type: Lark.IdConvertType
383
+ /** 长度最大100 */
384
+ ids?: string[]
385
+ }
386
+
387
+ export interface IdConvertResponse {
388
+ /** ID 映射,查询不到或者查询出错的不返回 */
389
+ items?: Lark.IdMapItem[]
390
+ }
391
+ }
392
+ }
393
+ }
394
+
395
+ Internal.define({
396
+ '/spark/v1/apps/{app_id}/tables': {
397
+ GET: { name: 'spark.app.table.getTableList', pagination: { argIndex: 1 } },
398
+ },
399
+ '/spark/v1/apps/{app_id}/tables/{table_name}': {
400
+ GET: 'spark.app.table.getTableDetail',
401
+ },
402
+ '/spark/v1/apps/{app_id}/tables/{table_name}/records': {
403
+ GET: 'spark.app.table.getTableRecordList',
404
+ POST: 'spark.app.table.postTableRecords',
405
+ PATCH: 'spark.app.table.patchTableRecords',
406
+ DELETE: 'spark.app.table.deleteTableRecords',
407
+ },
408
+ '/spark/v1/apps/{app_id}/tables/{table_name}/records_batch_update': {
409
+ PATCH: 'spark.app.table.batchUpdateTableRecords',
410
+ },
411
+ '/spark/v1/apps/{app_id}/views/{view_name}/records': {
412
+ GET: 'spark.app.view.getViewRecordList',
413
+ },
414
+ '/spark/v1/apps/{app_id}/enums': {
415
+ GET: { name: 'spark.app.enum.getEnumList', pagination: { argIndex: 1 } },
416
+ },
417
+ '/spark/v1/apps/{app_id}/enums/{enum_name}': {
418
+ GET: 'spark.app.enum.getEnumDetail',
419
+ },
420
+ '/spark/v1/apps/{app_id}/storage/upload': {
421
+ POST: { name: 'spark.app.storage.upload', multipart: true },
422
+ },
423
+ '/spark/v1/apps/{app_id}/storage': {
424
+ GET: { name: 'spark.app.storage.download', type: 'binary' },
425
+ },
426
+ '/spark/v1/apps/{app_id}/sql_commands': {
427
+ POST: 'spark.app.sqlCommands',
428
+ },
429
+ '/spark/v1/directory/user/id_convert': {
430
+ POST: 'spark.directory.user.idConvert',
431
+ },
432
+ })