(paths: string[], message: string)
| 518 | } |
| 519 | |
| 520 | async deleteFiles(paths: string[], message: string) { |
| 521 | if (this.useOpenAuthoring) { |
| 522 | throw new APIError( |
| 523 | 'Cannot delete published entries as an Open Authoring user!', |
| 524 | 403, |
| 525 | API_NAME, |
| 526 | ); |
| 527 | } |
| 528 | |
| 529 | const operations: ChangeFileOperation[] = await Promise.all( |
| 530 | paths.map(async path => { |
| 531 | const sha = await this.getFileSha(path); |
| 532 | |
| 533 | return { |
| 534 | operation: FileOperation.DELETE, |
| 535 | path, |
| 536 | sha, |
| 537 | } as ChangeFileOperation; |
| 538 | }), |
| 539 | ); |
| 540 | return this.changeFiles(operations, { commitMessage: message }); |
| 541 | } |
| 542 | |
| 543 | toBase64(str: string) { |
| 544 | return Promise.resolve(Base64.encode(str)); |
no test coverage detected