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

Method delete

packages/filesystem/baidu/baidu.ts:85–102  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

83 }
84
85 delete(path: string): Promise<void> {
86 const filelist = [joinPath(this.path, path)];
87 const myHeaders = new Headers();
88 myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
89 return this.request(
90 `https://pan.baidu.com/rest/2.0/xpan/file?method=filemanager&access_token=${this.accessToken}&opera=delete`,
91 {
92 method: "POST",
93 body: `async=0&filelist=${encodeURIComponent(JSON.stringify(filelist))}`,
94 headers: myHeaders,
95 }
96 ).then((data) => {
97 if (data.errno) {
98 throw new Error(JSON.stringify(data));
99 }
100 return data;
101 });
102 }
103
104 async list(): Promise<FileInfo[]> {
105 const list: FileInfo[] = [];

Callers

nothing calls this directly

Calls 3

requestMethod · 0.95
joinPathFunction · 0.90
appendMethod · 0.80

Tested by

no test coverage detected