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 +}