feat(extraction): extract a bundle of a tenant, never documents without established rights #66

Merged
crapougnax merged 1 commit from feat/38-tenant-extraction into develop 2026-11-19 20:32:12 +00:00
Owner

Refs #38 (step 4c, first part: extraction). Applies the rights status of #52 to the first consumer of the documents.

Routes (any member of the tenant)

  • POST /t/<tenant>/api/tenant/extraction?preview: documents kept, and counts of those left out (rights, status, profile, unreadable).
  • POST /t/<tenant>/api/tenant/extraction: the bundle, application/zip (fflate, new dependency 0.8.3): documents, index per theme, root index (okf_version: "0.2") naming the recipient, the source of authority and the commit.
  • Body { recipient, themes?, facets? }: a document is kept when, for every facet named, it lists at least one value asked.

Rights enforced

  • Never extracted: rights unknown or excluded, drafts, obsolete documents. A document written before v0.2 names no rights, so it waits for a curator.
  • Documents are given as in the repository, written in v0.2. Originals stay in the private storage.

Library: Extraire for every member: recipient, themes, facet values, preview with the counts left out, download.

Replaces the instance-wide /api/extract, removed in 4d. Telemetry is not in this PR: it needs a decision (see the conversation).

Docs: section 11 of docs/MULTI-TENANCY.md (EN, FR).

Checks: yarn test 263/263 (4 new). yarn build passes. tsc --noEmit: the same 11 errors as on develop. Not tried in a browser.

🤖 Generated with Claude Code

Refs #38 (step 4c, first part: extraction). Applies the rights status of #52 to the first consumer of the documents. **Routes** (any member of the tenant) - `POST /t/<tenant>/api/tenant/extraction?preview`: documents kept, and counts of those left out (rights, status, profile, unreadable). - `POST /t/<tenant>/api/tenant/extraction`: the bundle, `application/zip` (`fflate`, new dependency 0.8.3): documents, index per theme, root index (`okf_version: "0.2"`) naming the recipient, the source of authority and the commit. - Body `{ recipient, themes?, facets? }`: a document is kept when, for every facet named, it lists at least one value asked. **Rights enforced** - Never extracted: rights `unknown` or `excluded`, drafts, obsolete documents. A document written before v0.2 names no rights, so it waits for a curator. - Documents are given as in the repository, written in v0.2. Originals stay in the private storage. **Library**: *Extraire* for every member: recipient, themes, facet values, preview with the counts left out, download. Replaces the instance-wide `/api/extract`, removed in 4d. **Telemetry is not in this PR**: it needs a decision (see the conversation). Docs: section 11 of `docs/MULTI-TENANCY.md` (EN, FR). Checks: `yarn test` 263/263 (4 new). `yarn build` passes. `tsc --noEmit`: the same 11 errors as on `develop`. Not tried in a browser. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(extraction): extract a bundle of a tenant, never documents without established rights (#38)
All checks were successful
Build and Publish OCI Image / Build & Push ARM64 OCI Image (pull_request) Successful in 58s
ed51fd2d40
Any member extracts, from the Library, the documents of the themes and
facet values asked, for a recipient, as a zip bundle in OKF v0.2 with
the index of each theme and a root index naming the recipient and the
commit; a preview tells how many documents were left out and why.

Documents whose rights are unknown or excluded, drafts and obsolete
documents are never extracted; documents written before OKF v0.2, which
name no rights, wait for a curator. Originals stay in the storage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crapougnax merged commit 87f8e85daf into develop 2026-11-19 20:32:12 +00:00
crapougnax deleted branch feat/38-tenant-extraction 2026-11-19 20:32:12 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
modaka/studio!66
No description provided.