mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-10-17 21:29:20 +02:00
Rebuilt on top of dev's RFC #883 state-machine UI rather than the now-defunct StoredFile shape: - Extend StoredFileInfo with fileName/size/uploadedAt/isUserUpload - Populate metadata from on-disk stats in RagService.getStoredFiles - Add fileSourceSchema validator + getFileContent/downloadFile endpoints scoped to the uploads directory only (tighter than the original PR — matches docs_service traversal pattern) - KnowledgeBaseModal: sortable Size and Uploaded columns; View/Download buttons on upload-bucket rows; new FileViewerModal for in-browser text preview. Bucket grouping preserved — sort applies within each bucket. - Use formatBytes from ~/lib/util rather than redefining
41 lines
780 B
TypeScript
41 lines
780 B
TypeScript
import vine from '@vinejs/vine'
|
|
|
|
export const getJobStatusSchema = vine.compile(
|
|
vine.object({
|
|
filePath: vine.string(),
|
|
})
|
|
)
|
|
|
|
export const deleteFileSchema = vine.compile(
|
|
vine.object({
|
|
source: vine.string(),
|
|
})
|
|
)
|
|
|
|
export const embedFileSchema = vine.compile(
|
|
vine.object({
|
|
source: vine.string().minLength(1),
|
|
force: vine.boolean().optional(),
|
|
})
|
|
)
|
|
|
|
export const fileSourceSchema = vine.compile(
|
|
vine.object({
|
|
source: vine.string().minLength(1),
|
|
})
|
|
)
|
|
|
|
export const estimateBatchSchema = vine.compile(
|
|
vine.object({
|
|
files: vine
|
|
.array(
|
|
vine.object({
|
|
filename: vine.string().minLength(1).maxLength(255),
|
|
sizeBytes: vine.number().min(0),
|
|
})
|
|
)
|
|
.minLength(1)
|
|
.maxLength(500),
|
|
})
|
|
)
|