import { Connection } from '@salesforce/core'; export type WorkItemContext = { workItemId: string; projectId: string; }; export type UpdateWorkItemParams = { connection: Connection; workItemId: string; projectId: string; status?: string; subject?: string; description?: string; }; export type UpdateWorkItemResult = { success: boolean; workItemId: string; workItemName?: string; status?: string; subject?: string; description?: string; error?: string; }; export declare const ALLOWED_STATUSES: readonly ["In Progress", "Ready to Promote"]; export type AllowedStatus = (typeof ALLOWED_STATUSES)[number]; export declare function toApiStatus(status: string): string; /** * Allowed current statuses for each target status a user can set. A work item may only move * to IN_PROGRESS while it is NEW, and to READY_TO_PROMOTE while it is IN_REVIEW. Target statuses * absent from this map have no precondition. */ export declare const STATUS_TRANSITION_PRECONDITIONS: Record; /** * Verifies that the work item's current status permits the requested transition. Throws with a * descriptive error when it does not. Only runs a query when the target status has a precondition, * so subject/description-only updates are unaffected. */ export declare function assertStatusTransitionAllowed(connection: Connection, workItemId: string, targetApiStatus: string): Promise; export declare function resolveWorkItemByName(connection: Connection, workItemName: string): Promise; export declare function resolveProjectIdForWorkItem(connection: Connection, workItemId: string): Promise; /** * Updates a DevOps Center work item. * * Subject and description are plain WorkItem sObject fields — the DevOps Center connect work item * endpoint does not accept them — so they are written via the sObject API. Status changes go * through the connect endpoint (PATCH /connect/devops/projects/{projectId}/workitem/{workItemId}), * which is the only field that endpoint accepts, so platform-side status handling runs. * * The two writes hit different APIs with no shared transaction. Subject/description are committed * first; if the status call then fails, this returns `{ success: false }` with an error that names * the fields that did persist, rather than throwing and leaving the committed changes unreported. */ export declare function updateWorkItem(params: UpdateWorkItemParams): Promise;