export type GetApiApiTrackerV1DebuggerArgs = {app_id: string, limit?: number | undefined, offset?: number | undefined, ip?: unknown | undefined, visitor_id?: string | undefined, user_id?: string | undefined, page_url?: string | undefined, event_type?: (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24) | undefined, lookup_window?: number | undefined}; export type GetApiApiTrackerV1DebuggerOptions = {baseUrl?: string | undefined, JWTAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Debugger * * GET /api/tracker/v1/debugger */ export const getApiApiTrackerV1Debugger = async (args: GetApiApiTrackerV1DebuggerArgs, options?: GetApiApiTrackerV1DebuggerOptions) => { const {baseUrl = "https://example.piwik.pro", fetch: fetchFn = fetch, JWTAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/x-ndjson") if (args.app_id != null) query.append("app_id", String(args.app_id)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.offset != null) query.append("offset", String(args.offset)) if (args.ip != null) query.append("ip", String(args.ip)) if (args.visitor_id != null) query.append("visitor_id", String(args.visitor_id)) if (args.user_id != null) query.append("user_id", String(args.user_id)) if (args.page_url != null) query.append("page_url", String(args.page_url)) if (args.event_type != null) query.append("event_type", String(args.event_type)) if (args.lookup_window != null) query.append("lookup_window", String(args.lookup_window)) if (JWTAuth !== undefined) headers.set('authorization', `Bearer ${JWTAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/tracker/v1/debugger${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 res.blob() };