export type EncryptedText = {value?: string | undefined, type?: ('PLAIN' | 'ENCRYPTED') | undefined}; export type JiraNotification = {url?: string | undefined, connectionType?: ('JIRA_CLOUD' | 'JIRA_DATA_CENTER_BASIC' | 'JIRA_DATA_CENTER_ACCESS_TOKEN' | null) | undefined, apiKey?: EncryptedText | undefined, email?: (string | null) | undefined, boardId?: string | undefined, issueNameFilter?: (string | null) | undefined, projectId?: string | undefined, statusId?: string | undefined, failTransitionId?: (string | null) | undefined, passTransitionId?: (string | null) | undefined, errorTransitionId?: (string | null) | undefined}; export type CreateApiWorkspacesNotificationsJiraBoardTransitionsArgs = {notificationId?: string | undefined, body: JiraNotification}; export type CreateApiWorkspacesNotificationsJiraBoardTransitionsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * List available board transitions * * POST /workspaces/notifications/jira/board-transitions */ export const createApiWorkspacesNotificationsJiraBoardTransitions = async (args: CreateApiWorkspacesNotificationsJiraBoardTransitionsArgs, options?: CreateApiWorkspacesNotificationsJiraBoardTransitionsOptions) => { const {baseUrl = "https://api.octoperf.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (args.notificationId != null) query.append("notificationId", String(args.notificationId)) const url = `${baseUrl.replace(/\/+$/, '')}/workspaces/notifications/jira/board-transitions${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 res.blob() };