Skip to content

feat(reins): upload file and archive sources to knowledge#2

Merged
mykyta-torbynskyi merged 3 commits into
mainfrom
feat/reins-source-upload
Jun 16, 2026
Merged

feat(reins): upload file and archive sources to knowledge#2
mykyta-torbynskyi merged 3 commits into
mainfrom
feat/reins-source-upload

Conversation

@mykyta-torbynskyi

Copy link
Copy Markdown
Contributor

What

Enables file and archive (.zip) uploads as knowledge sources. Previously only text and URL sources worked; file and archive uploads silently failed.

Why

File/archive uploads went through a raw $fetch to a relative /api path with no auth, while text/url sources used the configured axios client (baseURL + Bearer interceptor). The backend also had no working S3 upload path for streamed archive entries.

Changes

  • admin: route multipart uploads through apiClient.instance so they reach the API origin with auth; add an archive upload form and the matching store action.
  • api: buffer the multipart upload to a temp file for extraction; implement uploadFileStream as a buffered S3 PutObject; run the archive import in the background (one file-source per entry) and return the detected count immediately.
  • api: new archive.extractor (lazy per-entry zip streaming, skips unsupported files and macOS metadata) plus AddFromArchiveResultDto.
  • terraform: provision the reins_sources S3 bucket and retire pg_backups via removed blocks (drops them from state without deleting the AWS bucket).

Verification

  • nest build passes clean (exit 0), dist emitted.
  • admin typecheck clean for the changed store and components.
  • Not yet runtime-tested in the browser.

@mykyta-torbynskyi mykyta-torbynskyi merged commit d92b482 into main Jun 16, 2026
1 of 2 checks passed
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.

2 participants