export type GetApiPosfinancingInternalV1LoansReferenceIdTimelineArgs = {referenceId: string}; export type GetApiPosfinancingInternalV1LoansReferenceIdTimelineOptions = {baseUrl?: string | undefined, jwt?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get timeline by reference id * * GET /posfinancing/internal/v1/loans/{referenceId}/timeline */ export const getApiPosfinancingInternalV1LoansReferenceIdTimeline = async (args: GetApiPosfinancingInternalV1LoansReferenceIdTimelineArgs, options?: GetApiPosfinancingInternalV1LoansReferenceIdTimelineOptions) => { const {baseUrl = "https://devint01-api.goodleap.com", fetch: fetchFn = fetch, jwt} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (jwt !== undefined) headers.set('authorization', `Bearer ${jwt}`) const url = `${baseUrl.replace(/\/+$/, '')}/posfinancing/internal/v1/loans/${encodeURIComponent(String(args.referenceId))}/timeline${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() };