feat: fs object metadata cache and validation

This commit is contained in:
Huskydog9988
2025-05-14 17:19:39 -04:00
parent b551788c4c
commit 2cc3f1329c
2 changed files with 28 additions and 9 deletions
+10 -5
View File
@@ -14,17 +14,22 @@
* anotherUserId:write
*/
import { type } from "arktype";
import { parse as getMimeTypeBuffer } from "file-type-mime";
import type { Writable } from "stream";
import { Readable } from "stream";
import { getMimeType as getMimeTypeStream } from "stream-mime-type";
export type ObjectReference = string;
export type ObjectMetadata = {
mime: string;
permissions: string[];
userMetadata: { [key: string]: string };
};
export const objectMetadata = type({
mime: "string",
permissions: "string[]",
userMetadata: {
"[string]": "string",
},
});
export type ObjectMetadata = typeof objectMetadata.infer;
export enum ObjectPermission {
Read = "read",