export type DeleteApiOcapiV1MembersAuthenticationCookieArgs = {'Connect-Region-Code'?: string | undefined}; export type DeleteApiOcapiV1MembersAuthenticationCookieOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Expires the current authentication cookie * * DELETE /ocapi/v1/members/authentication-cookie */ export const deleteApiOcapiV1MembersAuthenticationCookie = async (args: DeleteApiOcapiV1MembersAuthenticationCookieArgs, options: DeleteApiOcapiV1MembersAuthenticationCookieOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Connect-Region-Code'] != null) headers.set("Connect-Region-Code", String(args['Connect-Region-Code'])) const url = `${baseUrl.replace(/\/+$/, '')}/ocapi/v1/members/authentication-cookie${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 };