export type GetApiFinancialDatasetsMacroInflationSeriesOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * The CPI series ids and what they are, with each series first available month. Free; no API key required. * * GET /financial-datasets/macro/inflation/series */ export const getApiFinancialDatasetsMacroInflationSeries = async (options?: GetApiFinancialDatasetsMacroInflationSeriesOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/financial-datasets/macro/inflation/series${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 };