@kevisual/api 0.0.32 → 0.0.33

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/api",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "",
5
5
  "main": "mod.ts",
6
6
  "scripts": {
@@ -92,6 +92,18 @@ 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 params = {
97
+ newName: newpath,
98
+ };
99
+ const url = `${this.prefix}${oldpath}`;
100
+ return adapter({
101
+ url,
102
+ method: 'PUT' as any,
103
+ headers: this.header(opts?.headers),
104
+ params,
105
+ });
106
+ }
95
107
  async deleteFile(filepath: string, opts?: DataOpts): Promise<Result<any>> {
96
108
  const url = `${this.prefix}${filepath}`;
97
109
  return adapter({