import * as plugins from '../dist_ts/plugins.js'; export declare const SKR_MIGRATION_COLLECTION = "SkrMigration"; /** * What the ledger unification (v1 shapes → hashed journal) changed. The counts * are the writes of the run that completed the step; writes an interrupted * earlier run committed are not repeated and not counted again, and * `verifiedChains` covers them. */ export interface ILedgerUnificationReport { kind: 'ledger-unification'; /** legacy journal entries whose lines gained exact cents, side and Gegenkonto */ journalEntriesBackfilled: number; /** legacy transactions that gained cent mirrors */ transactionsBackfilled: number; /** largest float-to-cent rounding drift met, in cents */ maxDriftCents: number; /** legacy journal entries moved into the hashed journal */ legacyEntriesUpgraded: number; /** standalone legacy transactions synthesized into two-line journal entries */ transactionsSynthesized: number; /** * standalone legacy transactions whose synthesized entry an interrupted * 6.x `migrateToV2()` had written without marking the transaction: the entry * was found identical to the one this step derives and the transaction marked */ synthesizedEntriesAdopted: number; /** the hash chains the unchained entries were appended to, with the entries this run chained */ chains: Array<{ skrType: string; fiscalYear: number; chainedEntries: number; headHash: string; }>; /** * every chain this step appended to or that holds imported legacy entries, * verified end to end (gapless, every hash and link, counter and head) * after the step's writes */ verifiedChains: Array<{ skrType: string; fiscalYear: number; entries: number; headHash: string; }>; } /** What the storage topology step changed. */ export interface IStorageTopologyReport { kind: 'storage-topology'; /** collections whose legacy `smartdata_text_index` was dropped */ textIndexesDropped: string[]; /** the partial unique index over the journal's sequence numbers exists */ sequenceIndexEnsured: true; } export type TSkrMigrationReport = ILedgerUnificationReport | IStorageTopologyReport; /** An applied migration step as skr reports it (Verfahrensdokumentation artifact). */ export interface ISkrMigrationRecord { id: string; description: string; startedAt: Date; appliedAt: Date; report: TSkrMigrationReport; } /** * One document per migration step: the lease while a step runs, the record * and its report once it has been applied. */ export declare class SkrMigrationRecord extends plugins.nosqldb.SmartDataDbDoc { id: string; description: string; status: 'running' | 'applied'; /** the process holding the lease while the step runs */ owner: string; /** epoch milliseconds; a holder that stopped renewing loses the lease after it */ leaseUntil: number; startedAt: Date; appliedAt: Date | null; report: TSkrMigrationReport | null; } /** The applied steps, oldest first. */ export declare const listAppliedMigrations: () => Promise;