@kevisual/api 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -156,6 +156,18 @@ export class QueryResources {
|
|
|
156
156
|
|
|
157
157
|
return { code: 200, message: '上传成功' };
|
|
158
158
|
}
|
|
159
|
+
|
|
160
|
+
async getState(filepath: string, opts?: DataOpts): Promise<Result<Stat>> {
|
|
161
|
+
const url = `${this.prefix}${filepath}`;
|
|
162
|
+
return adapter({
|
|
163
|
+
url,
|
|
164
|
+
params: {
|
|
165
|
+
stat: '1',
|
|
166
|
+
},
|
|
167
|
+
method: 'GET' as any,
|
|
168
|
+
headers: this.header(opts?.headers),
|
|
169
|
+
});
|
|
170
|
+
}
|
|
159
171
|
async createFolder(folderpath: string, opts?: DataOpts): Promise<Result<any>> {
|
|
160
172
|
const filepath = folderpath.endsWith('/') ? `${folderpath}keep.txt` : `${folderpath}/keep.txt`;
|
|
161
173
|
return this.uploadFile(filepath, '文件夹占位,其他文件不存在,文件夹不存在,如果有其他文件夹,删除当前文件夹占位文件即可', opts);
|
|
@@ -252,3 +264,17 @@ export const getContentType = (filename: string): string => {
|
|
|
252
264
|
|
|
253
265
|
return type;
|
|
254
266
|
};
|
|
267
|
+
|
|
268
|
+
type Stat = {
|
|
269
|
+
"standardHeaders": any,
|
|
270
|
+
"size": string,
|
|
271
|
+
"etag": string,
|
|
272
|
+
"lastModified": string,
|
|
273
|
+
"metaData": {
|
|
274
|
+
"app-source": string,
|
|
275
|
+
"cache-control": string,
|
|
276
|
+
"content-type": string,
|
|
277
|
+
"share"?: string
|
|
278
|
+
},
|
|
279
|
+
"versionId": null
|
|
280
|
+
}
|