export type GetApiV1SignLogoOptions = {baseUrl?: string | undefined, signerAccessCode?: string | undefined, fetch?: typeof fetch | undefined}; /** * Workspace logo for the signing page * * GET /v1/sign/logo */ export const getApiV1SignLogo = async (options?: GetApiV1SignLogoOptions) => { const {baseUrl = "https://api.assinafy.com.br", fetch: fetchFn = fetch, signerAccessCode} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "image/*") if (signerAccessCode !== undefined) query.set("signer-access-code", signerAccessCode) const url = `${baseUrl.replace(/\/+$/, '')}/v1/sign/logo${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };