mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-08-26 01:02:02 +00:00
- Introduced new schemas for document viewing, including `DocumentViewFileRead` and `DocumentViewManifestRead`. - Implemented a new API endpoint to retrieve document view manifests, providing metadata for document presentation. - Added a document viewer component to handle various document types and their respective viewing logic. - Updated the right panel to support document viewing alongside existing features. - Enhanced tests to cover new document viewing functionalities and ensure robust error handling.
21 lines
669 B
TypeScript
21 lines
669 B
TypeScript
import { z } from "zod";
|
|
|
|
export const DocumentViewFileSchema = z.object({
|
|
file_id: z.number().int().positive(),
|
|
filename: z.string(),
|
|
mime_type: z.string(),
|
|
size_bytes: z.number().nonnegative(),
|
|
content_url: z.string(),
|
|
});
|
|
|
|
export const DocumentViewManifestSchema = z.object({
|
|
document_id: z.number().int().positive(),
|
|
title: z.string(),
|
|
document_type: z.string(),
|
|
status: z.string(),
|
|
presentation: z.enum(["original", "text", "missing_original"]),
|
|
file: DocumentViewFileSchema.nullable().optional(),
|
|
});
|
|
|
|
export type DocumentViewFile = z.infer<typeof DocumentViewFileSchema>;
|
|
export type DocumentViewManifest = z.infer<typeof DocumentViewManifestSchema>;
|