import { type OperationIr } from "../ir/operations.js"; import { type WorkflowRecipe } from "../schema/recipe.js"; import { type CompileContext } from "./shared.js"; /** * Compile a `WorkflowRecipe` to an Operation IR. * * Emits, in execution order: * * 1. Optional `Workflow Folder` group folder under * `/sitecore/system/Workflows/` (when `meta.tax.group` is set). * 2. The workflow item itself, conforming to Sitecore's `Workflow` * template (path-resolved at apply time via `templateOf: ref-path`). * 3. One state item per `recipe.states[]`, conforming to the * `State` template; carries `Final` and `Preview` fields. * 4. A `SetField` on the workflow item setting `__Initial state` to * a recipe-ref pointing at the initial state. * 5. One command item per `state.commands[]`, conforming to the * `Command` template; carries `Next state`, `__Auto Publish`, * `Suppress comment`, `Appearance Evaluator Type`. * 6. One action item per `state.actions[]`, conforming to either * `Webhook Submit Action` or `Webhook Validation Action`. * 7. One validation item per `command.validations[]` (Webhook * Validation Action). * 8. One `SetField` op per `bindings.templates[]` entry, writing the * `__Default workflow` field on each bound template's * `__Standard Values` item to a `ref-recipe` pointing at the * workflow item. Entries that look like a recipe handle resolve * via `standardValuesId(site, handle)` (the matching * `ContentTemplateRecipe` / `ComponentTemplateRecipe` must ship in * the same set). Entries that look like an absolute template path * resolve via `latePath: "/__Standard Values"` so the * executor seeds the captured-itemId map on demand. * * Workflow-specific field GUIDs are not published as a public contract * by Sitecore. The executor's `FieldValueInput.name` fallback resolves * each field by name against the target item's template at apply time, * so the IR carries arbitrary stable refKey GUIDs for `fieldId` plus * the canonical `fieldName`. Same pattern as recipe-created fields on * registry templates (see `FieldValueSchema.fieldName` comment). * * @throws `INPUT_INVALID` when initialState references an undeclared * state, when a command's nextState doesn't resolve, when no state is * final, or when an action declares both authorizationRef and * authorizationPath. */ export declare function compileWorkflowRecipe(input: WorkflowRecipe, context: CompileContext, emittedFolders?: Set): OperationIr;