export type ZoomDeauthPayload = {account_id?: string | undefined, client_id?: string | undefined, signature?: string | undefined, user_id?: string | undefined}; export type ZoomDeauthBody = {event?: string | undefined, payload?: ZoomDeauthPayload | undefined}; export type CreateApiZoomDeauthArgs = {body: ZoomDeauthBody}; export type CreateApiZoomDeauthOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Removes the status of the Zoom integration of the current user * * POST /zoom/deauth */ export const createApiZoomDeauth = async (args: CreateApiZoomDeauthArgs, options?: CreateApiZoomDeauthOptions) => { const {baseUrl = "http://api.attention.tech", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/zoom/deauth${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };