@xapp/stentor-handler-legacy
v1.86.7
Published
PLACEHOLDER DESCRIPTION OF PACKAGE
Readme
@xapp/stentor-handler-legacy
Backwards-compatibility utilities for older Stentor data models. It converts legacy Handler/Intent props (responseData, action, helpData, exitData, data.handler) into the current content-keyed Handler shape used by stentor-handler, and exposes guards to detect whether a given set of props is still in the legacy format.
Usage
import { convertToHandler, isLegacyHandler, hasLegacyHandlerProps } from "@xapp/stentor-handler-legacy";
if (isLegacyHandler(props)) {
// deleteLegacyKeys=true strips the old fields once merged into `content`
const handler = convertToHandler(props, true);
}convertToHandler(props, deleteLegacyKeys?)— merges legacy response/help/exit data intocontent.isLegacyHandler(props)/hasLegacyHandlerProps(props)— type guards for detecting legacy props.LegacyHandler— the interface describing the old, pre-contenthandler shape.
