export type DeleteApiApiV1LogsSignInArgs = {before?: string | undefined}; export type DeleteApiApiV1LogsSignInOptions = {baseUrl: string, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Sign-in logs before a certain date, this action is irreversible * * DELETE /api/v1/logs/sign-in */ export const deleteApiApiV1LogsSignIn = async (args: DeleteApiApiV1LogsSignInArgs, options: DeleteApiApiV1LogsSignInOptions) => { const {baseUrl, fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.before != null) query.append("before", String(args.before)) if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/logs/sign-in${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 };