export type DeleteApiActionsActionIdArgs = {actionId: string}; export type DeleteApiActionsActionIdOptions = {baseUrl: string, userAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete action from the system. * * DELETE /actions/{actionId} * * Also accepts auth: adminAuth */ export const deleteApiActionsActionId = async (args: DeleteApiActionsActionIdArgs, options: DeleteApiActionsActionIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, userAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (userAuth !== undefined) headers.set("authentication", userAuth) const url = `${baseUrl.replace(/\/+$/, '')}/actions/${encodeURIComponent(String(args.actionId))}${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 };