diff --git a/.vscode/settings.json b/.vscode/settings.json index 5420a28..110e8e4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,7 @@ "cSpell.words": [ "cloudml", "commitlint", + "metainfo", "tseslint", "unapproval", "Xauthor", diff --git a/packages/net-tool/src/larkServer/sheet.ts b/packages/net-tool/src/larkServer/sheet.ts index 97f108c..14d8ed2 100644 --- a/packages/net-tool/src/larkServer/sheet.ts +++ b/packages/net-tool/src/larkServer/sheet.ts @@ -98,6 +98,16 @@ class LarkSheetService extends LarkBaseService { const path = `/bitable/v1/apps/${appToken}/tables/${tableId}/records` return this.get(path) } + + /** + * 获取指定数据表的记录 + * @param sheetToken 表格令牌。 + * @returns + */ + async getMetaInfo(sheetToken: string) { + const path = `/sheets/v2/spreadsheets/${sheetToken}/metainfo` + return this.get(path) + } } export default LarkSheetService diff --git a/packages/net-tool/src/types/lark.ts b/packages/net-tool/src/types/lark.ts index ecc6f7e..e9c66bd 100644 --- a/packages/net-tool/src/types/lark.ts +++ b/packages/net-tool/src/types/lark.ts @@ -148,6 +148,13 @@ export namespace Lark { owner: string } + export interface SheetMetaInfo { + sheets: { + sheetId: string + index: number + }[] + } + export interface BaseRes { code: number data: T @@ -164,6 +171,10 @@ export namespace Lark { } } + export interface SheetMetaInfoRes extends BaseRes { + data: SheetMetaInfo + } + export interface WikiNodeRes extends BaseRes { data: WikiNodeData }