export type GetApiReportCompatibilityReadingInstantArgs = {input: {first_person: {first_name: string, middle_name?: string | undefined, last_name?: string | undefined, gender: 'male', datetime: string, coordinates: string, place: string}, second_person: {first_name: string, middle_name?: string | undefined, last_name?: string | undefined, gender: 'female', datetime: string, coordinates: string, place: string}}, options: {modules: Array<{name: string, options: Record}>, template: {style: string, footer: string}, report: {name: string, caption: string, brand_name: string, la?: string | undefined}}}; export type GetApiReportCompatibilityReadingInstantOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Compatibility Report PDF * * GET /report/compatibility-reading/instant */ export const getApiReportCompatibilityReadingInstant = async (args: GetApiReportCompatibilityReadingInstantArgs, options?: GetApiReportCompatibilityReadingInstantOptions) => { const {baseUrl = "https://api.prokerala.com/v2", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/pdf") if (args.input != null) query.append("input", JSON.stringify(args.input)) if (args.options != null) query.append("options", JSON.stringify(args.options)) if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/report/compatibility-reading/instant${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() };