/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited */ import type { DocumentPublishSchedule } from '../../@types/index.js'; import type { AuditCapability } from './audit.js'; import type { DocumentLifecycleContext } from './context.js'; export type PublishScheduleInvalidationReason = 'content_edited' | 'status_changed' | 'unpublished' | 'soft_deleted'; /** Bounded, JSON-safe audit projection; execution errors never enter audit. */ export declare function publishScheduleAuditValue(schedule: DocumentPublishSchedule): Record; /** * Lock and remove a schedule inside an already-open lifecycle transaction. * The caller appends the audit after its primary mutation audit so ordering is * deterministic. This helper deliberately never opens a transaction. */ export declare function cancelPublishScheduleInTransaction(ctx: DocumentLifecycleContext, documentId: string): Promise; /** Append the audit for a cancellation already performed in this transaction. */ export declare function appendPublishScheduleCancellationAudit(params: { ctx: DocumentLifecycleContext; audit: AuditCapability; schedule: DocumentPublishSchedule | null; reason: Exclude; }): Promise; /** * Commit a new content version and schedule suspension in one ambient * transaction. `write` may use the adapter's nested transaction/savepoint, * but every rejection propagates to this outer boundary. */ export declare function commitContentVersionWithScheduleSuspension(params: { ctx: DocumentLifecycleContext; documentId: string; write: () => Promise; }): Promise; /** Called after the primary writes, under their document lock and transaction. */ export declare function suspendPublishScheduleForEdit(ctx: DocumentLifecycleContext, audit: AuditCapability, documentId: string, reason: 'content_edited' | 'document_metadata_changed'): Promise;