export type GetApiApiNotesLeagueIdInternalScoutingArgs = {leagueId: number, season?: number | undefined}; export type GetApiApiNotesLeagueIdInternalScoutingOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * [Deprecated] Get internal scouting notes for a league * * GET /api/notes/{leagueId}/internal-scouting */ export const getApiApiNotesLeagueIdInternalScouting = async (args: GetApiApiNotesLeagueIdInternalScoutingArgs, options: GetApiApiNotesLeagueIdInternalScoutingOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.season != null) query.append("season", String(args.season)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/notes/${encodeURIComponent(String(args.leagueId))}/internal-scouting${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 };