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