export type IntectWebAPIControllersMiscellaneousControllerFeedback = {Message?: string | undefined}; export type CreateApiApiClientfailArgs = {body: IntectWebAPIControllersMiscellaneousControllerFeedback}; export type CreateApiApiClientfailOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reports that an unexpected error occurred in a client application. Do not call this method without previous approval from Intect. Please include as much information as possible in the request body. * * POST /api/clientfail */ export const createApiApiClientfail = async (args: CreateApiApiClientfailArgs, options?: CreateApiApiClientfailOptions) => { const {baseUrl = "https://api.intect.app", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set("X-API-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/clientfail${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };