Skip to content

Commit 3a952b5

Browse files
committed
[fix] 2 missing Type fields of BI Table
1 parent fe0dab7 commit 3a952b5

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mobx-lark",
3-
"version": "2.6.3",
3+
"version": "2.6.4",
44
"license": "LGPL-3.0",
55
"author": "shiy2008@gmail.com",
66
"description": "Unofficial TypeScript SDK for FeiShu/Lark API, which is based on MobX-RESTful.",

src/Lark.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export class LarkApp implements LarkAppOption {
286286
return this.documentStore.getOneContent(doc_token, 'markdown');
287287
}
288288

289-
async getBiTableSchema(appId: string) {
289+
async getBiTableSchema(appId: string): Promise<BiTableSchema> {
290290
const { client } = this;
291291

292292
class InternalTableModel extends BiTable() {
@@ -308,6 +308,6 @@ export class LarkApp implements LarkAppOption {
308308
Object.fromEntries(list.map(({ name, shared_url }) => [name, shared_url]))
309309
])
310310
);
311-
return { tables, tableIdMap, forms, formLinkMap } as BiTableSchema;
311+
return { appId, tables, tableIdMap, forms, formLinkMap };
312312
}
313313
}

src/module/BITable/type.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface TableFormView
2424
export type LarkFormData = LarkData<{ form: TableFormView }>;
2525

2626
export interface BiTableSchema {
27+
appId: string;
2728
tables: BITable[];
2829
tableIdMap: Record<string, string>;
2930
forms: Record<string, TableFormView[]>;
@@ -60,11 +61,9 @@ export interface TableCellAttachment
6061
mimeType: TableCellMedia['type'];
6162
}
6263

63-
export interface TableCellUser extends LocaleUser {
64-
id: string;
65-
}
64+
export type TableCellUser = LocaleUser & Record<'id' | 'avatar_url', string>;
6665

67-
export type TableCellGroup = Record<'id' | 'name' | 'avatar_url', string>;
66+
export type TableCellGroup = Pick<TableCellUser, 'id' | 'name' | 'avatar_url'>;
6867

6968
export interface TableCellMetion extends Record<'mentionType' | 'text', string> {
7069
type: 'mention';

0 commit comments

Comments
 (0)