MCPcopy Create free account
hub / github.com/decaporg/decap-cms / fetchFileMetadata

Method fetchFileMetadata

packages/decap-cms-backend-gitea/src/API.ts:292–308  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

290
291 async readFileMetadata(path: string, sha: string | null | undefined) {
292 const fetchFileMetadata = async () => {
293 try {
294 const result: ReposListCommitsResponse = await this.request(
295 `${this.originRepoURL}/commits`,
296 {
297 params: { path, sha: this.branch, stat: 'false' },
298 },
299 );
300 const { commit } = result[0];
301 return {
302 author: commit.author.name || commit.author.email,
303 updatedOn: commit.author.date,
304 };
305 } catch (e) {
306 return { author: '', updatedOn: '' };
307 }
308 };
309 const fileMetadata = await readFileMetadata(sha, fetchFileMetadata, localForage);
310 return fileMetadata;
311 }

Callers

nothing calls this directly

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected