export type CreateApiGeneralTerminateOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Terminate your current Kameleo session by deauthenticating and exiting the Engine. Use this to safely close your session and release any * associated resources. * * POST /general/terminate */ export const createApiGeneralTerminate = async (options?: CreateApiGeneralTerminateOptions) => { const {baseUrl = "http://localhost:5050", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/general/terminate${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 };