TypeScript client wrapper + vite dev proxy (in Mark/Kimi_Agent_Brother_10_Digitizing_App) #3
Labels
No labels
blocked:needs-attention
blocked:needs-decision
bug
feature-request
in-progress
needs-decompose
quickfix
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/easystitch-service#3
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?
Goal
Wire the ThreadCraft frontend to the deployed easystitch-service so #6, #8, #9, #10, and #2 can call it. Deliverable is a typed TS client and a dev proxy — no UI work in this issue.
Note: this issue lives in the frontend repo (
Mark/Kimi_Agent_Brother_10_Digitizing_App), but is being decomposed here for tracking the integration spec. The actual sub-issue will be filed against ThreadCraft.Implementation
src/lib/easystitch-client.ts— typed wrapper exposing:digitize(image: Blob, settings: AutoDigitizeSettings): Promise<DigitizeResponse>exportPES(stitchObjects: StitchObject[], opts?: ExportOpts): Promise<Blob>resolveThreads(colors: string[]): Promise<ThreadMatch[]>import.meta.env.VITE_EASYSTITCH_API_URL+/v1/....EasystitchErrorwithstatus,code,message. Network failures → retryable; 5xx → retryable with backoff; 4xx → not retryable.vite.config.ts— add a proxy entry for dev: In dev, the client uses/api/easystitchas the base URL (relative). In prod, it usesVITE_EASYSTITCH_API_URL..env.example— documentVITE_EASYSTITCH_API_URL=http://easystitch-service.tail018ac4.ts.net.Files touched
src/lib/easystitch-client.tssrc/lib/easystitch-client.test.ts(unit tests with msw or vi.mock for fetch)vite.config.ts.env.examplepackage.json— no new deps required (uses nativefetch)Acceptance
tsc --noEmitis clean./api/easystitch/healthzto the service and returns 200.Dependencies
Closed via commit 9e1ae96 in Mark/Kimi_Agent_Brother_10_Digitizing_App.
Delivered:
Deviation from issue body: added
vitestas a devDep even though the issue said 'no new deps required'. The acceptance criteria required unit tests, and the frontend repo had no test runner. Issue #1 (Vitest + RTL test suite) overlaps slightly — when #1 lands it merges cleanly with this work.