import { PoolClient } from '@evershop/postgres-query-builder'; import type { ChangesetOperationRow } from '../../../types/db/index.js'; /** * Apply a single changeset operation to the **source tables**. Used by the * publish path (transactional, irreversible). The on-the-fly rollout overlay * uses a separate in-memory walker (see `applyOverlayToWidgets.ts`). * * Op-type inference from `(old_payload, new_payload)`: * (null, set) โ†’ INSERT * (set, set) โ†’ UPDATE * (set, null) โ†’ DELETE * * Payloads can carry `*_uuid` references to other entities; this function * resolves them to integer FKs at apply time so the changeset never has to * track auto-increment IDs. */ export type OpType = 'INSERT' | 'UPDATE' | 'DELETE'; export declare function inferOpType(oldPayload: unknown, newPayload: unknown): OpType; /** * Apply one operation to the source tables. Throws if the operation targets * an unsupported URN type (only `cms:widget_instance` and `cms:widget_placement` * are supported in Phase 3a). * * `changesetTheme` is the publishing changeset's theme: it is stamped onto * inserted rows and verified against the target of UPDATE/DELETE ops * (spec 04 ยง 9.9). */ export declare function applyOperationToSource(op: ChangesetOperationRow, conn: PoolClient, changesetTheme: string | null): Promise;