export type GetApiApiV1SettingsPasskeysArgs = {'X-API-TOKEN': string}; export type GetApiApiV1SettingsPasskeysOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * List passkeys * * GET /api/v1/settings/passkeys */ export const getApiApiV1SettingsPasskeys = async (args: GetApiApiV1SettingsPasskeysArgs, options?: GetApiApiV1SettingsPasskeysOptions) => { const {baseUrl = "https://demo.invoiceninja.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-API-TOKEN'] != null) headers.set("X-API-TOKEN", String(args['X-API-TOKEN'])) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/settings/passkeys${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };