import type { WebhookHandlerSummary, WebhookSerializationType } from "../api/client.js"; import { type WebhookTaskOptions } from "./shared.js"; /** * Three flavors: * * - `item` / `publish` — create a Webhook Event Handler under * `/sitecore/system/Webhooks` (or `--parent-path`). Use `--event` * one or more times to pick event-type catalog entries. * - `workflow` — create a Webhook Submit Action or Validation Action * under a workflow state's (or command's) `Actions` folder. Use * `--on-state` (or `--on-command`) to point at the parent; pick * `--action submit|validation`. */ export interface WebhookCreateOptions extends WebhookTaskOptions { /** Item name for the new handler. */ name: string; url: string; /** Discriminator. */ event: "item" | "publish" | "workflow"; /** * Event-type names (e.g. `item:saved`, `publish:end`). Required for * the `item` and `publish` event flavors; ignored for `workflow`. * Can be a comma-separated string or repeated occurrences. */ events?: string[]; /** * For workflow webhooks — absolute path to the workflow state or * command under which the action item is created (i.e. * `/sitecore/system/Workflows/My Workflow/Draft` or `.../Submit`). */ onState?: string; /** For workflow webhooks — `submit` (default) or `validation`. */ action?: "submit" | "validation"; description?: string; /** Optional absolute path to an Authorization item. */ authorization?: string; serializationType?: WebhookSerializationType; /** Override parent path for item/publish handlers. */ parentPath?: string; /** Per-invocation override of the env's `allowWrite` flag. */ allowWrite?: boolean; /** Plan-only — no mutation. */ whatIf?: boolean; enabled?: boolean; } export interface WebhookCreateResult { status: "created" | "what-if"; handler: WebhookHandlerSummary | null; plan: { flavor: "item" | "publish" | "workflow"; name: string; url: string; events?: string[]; workflowAction?: "submit" | "validation"; parent: string; }; } export declare const runWebhookCreate: (options: WebhookCreateOptions) => Promise;