(
key: string,
mtime?: number | undefined,
ctime?: number | undefined
)
| 445 | } |
| 446 | |
| 447 | async mkdir( |
| 448 | key: string, |
| 449 | mtime?: number | undefined, |
| 450 | ctime?: number | undefined |
| 451 | ): Promise<Entity> { |
| 452 | await this._init(); |
| 453 | |
| 454 | // "abc/efg" -> "abc/" |
| 455 | const parent = getParentFolder(key); |
| 456 | const itself = key.slice(0, -1).split("/").pop()!; |
| 457 | const { data, error } = await this.client.POST( |
| 458 | "/api/v2.1/mounts/{mountId}/files/folder", |
| 459 | { |
| 460 | params: { |
| 461 | query: { path: getKoofrPath(parent, this.remoteBaseDir) }, |
| 462 | path: { mountId: this.placeID }, |
| 463 | }, |
| 464 | body: { |
| 465 | name: itself, |
| 466 | }, |
| 467 | } |
| 468 | ); |
| 469 | if (error !== undefined) { |
| 470 | throw Error(JSON.stringify(error)); |
| 471 | } |
| 472 | return this.stat(key); |
| 473 | } |
| 474 | |
| 475 | async writeFile( |
| 476 | key: string, |
nothing calls this directly
no test coverage detected