export type GetApiApiProjectIdDownloadImpulsesDetailedArgs = {projectId: number, format?: ('json' | 'csv') | undefined}; export type GetApiApiProjectIdDownloadImpulsesDetailedOptions = {baseUrl?: string | undefined, ApiKeyAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download all impulses (incl. metrics), as JSON or CSV. * * GET /api/{projectId}/download-impulses-detailed * * Also accepts auth: JWTAuthentication, JWTHttpHeaderAuthentication, OAuth2 */ export const getApiApiProjectIdDownloadImpulsesDetailed = async (args: GetApiApiProjectIdDownloadImpulsesDetailedArgs, options?: GetApiApiProjectIdDownloadImpulsesDetailedOptions) => { const {baseUrl = "https://studio.edgeimpulse.com/v1", fetch: fetchFn = fetch, ApiKeyAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (args.format != null) query.append("format", String(args.format)) if (ApiKeyAuthentication !== undefined) headers.set("x-api-key", ApiKeyAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.projectId))}/download-impulses-detailed${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() };