Skip to content

feat(sourcetypes): add excel to sourcetypes files and docs about comm… - #51

Merged
albegosu merged 1 commit into
mainfrom
feat/excel-sourcetype
May 19, 2026
Merged

feat(sourcetypes): add excel to sourcetypes files and docs about comm…#51
albegosu merged 1 commit into
mainfrom
feat/excel-sourcetype

Conversation

@albegosu

Copy link
Copy Markdown
Owner

Summary

  • Add .xls / .xlsx upload support to the document ingestion pipeline using SheetJS (xlsx)
  • Each worksheet is converted to a markdown table (## SheetName header + pipe-delimited rows) before chunking, so the RAG pipeline requires no changes
  • sourceType is set to 'spreadsheet' for Excel files; the document list renders a dedicated table-cells icon for this type

Changes

Backend (server/utils/documents.service.ts)

  • Import xlsx and add Excel MIMEs to ALLOWED_MIME
  • isAllowedMime() — accepts .xls / .xlsx by extension as fallback
  • detectFileType() — returns 'spreadsheet' for Excel inputs
  • spreadsheetToText() — iterates SheetNames, converts each sheet via sheet_to_json into a markdown table
  • extractTextFromUpload() — routes Excel buffers through spreadsheetToText()

Config (nuxt.config.ts)

  • Default ALLOWED_FORMATS extended from pdf,md,txtpdf,md,txt,xls,xlsx

Frontend

  • pages/upload.vue — file input accept includes .xls,.xlsx
  • pages/documents/index.vuegetIconForType() maps 'spreadsheet'i-heroicons-table-cells

i18n (en.json, es.json)

  • upload.supports updated to list .xls, .xlsx

Test plan

  • Upload a multi-sheet .xlsx file and verify each sheet appears as a markdown table in the stored content
  • Upload a legacy .xls file and confirm it is processed without errors
  • Verify unsupported extensions (e.g. .docx) still return HTTP 415
  • Confirm the document list shows the table-cells icon for spreadsheet documents
  • Confirm PDF, TXT, and MD uploads are unaffected (no regression)
  • Check that ALLOWED_FORMATS env override still works (set to pdf,txt and verify .xlsx is rejected)

@albegosu
albegosu merged commit 399beec into main May 19, 2026
5 checks passed
@albegosu
albegosu deleted the feat/excel-sourcetype branch June 20, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant