import type { EditDocumentInput, DualDocument, DocumentQuery, DbOperation } from './types.ts'; /** * Creates or edits a document * * Rules: * 1. Routes/paths are immutable (they can be deleted) * 2. When a path is updated for a document, make a new route and set the path_id to the new route * 3. When a draft is inserted for a document: * - If there is no existing draft: copy over every undefined/null field from the current saved version * - If there is an existing draft: update the fields for the draft * 4. When a draft is "saved" (published=true), it becomes the new current version and the old record is deleted * * Supports two call patterns: * - 3-param: upsert(client, query, input) - explicit query and input * - 2-param: upsert(client, inputWithQuery) - combined query and input in one object * * @param client Database client * @param queryOrInput Query to find the document, or combined query+input object * @param input Document data to update (optional if using combined object) * @returns Object with current (saved) and/or draft versions of the document */ export declare const upsert: DbOperation<[ DocumentQuery | (EditDocumentInput & DocumentQuery), EditDocumentInput? ], DualDocument>; //# sourceMappingURL=upsert.d.ts.map