(
path: string,
localFilePath: string,
onProgress?: (loaded: number, total: number) => void,
)
| 102 | } |
| 103 | |
| 104 | async putFile( |
| 105 | path: string, |
| 106 | localFilePath: string, |
| 107 | onProgress?: (loaded: number, total: number) => void, |
| 108 | ): Promise<void> { |
| 109 | const resolved = this.resolvePath(path); |
| 110 | try { |
| 111 | await this.client.putFile(resolved, localFilePath, onProgress); |
| 112 | } catch (e) { |
| 113 | const message = e instanceof Error ? e.message : String(e); |
| 114 | if (!/\b(403|404|409)\b/.test(message)) throw e; |
| 115 | const parent = resolved.substring(0, resolved.lastIndexOf("/")); |
| 116 | if (!parent || parent === "/") throw e; |
| 117 | await this.client.ensureDirectory(parent); |
| 118 | await this.client.putFile(resolved, localFilePath, onProgress); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | async get(path: string): Promise<Uint8Array> { |
| 123 | return this.client.get(this.resolvePath(path)); |
nothing calls this directly
no test coverage detected