parseApiResponse
parseApiResponse<
T>(value):APIResponse<T> |undefined
Defined in: packages/api-client/src/rest/types/response.ts:43
Validate that an unknown value matches the APIResponse envelope
shape (an object with a boolean isErr). Returns undefined when the
value is missing or malformed, so callers can safely fall through to a
generic error response instead of trusting an as cast.
The inner data field is not validated here — domain code (e.g.
mapTokens, mapUser in @eventista/sdk-auth) is responsible for
shape-checking the payload it consumes.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”APIResponse<T> | undefined