feat: Update customer related typings and sdk methods (#7440)

This commit is contained in:
Stevche Radevski
2024-05-24 13:25:10 +02:00
committed by GitHub
parent ff870482bb
commit 296473d994
41 changed files with 386 additions and 228 deletions

View File

@@ -20,7 +20,7 @@ const toBase64 = (str: string) => {
const sanitizeHeaders = (headers: Headers) => {
return {
...Object.fromEntries(headers.entries()),
Authorization: "<REDACTED>",
authorization: "<REDACTED>",
}
}
@@ -45,7 +45,9 @@ const normalizeRequest = (
const normalizeResponse = async (resp: Response, reqHeaders: Headers) => {
if (resp.status >= 300) {
const jsonError = await resp.json().catch(() => ({})) as { message?: string }
const jsonError = (await resp.json().catch(() => ({}))) as {
message?: string
}
throw new FetchError(
jsonError.message ?? resp.statusText,
resp.statusText,