This commit is contained in:
seb
2026-10-14 14:45:45 +02:00
parent 37c58648db
commit 90b782e500
7 changed files with 714 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
# `GET /company/export`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Export company catalog as zip archive (SSE)
Exports full company catalog data (categories hierarchy, articles, variants, brands, pictures)
into a round-trip compatible .zip archive matching the format of `/company/import`.
Streams progress events via Server-Sent Events (`text/event-stream`), followed by base64-encoded
binary chunks in `chunk` events and a final `done` event.
## Query parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `stream` | no | string | Force SSE stream mode (`1`) or direct binary download (`0`) |
## Response `200`
Export progress stream (`text/event-stream`) with binary chunks, or raw ZIP file
## Errors
| Status | Description |
|--------|-------------|
| 400 | Bad request (no company selected) — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 500 | Server error — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._

View File

@@ -0,0 +1,23 @@
# `POST /company/export`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Export company catalog as zip archive (SSE)
POST variant of `/company/export` with identical SSE streaming semantics.
## Response `200`
Export progress stream (`text/event-stream`) with binary chunks, or raw ZIP file
## Errors
| Status | Description |
|--------|-------------|
| 400 | Bad request (no company selected) — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 500 | Server error — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._