wingbot 3.47.2 → 3.48.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.47.2",
3
+ "version": "3.48.1",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Responder.js CHANGED
@@ -66,6 +66,7 @@ Object.freeze(ExpectedInput);
66
66
  * @prop {string} [style]
67
67
  * @prop {string} [language]
68
68
  * @prop {string} [voice]
69
+ * @prop {number} [timeout]
69
70
  */
70
71
 
71
72
  /**
@@ -32,6 +32,7 @@ const {
32
32
  * @prop {string} [label]
33
33
  * @prop {number} [value]
34
34
  * @prop {string} [lang]
35
+ * @prop {string|null} [pagePath]
35
36
  */
36
37
 
37
38
  /**
@@ -60,6 +61,7 @@ const {
60
61
  * @prop {string} [intent]
61
62
  * @prop {number} [intentScore]
62
63
  * @prop {string[]|string} [entities]
64
+ * @prop {string|null} [pagePath]
63
65
  * @prop {string[]|string} allActions
64
66
  * @prop {boolean} nonInteractive
65
67
  *
@@ -96,6 +98,7 @@ const {
96
98
  * @prop {number} [sessionStart]
97
99
  * @prop {number} [sessionDuration]
98
100
  * @prop {string[]} [responseTexts]
101
+ * @prop {string|null} [pagePath]
99
102
  */
100
103
 
101
104
  /**
@@ -165,6 +168,7 @@ const {
165
168
 
166
169
  /**
167
170
  * @typedef {object} HandlerConfig
171
+ * @prop {string} [pagePathVar]
168
172
  * @prop {string} [snapshot]
169
173
  * @prop {string} [botId]
170
174
  * @prop {string} [timeZone] - default UTC
@@ -207,6 +211,7 @@ function onInteractionHandler (
207
211
  snapshot,
208
212
  botId,
209
213
  timeZone = 'UTC',
214
+ pagePathVar = '§pathname',
210
215
  anonymize = (x) => x,
211
216
  userExtractor = (state) => null // eslint-disable-line no-unused-vars
212
217
  },
@@ -233,7 +238,7 @@ function onInteractionHandler (
233
238
  req,
234
239
  actions,
235
240
  lastAction,
236
- // state,
241
+ state,
237
242
  // data,
238
243
  skill,
239
244
  events,
@@ -258,8 +263,9 @@ function onInteractionHandler (
258
263
  _sid: sessionId,
259
264
  _sst: sessionStart,
260
265
  _sts: sessionTs,
261
- lang
262
- } = req.state;
266
+ lang,
267
+ [pagePathVar]: pagePath
268
+ } = state;
263
269
 
264
270
  const trackEvents = [];
265
271
 
@@ -297,7 +303,8 @@ function onInteractionHandler (
297
303
  timeZone,
298
304
  sessionStart,
299
305
  responseTexts,
300
- sessionDuration: sessionTs - sessionStart
306
+ sessionDuration: sessionTs - sessionStart,
307
+ pagePath
301
308
  };
302
309
 
303
310
  let sessionPromise;
@@ -391,7 +398,8 @@ function onInteractionHandler (
391
398
  intentScore: score,
392
399
  entities: asArray(req.entities.map((e) => e.entity)),
393
400
  text,
394
- allActions
401
+ allActions,
402
+ pagePath
395
403
  };
396
404
 
397
405
  const notHandled = actions.some((a) => a.match(/\*$/)) && !req.isQuickReply();
@@ -513,6 +521,7 @@ function onInteractionHandler (
513
521
  action,
514
522
  label,
515
523
  value,
524
+ pagePath,
516
525
  ...langsExtension
517
526
  });
518
527
  }
@@ -32,7 +32,7 @@ const {
32
32
  function getVoiceControlFromParams (params, lang = null) {
33
33
  const voiceControl = {};
34
34
 
35
- const voiceControlProps = ['speed', 'pitch', 'volume', 'voice', 'style', 'language'];
35
+ const voiceControlProps = ['speed', 'pitch', 'volume', 'voice', 'style', 'language', 'timeout'];
36
36
 
37
37
  voiceControlProps.forEach((prop) => {
38
38
  if (params[prop]) {