mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
디렉터리 페이지에서 파일 목록도 함께 표시하도록 구현 및 파일/디렉터리 이름이 너무 긴 경우 잘라서 표시하도록 개선
This commit is contained in:
@@ -14,6 +14,7 @@ import type {
|
||||
DirectroyInfoResponse,
|
||||
DirectoryCreateRequest,
|
||||
FileUploadRequest,
|
||||
FileInfoResponse,
|
||||
} from "$lib/server/schemas";
|
||||
import type { MasterKey } from "$lib/stores";
|
||||
|
||||
@@ -29,6 +30,15 @@ export const decryptDirectroyMetadata = async (
|
||||
};
|
||||
};
|
||||
|
||||
export const decryptFileMetadata = async (metadata: FileInfoResponse, masterKey: CryptoKey) => {
|
||||
const { dataKey } = await unwrapDataKey(metadata.dek, masterKey);
|
||||
return {
|
||||
name: new TextDecoder().decode(
|
||||
await decryptData(decodeFromBase64(metadata.name), metadata.nameIv, dataKey),
|
||||
),
|
||||
};
|
||||
};
|
||||
|
||||
export const requestDirectroyCreation = async (
|
||||
name: string,
|
||||
parentId: "root" | number,
|
||||
|
||||
Reference in New Issue
Block a user