import { type CaptureCoverage } from '@cclabsnz/sf-core'; export interface LoadRequest { /** Capture base directory. */ base: string; orgId: string; /** Window date, YYYY-MM-DD. */ date: string; /** Hours within that date, two digits. */ hours: ReadonlyArray; /** Window start, inclusive. Omit to keep every row in the selected files. */ startMs?: number; /** Window end, exclusive. */ endMs?: number; } export interface LoadedCaptures { rows: Array>; coverage: CaptureCoverage | undefined; /** True when any capture file existed for the window at all. */ windowPresent: boolean; /** Lines that could not be parsed. Reported, never fatal. */ malformed: number; /** Files that could not be read. Reported, never fatal. */ unreadable: number; /** Rows kept despite an unreadable timestamp — they could not be placed in or out of the window. */ undated: number; } /** * Which orgs have captures under this base directory. * * The store is keyed by org id, so the directory names already hold the answer. Reading them * keeps the command offline: resolving an alias would mean asking Salesforce, and this command * exists to work when the org is unreachable or its credentials are gone. * * Filtered by shape because the base directory belongs to the operator and may hold anything — * notes, exports, an unrelated folder. */ export declare function discoverCapturedOrgs(base: string): string[]; /** * Settle on the org to read, or explain why that is not possible. * * Inferring the only captured org removes a step that exists for no reason; an operator with one * capture directory should not have to retype an eighteen-character identifier they cannot check * by eye. Where the answer is genuinely ambiguous the command asks rather than picks: choosing * one of several would analyse the wrong org and produce output that looks entirely correct. */ export declare function resolveOrgId(base: string, explicit: string | undefined): string; /** One captured day, and how much of it there is. */ export interface CapturedDay { date: string; /** How many event types have a capture for that date. */ types: number; /** Hours captured in the hourly layout. Empty for a daily capture, which covers the day. */ hours: string[]; } /** * Which days have captures, read off the store's own layout. * * "No captures for that window" is only half an answer. The operator's next question is which * windows do exist, and without it they go and re-pull data that may already be on disk under a * date they guessed wrong. The store is keyed by date, so it already knows. * * An empty file does not count, matching what counts as captured everywhere else — a partial * write is not a capture, and offering it as an available window would send somebody to * investigate an hour that holds nothing. */ export declare function describeCaptures(base: string, orgId: string): CapturedDay[]; /** * A real CSV reader. * * Splitting on commas and newlines is wrong for this data specifically, not merely in principle: * event log columns carry GraphQL queries, URIs and Aura messages, and a quoted newline in any of * them splits one record into two while shifting every later field left. The result still parses, * still looks like rows, and is wrong — which is the worst failure mode available to a forensic * importer. */ export declare function parseCsv(text: string): Array>; /** * Load every captured row for a window. * * Fault-tolerant by design, matching the capture side: a parse failure on one file must never * lose the rest of the window. An investigation frequently runs against the one hour that also * happens to contain a truncated download, and losing the other fifty files to it would be * self-defeating. Failures are counted and returned so the caller can report them rather than * discover them by their absence. */ export declare function loadCaptures(request: LoadRequest): LoadedCaptures; //# sourceMappingURL=loadCaptures.d.ts.map