Complete files UI rewiring to the deployed api surface; expose mimeClass

page.tsx now calls the real backend: GET /files with groupId/name/mimeClass/
cursor/limit (origin filter dropped — the api has no origin param), shares
tracked as ShareCreated (revoke by id), retention mapped to the orthogonal
legalHold model, downloads by item.name, samples reshaped to the wire
contract.

GroupFile gains mimeClass (the indexed coarse class the row icon and the
filter depend on): core contract, service row mapper, parseGroupFile guard,
test fixture, UI types — one vocabulary end to end. parseGroupFile's roomId
becomes null-tolerant to match direct-upload rows (mapping input stays
strict).

Verified: core build clean, api typecheck 0 errors + group-files 22/22,
web typecheck 0 errors.
This commit is contained in:
glass beadian 2026-10-11 11:08:08 +00:00
parent e7e703c105
commit 4bf90ffe25
6 changed files with 53 additions and 49 deletions

View file

@ -22,6 +22,8 @@ export type SharedFileOrigin =
| { kind: "upload" }
| { kind: "pad-export"; padId: string; revision: string };
import type { MimeClass } from "./file-mime.js";
export interface GroupFile {
id: string;
workspaceId: string;
@ -34,6 +36,8 @@ export interface GroupFile {
origin: SharedFileOrigin;
name: string;
mimeType: string;
/** Coarse class derived from the payload (image/video/audio/document/archive/other). */
mimeClass: MimeClass;
sizeBytes: number;
/** SHA-256 of verified payload bytes, lowercase hex; never an S3 ETag. */
checksum: { algorithm: "sha256"; value: string };