export type DeleteApiRestApi3ScreensScreenIdTabsTabIdArgs = {screenId: number, tabId: number}; export type DeleteApiRestApi3ScreensScreenIdTabsTabIdOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete screen tab * * DELETE /rest/api/3/screens/{screenId}/tabs/{tabId} * * Also accepts auth: OAuth2 */ export const deleteApiRestApi3ScreensScreenIdTabsTabId = async (args: DeleteApiRestApi3ScreensScreenIdTabsTabIdArgs, options?: DeleteApiRestApi3ScreensScreenIdTabsTabIdOptions) => { const {baseUrl = "https://your-domain.atlassian.net", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/rest/api/3/screens/${encodeURIComponent(String(args.screenId))}/tabs/${encodeURIComponent(String(args.tabId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };