export type GetApiTeamsGetAllTeamsArgs = {'x-api-key': string}; export type GetApiTeamsGetAllTeamsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Fetch all teams * * GET /teams/get-all-teams */ export const getApiTeamsGetAllTeams = async (args: GetApiTeamsGetAllTeamsArgs, options?: GetApiTeamsGetAllTeamsOptions) => { const {baseUrl = "https://api.spike.sh", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) const url = `${baseUrl.replace(/\/+$/, '')}/teams/get-all-teams${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 };