export type CreateApiEngineResetOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset the engine * * POST /engine/reset */ export const createApiEngineReset = async (options?: CreateApiEngineResetOptions) => { const {baseUrl = "https://rvig-engine.bzlg.apps.digilab.network/v0", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/engine/reset${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };