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

Method createNewFile

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

Source from the content-addressed store, hash-verified

93 }
94
95 private async createNewFile(content: string | Blob): Promise<void> {
96 const myHeaders = new Headers();
97 myHeaders.append("Content-Type", "application/octet-stream");
98 myHeaders.append(
99 "Dropbox-API-Arg",
100 JSON.stringify({
101 path: this.path,
102 mode: "add",
103 autorename: false,
104 })
105 );
106
107 await this.fs.request("https://content.dropboxapi.com/2/files/upload", {
108 method: "POST",
109 headers: myHeaders,
110 body: content instanceof Blob ? content : new Blob([content]),
111 });
112
113 return Promise.resolve();
114 }
115}

Callers 1

writeMethod · 0.95

Calls 2

appendMethod · 0.80
requestMethod · 0.45

Tested by

no test coverage detected