web: change offline mode api

This commit is contained in:
Abdullah Atta
2024-08-02 15:14:52 +05:00
committed by Abdullah Atta
parent a4c0e8412b
commit 1b71edef45
4 changed files with 17 additions and 5 deletions

View File

@@ -564,6 +564,12 @@ async function exists(filename: string | FileHandle) {
);
}
async function bulkExists(filenames: string[]) {
return Array.from(
new Set(filenames).difference(new Set(await streamablefs.list())).values()
);
}
type FileMetadata = {
key: SerializedKey;
iv: string;
@@ -666,7 +672,8 @@ export const FileStorage: IFileStorage = {
exists,
clearFileStorage,
hashBase64,
getUploadedFileSize
getUploadedFileSize,
bulkExists
};
function isSuccessStatusCode(statusCode: number) {