export type GetApiApiPscUserExistsArgs = {'Content-Type'?: string | undefined, Authorization?: string | undefined, cpf?: number | undefined}; export type GetApiApiPscUserExistsOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Verificar ExistĂȘncia de Conta Syn * * GET /api/psc/user-exists */ export const getApiApiPscUserExists = async (args: GetApiApiPscUserExistsArgs, options?: GetApiApiPscUserExistsOptions) => { const {baseUrl = "https://cloud-hom.bry.com.br", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args.cpf != null) query.append("cpf", String(args.cpf)) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/psc/user-exists${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.text() };