refactor(server): use new storage providers (#5433)

This commit is contained in:
liuyi
2024-01-03 10:56:54 +00:00
parent a709624ebf
commit 0d34805375
42 changed files with 614 additions and 679 deletions

View File

@@ -1,5 +1,4 @@
import {
checkBlobSizesQuery,
deleteBlobMutation,
fetchWithTraceReport,
getBaseUrl,
@@ -31,20 +30,7 @@ export const createAffineCloudBlobStorage = (
});
},
set: async (key, value) => {
const {
checkBlobSize: { size },
} = await fetcher({
query: checkBlobSizesQuery,
variables: {
workspaceId,
size: value.size,
},
});
if (size <= 0) {
throw new Error('Blob size limit exceeded');
}
// set blob will check blob size & quota
const result = await fetcher({
query: setBlobMutation,
variables: {
@@ -52,7 +38,6 @@ export const createAffineCloudBlobStorage = (
blob: new File([value], key),
},
});
console.assert(result.setBlob === key, 'Blob hash mismatch');
return result.setBlob;
},
list: async () => {