export type InsightsRequest = Array<{network_id?: number | undefined, network_type?: (0 | 1 | 2) | undefined, client_user_network_id?: number | undefined, extern_post_id?: number | undefined}>; export type CreateApiNetworkPostInsightsStatusEnableArgs = {body: InsightsRequest}; export type CreateApiNetworkPostInsightsStatusEnableOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * V1 - Enable Insights Entry * * POST /network/post/insights/status/enable */ export const createApiNetworkPostInsightsStatusEnable = async (args: CreateApiNetworkPostInsightsStatusEnableArgs, options?: CreateApiNetworkPostInsightsStatusEnableOptions) => { const {baseUrl = "https://api.blog2social.com/rest/v1.0", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/network/post/insights/status/enable${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 };