export type GetApiTombaV1AuthorFinderArgs = {url: string}; export type GetApiTombaV1AuthorFinderOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Find the email address of a blog post author from the article URL. * * GET /tomba/v1/author-finder */ export const getApiTombaV1AuthorFinder = async (args: GetApiTombaV1AuthorFinderArgs, options?: GetApiTombaV1AuthorFinderOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.url != null) query.append("url", String(args.url)) const url = `${baseUrl.replace(/\/+$/, '')}/tomba/v1/author-finder${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 undefined };