import { Logger } from "../../shared/logger.js"; import type { EnvironmentConfiguration, RootConfiguration } from "../../config/types.js"; import { type ItemSelector, type WorkflowApiClient, type WorkflowDefinitionDetail } from "../api/client.js"; /** Shared option shape for `scai content workflow *` tasks. */ export interface WorkflowTaskOptions { config?: string; environmentName?: string; verbose?: boolean; trace?: boolean; quiet?: boolean; json?: boolean; logFile?: string; nonInteractive?: boolean; } export declare const toLogger: (options: WorkflowTaskOptions) => Logger; export interface ResolvedWorkflowTenant { envName: string; environment: EnvironmentConfiguration; root: RootConfiguration; client: WorkflowApiClient; } export declare const resolveWorkflowTenant: (options: WorkflowTaskOptions) => ResolvedWorkflowTenant; export declare const WORKFLOW_ITEM_ID_PATTERN: RegExp; /** * Resolve a workflow ref (GUID, content-tree path, or display/item name) * to a `WorkflowDefinitionDetail` via the same lookup `scai content workflow * inspect` / `scai content workflow apply` use. Returns `null` when no * workflow-templated item matches the ref. Callers convert null into a * task-specific "skipped-workflow-not-found" outcome. */ export declare const resolveWorkflowRef: (client: WorkflowApiClient, ref: string) => Promise; /** * Resolve a state ref (GUID, item name, or display name) against the * states declared on a workflow definition. Returns `null` when the ref * doesn't match any state — callers turn this into a * `skipped-state-not-found` outcome. */ export declare const resolveWorkflowState: (workflow: WorkflowDefinitionDetail, stateRef: string) => { itemId: string; name: string; } | null; /** * Normalize a Sitecore item ID to dashed lowercase form * (`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`). The Authoring API's * `workflow.commands(query: {item: {itemId}})` and * `executeWorkflowCommand(input: {item: {itemId}})` both require this * dashed form even though `item(where: {itemId})` accepts undashed. * * Pass-through if the input isn't a 32-hex string — callers can rely on * receiving a still-valid input or surfacing the eventual API error. */ export declare const dashifyItemId: (id: string) => string; /** * Parse a `` CLI argument into an `ItemSelector`. Accepts: * * - 32-hex GUIDs with or without braces/hyphens → `{itemId}` * - paths starting with `/sitecore/` → `{path}` * * Anything else throws an INPUT_INVALID error. */ export declare const parseItemReference: (value: string) => ItemSelector; /** * Render a result either as a `--json` envelope or as a small key/value * block for human-readable output. Used by `scai content workflow get` / * `list-commands` where the result is a single record (not a long list * that would warrant the broader `printReport` helper from hygiene). */ export declare const printWorkflowResult: (params: { logger: Logger; command: string; envName: string; result: unknown; /** Lines of human-friendly text emitted when `--json` is off. */ humanLines?: string[]; }) => void;