wingbot 3.46.0-alpha.7 → 3.46.0-alpha.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.46.0-alpha.7",
3
+ "version": "3.46.0-alpha.8",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -97,6 +97,10 @@ const {
97
97
  * @prop {string} [action]
98
98
  * @prop {string} [snapshot]
99
99
  * @prop {string} [botId]
100
+ * @prop {boolean} [didHandover]
101
+ * @prop {number|null} [feedback]
102
+ * @prop {string} [timeZone]
103
+ * @prop {number} [sessionStart]
100
104
  */
101
105
 
102
106
  /**
@@ -107,7 +111,6 @@ const {
107
111
  * @param {SessionMetadata} [metadata]
108
112
  * @param {number} [ts]
109
113
  * @param {boolean} [nonInteractive]
110
- * @param {string} [timeZone]
111
114
  * @returns {Promise}
112
115
  */
113
116
 
@@ -121,7 +124,7 @@ const {
121
124
  * @param {number} [ts]
122
125
  * @param {boolean} [nonInteractive]
123
126
  * @param {boolean} [sessionStarted]
124
- * @param {string} [timeZone]
127
+ * @param {SessionMetadata} [metadata]
125
128
  * @returns {Promise}
126
129
  */
127
130
 
@@ -285,26 +288,27 @@ function onInteractionHandler (
285
288
  didHandover = true;
286
289
  }
287
290
 
291
+ const metadata = {
292
+ sessionCount,
293
+ lang,
294
+ action,
295
+ snapshot,
296
+ botId,
297
+ didHandover,
298
+ feedback,
299
+ timeZone,
300
+ sessionStart
301
+ };
302
+
288
303
  let sessionPromise;
289
304
  if (createSession) {
290
- const metadata = {
291
- sessionCount,
292
- lang,
293
- action,
294
- snapshot,
295
- botId,
296
- didHandover,
297
- feedback
298
- };
299
-
300
305
  sessionPromise = analyticsStorage.createUserSession(
301
306
  pageId,
302
307
  senderId,
303
308
  sessionId,
304
309
  metadata,
305
310
  timestamp,
306
- nonInteractive,
307
- timeZone
311
+ nonInteractive
308
312
  );
309
313
 
310
314
  if (!parallelSessionInsert) {
@@ -410,11 +414,8 @@ function onInteractionHandler (
410
414
  prevAction: lastAction,
411
415
  skill: useSkill,
412
416
  isGoto: false,
413
- sessionStart,
414
417
  sessionDuration: timestamp - sessionStart,
415
418
  withUser,
416
- snapshot,
417
- botId,
418
419
  ...langsExtension,
419
420
  ...(hasExtendedEvents ? {} : actionMeta)
420
421
  });
@@ -434,10 +435,7 @@ function onInteractionHandler (
434
435
  prevAction,
435
436
  skill: useSkill,
436
437
  isGoto: true,
437
- sessionStart,
438
438
  sessionDuration: timestamp - sessionStart,
439
- snapshot,
440
- botId,
441
439
  ...langsExtension
442
440
  };
443
441
 
@@ -456,7 +454,6 @@ function onInteractionHandler (
456
454
  action: eventAction,
457
455
  label,
458
456
  value: eVal,
459
- sessionStart,
460
457
  ...langsExtension
461
458
  }))
462
459
  );
@@ -473,7 +470,6 @@ function onInteractionHandler (
473
470
  action,
474
471
  label: text,
475
472
  value: score >= ai.confidence ? 0 : 1,
476
- sessionStart,
477
473
  ...langsExtension
478
474
  });
479
475
  }
@@ -521,7 +517,6 @@ function onInteractionHandler (
521
517
  action,
522
518
  label,
523
519
  value,
524
- sessionStart,
525
520
  ...langsExtension
526
521
  });
527
522
  }
@@ -537,7 +532,7 @@ function onInteractionHandler (
537
532
  timestamp,
538
533
  nonInteractive,
539
534
  createSession,
540
- timeZone
535
+ metadata
541
536
  ),
542
537
  sessionPromise
543
538
  ]);