export type GetApiApiV1GitlabInstallArgs = {gitlab_instance_url?: string | undefined}; export type GetApiApiV1GitlabInstallOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Install GitLab integration * * GET /api/v1/gitlab/install */ export const getApiApiV1GitlabInstall = async (args: GetApiApiV1GitlabInstallArgs, options: GetApiApiV1GitlabInstallOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.gitlab_instance_url != null) query.append("gitlab_instance_url", String(args.gitlab_instance_url)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/gitlab/install${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 };