Import a menu from PDF, photo, Excel/CSV, web link, or pasted text and turn it into draft sections + products with Claude. - Product.aiEstimated JSON flags AI-inferred macros/allergens (migration 0002) - POST /api/[slug]/import: resolves the source (vision via Sonnet for PDF/photo, Haiku for text/CSV/XLSX/web), extracts structured JSON for review only - POST /api/[slug]/import/apply: writes to the draft in add or replace mode, preserving aiEstimated flags; replace wipes the draft first - Editor: 'Cargar menú' button + glass ImportModal (method -> review -> add/replace), 'Estimado por IA — verifica' badges, verification disclaimer; ProductEditor shows the badge and clears the flag when the value is edited - Reuses anthropic.ts, upload/guard, shared extractJson (moved to lib/json.ts) - i18n labels (es/en); adds xlsx dependency for spreadsheet parsing Verified: build passes; migration applies; apply add/replace persist correctly with aiEstimated; extract validation + auth guard behave as expected.
45 lines
1.1 KiB
JSON
45 lines
1.1 KiB
JSON
{
|
|
"name": "smartmenu-collina",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "next dev",
|
|
"build": "prisma generate && next build",
|
|
"start": "next start",
|
|
"lint": "next lint",
|
|
"prisma:generate": "prisma generate",
|
|
"prisma:migrate": "prisma migrate dev",
|
|
"prisma:deploy": "prisma migrate deploy",
|
|
"db:seed": "tsx prisma/seed.ts"
|
|
},
|
|
"prisma": {
|
|
"seed": "tsx prisma/seed.ts"
|
|
},
|
|
"dependencies": {
|
|
"@anthropic-ai/sdk": "^0.65.0",
|
|
"@prisma/client": "^5.22.0",
|
|
"bcryptjs": "^2.4.3",
|
|
"clsx": "^2.1.1",
|
|
"jose": "^5.9.6",
|
|
"next": "14.2.21",
|
|
"next-intl": "^3.26.3",
|
|
"qrcode": "^1.5.4",
|
|
"xlsx": "^0.18.5",
|
|
"react": "^18.3.1",
|
|
"react-dom": "^18.3.1"
|
|
},
|
|
"devDependencies": {
|
|
"@types/bcryptjs": "^2.4.6",
|
|
"@types/node": "^20.17.10",
|
|
"@types/qrcode": "^1.5.5",
|
|
"@types/react": "^18.3.18",
|
|
"@types/react-dom": "^18.3.5",
|
|
"autoprefixer": "^10.4.20",
|
|
"postcss": "^8.4.49",
|
|
"prisma": "^5.22.0",
|
|
"tailwindcss": "^3.4.17",
|
|
"tsx": "^4.19.2",
|
|
"typescript": "^5.7.2"
|
|
}
|
|
}
|