@xapp/stentor-handler-legacy 1.86.6 → 1.86.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +18 -1
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1 +1,18 @@
1
- Copy this to create a new package under `/packages`
1
+ ## @xapp/stentor-handler-legacy
2
+
3
+ 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.
4
+
5
+ ### Usage
6
+
7
+ ```ts
8
+ import { convertToHandler, isLegacyHandler, hasLegacyHandlerProps } from "@xapp/stentor-handler-legacy";
9
+
10
+ if (isLegacyHandler(props)) {
11
+ // deleteLegacyKeys=true strips the old fields once merged into `content`
12
+ const handler = convertToHandler(props, true);
13
+ }
14
+ ```
15
+
16
+ - `convertToHandler(props, deleteLegacyKeys?)` — merges legacy response/help/exit data into `content`.
17
+ - `isLegacyHandler(props)` / `hasLegacyHandlerProps(props)` — type guards for detecting legacy props.
18
+ - `LegacyHandler` — the interface describing the old, pre-`content` handler shape.
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.86.6",
7
+ "version": "1.86.8",
8
8
  "description": "PLACEHOLDER DESCRIPTION OF PACKAGE",
9
9
  "types": "lib/index",
10
10
  "main": "lib/index",
@@ -19,9 +19,9 @@
19
19
  "@xapp/config": "0.3.0",
20
20
  "chai": "4.5.0",
21
21
  "mocha": "11.8.0",
22
- "stentor-guards": "1.74.5",
23
- "stentor-models": "1.79.0",
24
- "stentor-utils": "1.76.0",
22
+ "stentor-guards": "1.74.7",
23
+ "stentor-models": "1.81.0",
24
+ "stentor-utils": "1.76.3",
25
25
  "typescript": "5.9.3"
26
26
  },
27
27
  "peerDependencies": {