feat: adds PDF import with conversion to JSON 1.0

- Accept only PDF and JSON files in import modal and API
- Convert PDF statements to JSON 1.0 via LLM (OpenAI-compatible)
- Use multipart/form-data for file upload (multer, 15 MB limit)
- Add LLM_API_KEY and LLM_API_BASE_URL for configurable LLM endpoint
- Update ImportModal to validate type and send FormData
- Add postFormData to API client for file upload
This commit is contained in:
Anton
2026-03-13 13:38:02 +03:00
parent d1536b8872
commit 975f2c4fd2
13 changed files with 745 additions and 48 deletions

View File

@@ -14,6 +14,9 @@
"cors": "^2.8.6",
"dotenv": "^17.3.1",
"express": "^5.2.1",
"multer": "^2.1.1",
"openai": "^6.27.0",
"pdf-parse": "^2.4.5",
"pg": "^8.19.0",
"uuid": "^13.0.0"
},
@@ -21,6 +24,7 @@
"@types/cookie-parser": "^1.4.10",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"@types/multer": "^2.1.0",
"@types/node": "^25.3.3",
"@types/pg": "^8.18.0",
"@types/uuid": "^10.0.0",