From 8dbe5c2a1d8dc15bbdd6810b2582c680e1c0bb9b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 1 Jan 2026 22:06:40 +0900 Subject: feat(import): add CSV bulk import for notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add client-side CSV parsing and bulk import API endpoint for importing notes from CSV files. Supports quoted fields, newlines in values, and escaped quotes. - New POST /api/decks/{deckId}/notes/import endpoint for bulk creation - CSV parser with RFC 4180 compliance - Multi-phase import modal (upload → validate → preview → import) - Client-side validation with per-row error reporting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/server/schemas/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/server/schemas') diff --git a/src/server/schemas/index.ts b/src/server/schemas/index.ts index d2a8fb0..fc1bd77 100644 --- a/src/server/schemas/index.ts +++ b/src/server/schemas/index.ts @@ -186,6 +186,16 @@ export const updateNoteSchema = z.object({ fields: z.record(z.uuid(), z.string()), }); +// Bulk note import input schema +export const bulkCreateNotesSchema = z.object({ + notes: z.array( + z.object({ + noteTypeId: z.uuid(), + fields: z.record(z.uuid(), z.string()), + }), + ), +}); + // NoteFieldValue schema export const noteFieldValueSchema = z.object({ id: z.uuid(), @@ -244,4 +254,5 @@ export type UpdateNoteFieldTypeSchema = z.infer< export type NoteSchema = z.infer; export type CreateNoteSchema = z.infer; export type UpdateNoteSchema = z.infer; +export type BulkCreateNotesSchema = z.infer; export type NoteFieldValueSchema = z.infer; -- cgit v1.2.3-70-g09d2