Skip to main content

FileMetadata

@forge/monorepo


@forge/monorepo / backend/src / FileMetadata

Type Alias: FileMetadata

FileMetadata = object

Defined in: backend/src/persistence/index.ts:1110

Properties

byteSize

readonly byteSize: number

Defined in: backend/src/persistence/index.ts:1123


checksum?

readonly optional checksum?: string

Defined in: backend/src/persistence/index.ts:1134

Of the bytes as stored, so a read-back can be checked rather than assumed.


contentKey

readonly contentKey: string

Defined in: backend/src/persistence/index.ts:1132

How the content store addresses the bytes. Opaque here.

Deliberately not derived from the filename or the id: a key a caller can construct is a key a caller can guess, and sanitizeMediaRefs' comment in ShareFlow is the cautionary tale — its workspace-prefix check was "the ONLY thing standing between a forged path and a signed URL to another tenant's private object".


conversationId

readonly conversationId: ConversationId

Defined in: backend/src/persistence/index.ts:1119

The conversation that owns it.

Ownership rather than association: AC-3 and AC-4 of #129 both follow from it — entitlement to the file is entitlement to the conversation, and deleting the conversation is what schedules the bytes. A file with no owner would need its own permission model, which is a second one to keep in step.


createdAt

readonly createdAt: string

Defined in: backend/src/persistence/index.ts:1139


deletedAt?

readonly optional deletedAt?: string

Defined in: backend/src/persistence/index.ts:1141

Soft delete. A row is kept so a reference to it resolves to "deleted" rather than to nothing.


extraction?

readonly optional extraction?: FileExtraction

Defined in: backend/src/persistence/index.ts:1137

Extraction outcome (#131). Absent for a file nothing has tried to extract yet.


filename

readonly filename: string

Defined in: backend/src/persistence/index.ts:1121

As the user named it. Display only — never used to address the bytes.


id

readonly id: FileId

Defined in: backend/src/persistence/index.ts:1111


mediaType

readonly mediaType: string

Defined in: backend/src/persistence/index.ts:1122


state

readonly state: FileState

Defined in: backend/src/persistence/index.ts:1135


uploadedBy

readonly uploadedBy: PrincipalId

Defined in: backend/src/persistence/index.ts:1138