From 17d00ca08fcc6a3f1e847788e2806d5a8fad0fb8 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Sun, 1 Feb 2026 17:43:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E8=87=B3?= =?UTF-8?q?=200.0.40=EF=BC=8C=E6=96=B0=E5=A2=9E=20getState=20=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=BB=A5=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6=E7=8A=B6?= =?UTF-8?q?=E6=80=81=EF=BC=8C=E5=B9=B6=E6=89=A9=E5=B1=95=20Stat=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=BB=A5=E5=8C=85=E5=90=AB=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E5=85=83=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- query/query-resources/index.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c00d4ab..9a00eb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/api", - "version": "0.0.39", + "version": "0.0.40", "description": "", "main": "mod.ts", "scripts": { diff --git a/query/query-resources/index.ts b/query/query-resources/index.ts index 2283326..0fb0c73 100644 --- a/query/query-resources/index.ts +++ b/query/query-resources/index.ts @@ -156,6 +156,18 @@ export class QueryResources { return { code: 200, message: '上传成功' }; } + + async getState(filepath: string, opts?: DataOpts): Promise> { + const url = `${this.prefix}${filepath}`; + return adapter({ + url, + params: { + stat: '1', + }, + method: 'GET' as any, + headers: this.header(opts?.headers), + }); + } async createFolder(folderpath: string, opts?: DataOpts): Promise> { const filepath = folderpath.endsWith('/') ? `${folderpath}keep.txt` : `${folderpath}/keep.txt`; return this.uploadFile(filepath, '文件夹占位,其他文件不存在,文件夹不存在,如果有其他文件夹,删除当前文件夹占位文件即可', opts); @@ -252,3 +264,17 @@ export const getContentType = (filename: string): string => { return type; }; + +type Stat = { + "standardHeaders": any, + "size": string, + "etag": string, + "lastModified": string, + "metaData": { + "app-source": string, + "cache-control": string, + "content-type": string, + "share"?: string + }, + "versionId": null +}