Skip to content

RepositoryExportSession

The verification state of one logical export stream.

A resumed request carries no header, and its trailer covers only the rows of that segment — the server cannot know what a client already read. So the session keeps two hashers: a per-segment one, which each segment’s trailer is checked against, and a whole-stream one, which accumulates across every segment and is what the caller should record as the export’s content digest. For a stream that never broke the two agree, and the trailer proves both.

new RepositoryExportSession(): RepositoryExportSession

RepositoryExportSession

get header(): { kind: "header"; formatVersion: 3; repo: string; mode: "heads" | "ops"; sinceRepoSeq: number; atRepoSeq: number; } | undefined

The header of the opening segment; resumed segments repeat none.

{ kind: "header"; formatVersion: 3; repo: string; mode: "heads" | "ops"; sinceRepoSeq: number; atRepoSeq: number; } | undefined


get lastDurableId(): string | undefined

Cursor for afterDurableId when resuming a broken stream.

string | undefined


get rowCount(): number

Rows verified so far across every segment.

number


get segmentRowCount(): number

Rows verified in the segment currently being read.

number


get contentSha256(): string | undefined

The whole logical stream’s content digest, available once the stream has been finalized — by its closing trailer, or by finalizeContentSha256.

string | undefined


get complete(): boolean

Whether this session’s trailer has been verified.

boolean

finalizeContentSha256(): string

End the session early and read the digest of what was verified. Useful when a stream will not be resumed; the session cannot be read from again.

string