import type { CatalogId } from "@x12i/catalox-contracts/ids.js"; import type { NativeCatalogItemRecord } from "@x12i/catalox-contracts/items.js"; import type { CatalogItemHistoryEventV1, CatalogItemHistoryIndexRecord, CatalogItemHistoryOp, ListCatalogItemHistoryInput, ListCatalogItemHistoryResult } from "@x12i/catalox-contracts/record-history.js"; import type { CataloxContext } from "@x12i/catalox-contracts/context.js"; import { type CataloxHelpersGcsClient } from "./backup-data.js"; /** Duck-typed history index store (Mongo or legacy Firestore implementation). */ export type CatalogItemHistoryStoreLike = { upsertIndex(row: CatalogItemHistoryIndexRecord): Promise; get(eventId: string): Promise; listByCatalog(catalogId: CatalogId, input?: ListCatalogItemHistoryInput): Promise; listByCatalogChronologicalUntil(catalogId: CatalogId, asOf: string, maxRows?: number): Promise; }; export type RecordHistoryDeps = { store: CatalogItemHistoryStoreLike; /** Object-store bucket (R2). Field name kept for contracts compatibility. */ gcsBucket: string; /** Prefix without leading slash; no trailing slash (helpers client normalizes). */ gcsBasePrefix: string; failClosed: boolean; }; export declare function normalizeRecordHistoryGcsPrefix(raw: string | undefined): string; export declare function fingerprintNativeRecord(rec: NativeCatalogItemRecord | null | undefined): string | undefined; /** Relative object path under the record-history prefix. */ export declare function buildRecordHistoryGcsRelativePath(params: { catalogId: CatalogId; op: CatalogItemHistoryOp; itemId: string; ts: string; }): string; export declare function buildRecordHistoryGcsClient(deps: RecordHistoryDeps): CataloxHelpersGcsClient; export type EmitRecordHistoryParams = { catalogId: CatalogId; itemId: string; storageDocId?: string; op: CatalogItemHistoryOp; before?: NativeCatalogItemRecord | null; after?: NativeCatalogItemRecord | null; manifest?: Record; }; export type EmitRecordHistoryResult = { ok: true; eventId: string; } | { ok: false; error: string; }; export declare function emitRecordHistoryEvent(deps: RecordHistoryDeps, context: CataloxContext, params: EmitRecordHistoryParams): Promise; export declare function readRecordHistoryEventPayload(deps: RecordHistoryDeps, indexRow: CatalogItemHistoryIndexRecord): Promise; export declare function emitRecordHistoryEventWithCustomPath(deps: RecordHistoryDeps, context: CataloxContext, params: { gcsRelativePath: string; catalogId: CatalogId; itemId: string; storageDocId?: string; op: CatalogItemHistoryOp; before?: NativeCatalogItemRecord | null; after?: NativeCatalogItemRecord | null; manifest?: Record; }): Promise; export declare function recordHistoryKeyForNativeRow(_catalogId: CatalogId, rec: NativeCatalogItemRecord): string; //# sourceMappingURL=record-history.d.ts.map