export type DeleteApiBulkOperationsIdArgs = {id: string}; export type DeleteApiBulkOperationsIdOptions = {baseUrl?: string | undefined, authToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete bulk operation * * DELETE /bulk-operations/{id} */ export const deleteApiBulkOperationsId = async (args: DeleteApiBulkOperationsIdArgs, options?: DeleteApiBulkOperationsIdOptions) => { const {baseUrl = "https://commerce_studio_id.experiencemanager.lucidworks.com", fetch: fetchFn = fetch, authToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (authToken !== undefined) headers.set('authorization', `Bearer ${authToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/bulk-operations/${encodeURIComponent(String(args.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 };