export type GetApiServiceOwnerUsernameReposRepoNameEvalsSummaryArgs = {classname?: string | undefined, commit?: string | undefined, owner_username: string, repo_name: string, service: 'bitbucket' | 'bitbucket_server' | 'github' | 'github_enterprise' | 'gitlab' | 'gitlab_enterprise'}; export type GetApiServiceOwnerUsernameReposRepoNameEvalsSummaryOptions = {baseUrl?: string | undefined, tokenAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Evaluation summary * * GET /{service}/{owner_username}/repos/{repo_name}/evals/summary/ */ export const getApiServiceOwnerUsernameReposRepoNameEvalsSummary = async (args: GetApiServiceOwnerUsernameReposRepoNameEvalsSummaryArgs, options?: GetApiServiceOwnerUsernameReposRepoNameEvalsSummaryOptions) => { const {baseUrl = "https://api.codecov.io/api/v2", fetch: fetchFn = fetch, tokenAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.classname != null) query.append("classname", String(args.classname)) if (args.commit != null) query.append("commit", String(args.commit)) if (tokenAuth !== undefined) headers.set('authorization', `Bearer ${tokenAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.service))}/${encodeURIComponent(String(args.owner_username))}/repos/${encodeURIComponent(String(args.repo_name))}/evals/summary/${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 };