export type CreateApiNetworksReportingAffiliatePixelsExportArgs = {body: {from: string, to: string, timezone_id: number, format: 'csv' | 'json', query?: ({filters?: (Array<{resource_type?: ('offer' | 'affiliate' | 'delivery_status') | undefined, filter_id_value?: string | undefined}>) | undefined, search_terms?: (Array<{search_type?: ('conversion_id' | 'payload' | 'transaction_id' | 'pixel_id') | undefined, value?: string | undefined}>) | undefined}) | undefined}}; export type CreateApiNetworksReportingAffiliatePixelsExportOptions = {baseUrl?: string | undefined, APIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Export Partner Pixel Log * * POST /networks/reporting/affiliate/pixels/export */ export const createApiNetworksReportingAffiliatePixelsExport = async (args: CreateApiNetworksReportingAffiliatePixelsExportArgs, options?: CreateApiNetworksReportingAffiliatePixelsExportOptions) => { const {baseUrl = "https://api.eflow.team/v1", fetch: fetchFn = fetch, APIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (APIKey !== undefined) headers.set("X-Eflow-Api-Key", APIKey) const url = `${baseUrl.replace(/\/+$/, '')}/networks/reporting/affiliate/pixels/export${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 };