export type GetApiApiRebookingsStrategiesArgs = {top?: number | undefined, skip?: number | undefined}; export type GetApiApiRebookingsStrategiesOptions = {baseUrl?: string | undefined, jwt?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/rebookings/strategies * * Also accepts auth: apikey */ export const getApiApiRebookingsStrategies = async (args: GetApiApiRebookingsStrategiesArgs, options?: GetApiApiRebookingsStrategiesOptions) => { const {baseUrl = "https://vivenu.com", fetch: fetchFn = fetch, jwt} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.top != null) query.append("top", String(args.top)) if (args.skip != null) query.append("skip", String(args.skip)) if (jwt !== undefined) headers.set('authorization', `Bearer ${jwt}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/rebookings/strategies${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 };