(
items: AzureCommitItem[],
comment: string,
branch: string,
newBranch: boolean,
)
| 419 | } |
| 420 | |
| 421 | async uploadAndCommit( |
| 422 | items: AzureCommitItem[], |
| 423 | comment: string, |
| 424 | branch: string, |
| 425 | newBranch: boolean, |
| 426 | ) { |
| 427 | const ref = await this.getRef(newBranch ? this.branch : branch); |
| 428 | |
| 429 | const refUpdate = [ |
| 430 | { |
| 431 | name: this.branchToRef(branch), |
| 432 | oldObjectId: ref.objectId, |
| 433 | }, |
| 434 | ]; |
| 435 | |
| 436 | const changes = items.map(item => getChangeItem(item)); |
| 437 | const commits = [{ comment, changes }]; |
| 438 | const push = { |
| 439 | refUpdates: refUpdate, |
| 440 | commits, |
| 441 | }; |
| 442 | |
| 443 | return this.requestJSON({ |
| 444 | url: `${this.endpointUrl}/pushes`, |
| 445 | method: 'POST', |
| 446 | body: JSON.stringify(push), |
| 447 | }); |
| 448 | } |
| 449 | |
| 450 | async retrieveUnpublishedEntryData(contentKey: string) { |
| 451 | const { collection, slug } = parseContentKey(contentKey); |
no test coverage detected