import type { EnvironmentConfiguration } from "../../config/types.js"; import { type WebhookRequestOptions } from "./graphql.js"; /** * Runtime resolvers for Sitecore template IDs and event-type catalog * item IDs needed by `scai content workflow webhook create`. * * **Why runtime, not hardcoded.** XM Cloud ships these templates and * catalog items as part of base content, but Sitecore has never * published their GUIDs as a public contract — they're treated as * tenant-internal. They should be stable within a major version, but * resolving by path keeps the CLI working if a tenant has been * customized or if Sitecore ever renumbers them in a base-content * update. * * Both resolvers cache per-instance — the resolver is constructed * once per `WebhookApiClient` invocation, so subsequent `create` calls * within the same task run share the cache and pay for resolution * once. */ export declare const WEBHOOK_EVENT_HANDLER_TEMPLATE_PATH = "/sitecore/templates/System/Webhooks/Webhook Event Handler"; export declare const WEBHOOK_SUBMIT_ACTION_TEMPLATE_PATH = "/sitecore/templates/System/Workflow/Webhook Submit Action"; export declare const WEBHOOK_VALIDATION_ACTION_TEMPLATE_PATH = "/sitecore/templates/System/Workflow/Webhook Validation Action"; export declare const EVENT_TYPE_ITEM_ROOT = "/sitecore/system/Settings/Webhooks/Event Types/Item"; export declare const EVENT_TYPE_PUBLISH_ROOT = "/sitecore/system/Settings/Webhooks/Event Types/Publish"; export interface WebhookTemplateResolver { /** Resolve the Webhook Event Handler template's item ID. */ webhookEventHandlerTemplateId(): Promise; /** Resolve the Webhook Submit Action (workflow) template's item ID. */ webhookSubmitActionTemplateId(): Promise; /** Resolve the Webhook Validation Action (workflow) template's item ID. */ webhookValidationActionTemplateId(): Promise; /** * Resolve a set of event-type names (e.g. `item:saved`, `publish:end`) * to their catalog item IDs. Missing events throw `INPUT_INVALID` * with a hint pointing at the catalog tree. */ resolveEventTypeIds(eventNames: readonly string[]): Promise; /** Generic path resolution. Returns null if the item doesn't exist. */ resolveItemIdByPath(path: string): Promise; } export declare const createWebhookTemplateResolver: (environment: EnvironmentConfiguration, request?: WebhookRequestOptions) => WebhookTemplateResolver;