/** * 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 RequestContext } from '@byline/auth'; import type { DocumentPublishSchedule, DocumentPublishSchedulePage, DocumentPublishScheduleState } from '../../@types/index.js'; import type { BylineCore } from '../../core.js'; import type { DocumentLifecycleContext } from './context.js'; export type ClaimedScheduledPublicationResult = { status: 'published'; } | { status: 'claim_lost'; } | { status: 'target_changed'; reason: 'content_edited' | 'document_metadata_changed'; } | { status: 'terminal'; reason: 'document_not_found' | 'already_published' | 'invalid_transition'; }; export declare function scheduleDocumentPublish(ctx: DocumentLifecycleContext, params: { documentId: string; publishAt: string; expectedVersionId: string; expectedRevision: number; }): Promise; export declare function confirmDocumentScheduledPublish(ctx: DocumentLifecycleContext, params: { documentId: string; expectedVersionId: string; expectedRevision: number; }): Promise; export declare function cancelDocumentScheduledPublish(ctx: DocumentLifecycleContext, params: { documentId: string; expectedRevision: number; }): Promise<{ schedule: DocumentPublishSchedule | null; revision: number; }>; export declare function getDocumentScheduledPublish(ctx: DocumentLifecycleContext, params: { documentId: string; }): Promise; export declare function listDocumentPublishSchedules(core: BylineCore, requestContext: RequestContext | undefined, params: { states?: readonly DocumentPublishScheduleState[]; lastAuthorizedBy?: string; page: number; pageSize: number; }): Promise & { schedules: (DocumentPublishSchedule & { revision: number; documentPath: string | null; })[]; }>; /** * Execute one token-fenced publication through the normal status lifecycle. * Internal to the server-only sweep: authorization was captured when the row * was armed, so callers must construct an explicit system context. */ export declare function publishClaimedScheduledDocument(ctx: DocumentLifecycleContext, params: { documentId: string; executionToken: string; }): Promise;