export type GetApiTrendsDisruptiveAppsArgs = {'X-API-Key': string}; export type GetApiTrendsDisruptiveAppsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve apps with the largest recent spikes in notification activity. * * GET /trends/disruptive-apps */ export const getApiTrendsDisruptiveApps = async (args: GetApiTrendsDisruptiveAppsArgs, options?: GetApiTrendsDisruptiveAppsOptions) => { const {baseUrl = "https://api.notiflow.empushy.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args['X-API-Key'] != null) headers.set("X-API-Key", String(args['X-API-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/trends/disruptive-apps${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 (await res.json()) as unknown };