botium-core 1.13.9 → 1.13.11

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/dist/botium-es.js CHANGED
@@ -10,7 +10,7 @@ import randomatic from 'randomatic';
10
10
  import lodash from 'lodash';
11
11
  import boolean$1 from 'boolean';
12
12
  import events from 'events';
13
- import debug$m from 'debug';
13
+ import debug$n from 'debug';
14
14
  import vm2 from 'vm2';
15
15
  import isClass from 'is-class';
16
16
  import crypto from 'crypto';
@@ -37,7 +37,7 @@ import express from 'express';
37
37
  import bodyParser from 'body-parser';
38
38
 
39
39
  var name = "botium-core";
40
- var version$1 = "1.13.9";
40
+ var version$1 = "1.13.11";
41
41
  var description = "The Selenium for Chatbots";
42
42
  var main = "index.js";
43
43
  var module = "dist/botium-es.js";
@@ -1159,7 +1159,7 @@ LogicHookConsts.DEFAULT_USER_INPUTS;
1159
1159
  const {
1160
1160
  NodeVM: NodeVM$2
1161
1161
  } = vm2;
1162
- const debug$l = debug$m('botium-core-asserterUtils');
1162
+ const debug$m = debug$n('botium-core-asserterUtils');
1163
1163
  const {
1164
1164
  BotiumError: BotiumError$6
1165
1165
  } = BotiumError_1;
