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

Method updateFile

packages/filesystem/dropbox/rw.ts:74–93  ·  view source on GitHub ↗
(content: string | Blob)

Source from the content-addressed store, hash-verified

72 }
73
74 private async updateFile(content: string | Blob): Promise<void> {
75 const myHeaders = new Headers();
76 myHeaders.append("Content-Type", "application/octet-stream");
77 myHeaders.append(
78 "Dropbox-API-Arg",
79 JSON.stringify({
80 path: this.path,
81 mode: "overwrite",
82 autorename: false,
83 })
84 );
85
86 await this.fs.request("https://content.dropboxapi.com/2/files/upload", {
87 method: "POST",
88 headers: myHeaders,
89 body: content instanceof Blob ? content : new Blob([content]),
90 });
91
92 return Promise.resolve();
93 }
94
95 private async createNewFile(content: string | Blob): Promise<void> {
96 const myHeaders = new Headers();

Callers 1

writeMethod · 0.95

Calls 2

appendMethod · 0.80
requestMethod · 0.45

Tested by

no test coverage detected