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

Method uploadBlob

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

Source from the content-addressed store, hash-verified

1404 }
1405
1406 async uploadBlob(item: { raw?: string; sha?: string; toBase64?: () => Promise<string> }) {
1407 const contentBase64 = await result(
1408 item,
1409 'toBase64',
1410 partial(this.toBase64, item.raw as string),
1411 );
1412 const response = await this.request(`${this.repoURL}/git/blobs`, {
1413 method: 'POST',
1414 body: JSON.stringify({
1415 content: contentBase64,
1416 encoding: 'base64',
1417 }),
1418 });
1419 item.sha = response.sha;
1420 return item;
1421 }
1422
1423 async updateTree(
1424 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