ConusAI vendor v0.1.0-dev.20261013+85463d22

This commit is contained in:
ConusAI vendor v0.1.0-dev.20261013+85463d22
2026-10-13 20:45:57 +00:00
parent c3c6526952
commit 0da8a2a81b
67 changed files with 1510 additions and 10153 deletions
+10
View File
@@ -23,6 +23,16 @@ export function fileRepository(db: Db) {
return db.select().from(files).where(eq(files.noteId, noteId))
},
/** The attachment, or `undefined` when `authorId` did not attach it. */
async get(id: string, authorId: string): Promise<FileRow | undefined> {
const [row] = await db
.select()
.from(files)
.where(and(eq(files.id, id), eq(files.authorId, authorId)))
.limit(1)
return row
},
/** Every attachment the visitor made, across their notes. */
async listByAuthor(authorId: string): Promise<FileRow[]> {
return db.select().from(files).where(eq(files.authorId, authorId))
+1
View File
@@ -1,3 +1,4 @@
export { files, type FileRow } from './model/schema'
export { fileId } from './model/id'
export { MAX_UPLOAD_BYTES, ALLOWED_CONTENT_TYPES, uploadLimits, type UploadCandidate } from './model/limits'
export { fileRepository, type NewFile } from './api/repository'
+4
View File
@@ -0,0 +1,4 @@
import { z } from 'zod'
/** A file id as it arrives in a URL or a form: a UUID, nothing else. */
export const fileId = z.uuid()