export type DeleteApiUsersForwardUserIdArgs = {userId: string}; export type DeleteApiUsersForwardUserIdOptions = {baseUrl: string, adminAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove account from local server valid account to forward from remote to local * * DELETE /users/forward/{userId} * * Also accepts auth: userAuth */ export const deleteApiUsersForwardUserId = async (args: DeleteApiUsersForwardUserIdArgs, options: DeleteApiUsersForwardUserIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, adminAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (adminAuth !== undefined) headers.set("authentication", adminAuth) const url = `${baseUrl.replace(/\/+$/, '')}/users/forward/${encodeURIComponent(String(args.userId))}${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 };