/** * Parse a Charles Proxy session (or HAR capture) into normalized HTTP entries * and classify each request as manifest / segment / license / key / other. * * Supported export formats: * - Charles ".chlsj" (JSON Session File): either a single JSON array of * request objects, or newline-delimited JSON (one object per line). * - ".har" (HTTP Archive): the standard `{ log: { entries: [...] } }` shape * produced by Charles "Export > HAR" and by browser devtools. * * NOTE: the binary ".chls" format is NOT supported (it is a proprietary binary * blob). Callers should instruct the user to export as ".chlsj" or ".har". * * Charles .chlsj entry shape (varies slightly by version) roughly looks like: * { * "host": "...", "method": "GET", "path": "/x.m3u8", * "scheme": "https", "status": 200, * "request": { "header": { "headers": [{ "name", "value" }] }, "body": {...} }, * "response": { "header": { "headers": [...] }, "body": { "text"|"encoded", "contentType" } }, * "times": { "totalDuration": 123 } * } */ export interface NormalizedHttpEntry { url: string; host: string; path: string; method: string; status: number; reqHeaders: Record; respHeaders: Record; /** Decoded response body text when available (manifests, license errors). */ respBody?: string; /** Response content-type, lowercased. */ mimeType?: string; durationMs?: number; kind: HttpEntryKind; } export type HttpEntryKind = 'manifest' | 'segment' | 'license' | 'key' | 'other'; export interface CharlesSession { entries: NormalizedHttpEntry[]; /** Entries with a non-2xx status or otherwise suspicious response. */ failing: NormalizedHttpEntry[]; format: 'chlsj' | 'har'; notes: string[]; } /** Parse the raw text of a Charles .chlsj or .har file. */ export declare function parseCharlesText(text: string): CharlesSession; /** A request is "failing" if it has a non-2xx status, or an empty body where one is expected. */ export declare function isFailing(entry: NormalizedHttpEntry): boolean; //# sourceMappingURL=charles.d.ts.map