Export serializer + GET /api/export (tar.gz assembly, media copy) #316
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol#316
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Child of #286 (export path — first slice).
Serialize all of a user's domain data into a portable
carol-export-<date>.tar.gz: YAML docs at the archive root plus amedia/dir for blobs.Scope
apps/api/lib/export/serialize.ts—buildExportData(db, userId): gather every domain entity for the user via the repositories, group into the archive's YAML docs, nest children under their parents, omituser_idfrom every emitted row, compute per-entity counts. Pure data (no YAML/tar).apps/api/lib/export/archive.ts—buildExportArchive(data): YAML-serialize each doc (yaml), pack withtar-stream, gzip (zlib). Manifest carriesformatVersion: 1,exportedAt,appVersion(fromapps/api/package.json), and per-entity counts. Copies media from blob storage (profile picture today).GET /api/export— authed, returnsapplication/gzipwithContent-Disposition: attachment; filename="carol-export-<YYYY-MM-DD>.tar.gz". Auth required (not in the public-routes allowlist).datatag; regenerate the committedopenapi.json;openapi:check+openapi:coveragepass.Notes
projects.yamlholdsprojects + contributions, butcontributionsare children ofpositions(contributions.position_id → positions → jobs); they nest underexperience.yaml.projects.yamlholds projects only.Archive shape, serialization rules, and the file list per the approved plan.