export type DeleteApiApiV3AutomatedRecipesRecipeIdArgs = {recipe_id: string}; export type DeleteApiApiV3AutomatedRecipesRecipeIdOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * DEPRECATED Delete automated recipe * * DELETE /api/v3/automated-recipes/{recipe_id}/ * * Also accepts auth: cookieAuth */ export const deleteApiApiV3AutomatedRecipesRecipeId = async (args: DeleteApiApiV3AutomatedRecipesRecipeIdArgs, options?: DeleteApiApiV3AutomatedRecipesRecipeIdOptions) => { const {baseUrl = "https://embedded.improvado.io", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/automated-recipes/${encodeURIComponent(String(args.recipe_id))}/${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 };