@kevisual/api 0.0.32 → 0.0.34
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
|
@@ -92,6 +92,20 @@ export class QueryResources {
|
|
|
92
92
|
const filepath = folderpath.endsWith('/') ? `${folderpath}keep.txt` : `${folderpath}/keep.txt`;
|
|
93
93
|
return this.uploadFile(filepath, '文件夹占位,其他文件不存在,文件夹不存在,如果有其他文件夹,删除当前文件夹占位文件即可', opts);
|
|
94
94
|
}
|
|
95
|
+
async rename(oldpath: string, newpath: string, opts?: DataOpts): Promise<Result<any>> {
|
|
96
|
+
const pathname = `${this.prefix}${oldpath}`;
|
|
97
|
+
const newName = `${this.prefix}${newpath}`;
|
|
98
|
+
const params = {
|
|
99
|
+
newName: newName,
|
|
100
|
+
};
|
|
101
|
+
const url = pathname
|
|
102
|
+
return adapter({
|
|
103
|
+
url,
|
|
104
|
+
method: 'PUT' as any,
|
|
105
|
+
headers: this.header(opts?.headers),
|
|
106
|
+
params,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
95
109
|
async deleteFile(filepath: string, opts?: DataOpts): Promise<Result<any>> {
|
|
96
110
|
const url = `${this.prefix}${filepath}`;
|
|
97
111
|
return adapter({
|