POST /v1/export #86

Closed
opened 2026-06-26 19:18:10 +00:00 by Mark · 0 comments
Owner

Phase 1: POST /v1/export

Take pre-computed stitch objects (already in the client or returned by
P2) and emit a binary embroidery file in the requested format.

Files:

  • Modify: src/service/app.py (add /v1/export route)
  • Modify: src/service/models.py (ExportRequest, ExportResponse or
    binary response)
  • New: src/service/handlers/export.py

Acceptance:

  • POST /v1/export with stitch objects and format=pes returns a
    valid PES file body. Header check: starts with #PES0001 or the
    correct v1 magic for the requested PES version.
  • format=dst, format=exp, format=jef each return a valid file
    with the correct magic bytes for that format.
  • Response includes X-Stitch-Count and X-Color-Count headers.
  • The output is the same bytes as calling the generator directly (no
    transformation in the service layer).

Depends on: P1 (skeleton), P2 (routing pattern). Independent of
P2's data path — accepts stitch objects from any source.



Decomposed from easystitch#31


Decomposed from easystitch#48

## Phase 1: POST /v1/export Take pre-computed stitch objects (already in the client or returned by P2) and emit a binary embroidery file in the requested format. **Files:** - Modify: `src/service/app.py` (add `/v1/export` route) - Modify: `src/service/models.py` (ExportRequest, ExportResponse or binary response) - New: `src/service/handlers/export.py` **Acceptance:** - `POST /v1/export` with stitch objects and `format=pes` returns a valid PES file body. Header check: starts with `#PES0001` or the correct v1 magic for the requested PES version. - `format=dst`, `format=exp`, `format=jef` each return a valid file with the correct magic bytes for that format. - Response includes `X-Stitch-Count` and `X-Color-Count` headers. - The output is the same bytes as calling the generator directly (no transformation in the service layer). **Depends on:** P1 (skeleton), P2 (routing pattern). Independent of P2's data path — accepts stitch objects from any source. --- --- _Decomposed from [easystitch#31](https://forgejo.tail018ac4.ts.net/Mark/easystitch/issues/31)_ --- _Decomposed from [easystitch#48](https://forgejo.tail018ac4.ts.net/Mark/easystitch/issues/48)_
Mark closed this issue 2026-06-26 19:18:30 +00:00
Sign in to join this conversation.
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
Mark/easystitch#86
No description provided.