(
path: string,
sha: string | null | undefined,
{ branch = this.branch } = {},
)
| 322 | }; |
| 323 | |
| 324 | async readFileMetadata( |
| 325 | path: string, |
| 326 | sha: string | null | undefined, |
| 327 | { branch = this.branch } = {}, |
| 328 | ) { |
| 329 | const fetchFileMetadata = async () => { |
| 330 | try { |
| 331 | const { value } = await this.requestJSON<AzureArray<AzureCommit>>({ |
| 332 | url: `${this.endpointUrl}/commits/`, |
| 333 | params: { |
| 334 | 'searchCriteria.itemPath': path, |
| 335 | 'searchCriteria.itemVersion.version': branch, |
| 336 | 'searchCriteria.$top': 1, |
| 337 | }, |
| 338 | }); |
| 339 | const [commit] = value; |
| 340 | |
| 341 | return { |
| 342 | author: commit.author.name || commit.author.email, |
| 343 | updatedOn: commit.author.date, |
| 344 | }; |
| 345 | } catch (error) { |
| 346 | return { author: '', updatedOn: '' }; |
| 347 | } |
| 348 | }; |
| 349 | |
| 350 | const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage); |
| 351 | return fileMetadata; |
| 352 | } |
| 353 | |
| 354 | readFile = ( |
| 355 | path: string, |
nothing calls this directly
no test coverage detected