export type CreateApiAviatoMarketmapGenerateArgs = {body: {name?: string | undefined, website?: string | undefined, id?: string | undefined}}; export type CreateApiAviatoMarketmapGenerateOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Start generating a market map to find similar companies. Supply name+website or an Aviato company ID. * * POST /aviato/marketmap/generate */ export const createApiAviatoMarketmapGenerate = async (args: CreateApiAviatoMarketmapGenerateArgs, options?: CreateApiAviatoMarketmapGenerateOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/aviato/marketmap/generate${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 };