(path: string)
| 140 | } |
| 141 | |
| 142 | async delete(path: string): Promise<void> { |
| 143 | const fullPath = joinPath(this.path, path); |
| 144 | |
| 145 | const myHeaders = new Headers(); |
| 146 | myHeaders.append("Content-Type", "application/json"); |
| 147 | |
| 148 | try { |
| 149 | await this.request("https://api.dropboxapi.com/2/files/delete_v2", { |
| 150 | method: "POST", |
| 151 | headers: myHeaders, |
| 152 | body: JSON.stringify({ |
| 153 | path: fullPath, |
| 154 | }), |
| 155 | }); |
| 156 | } catch (e: any) { |
| 157 | if (isDropboxPathNotFound(e)) { |
| 158 | return; |
| 159 | } |
| 160 | throw e; |
| 161 | } |
| 162 | |
| 163 | // 清除相关缓存 |
| 164 | this.clearRelatedCache(fullPath); |
| 165 | } |
| 166 | |
| 167 | async list(): Promise<FileInfo[]> { |
| 168 | let folderPath = this.path; |
nothing calls this directly
no test coverage detected