@xapp/stentor-lex-lib 1.86.8 → 1.86.10
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.
- package/README.md +21 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## @xapp/stentor-lex-lib
|
|
2
|
+
|
|
3
|
+
Shared AWS Lex library used by the `@xapp/stentor-lex-connect` (Lex V1) and `@xapp/stentor-lex-v2` channel packages. It has no `Channel` of its own; instead it provides the common pieces those channels build on:
|
|
4
|
+
|
|
5
|
+
- **Models** for Lex V1 fulfillment requests/responses (`LexRequest`, `LexResponse`), `PostText` requests/responses, slots, active contexts, response cards, and the Lex Import/Export bot format (bots, intents, slot types).
|
|
6
|
+
- **Translators** that turn a Stentor `Request` into a Lex `PostText` (V1) or `RecognizeText` (V2) request and translate the Lex results back into a Stentor `Response`, plus translators to build/parse Lex Import/Export bot definitions.
|
|
7
|
+
- **Utils** (`slugForLex`, `convertName`, `createPostFix`) for generating names that satisfy Lex's naming restrictions (letters/underscores only, no consecutive underscores), including a per-app postfix derived from an MD5 hash of the app id.
|
|
8
|
+
|
|
9
|
+
### Usage
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { slugForLex, createPostFix } from "@xapp/stentor-lex-lib";
|
|
13
|
+
|
|
14
|
+
const name = slugForLex("My Intent - Name"); // "My_Intent_Name"
|
|
15
|
+
const postfix = createPostFix({ appId: "abc123" });
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Documentation
|
|
19
|
+
|
|
20
|
+
- [Amazon Lex V1 Developer Guide](https://docs.aws.amazon.com/lex/latest/dg/what-is.html)
|
|
21
|
+
- [Amazon Lex Import/Export format](https://docs.aws.amazon.com/lex/latest/dg/import-export.html)
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.86.
|
|
7
|
+
"version": "1.86.10",
|
|
8
8
|
"description": "Shared AWS LEX Library for :mega: stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"main": "lib/index",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"node": "^20 || ^22 || ^24"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@aws-sdk/client-lex-runtime-v2": "3.
|
|
18
|
+
"@aws-sdk/client-lex-runtime-v2": "3.1133.0",
|
|
19
19
|
"@types/chai": "5.2.3",
|
|
20
20
|
"@types/sinon": "4.3.3",
|
|
21
21
|
"@xapp/config": "0.3.0",
|