export type DeleteApiEndpointsAgentsPssoRegisterDeviceOptions = {baseUrl: string, authentikDeviceAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Clear this device's Platform SSO registration, used when the configuration * * DELETE /endpoints/agents/psso/register/device/ */ export const deleteApiEndpointsAgentsPssoRegisterDevice = async (options: DeleteApiEndpointsAgentsPssoRegisterDeviceOptions) => { const {baseUrl, fetch: fetchFn = fetch, authentikDeviceAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (authentikDeviceAuth !== undefined) headers.set('authorization', `bearer+agent ${authentikDeviceAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/endpoints/agents/psso/register/device/${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 };