@xapp/stentor-lex-v2 1.45.52 → 1.45.53

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.
@@ -7,4 +7,10 @@ import { LexV2Request } from "../../models";
7
7
  * that it's the first (message).
8
8
  */
9
9
  export declare function getUserId(requestBody: LexV2Request): string;
10
- export declare function getSessionId(requestBody: LexV2Request): string;
10
+ /**
11
+ * Retrieves the sessionId from the request. It prefers the request.sessionId and will override it if it finds one on the sessionAttributes.
12
+ *
13
+ * @param requestBody
14
+ * @returns
15
+ */
16
+ export declare function getSessionId(requestBody: Pick<LexV2Request, "sessionId" | "sessionState">): string;
@@ -29,9 +29,17 @@ function getUserId(requestBody) {
29
29
  return userId;
30
30
  }
31
31
  exports.getUserId = getUserId;
32
+ /**
33
+ * Retrieves the sessionId from the request. It prefers the request.sessionId and will override it if it finds one on the sessionAttributes.
34
+ *
35
+ * @param requestBody
36
+ * @returns
37
+ */
32
38
  function getSessionId(requestBody) {
33
- let sessionId;
34
- if (requestBody === null || requestBody === void 0 ? void 0 : requestBody.sessionState.sessionAttributes) {
39
+ var _a, _b;
40
+ let sessionId = requestBody.sessionId;
41
+ // only if it exists on the session attributes do we then override it.
42
+ if ((_b = (_a = requestBody === null || requestBody === void 0 ? void 0 : requestBody.sessionState) === null || _a === void 0 ? void 0 : _a.sessionAttributes) === null || _b === void 0 ? void 0 : _b.sessionId) {
35
43
  sessionId = requestBody.sessionState.sessionAttributes.sessionId;
36
44
  }
37
45
  if (!sessionId) {
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/translators/request/helpers.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,iDAAqC;AAIrC;;;;;;GAMG;AAEH,SAAgB,SAAS,CAAC,WAAyB;IAC/C,IAAI,MAAc,CAAC;IAEnB,0CAA0C;IAE1C,IAAI,WAAW,KAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY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AA6B;QAC7B,IAAI,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YAClC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACvD,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACjC;KACJ;IAED,oBAAoB;IACpB,IAAI,CAAC,MAAM,EAAE;QACT,oEAAoE;QACpE,MAAM,GAAG,IAAA,oBAAI,GAAE,CAAC;KACnB;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAtBD,8BAsBC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,WAA6D;;IACtF,IAAI,SAAS,GAAW,WAAW,CAAC,SAAS,CAAC;IAE9C,sEAAsE;IACtE,IAAI,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,0CAAE,iBAAiB,0CAAE,SAAS,EAAE;QACzD,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAAC,SAAS,CAAC;KACpE;IAED,IAAI,CAAC,SAAS,EAAE;QACZ,qEAAqE;QACrE,SAAS,GAAG,IAAA,oBAAI,GAAE,CAAC;KACtB;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAdD,oCAcC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.45.52",
7
+ "version": "1.45.53",
8
8
  "description": "Stentor Lex V2 channel for stentor",
9
9
  "types": "lib/index",
10
10
  "main": "lib/index",
@@ -35,8 +35,8 @@
35
35
  "dependencies": {
36
36
  "@xapp/patterns": "2.0.1",
37
37
  "@xapp/stentor-alexa-lib": "1.45.45",
38
- "@xapp/stentor-lex-lib": "1.45.52",
39
- "@xapp/stentor-service-lex": "1.45.52",
38
+ "@xapp/stentor-lex-lib": "1.45.53",
39
+ "@xapp/stentor-service-lex": "1.45.53",
40
40
  "actions-on-google": "2.14.0"
41
41
  },
42
42
  "peerDependencies": {
@@ -54,5 +54,5 @@
54
54
  "clean": "rm -rf ./lib/*",
55
55
  "test": "mocha --recursive -r ts-node/register \"./src/**/*.test.ts\""
56
56
  },
57
- "gitHead": "6c299938a163d89d6969a60a7bd7106640f8b5b9"
57
+ "gitHead": "10ba2b5a794b4fba9dbd2efebedd3ead280bb63e"
58
58
  }