@@ -1214,7 +1214,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
1214
1214
  _fetchAsserters() {
1215
1215
  this.caps[Capabilities.ASSERTERS].forEach(asserter => {
1216
1216
  if (this.asserters[asserter.ref]) {
1217
- debug$l(`${asserter.ref} asserter already exists, overwriting.`);
1217
+ debug$m(`${asserter.ref} asserter already exists, overwriting.`);
1218
1218
  }
1219
1219
  this.asserters[asserter.ref] = this._loadClass(asserter, 'asserter');
1220
1220
  if (asserter.global) {
@@ -1225,7 +1225,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
1225
1225
  _fetchLogicHooks() {
1226
1226
  this.caps[Capabilities.LOGIC_HOOKS].forEach(logicHook => {
1227
1227
  if (this.logicHooks[logicHook.ref]) {
1228
- debug$l(`${logicHook.ref} logic hook already exists, overwriting.`);
1228
+ debug$m(`${logicHook.ref} logic hook already exists, overwriting.`);
1229
1229
  }
1230
1230
  this.logicHooks[logicHook.ref] = this._loadClass(logicHook, 'logichook');
1231
1231
  if (logicHook.global) {
@@ -1236,7 +1236,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
1236
1236
  _fetchUserInputs() {
1237
1237
  this.caps[Capabilities.USER_INPUTS].forEach(userInput => {
1238
1238
  if (this.userInputs[userInput.ref]) {
1239
- debug$l(`${userInput.ref} userinput already exists, overwriting.`);
1239
+ debug$m(`${userInput.ref} userinput already exists, overwriting.`);
1240
1240
  }
1241
1241
  this.userInputs[userInput.ref] = this._loadClass(userInput, 'userinput');
1242
1242
  });
@@ -1441,7 +1441,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
1441
1441
  loadErr.push(`Failed to fetch ${ref} ${hookType} from ${src} - ${err.message} `);
1442
1442
  }
1443
1443
  }
1444
- loadErr.forEach(debug$l);
1444
+ loadErr.forEach(debug$m);
1445
1445
  }
1446
1446
  throw new Error(`Failed to fetch ${ref} ${hookType}, no idea how to load ...`);
1447
1447
  }
@@ -1652,6 +1652,7 @@ var Enums = {
1652
1652
  };
1653
1653
  Enums.E_SCRIPTING_MEMORY_COLUMN_MODE;
1654
1654
 
1655
+ const debug$l = debug$n('botium-core-scripting-helper');
1655
1656
  const {
1656
1657
  E_SCRIPTING_MEMORY_COLUMN_MODE: E_SCRIPTING_MEMORY_COLUMN_MODE$1
1657
1658
  } = Enums;
@@ -2202,7 +2203,7 @@ const calculateWer$1 = (str, pattern) => {
2202
2203
  continue;
2203
2204
  }
2204
2205
  const wordCount = wildcardPart.split(' ').length;
2205
- const subsetPhrases = _getSubsets(botMessageWords, wordCount).map(subset => subset.join(' ')); // botMessageWordsSubsets.filter(subset => subset.length === wordCount).map(subset => subset.reverse().join(' '))
2206
+ const subsetPhrases = _getSubsets(botMessageWords, Math.min(wordCount, botMessageWords.length)).map(subset => subset.join(' '));
2206
2207
  let subsetPhraseFound = null;
2207
2208
  for (const subsetPhrase of subsetPhrases) {
2208
2209
  const localWer = wordErrorRate.wordErrorRate(subsetPhrase, wildcardPart).toFixed(2);
@@ -2211,7 +2212,9 @@ const calculateWer$1 = (str, pattern) => {
2211
2212
  wer = localWer;
2212
2213
  }
2213
2214
  }
2214
- console.log('lala', subsetPhraseFound);
2215
+ if (lodash.isNil(subsetPhraseFound)) {
2216
+ throw new Error('Word Error Asserter: Something went wrong here, please try to modify your assertion!');
2217
+ }
2215
2218
  errors.push(_getErrors(_getWords(wildcardPart), _getWords(subsetPhraseFound)));
2216
2219
  }
2217
2220
  let errCount = 0;
@@ -2220,6 +2223,7 @@ const calculateWer$1 = (str, pattern) => {
2220
2223
  errCount += err.filter(err => err === true).length;
2221
2224
  allCount += err.length;
2222
2225
  }
2226
+ debug$l(`Word Error Rate Asserter - Compared Bot Message '${botMessage}' / '${utt}': ${(errCount / allCount).toFixed(2)}`);
2223
2227
  return (errCount / allCount).toFixed(2);
2224
2228
  };
2225
2229
  var helper = {
@@ -2239,7 +2243,7 @@ var helper = {
2239
2243
  calculateWer: calculateWer$1
2240
2244
  };
2241
2245
 
2242
- const debug$k = debug$m('botium-core-ScriptingMemory');
2246
+ const debug$k = debug$n('botium-core-ScriptingMemory');
2243
2247
  const {
2244
2248
  v1: uuidv1
2245
2249
  } = uuid;
@@ -2576,7 +2580,7 @@ ScriptingMemory.extractVarNames;
2576
2580
  ScriptingMemory.RESERVED_WORDS;
2577
2581
  ScriptingMemory.SCRIPTING_FUNCTIONS;
2578
2582
 
2579
- const debug$j = debug$m('botium-core-RetryHelper');
2583
+ const debug$j = debug$n('botium-core-RetryHelper');
2580
2584
  var RetryHelper_1 = class RetryHelper {
2581
2585
  constructor(caps, section, options = {}) {
2582
2586
  this.retryErrorPatterns = [];
@@ -2614,7 +2618,7 @@ var RetryHelper_1 = class RetryHelper {
2614
2618
  }
2615
2619
  };
2616
2620
 
2617
- const debug$i = debug$m('botium-core-Convo');
2621
+ const debug$i = debug$n('botium-core-Convo');
2618
2622
  const {
2619
2623
  BotiumError: BotiumError$4,
2620
2624
  botiumErrorFromErr: botiumErrorFromErr$1,
@@ -3718,7 +3722,7 @@ var JsonToJson = {
3718
3722
  const {
3719
3723
  NodeVM
3720
3724
  } = vm2;
3721
- const debug$h = debug$m('botium-core-HookUtils');
3725
+ const debug$h = debug$n('botium-core-HookUtils');
3722
3726
  const {
3723
3727
  BotiumError: BotiumError$3
3724
3728
  } = BotiumError_1;
@@ -3844,7 +3848,7 @@ var Script = {
3844
3848
  precompile: precompile$1
3845
3849
  };
3846
3850
 
3847
- const debug$g = debug$m('botium-core-PrecompilerMarkdownRasa');
3851
+ const debug$g = debug$n('botium-core-PrecompilerMarkdownRasa');
3848
3852
  const htmlCommentRegexp = /(<!--.*?-->)/g;
3849
3853
  var precompile = (caps, scriptBuffer, options, filename) => {
3850
3854
  if (!filename.endsWith('.md')) {
@@ -3945,7 +3949,7 @@ var MarkdownRasa = {
3945
3949
  precompile: precompile
3946
3950
  };
3947
3951
 
3948
- const debug$f = debug$m('botium-core-CapabilitiesUtils');
3952
+ const debug$f = debug$n('botium-core-CapabilitiesUtils');
3949
3953
  const {
3950
3954
  toJsonWeak
3951
3955
  } = Utils;
@@ -4036,7 +4040,7 @@ var CapabilitiesUtils = {
4036
4040
  flatCababilities: flatCababilities$1
4037
4041
  };
4038
4042
 
4039
- const debug$e = debug$m('botium-core-Precompilers');
4043
+ const debug$e = debug$n('botium-core-Precompilers');
4040
4044
  const {
4041
4045
  isJsonObject
4042
4046
  } = Utils;
@@ -4163,7 +4167,7 @@ var Utterance_1 = class Utterance {
4163
4167
  }
4164
4168
  };
4165
4169
 
4166
- const debug$d = debug$m('botium-core-CompilerXlsx');
4170
+ const debug$d = debug$n('botium-core-CompilerXlsx');
4167
4171
  const {
4168
4172
  E_SCRIPTING_MEMORY_COLUMN_MODE
4169
4173
  } = Enums;
@@ -4826,7 +4830,7 @@ var CompilerTxt_1 = class CompilerTxt extends CompilerBase_1 {
4826
4830
  const {
4827
4831
  parse
4828
4832
  } = sync;
4829
- const debug$c = debug$m('botium-core-CompilerCsv');
4833
+ const debug$c = debug$n('botium-core-CompilerCsv');
4830
4834
  const {
4831
4835
  Convo: Convo$3
4832
4836
  } = Convo_1;
@@ -5037,7 +5041,7 @@ var CompilerCsv_1 = class CompilerCsv extends CompilerBase_1 {
5037
5041
  }
5038
5042
  };
5039
5043
 
5040
- const debug$b = debug$m('botium-core-CompilerObject');
5044
+ const debug$b = debug$n('botium-core-CompilerObject');
5041
5045
  const {
5042
5046
  Convo: Convo$2
5043
5047
  } = Convo_1;
@@ -5183,7 +5187,7 @@ var CompilerJson_1 = class CompilerJson extends CompilerObjectBase_1 {
5183
5187
  }
5184
5188
  };
5185
5189
 
5186
- const debug$a = debug$m('botium-core-CompilerMarkdown');
5190
+ const debug$a = debug$n('botium-core-CompilerMarkdown');
5187
5191
  const md = new markdownIt();
5188
5192
  const {
5189
5193
  Convo: Convo$1
@@ -5294,7 +5298,7 @@ var CompilerMarkdown_1 = class CompilerMarkdown extends CompilerBase_1 {
5294
5298
  };
5295
5299
 
5296
5300
  promise.shim();
5297
- const debug$9 = debug$m('botium-core-ScriptingProvider');
5301
+ const debug$9 = debug$n('botium-core-ScriptingProvider');
5298
5302
  const {
5299
5303
  Convo,
5300
5304
  ConvoStep
@@ -5685,6 +5689,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
5685
5689
  convo,
5686
5690
  convoStep,
5687
5691
  scriptingMemory,
5692
+ container,
5688
5693
  args: [],
5689
5694
  isGlobal: true,
5690
5695
  ...rest
@@ -5727,6 +5732,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
5727
5732
  convo,
5728
5733
  convoStep,
5729
5734
  scriptingMemory,
5735
+ container,
5730
5736
  args: [],
5731
5737
  isGlobal: true,
5732
5738
  ...rest
@@ -6892,7 +6898,7 @@ var NoRepo_1 = class NoRepo extends BaseRepo_1 {
6892
6898
  };
6893
6899
 
6894
6900
  var ProcessUtils = createCommonjsModule(function (module) {
6895
- const debug = debug$m('botium-core-ProcessUtils');
6901
+ const debug = debug$n('botium-core-ProcessUtils');
6896
6902
  module.exports = {
6897
6903
  childCommandLineRun: (cmd, ignoreErrors = false, processOptions = {}) => {
6898
6904
  const cmdOptions = cmd.split(' ');
@@ -6943,7 +6949,7 @@ var ProcessUtils = createCommonjsModule(function (module) {
6943
6949
  ProcessUtils.childCommandLineRun;
6944
6950
  ProcessUtils.childProcessRun;
6945
6951
 
6946
- const debug$8 = debug$m('botium-core-GitRepo');
6952
+ const debug$8 = debug$n('botium-core-GitRepo');
6947
6953
  var GitRepo_1 = class GitRepo extends BaseRepo_1 {
6948
6954
  Validate() {
6949
6955
  return super.Validate().then(() => {
@@ -7092,7 +7098,7 @@ var Queue_1 = class Queue {
7092
7098
  }
7093
7099
  };
7094
7100
 
7095
- const debug$7 = debug$m('botium-connector-BaseContainer');
7101
+ const debug$7 = debug$n('botium-connector-BaseContainer');
7096
7102
  const {
7097
7103
  executeHook: executeHook$1,
7098
7104
  getHook: getHook$1
@@ -7291,7 +7297,7 @@ var BaseContainer_1 = class BaseContainer {
7291
7297
  }
7292
7298
  };
7293
7299
 
7294
- const debug$6 = debug$m('botium-connector-GridContainer');
7300
+ const debug$6 = debug$n('botium-connector-GridContainer');
7295
7301
  var GridContainer_1 = class GridContainer extends BaseContainer_1 {
7296
7302
  Validate() {
7297
7303
  return super.Validate().then(() => {
@@ -7491,7 +7497,7 @@ var InProcessContainer_1 = class InProcessContainer extends BaseContainer_1 {
7491
7497
  }
7492
7498
  };
7493
7499
 
7494
- const debug$5 = debug$m('botium-core-inbound-proxy');
7500
+ const debug$5 = debug$n('botium-core-inbound-proxy');
7495
7501
  const buildRedisHandler = (redisurl, topic) => {
7496
7502
  const redis = new ioredis(redisurl);
7497
7503
  redis.on('connect', () => {
@@ -7569,7 +7575,7 @@ proxy.startProxy;
7569
7575
  const {
7570
7576
  v4: uuidv4
7571
7577
  } = uuid;
7572
- const debug$4 = debug$m('botium-connector-simplerest');
7578
+ const debug$4 = debug$n('botium-connector-simplerest');
7573
7579
  const {
7574
7580
  startProxy
7575
7581
  } = proxy;
@@ -8442,7 +8448,7 @@ var SimpleRestContainer_1 = class SimpleRestContainer {
8442
8448
  }
8443
8449
  };
8444
8450
 
8445
- const debug$3 = debug$m('botium-connector-PluginConnectorContainer-helper');
8451
+ const debug$3 = debug$n('botium-connector-PluginConnectorContainer-helper');
8446
8452
  const {
8447
8453
  BotiumError
8448
8454
  } = BotiumError_1;
@@ -8584,7 +8590,7 @@ var plugins = {
8584
8590
  tryLoadPlugin: tryLoadPlugin$1
8585
8591
  };
8586
8592
 
8587
- const debug$2 = debug$m('botium-connector-PluginConnectorContainer');
8593
+ const debug$2 = debug$n('botium-connector-PluginConnectorContainer');
8588
8594
  const {
8589
8595
  tryLoadPlugin
8590
8596
  } = plugins;
@@ -8729,7 +8735,7 @@ var require$$2 = getCjsExportFromNamespace(_package$1);
8729
8735
  const {
8730
8736
  boolean
8731
8737
  } = boolean$1;
8732
- const debug$1 = debug$m('botium-core-BotDriver');
8738
+ const debug$1 = debug$n('botium-core-BotDriver');
8733
8739
  const {
8734
8740
  version
8735
8741
  } = require$$2;
@@ -9034,7 +9040,7 @@ var BotDriver_1 = class BotDriver {
9034
9040
  }
9035
9041
  };
9036
9042
 
9037
- const debug = debug$m('botium-core-Plugins');
9043
+ const debug = debug$n('botium-core-Plugins');
9038
9044
  const PLUGIN_TYPE_CONNECTOR = 'PLUGIN_TYPE_CONNECTOR';
9039
9045
  const PLUGIN_TYPE_ASSERTER = 'PLUGIN_TYPE_ASSERTER';
9040
9046
  const PLUGIN_TYPE_LOGICHOOK = 'PLUGIN_TYPE_LOGICHOOK';