export type GetApiAstrologyProgressionAspectChartArgs = {profile: {datetime: string, coordinates: string, birth_time_unknown?: boolean | undefined}, progression_year: string, current_coordinates: string, house_system: string, orb: string, birth_time_rectification?: string | undefined, aspect_filter?: string | undefined, la?: string | undefined, ayanamsa?: number | undefined}; export type GetApiAstrologyProgressionAspectChartOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Progression Aspect Chart * * GET /astrology/progression-aspect-chart */ export const getApiAstrologyProgressionAspectChart = async (args: GetApiAstrologyProgressionAspectChartArgs, options?: GetApiAstrologyProgressionAspectChartOptions) => { const {baseUrl = "https://api.prokerala.com/v2", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "image/svg+xml") if (args.profile != null) query.append("profile", JSON.stringify(args.profile)) if (args.progression_year != null) query.append("progression_year", String(args.progression_year)) if (args.current_coordinates != null) query.append("current_coordinates", String(args.current_coordinates)) if (args.house_system != null) query.append("house_system", String(args.house_system)) if (args.orb != null) query.append("orb", String(args.orb)) if (args.birth_time_rectification != null) query.append("birth_time_rectification", String(args.birth_time_rectification)) if (args.aspect_filter != null) query.append("aspect_filter", String(args.aspect_filter)) if (args.la != null) query.append("la", String(args.la)) if (args.ayanamsa != null) query.append("ayanamsa", String(args.ayanamsa)) if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/astrology/progression-aspect-chart${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() };