wingbot 3.46.0-alpha.3 → 3.46.0-alpha.4

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.3",
3
+ "version": "3.46.0-alpha.4",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,7 +9,7 @@
9
9
  "doc": "npm run doc:gql && node ./bin/makeApiDoc.js && cpy ./CHANGELOG.md ./doc && gitbook install ./doc && gitbook build ./doc && rimraf -rf ./docs && rimraf --rf ./doc/CHANGELOG.md && move-cli ./doc/_book ./docs",
10
10
  "test": "npm run test:lint && npm run test:coverage && npm run test:coverage:threshold",
11
11
  "test:coverage": "nyc --reporter=html mocha ./test && nyc report",
12
- "test:coverage:threshold": "nyc check-coverage --lines 90 --functions 90 --branches 80",
12
+ "test:coverage:threshold": "nyc check-coverage --lines 90 --functions 89 --branches 80",
13
13
  "test:backend": "mocha ./test",
14
14
  "test:lint": "eslint --ext .js src test *.js plugins"
15
15
  },
@@ -359,10 +359,15 @@ function onInteractionHandler (
359
359
  allActions
360
360
  };
361
361
 
362
+ const notHandled = actions.some((a) => a.match(/\*$/)) && !req.isQuickReply();
363
+ const value = notHandled ? 1 : 0;
364
+
362
365
  trackEvents.push({
363
366
  type: TrackingType.PAGE_VIEW,
364
367
  category: asCategory(TrackingCategory.PAGE_VIEW_FIRST),
365
368
  action,
369
+ label: (isText || isQuickReply ? text : null),
370
+ value,
366
371
  allActions,
367
372
  nonInteractive,
368
373
  lastAction,
@@ -381,6 +386,7 @@ function onInteractionHandler (
381
386
  type: TrackingType.PAGE_VIEW,
382
387
  category: asCategory(TrackingCategory.PAGE_VIEW_SUBSEQUENT),
383
388
  action: a,
389
+ value: 0,
384
390
  allActions,
385
391
  nonInteractive: false,
386
392
  lastAction,
@@ -397,14 +403,14 @@ function onInteractionHandler (
397
403
 
398
404
  trackEvents.push(
399
405
  ...events.map(({
400
- type, category, action: eventAction, label, value
406
+ type, category, action: eventAction, label, value: eVal
401
407
  }) => ({
402
408
  lastAction,
403
409
  type,
404
410
  category,
405
411
  action: eventAction,
406
412
  label,
407
- value,
413
+ value: eVal,
408
414
  ...langsExtension
409
415
  }))
410
416
  );
@@ -425,11 +431,8 @@ function onInteractionHandler (
425
431
  });
426
432
  }
427
433
 
428
- const notHandled = actions.some((a) => a.match(/\*$/)) && !req.isQuickReply();
429
-
430
434
  let actionCategory;
431
435
  let label = noneAction;
432
- const value = notHandled ? 1 : 0;
433
436
 
434
437
  if (isPassThread) {
435
438
  actionCategory = TrackingCategory.HANDOVER_TO_BOT;
@@ -458,7 +461,7 @@ function onInteractionHandler (
458
461
  actionCategory = TrackingCategory.REFERRAL;
459
462
  } else if (isPostback) {
460
463
  actionCategory = TrackingCategory.POSTBACK_BUTTON;
461
- label = req.event.postback.title || '(unknown)';
464
+ label = req.event.postback.title || (useExtendedScalars ? null : '(unknown)');
462
465
  } else {
463
466
  actionCategory = TrackingCategory.OTHER;
464
467
  }