export type CreateApiReadersIdResetTamperArgs = {id: number}; export type CreateApiReadersIdResetTamperOptions = {baseUrl?: string | undefined, KisiLogin?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reset the tampered state of a reader * * POST /readers/{id}/reset_tamper * * Also accepts auth: OAuth2 */ export const createApiReadersIdResetTamper = async (args: CreateApiReadersIdResetTamperArgs, options?: CreateApiReadersIdResetTamperOptions) => { const {baseUrl = "https://api.kisi.io", fetch: fetchFn = fetch, KisiLogin} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (KisiLogin !== undefined) headers.set("Authorization", KisiLogin) const url = `${baseUrl.replace(/\/+$/, '')}/readers/${encodeURIComponent(String(args.id))}/reset_tamper${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 };