veza/apps/web/src
senke aa6ccbefed
Some checks failed
Veza CI / Rust (Stream Server) (push) Failing after 2s
Frontend CI / test (push) Failing after 2m1s
Security Scan / Secret Scanning (gitleaks) (push) Successful in 1m1s
Veza CI / Backend (Go) (push) Failing after 15m48s
E2E Playwright / e2e (full) (push) Failing after 11m33s
Veza CI / Frontend (Web) (push) Failing after 28m3s
Veza CI / Notify on failure (push) Successful in 5s
refactor(web): migrate queue.ts + finish authService → orval
Closes the v1.0.8 deferrals on the frontend side now that the backend
swaggo annotations + orval regen landed in the previous commit.

queue.ts (services/api/queue.ts, 11 functions):
  - getQueue / updateQueue / addToQueue / removeFromQueue / clearQueue
    → orval (getQueue / putQueue / postQueueItems /
    deleteQueueItemsId / deleteQueue).
  - createQueueSession / getQueueSession / deleteQueueSession /
    addToSessionQueue / removeFromSessionQueue → orval (postQueueSession
    / getQueueSessionToken / deleteQueueSessionToken /
    postQueueSessionTokenItems / deleteQueueSessionTokenItemsId).

  Public surface (queueApi.{...} object) preserved verbatim — no
  changes to the two consumers (useQueueSync.ts, PlayerQueue.tsx).
  An unwrapPayload<T>() helper strips the APIResponse {data: ...}
  envelope, mirroring the B4 / B5 / B6 patterns. mapQueueItemToTrack
  conversion logic kept identical.

authService.ts (5/9 deferred functions migrated, total 9/9 now):
  - register      → postAuthRegister + rename `password_confirm` →
                    `password_confirmation` (backend DTO field, see
                    register_request.go:8). Frontend RegisterFormData
                    keeps its existing field name; the rename happens
                    at the wire boundary.
  - refreshToken  → postAuthRefresh + rename `refreshToken` →
                    `refresh_token`.
  - requestPasswordReset → postAuthPasswordResetRequest. Wire shape
                    `{email}` matches the frontend ForgotPasswordFormData
                    1:1.
  - resetPassword → postAuthPasswordReset + rename `password` →
                    `new_password` (backend DTO ResetPasswordRequest).
                    `confirmPassword` from the form is dropped — the
                    backend only validates the new password against
                    the strength policy; the equality check is
                    client-side responsibility (the form does it).
  - verifyEmail   → postAuthVerifyEmail. Verb shift GET → POST to
                    match the backend route registration
                    (routes_auth.go:107) and the swaggo annotation on
                    auth.go:VerifyEmail. Token still passed as `?token=`
                    query param.

  The wire-shape renames pre-existed as drift between the frontend
  serializer and the Go DTO field tags; the backend likely tolerated
  some via lenient unmarshaling or the affected paths were rarely
  exercised end-to-end before E2E CI lands. Migration to orval forces
  the correct shape because the typed body is the source of truth.

  authService.ts docblock rewritten to inventory the wire-shape
  mappings instead of the prior "deferred" warning. Callers
  (LoginPage / RegisterPage / ResetPasswordPage / etc.) untouched —
  service signatures unchanged.

authService.test.ts:
  - orval module mocks added for postAuthRegister / postAuthRefresh /
    postAuthPasswordResetRequest / postAuthPasswordReset /
    postAuthVerifyEmail (delegate to apiClient mock, same pattern as
    the 4 already migrated in v1.0.8 B6).
  - Wire-shape assertions updated for register
    (`password_confirmation`), refreshToken (`refresh_token`),
    resetPassword (`new_password`), verifyEmail (POST instead of GET).
    Comments cite the backend DTO line where the field name lives.

Tests: 17/17 in authService.test.ts green. 708/709 across
features/auth + features/player + services/__tests__ (1 skipped is
the long-standing ResetPasswordPage flake unrelated to this work).
npm run typecheck clean.

Bisectable: revert this commit → queue / auth functions return to
raw apiClient pattern (with the pre-existing wire drift). Combined
with the previous commit (backend annotations) gives a clean two-step
migration narrative.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 00:56:44 +02:00
..
__tests__ chore(refactor/sumi-migration): commit pending changes — tests, stream server, dist_verification 2026-02-13 19:39:18 +01:00
app chore: apply pre-commit hook formatting and cleanup 2026-04-01 01:40:54 +02:00
components refactor(web): migrate playlistService to orval-generated playlist client (v1.0.8 B4) 2026-04-25 21:07:49 +02:00
config fix(backend,web): restore audio playback via /stream fallback 2026-04-16 14:52:26 +02:00
context chore: consolidate CI, E2E, backend and frontend updates 2026-02-17 16:43:21 +01:00
docs refactor(frontend): document chat store as single source of truth 2026-02-15 16:02:14 +01:00
features refactor(web): migrate queue.ts + finish authService → orval 2026-04-26 00:56:44 +02:00
hooks fix: stabilize builds, tests, and lint across all stacks 2026-04-05 16:48:07 +02:00
lib fix(a11y): fix heading hierarchy h1→h3 gaps on 8 pages 2026-03-25 10:14:18 +01:00
locales feat(ui): add SUMI design system components, seasonal hooks, and i18n updates 2026-03-31 19:15:54 +02:00
mocks fix(backend,web): restore audio playback via /stream fallback 2026-04-16 14:52:26 +02:00
providers refactor(frontend): simplify TokenStorage usage for httpOnly cookie auth 2026-02-15 16:04:42 +01:00
router fix(security): protect admin routes with role check 2026-04-05 16:19:16 +02:00
schemas chore(cleanup): remove orphan code + archive disabled workflows + .playwright-mcp 2026-04-20 20:33:40 +02:00
services refactor(web): migrate queue.ts + finish authService → orval 2026-04-26 00:56:44 +02:00
stores feat(v0.12.7): internationalisation i18n — FR/EN/ES avec formatage locale 2026-03-12 14:29:22 +01:00
stories fix: stabilize builds, tests, and lint across all stacks 2026-04-05 16:48:07 +02:00
styles docs: update Welcome.mdx and deprecate Kodo references in docs 2026-02-17 17:05:33 +01:00
test fix: stabilize builds, tests, and lint across all stacks 2026-04-05 16:48:07 +02:00
types chore(web): drop legacy openapi-generator-cli — orval is the single source (v1.0.8 B9) 2026-04-26 00:02:58 +02:00
utils chore(cleanup): remove orphan code + archive disabled workflows + .playwright-mcp 2026-04-20 20:33:40 +02:00
index.css fix: stabilize builds, tests, and lint across all stacks 2026-04-05 16:48:07 +02:00
main.tsx chore(web): remove console.log in prod, address TODO/FIXME for v0.101 2026-02-19 19:01:42 +01:00
setupTests.ts refonte: backend-api go first; phase 1 2025-12-12 21:34:34 -05:00
vite-env.d.ts fix: stabilize frontend — 98 TS errors to 0, align API endpoints, optimize bundle 2026-03-24 21:18:49 +01:00