export type DeleteRepositoryReportsRequest = {configId: string, repository: string, branch?: (string | null) | undefined, settingId?: (number | null) | undefined}; export type CreateApiV1CodeReferencesDeleteReportsArgs = {body: DeleteRepositoryReportsRequest}; export type CreateApiV1CodeReferencesDeleteReportsOptions = {baseUrl?: string | undefined, Basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete Reference reports * * POST /v1/code-references/delete-reports */ export const createApiV1CodeReferencesDeleteReports = async (args: CreateApiV1CodeReferencesDeleteReportsArgs, options?: CreateApiV1CodeReferencesDeleteReportsOptions) => { const {baseUrl = "https://api.configcat.com", fetch: fetchFn = fetch, Basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Basic !== undefined) headers.set('authorization', `Basic ${btoa(`${Basic.username}:${Basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/code-references/delete-reports${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };