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

Method uploadBlob

packages/decap-cms-backend-github/src/API.ts:1432–1447  ·  view source on GitHub ↗
(item: { raw?: string; sha?: string; toBase64?: () => Promise<string> })

Source from the content-addressed store, hash-verified

1430 }
1431
1432 async uploadBlob(item: { raw?: string; sha?: string; toBase64?: () => Promise<string> }) {
1433 const contentBase64 = await result(
1434 item,
1435 'toBase64',
1436 partial(this.toBase64, item.raw as string),
1437 );
1438 const response = await this.request(`${this.repoURL}/git/blobs`, {
1439 method: 'POST',
1440 body: JSON.stringify({
1441 content: contentBase64,
1442 encoding: 'base64',
1443 }),
1444 });
1445 item.sha = response.sha;
1446 return item;
1447 }
1448
1449 async updateTree(
1450 baseSha: string,

Callers 3

checkMetadataRefMethod · 0.95
storeMetadataMethod · 0.95
persistFilesMethod · 0.95

Calls 2

requestMethod · 0.95
partialFunction · 0.85

Tested by

no test coverage detected