From 1d6931d10be5754b06b673277b8fdca4acafedb6 Mon Sep 17 00:00:00 2001 From: zhaoyingbo Date: Tue, 28 Jan 2025 09:22:36 +0000 Subject: [PATCH] =?UTF-8?q?feat(net-tool):=20=E6=B7=BB=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=95=B0=E6=8D=AE=E8=A1=A8=E8=AE=B0=E5=BD=95=E7=9A=84?= =?UTF-8?q?=20getMetaInfo=20=E6=96=B9=E6=B3=95=E5=8F=8A=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 1 + packages/net-tool/src/larkServer/sheet.ts | 10 ++++++++++ packages/net-tool/src/types/lark.ts | 11 +++++++++++ 3 files changed, 22 insertions(+) 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 }