MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / delete

Method delete

packages/filesystem/dropbox/dropbox.ts:142–165  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 5

requestMethod · 0.95
clearRelatedCacheMethod · 0.95
joinPathFunction · 0.90
isDropboxPathNotFoundFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected