export type GetApiV1EntitiesNameHistoryArgs = {name: string}; export type GetApiV1EntitiesNameHistoryOptions = {baseUrl?: string | undefined, oAuthKeycloak?: string | undefined, fetch?: typeof fetch | undefined}; /** * Gets the history of changes to the entity * * GET /v1/entities/{name}/history */ export const getApiV1EntitiesNameHistory = async (args: GetApiV1EntitiesNameHistoryArgs, options?: GetApiV1EntitiesNameHistoryOptions) => { const {baseUrl = "https://virtserver.swaggerhub.com/Viable-Data/Reference-Data-Service-API/0.0.1", fetch: fetchFn = fetch, oAuthKeycloak} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oAuthKeycloak !== undefined) headers.set('authorization', `Bearer ${oAuthKeycloak}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/entities/${encodeURIComponent(String(args.name))}/history${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 };