export type GetApiV3EmailAccountsConnectOffice365Options = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Connect Office 365 account via OAuth * * GET /v3/email-accounts/connect/office-365 */ export const getApiV3EmailAccountsConnectOffice365 = async (options?: GetApiV3EmailAccountsConnectOffice365Options) => { const {baseUrl = "https://api.reply.io", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v3/email-accounts/connect/office-365${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 };