Cybersecurity-Projects/PROJECTS/beginner/canary-token-generator/frontend/src/api
CarterPerez-dev 7c0a504d0b fix(canary-phase14): single-source envelope parsing + query-key splay
Address audit findings S-1, S-3, S-4, S-7 pre-rollup (fix-in-phase).

S-1: Eliminate hand-rolled envelope error parser duplication.
  Moved transformAxiosError out of core/api/errors.ts (where it
  required a private parseEnvelopeError mirror of the Zod schema)
  into api/client.ts where it now uses apiErrorEnvelopeSchema directly
  via safeParse. core/api/errors.ts is now ApiError class + code
  constants + module augmentation only, with no canary-envelope
  knowledge — keeps layering core <- universal, api <- canary clean.

S-3: useManageToken query key now splays cursor/limit individually
  instead of carrying the params object reference. Without this,
  callers passing a freshly-allocated { cursor } each render would
  miss the cache even with identical values.

S-4: unwrapEnvelope's PARSE_ERROR now includes the first Zod issue
  (path + message) in the ApiError.message so operators see WHICH
  field shape failed, not just that something did.

S-7: Add request interceptor rejection handler so request-phase
  errors propagate via Promise.reject instead of throwing
  synchronously.
2026-05-17 13:03:27 -04:00
..
hooks fix(canary-phase14): single-source envelope parsing + query-key splay 2026-05-17 13:03:27 -04:00
types feat(canary): Zod schemas + canary envelope error normalization 2026-05-17 12:55:10 -04:00
client.ts fix(canary-phase14): single-source envelope parsing + query-key splay 2026-05-17 13:03:27 -04:00
index.ts feat(canary): axios client with Turnstile header interceptor 2026-05-17 12:55:42 -04:00