MCPcopy Create free account
hub / github.com/fontsource/fontsource / abortMultiPartUpload

Function abortMultiPartUpload

api/download/src/bucket.ts:76–102  ·  view source on GitHub ↗
(
	bucketPath: string,
	uploadId: string,
	msg?: string,
)

Source from the content-addressed store, hash-verified

74};
75
76const abortMultiPartUpload = async (
77 bucketPath: string,
78 uploadId: string,
79 msg?: string,
80) => {
81 const resp = await fetch(
82 `https://upload.fontsource.org/multipart/${bucketPath}?action=mpu-abort`,
83 {
84 method: 'DELETE',
85 headers: {
86 Authorization: `Bearer ${
87 // biome-ignore lint/style/noNonNullAssertion: <explanation>
88 process.env.UPLOAD_KEY!
89 }`,
90 },
91 body: JSON.stringify({
92 uploadId,
93 }),
94 },
95 );
96
97 if (!resp.ok) {
98 const error = await resp.text();
99 const errorMsg = `Unable to abort multipart upload. ${error}`;
100 handleBucketError(resp, msg ? `${msg} ${errorMsg}` : errorMsg);
101 }
102};
103
104const initiateMultipartUpload = async (bucketPath: string): Promise<string> => {
105 const resp = await fetch(

Callers 2

uploadPartFunction · 0.85
completeMultipartUploadFunction · 0.85

Calls 3

handleBucketErrorFunction · 0.85
textMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected