botium-core 1.11.16 → 1.12.3

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.
Files changed (42) hide show
  1. package/dist/botium-cjs.js +493 -202
  2. package/dist/botium-cjs.js.map +1 -1
  3. package/dist/botium-es.js +484 -194
  4. package/dist/botium-es.js.map +1 -1
  5. package/index.js +1 -0
  6. package/package.json +29 -29
  7. package/samples/connectors/custom/botium-connector-myapi.js +3 -3
  8. package/samples/extensions/asserterHooks/DummyAsserter.js +3 -3
  9. package/src/BotDriver.js +3 -3
  10. package/src/Capabilities.js +9 -0
  11. package/src/Defaults.js +1 -1
  12. package/src/Enums.js +6 -0
  13. package/src/containers/BaseContainer.js +20 -10
  14. package/src/containers/PluginConnectorContainer.js +1 -0
  15. package/src/containers/plugins/SimpleRestContainer.js +98 -30
  16. package/src/scripting/BotiumError.js +21 -0
  17. package/src/scripting/CompilerCsv.js +1 -1
  18. package/src/scripting/CompilerObjectBase.js +4 -14
  19. package/src/scripting/CompilerTxt.js +4 -15
  20. package/src/scripting/CompilerXlsx.js +81 -25
  21. package/src/scripting/Convo.js +16 -4
  22. package/src/scripting/ScriptingProvider.js +6 -0
  23. package/src/scripting/helper.js +54 -1
  24. package/src/scripting/logichook/LogicHookUtils.js +2 -0
  25. package/src/scripting/logichook/asserter/JsonPathAsserter.js +1 -1
  26. package/src/scripting/logichook/logichooks/ClearQueueLogicHook.js +1 -1
  27. package/src/scripting/logichook/userinput/MediaInput.js +14 -2
  28. package/test/connectors/convos/hello.convo.txt +6 -0
  29. package/test/connectors/simplerest.spec.js +106 -2
  30. package/test/convo/convos/continuefailing.convo.txt +19 -0
  31. package/test/convo/transcript.spec.js +34 -0
  32. package/test/scripting/scriptingProvider.spec.js +4 -4
  33. package/test/scripting/scriptingmemory/convosMultiMemorySameCols/buy.convo.txt +6 -0
  34. package/test/scripting/scriptingmemory/convosMultiMemorySameCols/products1.scriptingmemory.txt +2 -0
  35. package/test/scripting/scriptingmemory/convosMultiMemorySameCols/products2.scriptingmemory.txt +2 -0
  36. package/test/scripting/scriptingmemory/convosSimpleCols/buy.convo.txt +8 -0
  37. package/test/scripting/scriptingmemory/convosSimpleCols/product.scriptingmemory.txt +3 -0
  38. package/test/scripting/scriptingmemory/convosTwoTablesCols/buy.convo.txt +6 -0
  39. package/test/scripting/scriptingmemory/convosTwoTablesCols/customer.xlsx +0 -0
  40. package/test/scripting/scriptingmemory/convosTwoTablesCols/product.xlsx +0 -0
  41. package/test/scripting/scriptingmemory/fillScriptingMemoryFromFile.spec.js +45 -0
  42. package/test/scripting/userinputs/mediaInputConvos.spec.js +53 -2
@@ -27,7 +27,7 @@ var isJson$1 = require('is-json');
27
27
  var esprima = require('esprima');
28
28
  var markdownIt = require('markdown-it');
29
29
  var xlsx = require('xlsx');
30
- var sync = require('csv-parse/lib/sync');
30
+ var sync = require('csv-parse/sync');
31
31
  var yaml = require('yaml');
32
32
  var child_process = require('child_process');
33
33
  var socket = require('socket.io-client');
@@ -79,12 +79,12 @@ var express__default = /*#__PURE__*/_interopDefaultLegacy(express);
79
79
  var bodyParser__default = /*#__PURE__*/_interopDefaultLegacy(bodyParser);
80
80
 
81
81
  var name = "botium-core";
82
- var version$1 = "1.11.16";
82
+ var version$1 = "1.12.3";
83
83
  var description = "The Selenium for Chatbots";
84
84
  var main = "index.js";
85
85
  var module$1 = "dist/botium-es.js";
86
86
  var engines = {
87
- node: ">=10.0.0"
87
+ node: ">=14.0.0"
88
88
  };
89
89
  var scripts = {
90
90
  postinstall: "node ./report.js",
@@ -111,23 +111,23 @@ var bugs = {
111
111
  };
112
112
  var homepage = "https://www.botium.ai";
113
113
  var dependencies = {
114
- "@babel/runtime": "^7.16.0",
115
- async: "^3.2.2",
116
- "body-parser": "^1.19.0",
114
+ "@babel/runtime": "^7.17.2",
115
+ async: "^3.2.3",
116
+ "body-parser": "^1.19.1",
117
117
  boolean: "^3.1.4",
118
118
  bottleneck: "^2.19.5",
119
- "csv-parse": "^4.16.3",
120
- debug: "^4.3.2",
119
+ "csv-parse": "^5.0.4",
120
+ debug: "^4.3.3",
121
121
  esprima: "^4.0.1",
122
- express: "^4.17.1",
122
+ express: "^4.17.2",
123
123
  globby: "11.0.4",
124
- ioredis: "^4.28.0",
124
+ ioredis: "^4.28.5",
125
125
  "is-class": "^0.0.9",
126
126
  "is-json": "^2.0.1",
127
127
  jsonpath: "^1.1.1",
128
128
  lodash: "^4.17.21",
129
- "markdown-it": "^12.2.0",
130
- "mime-types": "^2.1.33",
129
+ "markdown-it": "^12.3.2",
130
+ "mime-types": "^2.1.34",
131
131
  mkdirp: "^1.0.4",
132
132
  moment: "^2.29.1",
133
133
  mustache: "^4.2.0",
@@ -137,40 +137,40 @@ var dependencies = {
137
137
  request: "^2.88.2",
138
138
  rimraf: "^3.0.2",
139
139
  "sanitize-filename": "^1.6.3",
140
- slugify: "^1.6.1",
141
- "socket.io": "^4.3.1",
142
- "socket.io-client": "^4.3.2",
140
+ slugify: "^1.6.5",
141
+ "socket.io": "^4.4.1",
142
+ "socket.io-client": "^4.4.1",
143
143
  "socketio-auth": "^0.1.1",
144
144
  "swagger-jsdoc": "^6.1.0",
145
- "swagger-ui-express": "^4.1.6",
145
+ "swagger-ui-express": "^4.3.0",
146
146
  uuid: "^8.3.2",
147
- vm2: "^3.9.5",
147
+ vm2: "^3.9.7",
148
148
  "write-yaml": "^1.0.0",
149
- xlsx: "^0.17.3",
149
+ xlsx: "^0.18.2",
150
150
  xregexp: "^5.1.0",
151
151
  yaml: "^1.10.2"
152
152
  };
153
153
  var devDependencies = {
154
- "@babel/core": "^7.16.0",
155
- "@babel/node": "^7.16.0",
156
- "@babel/plugin-transform-runtime": "^7.16.0",
157
- "@babel/preset-env": "^7.16.0",
158
- chai: "^4.3.4",
154
+ "@babel/core": "^7.17.2",
155
+ "@babel/node": "^7.16.8",
156
+ "@babel/plugin-transform-runtime": "^7.17.0",
157
+ "@babel/preset-env": "^7.16.11",
158
+ chai: "^4.3.6",
159
159
  "chai-as-promised": "^7.1.1",
160
160
  "cross-env": "^7.0.3",
161
- eslint: "^8.1.0",
161
+ eslint: "^8.9.0",
162
162
  "eslint-config-standard": "^16.0.3",
163
- "eslint-plugin-import": "^2.25.2",
163
+ "eslint-plugin-import": "^2.25.4",
164
164
  "eslint-plugin-node": "^11.1.0",
165
- "eslint-plugin-promise": "^5.1.1",
165
+ "eslint-plugin-promise": "^6.0.0",
166
166
  "eslint-plugin-standard": "^4.1.0",
167
167
  "license-checker": "^25.0.1",
168
168
  "license-compatibility-checker": "^0.3.5",
169
- mocha: "^9.1.3",
170
- nock: "^13.1.4",
171
- "npm-check-updates": "^12.0.0",
169
+ mocha: "^9.2.0",
170
+ nock: "^13.2.4",
171
+ "npm-check-updates": "^12.3.0",
172
172
  nyc: "^15.1.0",
173
- rollup: "^2.59.0",
173
+ rollup: "^2.67.2",
174
174
  "rollup-plugin-babel": "^4.4.0",
175
175
  "rollup-plugin-commonjs": "^10.1.0",
176
176
  "rollup-plugin-json": "^4.0.0",
@@ -287,6 +287,11 @@ var Capabilities = {
287
287
  SIMPLEREST_RESPONSE_HOOK: 'SIMPLEREST_RESPONSE_HOOK',
288
288
  SIMPLEREST_MEDIA_JSONPATH: 'SIMPLEREST_MEDIA_JSONPATH',
289
289
  SIMPLEREST_BUTTONS_JSONPATH: 'SIMPLEREST_BUTTONS_JSONPATH',
290
+ SIMPLEREST_CARDS_JSONPATH: 'SIMPLEREST_CARDS_JSONPATH',
291
+ SIMPLEREST_CARD_TEXT_JSONPATH: 'SIMPLEREST_CARD_TEXT_JSONPATH',
292
+ SIMPLEREST_CARD_SUBTEXT_JSONPATH: 'SIMPLEREST_CARD_SUBTEXT_JSONPATH',
293
+ SIMPLEREST_CARD_BUTTONS_JSONPATH: 'SIMPLEREST_CARD_BUTTONS_JSONPATH',
294
+ SIMPLEREST_CARD_ATTACHMENTS_JSONPATH: 'SIMPLEREST_CARD_ATTACHMENTS_JSONPATH',
290
295
  SIMPLEREST_CONTEXT_JSONPATH: 'SIMPLEREST_CONTEXT_JSONPATH',
291
296
  SIMPLEREST_CONTEXT_MERGE_OR_REPLACE: 'SIMPLEREST_CONTEXT_MERGE_OR_REPLACE',
292
297
  SIMPLEREST_CONVERSATION_ID_TEMPLATE: 'SIMPLEREST_CONVERSATION_ID_TEMPLATE',
@@ -325,6 +330,7 @@ var Capabilities = {
325
330
  SCRIPTING_NORMALIZE_TEXT: 'SCRIPTING_NORMALIZE_TEXT',
326
331
  SCRIPTING_ENABLE_MEMORY: 'SCRIPTING_ENABLE_MEMORY',
327
332
  SCRIPTING_ENABLE_MULTIPLE_ASSERT_ERRORS: 'SCRIPTING_ENABLE_MULTIPLE_ASSERT_ERRORS',
333
+ SCRIPTING_ENABLE_SKIP_ASSERT_ERRORS: 'SCRIPTING_ENABLE_SKIP_ASSERT_ERRORS',
328
334
  SCRIPTING_FORCE_BOT_CONSUMED: 'SCRIPTING_FORCE_BOT_CONSUMED',
329
335
  // regexp, regexpIgnoreCase, wildcard, wildcardIgnoreCase, wildcardExact, wildcardExactIgnoreCase, include, includeIgnoreCase, equals, equalsIgnoreCase
330
336
  SCRIPTING_MATCHING_MODE: 'SCRIPTING_MATCHING_MODE',
@@ -340,6 +346,8 @@ var Capabilities = {
340
346
  SCRIPTING_MEMORYEXPANSION_KEEP_ORIG: 'SCRIPTING_MEMORYEXPANSION_KEEP_ORIG',
341
347
  // word, non_whitespace, joker
342
348
  SCRIPTING_MEMORY_MATCHING_MODE: 'SCRIPTING_MEMORY_MATCHING_MODE',
349
+ // varnames, testcasenames
350
+ SCRIPTING_MEMORY_COLUMN_MODE: 'SCRIPTING_MEMORY_COLUMN_MODE',
343
351
  // Botium Lifecycle Hooks
344
352
  CUSTOMHOOK_ONBUILD: 'CUSTOMHOOK_ONBUILD',
345
353
  CUSTOMHOOK_ONSTART: 'CUSTOMHOOK_ONSTART',
@@ -354,6 +362,7 @@ var Capabilities = {
354
362
  // API Calls Rate Limiting
355
363
  RATELIMIT_USERSAYS_MAXCONCURRENT: 'RATELIMIT_USERSAYS_MAXCONCURRENT',
356
364
  RATELIMIT_USERSAYS_MINTIME: 'RATELIMIT_USERSAYS_MINTIME',
365
+ RATELIMIT_BOTTLENECK_FN: 'RATELIMIT_BOTTLENECK_FN',
357
366
  SECURITY_ALLOW_UNSAFE: 'SECURITY_ALLOW_UNSAFE',
358
367
  PRECOMPILERS: 'PRECOMPILERS'
359
368
  };
@@ -429,6 +438,11 @@ Capabilities.SIMPLEREST_RESPONSE_JSONPATH;
429
438
  Capabilities.SIMPLEREST_RESPONSE_HOOK;
430
439
  Capabilities.SIMPLEREST_MEDIA_JSONPATH;
431
440
  Capabilities.SIMPLEREST_BUTTONS_JSONPATH;
441
+ Capabilities.SIMPLEREST_CARDS_JSONPATH;
442
+ Capabilities.SIMPLEREST_CARD_TEXT_JSONPATH;
443
+ Capabilities.SIMPLEREST_CARD_SUBTEXT_JSONPATH;
444
+ Capabilities.SIMPLEREST_CARD_BUTTONS_JSONPATH;
445
+ Capabilities.SIMPLEREST_CARD_ATTACHMENTS_JSONPATH;
432
446
  Capabilities.SIMPLEREST_CONTEXT_JSONPATH;
433
447
  Capabilities.SIMPLEREST_CONTEXT_MERGE_OR_REPLACE;
434
448
  Capabilities.SIMPLEREST_CONVERSATION_ID_TEMPLATE;
@@ -465,6 +479,7 @@ Capabilities.SCRIPTING_CSV_QA_COLUMN_ANSWER;
465
479
  Capabilities.SCRIPTING_NORMALIZE_TEXT;
466
480
  Capabilities.SCRIPTING_ENABLE_MEMORY;
467
481
  Capabilities.SCRIPTING_ENABLE_MULTIPLE_ASSERT_ERRORS;
482
+ Capabilities.SCRIPTING_ENABLE_SKIP_ASSERT_ERRORS;
468
483
  Capabilities.SCRIPTING_FORCE_BOT_CONSUMED;
469
484
  Capabilities.SCRIPTING_MATCHING_MODE;
470
485
  Capabilities.SCRIPTING_UTTEXPANSION_MODE;
@@ -475,6 +490,7 @@ Capabilities.SCRIPTING_UTTEXPANSION_NAMING_MODE;
475
490
  Capabilities.SCRIPTING_UTTEXPANSION_NAMING_UTTERANCE_MAX;
476
491
  Capabilities.SCRIPTING_MEMORYEXPANSION_KEEP_ORIG;
477
492
  Capabilities.SCRIPTING_MEMORY_MATCHING_MODE;
493
+ Capabilities.SCRIPTING_MEMORY_COLUMN_MODE;
478
494
  Capabilities.CUSTOMHOOK_ONBUILD;
479
495
  Capabilities.CUSTOMHOOK_ONSTART;
480
496
  Capabilities.CUSTOMHOOK_ONUSERSAYS;
@@ -486,6 +502,7 @@ Capabilities.LOGIC_HOOKS;
486
502
  Capabilities.USER_INPUTS;
487
503
  Capabilities.RATELIMIT_USERSAYS_MAXCONCURRENT;
488
504
  Capabilities.RATELIMIT_USERSAYS_MINTIME;
505
+ Capabilities.RATELIMIT_BOTTLENECK_FN;
489
506
  Capabilities.SECURITY_ALLOW_UNSAFE;
490
507
  Capabilities.PRECOMPILERS;
491
508
 
@@ -534,7 +551,6 @@ var Defaults$1 = {
534
551
  [Capabilities.SIMPLEREST_METHOD]: 'GET',
535
552
  [Capabilities.SIMPLEREST_IGNORE_EMPTY]: true,
536
553
  [Capabilities.SIMPLEREST_TIMEOUT]: 10000,
537
- [Capabilities.SIMPLEREST_EXTRA_OPTIONS]: {},
538
554
  [Capabilities.SIMPLEREST_STRICT_SSL]: true,
539
555
  [Capabilities.SIMPLEREST_INBOUND_UPDATE_CONTEXT]: true,
540
556
  [Capabilities.SIMPLEREST_CONTEXT_MERGE_OR_REPLACE]: 'MERGE',
@@ -553,6 +569,7 @@ var Defaults$1 = {
553
569
  [Capabilities.SCRIPTING_UTTEXPANSION_NAMING_MODE]: 'justLineTag',
554
570
  [Capabilities.SCRIPTING_UTTEXPANSION_NAMING_UTTERANCE_MAX]: '16',
555
571
  [Capabilities.SCRIPTING_MEMORYEXPANSION_KEEP_ORIG]: false,
572
+ [Capabilities.SCRIPTING_ENABLE_SKIP_ASSERT_ERRORS]: false,
556
573
  [Capabilities.SCRIPTING_FORCE_BOT_CONSUMED]: false,
557
574
  [Capabilities.ASSERTERS]: [],
558
575
  [Capabilities.LOGIC_HOOKS]: [],
@@ -874,7 +891,7 @@ function getCjsExportFromNamespace (n) {
874
891
  return n && n['default'] || n;
875
892
  }
876
893
 
877
- const BotiumError$6 = class BotiumError extends Error {
894
+ const BotiumError$7 = class BotiumError extends Error {
878
895
  /**
879
896
  *
880
897
  * @param message
@@ -899,6 +916,27 @@ const BotiumError$6 = class BotiumError extends Error {
899
916
  this.context.message = message.message || message;
900
917
  }
901
918
 
919
+ isAsserterError() {
920
+ if (this.context) {
921
+ const errArr = lodash__default["default"].isArray(this.context) ? this.context : [this.context];
922
+ const hasNotAsserterError = errArr.findIndex(errDetail => {
923
+ if (errDetail.type === 'list') {
924
+ if (errDetail.errors) {
925
+ return errDetail.errors.findIndex(e => e.type !== 'asserter') >= 0;
926
+ } else {
927
+ return true;
928
+ }
929
+ } else {
930
+ return errDetail.type !== 'asserter';
931
+ }
932
+ }) >= 0;
933
+ if (hasNotAsserterError) return false;
934
+ return true;
935
+ } else {
936
+ return false;
937
+ }
938
+ }
939
+
902
940
  prettify(includeJson) {
903
941
  const lines = [];
904
942
 
@@ -960,10 +998,10 @@ const _getChildErrorsFromContext = context => {
960
998
  };
961
999
 
962
1000
  const botiumErrorFromErr$2 = (message, err) => {
963
- if (err instanceof BotiumError$6) {
964
- return new BotiumError$6(message, err.context, true);
1001
+ if (err instanceof BotiumError$7) {
1002
+ return new BotiumError$7(message, err.context, true);
965
1003
  } else {
966
- return new BotiumError$6(message, {
1004
+ return new BotiumError$7(message, {
967
1005
  err
968
1006
  }, true);
969
1007
  }
@@ -978,7 +1016,7 @@ const botiumErrorFromList$2 = (errors, {
978
1016
  let children = [];
979
1017
 
980
1018
  for (const error of errors) {
981
- if (error instanceof BotiumError$6) {
1019
+ if (error instanceof BotiumError$7) {
982
1020
  const childErrors = flat && _getChildErrorsFromContext(error.context);
983
1021
 
984
1022
  if (childErrors && childErrors.length) {
@@ -991,7 +1029,7 @@ const botiumErrorFromList$2 = (errors, {
991
1029
  }
992
1030
  }
993
1031
 
994
- const result = new BotiumError$6(message, {
1032
+ const result = new BotiumError$7(message, {
995
1033
  errors: children,
996
1034
  type,
997
1035
  source
@@ -1000,7 +1038,7 @@ const botiumErrorFromList$2 = (errors, {
1000
1038
  };
1001
1039
 
1002
1040
  var BotiumError_1 = {
1003
- BotiumError: BotiumError$6,
1041
+ BotiumError: BotiumError$7,
1004
1042
  botiumErrorFromErr: botiumErrorFromErr$2,
1005
1043
  botiumErrorFromList: botiumErrorFromList$2
1006
1044
  };
@@ -1181,7 +1219,7 @@ const {
1181
1219
  } = vm2__default["default"];
1182
1220
  const debug$k = debug__default["default"]('botium-core-asserterUtils');
1183
1221
  const {
1184
- BotiumError: BotiumError$5
1222
+ BotiumError: BotiumError$6
1185
1223
  } = BotiumError_1;
1186
1224
  const {
1187
1225
  DEFAULT_ASSERTERS,
@@ -1332,7 +1370,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
1332
1370
 
1333
1371
  const _checkUnsafe = () => {
1334
1372
  if (!this.caps[Capabilities.SECURITY_ALLOW_UNSAFE]) {
1335
- throw new BotiumError$5('Security Error. Using unsafe component is not allowed', {
1373
+ throw new BotiumError$6('Security Error. Using unsafe component is not allowed', {
1336
1374
  type: 'security',
1337
1375
  subtype: 'allow unsafe',
1338
1376
  source: path__default["default"].basename(__filename),
@@ -1476,6 +1514,11 @@ var LogicHookUtils_1 = class LogicHookUtils {
1476
1514
  ref,
1477
1515
  ...this.buildScriptContext
1478
1516
  }, this.caps, args);
1517
+ } else if (lodash__default["default"].isFunction(CheckClass.PluginClass)) {
1518
+ return CheckClass.PluginClass({
1519
+ ref,
1520
+ ...this.buildScriptContext
1521
+ }, this.caps, args);
1479
1522
  } else {
1480
1523
  throw new Error(`${src} class or function expected`);
1481
1524
  }
@@ -1731,6 +1774,18 @@ var BotiumMockMessage_1 = class BotiumMockMessage {
1731
1774
 
1732
1775
  };
1733
1776
 
1777
+ var Enums = {
1778
+ E_SCRIPTING_MEMORY_COLUMN_MODE: {
1779
+ VARNAMES: 'varnames',
1780
+ TESTCASENAMES: 'testcasenames'
1781
+ }
1782
+ };
1783
+ Enums.E_SCRIPTING_MEMORY_COLUMN_MODE;
1784
+
1785
+ const {
1786
+ E_SCRIPTING_MEMORY_COLUMN_MODE: E_SCRIPTING_MEMORY_COLUMN_MODE$1
1787
+ } = Enums;
1788
+
1734
1789
  const normalizeText$1 = (str, doCleanup) => {
1735
1790
  if (str && lodash__default["default"].isArray(str)) {
1736
1791
  str = str.join(' ');
@@ -2259,6 +2314,71 @@ const convoStepToLines$2 = step => {
2259
2314
  return lines.map(l => l.trim());
2260
2315
  };
2261
2316
 
2317
+ const linesToScriptingMemories$2 = (lines, columnMode = null) => {
2318
+ const guessScriptingMemoryColumnMode = lines => {
2319
+ if (lines && lines.length > 1) {
2320
+ if (lines[1].trim().startsWith('$')) return E_SCRIPTING_MEMORY_COLUMN_MODE$1.TESTCASENAMES;
2321
+ }
2322
+
2323
+ return E_SCRIPTING_MEMORY_COLUMN_MODE$1.VARNAMES;
2324
+ };
2325
+
2326
+ columnMode = columnMode || guessScriptingMemoryColumnMode(lines);
2327
+ const scriptingMemories = [];
2328
+
2329
+ if (columnMode === E_SCRIPTING_MEMORY_COLUMN_MODE$1.TESTCASENAMES) {
2330
+ const caseNames = lines[0].split('|').map(name => name.trim()).slice(1);
2331
+ const varNames = [];
2332
+ const varValues = [];
2333
+
2334
+ for (let row = 1; row < lines.length; row++) {
2335
+ if (!lines[row] || lines[row].length === 0) continue;
2336
+ const rawRow = lines[row].split('|').map(name => name.trim());
2337
+ varNames.push(rawRow[0]);
2338
+ varValues.push(rawRow.slice(1));
2339
+ }
2340
+
2341
+ for (let caseIndex = 0; caseIndex < caseNames.length; caseIndex++) {
2342
+ const caseName = caseNames[caseIndex];
2343
+ const values = varNames.reduce((agg, varName, varIndex) => {
2344
+ agg[varName] = varValues[varIndex][caseIndex] || null;
2345
+ return agg;
2346
+ }, {});
2347
+ const scriptingMemory = {
2348
+ header: {
2349
+ name: caseName
2350
+ },
2351
+ values: values
2352
+ };
2353
+ scriptingMemories.push(scriptingMemory);
2354
+ }
2355
+ } else {
2356
+ const varNames = lines[0].split('|').map(name => name.trim()).slice(1);
2357
+
2358
+ for (let row = 1; row < lines.length; row++) {
2359
+ if (!lines[row] || lines[row].length === 0) continue;
2360
+ const rawRow = lines[row].split('|').map(name => name.trim());
2361
+ const caseName = rawRow[0];
2362
+ const values = rawRow.slice(1);
2363
+ const varValues = {};
2364
+
2365
+ for (let varIndex = 0; varIndex < varNames.length; varIndex++) {
2366
+ varValues[varNames[varIndex]] = values[varIndex];
2367
+ }
2368
+
2369
+ const scriptingMemory = {
2370
+ header: {
2371
+ name: caseName
2372
+ },
2373
+ values: varValues
2374
+ };
2375
+ scriptingMemories.push(scriptingMemory);
2376
+ }
2377
+ }
2378
+
2379
+ return scriptingMemories;
2380
+ };
2381
+
2262
2382
  var helper = {
2263
2383
  normalizeText: normalizeText$1,
2264
2384
  splitStringInNonEmptyLines: splitStringInNonEmptyLines$1,
@@ -2271,7 +2391,8 @@ var helper = {
2271
2391
  convoStepToObject: convoStepToObject$1,
2272
2392
  validSenders: validSenders$3,
2273
2393
  validateSender: validateSender$1,
2274
- validateConvo: validateConvo$2
2394
+ validateConvo: validateConvo$2,
2395
+ linesToScriptingMemories: linesToScriptingMemories$2
2275
2396
  };
2276
2397
 
2277
2398
  const debug$j = debug__default["default"]('botium-core-ScriptingMemory');
@@ -2286,7 +2407,7 @@ const {
2286
2407
  toString: toString$2
2287
2408
  } = helper;
2288
2409
  const {
2289
- BotiumError: BotiumError$4
2410
+ BotiumError: BotiumError$5
2290
2411
  } = BotiumError_1; // If they got parameter, then it will be a string always.
2291
2412
  // the receiver can decide what to do with it,
2292
2413
  // convert to int,
@@ -2455,7 +2576,7 @@ const SCRIPTING_FUNCTIONS$1 = lodash__default["default"].mapValues(SCRIPTING_FUN
2455
2576
  return {
2456
2577
  handler: (caps, ...rest) => {
2457
2578
  if (!caps[Capabilities.SECURITY_ALLOW_UNSAFE] && funcOrStruct.unsafe) {
2458
- throw new BotiumError$4(`Security Error. Using unsafe scripting memory function ${name} is not allowed`, {
2579
+ throw new BotiumError$5(`Security Error. Using unsafe scripting memory function ${name} is not allowed`, {
2459
2580
  type: 'security',
2460
2581
  subtype: 'allow unsafe',
2461
2582
  source: path__default["default"].basename(__filename),
@@ -2604,7 +2725,7 @@ ScriptingMemory.SCRIPTING_FUNCTIONS;
2604
2725
 
2605
2726
  const debug$i = debug__default["default"]('botium-core-Convo');
2606
2727
  const {
2607
- BotiumError: BotiumError$3,
2728
+ BotiumError: BotiumError$4,
2608
2729
  botiumErrorFromErr: botiumErrorFromErr$1,
2609
2730
  botiumErrorFromList: botiumErrorFromList$1
2610
2731
  } = BotiumError_1;
@@ -2644,7 +2765,9 @@ class ConvoStepAssert {
2644
2765
  }
2645
2766
 
2646
2767
  toString() {
2647
- return (this.optional ? '?' : '') + (this.not ? '!' : '') + this.name + '(' + (this.args ? this.args.join(',') : 'no args') + ')';
2768
+ return (this.optional ? '?' : '') + (this.not ? '!' : '') + this.name + '(' + (this.args ? this.args.map(a => lodash__default["default"].truncate(a, {
2769
+ length: 200
2770
+ })).join(',') : 'no args') + ')';
2648
2771
  }
2649
2772
 
2650
2773
  }
@@ -2656,7 +2779,9 @@ class ConvoStepLogicHook {
2656
2779
  }
2657
2780
 
2658
2781
  toString() {
2659
- return this.name + '(' + (this.args ? this.args.join(',') : 'no args') + ')';
2782
+ return this.name + '(' + (this.args ? this.args.map(a => lodash__default["default"].truncate(a, {
2783
+ length: 200
2784
+ })).join(',') : 'no args') + ')';
2660
2785
  }
2661
2786
 
2662
2787
  }
@@ -2668,7 +2793,9 @@ class ConvoStepUserInput {
2668
2793
  }
2669
2794
 
2670
2795
  toString() {
2671
- return this.name + '(' + (this.args ? this.args.join(',') : 'no args') + ')';
2796
+ return this.name + '(' + (this.args ? this.args.map(a => lodash__default["default"].truncate(a, {
2797
+ length: 200
2798
+ })).join(',') : 'no args') + ')';
2672
2799
  }
2673
2800
 
2674
2801
  }
@@ -3133,7 +3260,7 @@ class Convo$6 {
3133
3260
  }
3134
3261
 
3135
3262
  if (!botMsg || !botMsg.messageText && !botMsg.media && !botMsg.buttons && !botMsg.cards && !botMsg.sourceData && !botMsg.nlp) {
3136
- const failErr = new BotiumError$3(`${this.header.name}/${convoStep.stepTag}: bot says nothing`);
3263
+ const failErr = new BotiumError$4(`${this.header.name}/${convoStep.stepTag}: bot says nothing`);
3137
3264
  debug$i(failErr);
3138
3265
 
3139
3266
  try {
@@ -3236,7 +3363,7 @@ class Convo$6 {
3236
3363
  this.scriptingEvents.fail && this.scriptingEvents.fail(failErr, lastMeConvoStep);
3237
3364
  } catch (failErr) {}
3238
3365
 
3239
- if (container.caps[Capabilities.SCRIPTING_ENABLE_MULTIPLE_ASSERT_ERRORS] && err instanceof BotiumError$3) {
3366
+ if (container.caps[Capabilities.SCRIPTING_ENABLE_MULTIPLE_ASSERT_ERRORS] && err instanceof BotiumError$4) {
3240
3367
  assertErrors.push(err);
3241
3368
  } else {
3242
3369
  throw failErr;
@@ -3253,7 +3380,7 @@ class Convo$6 {
3253
3380
  }
3254
3381
  }
3255
3382
  } else {
3256
- const failErr = new BotiumError$3(`${this.header.name}/${convoStep.stepTag}: invalid sender - ${util__default["default"].inspect(convoStep.sender)}`);
3383
+ const failErr = new BotiumError$4(`${this.header.name}/${convoStep.stepTag}: invalid sender - ${util__default["default"].inspect(convoStep.sender)}`);
3257
3384
  debug$i(failErr);
3258
3385
 
3259
3386
  try {
@@ -3264,7 +3391,7 @@ class Convo$6 {
3264
3391
  }
3265
3392
  } catch (err) {
3266
3393
  if (lastMeConvoStep) {
3267
- if (err instanceof BotiumError$3 && err.context) {
3394
+ if (err instanceof BotiumError$4 && err.context) {
3268
3395
  err.context.input = new ConvoStep$1(lastMeConvoStep);
3269
3396
  err.context.transcript = [...transcriptSteps, { ...transcriptStep
3270
3397
  }];
@@ -3276,7 +3403,14 @@ class Convo$6 {
3276
3403
  }
3277
3404
 
3278
3405
  transcriptStep.err = err;
3279
- throw err;
3406
+
3407
+ if (err instanceof BotiumError$4 && container.caps[Capabilities.SCRIPTING_ENABLE_SKIP_ASSERT_ERRORS]) {
3408
+ if (!err.isAsserterError()) {
3409
+ throw err;
3410
+ }
3411
+ } else {
3412
+ throw err;
3413
+ }
3280
3414
  } finally {
3281
3415
  if (convoStep.sender !== 'begin' && convoStep.sender !== 'end' && !skipTranscriptStep) {
3282
3416
  transcriptStep.scriptingMemory = Object.assign({}, scriptingMemory);
@@ -3291,6 +3425,14 @@ class Convo$6 {
3291
3425
  transcript.steps = transcriptSteps.filter(s => s);
3292
3426
  transcript.scriptingMemory = scriptingMemory;
3293
3427
  transcript.convoEnd = new Date();
3428
+
3429
+ if (container.caps[Capabilities.SCRIPTING_ENABLE_SKIP_ASSERT_ERRORS]) {
3430
+ const transcriptStepErrs = transcript.steps.filter(s => s.err).map(s => s.err);
3431
+
3432
+ if (transcriptStepErrs && transcriptStepErrs.length > 0) {
3433
+ transcript.err = botiumErrorFromList$1([transcriptStepErrs, transcript.err].filter(e => e), {});
3434
+ }
3435
+ }
3294
3436
  }
3295
3437
  }
3296
3438
 
@@ -3299,11 +3441,11 @@ class Convo$6 {
3299
3441
 
3300
3442
  if (lodash__default["default"].isArray(expected)) {
3301
3443
  if (!lodash__default["default"].isArray(result)) {
3302
- throw new BotiumError$3(`${this.header.name}/${convoStep.stepTag}: bot response expected array, got "${result}"`);
3444
+ throw new BotiumError$4(`${this.header.name}/${convoStep.stepTag}: bot response expected array, got "${result}"`);
3303
3445
  }
3304
3446
 
3305
3447
  if (expected.length !== result.length) {
3306
- throw new BotiumError$3(`${this.header.name}/${convoStep.stepTag}: bot response expected array length ${expected.length}, got ${result.length}`);
3448
+ throw new BotiumError$4(`${this.header.name}/${convoStep.stepTag}: bot response expected array length ${expected.length}, got ${result.length}`);
3307
3449
  }
3308
3450
 
3309
3451
  for (let i = 0; i < expected.length; i++) {
@@ -3314,7 +3456,7 @@ class Convo$6 {
3314
3456
  if (Object.prototype.hasOwnProperty.call(result, key)) {
3315
3457
  this._compareObject(container, scriptingMemory, convoStep, result[key], expected[key]);
3316
3458
  } else {
3317
- throw new BotiumError$3(`${this.header.name}/${convoStep.stepTag}: bot response "${result}" missing expected property: ${key}`);
3459
+ throw new BotiumError$4(`${this.header.name}/${convoStep.stepTag}: bot response "${result}" missing expected property: ${key}`);
3318
3460
  }
3319
3461
  });
3320
3462
  } else {
@@ -3442,17 +3584,17 @@ class Convo$6 {
3442
3584
  const alreadyThereAt = parentPConvos.indexOf(includeLogicHook);
3443
3585
 
3444
3586
  if (alreadyThereAt >= 0) {
3445
- throw new BotiumError$3(`Partial convos are included circular. "${includeLogicHook}" is referenced by "/${parentPConvos.slice(0, alreadyThereAt).join('/')}" and by "/${parentPConvos.join('/')}" `);
3587
+ throw new BotiumError$4(`Partial convos are included circular. "${includeLogicHook}" is referenced by "/${parentPConvos.slice(0, alreadyThereAt).join('/')}" and by "/${parentPConvos.join('/')}" `);
3446
3588
  }
3447
3589
 
3448
3590
  if (!partialConvos || Object.keys(partialConvos).length === 0) {
3449
- throw new BotiumError$3(`Cant find partial convo with name ${includeLogicHook} (There are no partial convos)`);
3591
+ throw new BotiumError$4(`Cant find partial convo with name ${includeLogicHook} (There are no partial convos)`);
3450
3592
  }
3451
3593
 
3452
3594
  const partialConvo = partialConvos[includeLogicHook];
3453
3595
 
3454
3596
  if (!partialConvo) {
3455
- throw new BotiumError$3(`Cant find partial convo with name ${includeLogicHook} (available partial convos: ${Object.keys(partialConvos).join(',')})`);
3597
+ throw new BotiumError$4(`Cant find partial convo with name ${includeLogicHook} (available partial convos: ${Object.keys(partialConvos).join(',')})`);
3456
3598
  }
3457
3599
 
3458
3600
  _getEffectiveConversationRecursive(partialConvo.conversation, [...parentPConvos, includeLogicHook], result, true);
@@ -3834,7 +3976,7 @@ const {
3834
3976
  } = vm2__default["default"];
3835
3977
  const debug$h = debug__default["default"]('botium-core-HookUtils');
3836
3978
  const {
3837
- BotiumError: BotiumError$2
3979
+ BotiumError: BotiumError$3
3838
3980
  } = BotiumError_1;
3839
3981
 
3840
3982
  const executeHook$2 = async (caps, hook, args) => {
@@ -3906,7 +4048,7 @@ const getHook$3 = (caps, data) => {
3906
4048
 
3907
4049
  if (resultWithRequire) {
3908
4050
  if (!allowUnsafe) {
3909
- throw new BotiumError$2('Security Error. Using unsafe custom hook with require is not allowed', {
4051
+ throw new BotiumError$3('Security Error. Using unsafe custom hook with require is not allowed', {
3910
4052
  type: 'security',
3911
4053
  subtype: 'allow unsafe',
3912
4054
  source: path__default["default"].basename(__filename),
@@ -4361,6 +4503,9 @@ var Utterance_1 = class Utterance {
4361
4503
  };
4362
4504
 
4363
4505
  const debug$d = debug__default["default"]('botium-core-CompilerXlsx');
4506
+ const {
4507
+ E_SCRIPTING_MEMORY_COLUMN_MODE
4508
+ } = Enums;
4364
4509
  const {
4365
4510
  Convo: Convo$5
4366
4511
  } = Convo_1;
@@ -4673,49 +4818,120 @@ var CompilerXlsx_1 = class CompilerXlsx extends CompilerBase_1 {
4673
4818
  }
4674
4819
 
4675
4820
  if (scriptType === Constants.SCRIPTING_TYPE_SCRIPTING_MEMORY) {
4676
- const variableNames = [];
4677
- let colindexTemp = colindex + 1;
4678
-
4679
- while (true) {
4680
- const variableNameCell = this.colnames[colindexTemp] + rowindex;
4821
+ const guessScriptingMemoryColumnMode = () => {
4822
+ const line1Cell = this.colnames[colindex] + (rowindex + 1);
4681
4823
 
4682
- if (sheet[variableNameCell] && sheet[variableNameCell].v) {
4683
- variableNames.push(sheet[variableNameCell].v);
4684
- } else {
4685
- break;
4824
+ if (sheet[line1Cell] && sheet[line1Cell].v) {
4825
+ if (sheet[line1Cell].v.startsWith('$')) return E_SCRIPTING_MEMORY_COLUMN_MODE.TESTCASENAMES;
4686
4826
  }
4687
4827
 
4688
- colindexTemp++;
4689
- }
4828
+ return E_SCRIPTING_MEMORY_COLUMN_MODE.VARNAMES;
4829
+ };
4690
4830
 
4691
- rowindex += 1;
4831
+ const columnMode = this.caps[Capabilities.SCRIPTING_MEMORY_COLUMN_MODE] || guessScriptingMemoryColumnMode();
4692
4832
 
4693
- while (true) {
4694
- const caseNameCell = this.colnames[colindex] + rowindex;
4833
+ if (columnMode === E_SCRIPTING_MEMORY_COLUMN_MODE.TESTCASENAMES) {
4834
+ const caseNames = [];
4835
+ let colindexTemp = colindex + 1;
4836
+
4837
+ while (true) {
4838
+ const caseNameCell = this.colnames[colindexTemp] + rowindex;
4839
+
4840
+ if (sheet[caseNameCell] && sheet[caseNameCell].v) {
4841
+ caseNames.push(sheet[caseNameCell].v);
4842
+ } else {
4843
+ break;
4844
+ }
4845
+
4846
+ colindexTemp++;
4847
+ }
4695
4848
 
4696
- if (sheet[caseNameCell] && sheet[caseNameCell].v) {
4697
- const caseName = sheet[caseNameCell].v;
4698
- const values = {};
4849
+ const varNames = [];
4850
+ const varValues = [];
4851
+ rowindex += 1;
4699
4852
 
4700
- for (let i = 0; i < variableNames.length; i++) {
4701
- const variableValueCell = this.colnames[colindex + 1 + i] + rowindex;
4853
+ while (true) {
4854
+ const varNameCell = this.colnames[colindex] + rowindex;
4702
4855
 
4703
- if (sheet[variableValueCell] && sheet[variableValueCell].v) {
4704
- values[variableNames[i]] = sheet[variableValueCell].v.toString();
4705
- } else {
4706
- values[variableNames[i]] = null;
4856
+ if (sheet[varNameCell] && sheet[varNameCell].v) {
4857
+ varNames.push(sheet[varNameCell].v);
4858
+ const values = [];
4859
+
4860
+ for (let i = 0; i < caseNames.length; i++) {
4861
+ const variableValueCell = this.colnames[colindex + 1 + i] + rowindex;
4862
+
4863
+ if (sheet[variableValueCell] && sheet[variableValueCell].v) {
4864
+ values.push(sheet[variableValueCell].v.toString());
4865
+ } else {
4866
+ values.push(null);
4867
+ }
4707
4868
  }
4869
+
4870
+ varValues.push(values);
4871
+ rowindex += 1;
4872
+ } else {
4873
+ break;
4708
4874
  }
4875
+ }
4709
4876
 
4710
- rowindex += 1;
4877
+ for (let caseIndex = 0; caseIndex < caseNames.length; caseIndex++) {
4878
+ const caseName = caseNames[caseIndex];
4879
+ const values = varNames.reduce((agg, varName, varIndex) => {
4880
+ agg[varName] = varValues[varIndex][caseIndex] || null;
4881
+ return agg;
4882
+ }, {});
4711
4883
  scriptResults.push({
4712
4884
  header: {
4713
4885
  name: caseName
4714
4886
  },
4715
4887
  values: values
4716
4888
  });
4717
- } else {
4718
- break;
4889
+ }
4890
+ } else {
4891
+ const variableNames = [];
4892
+ let colindexTemp = colindex + 1;
4893
+
4894
+ while (true) {
4895
+ const variableNameCell = this.colnames[colindexTemp] + rowindex;
4896
+
4897
+ if (sheet[variableNameCell] && sheet[variableNameCell].v) {
4898
+ variableNames.push(sheet[variableNameCell].v);
4899
+ } else {
4900
+ break;
4901
+ }
4902
+
4903
+ colindexTemp++;
4904
+ }
4905
+
4906
+ rowindex += 1;
4907
+
4908
+ while (true) {
4909
+ const caseNameCell = this.colnames[colindex] + rowindex;
4910
+
4911
+ if (sheet[caseNameCell] && sheet[caseNameCell].v) {
4912
+ const caseName = sheet[caseNameCell].v;
4913
+ const values = {};
4914
+
4915
+ for (let i = 0; i < variableNames.length; i++) {
4916
+ const variableValueCell = this.colnames[colindex + 1 + i] + rowindex;
4917
+
4918
+ if (sheet[variableValueCell] && sheet[variableValueCell].v) {
4919
+ values[variableNames[i]] = sheet[variableValueCell].v.toString();
4920
+ } else {
4921
+ values[variableNames[i]] = null;
4922
+ }
4923
+ }
4924
+
4925
+ rowindex += 1;
4926
+ scriptResults.push({
4927
+ header: {
4928
+ name: caseName
4929
+ },
4930
+ values: values
4931
+ });
4932
+ } else {
4933
+ break;
4934
+ }
4719
4935
  }
4720
4936
  }
4721
4937
  }
@@ -4875,7 +5091,8 @@ const {
4875
5091
  linesToConvoStep: linesToConvoStep$3,
4876
5092
  convoStepToLines,
4877
5093
  validateConvo,
4878
- validSenders: validSenders$2
5094
+ validSenders: validSenders$2,
5095
+ linesToScriptingMemories: linesToScriptingMemories$1
4879
5096
  } = helper;
4880
5097
  var CompilerTxt_1 = class CompilerTxt extends CompilerBase_1 {
4881
5098
  constructor(context, caps = {}) {
@@ -5006,30 +5223,12 @@ var CompilerTxt_1 = class CompilerTxt extends CompilerBase_1 {
5006
5223
 
5007
5224
  _compileScriptingMemory(lines) {
5008
5225
  if (lines && lines.length > 1) {
5009
- const names = lines[0].split('|').map(name => name.trim()).slice(1);
5010
- const scriptingMemories = [];
5011
-
5012
- for (let row = 1; row < lines.length; row++) {
5013
- if (!lines[row] || lines[row].length === 0) continue;
5014
- const rawRow = lines[row].split('|').map(name => name.trim());
5015
- const caseName = rawRow[0];
5016
- const values = rawRow.slice(1);
5017
- const json = {};
5018
-
5019
- for (let col = 0; col < names.length; col++) {
5020
- json[names[col]] = values[col];
5021
- }
5226
+ const scriptingMemories = linesToScriptingMemories$1(lines, this.caps[Capabilities.SCRIPTING_MEMORY_COLUMN_MODE]);
5022
5227
 
5023
- const scriptingMemory = {
5024
- header: {
5025
- name: caseName
5026
- },
5027
- values: json
5028
- };
5029
- scriptingMemories.push(scriptingMemory);
5228
+ if (scriptingMemories && scriptingMemories.length > 0) {
5229
+ this.context.AddScriptingMemories(scriptingMemories);
5030
5230
  }
5031
5231
 
5032
- this.context.AddScriptingMemories(scriptingMemories);
5033
5232
  return scriptingMemories;
5034
5233
  }
5035
5234
  }
@@ -5073,6 +5272,9 @@ var CompilerTxt_1 = class CompilerTxt extends CompilerBase_1 {
5073
5272
 
5074
5273
  };
5075
5274
 
5275
+ const {
5276
+ parse
5277
+ } = sync__default["default"];
5076
5278
  const debug$c = debug__default["default"]('botium-core-CompilerCsv');
5077
5279
  const {
5078
5280
  Convo: Convo$3
@@ -5145,7 +5347,7 @@ var CompilerCsv_1 = class CompilerCsv extends CompilerBase_1 {
5145
5347
  let rows;
5146
5348
 
5147
5349
  try {
5148
- rows = sync__default["default"](scriptData, {
5350
+ rows = parse(scriptData, {
5149
5351
  delimiter,
5150
5352
  escape: this.caps[Capabilities.SCRIPTING_CSV_ESCAPE],
5151
5353
  quote: this.caps[Capabilities.SCRIPTING_CSV_QUOTE],
@@ -5284,7 +5486,8 @@ const {
5284
5486
  } = Convo_1;
5285
5487
  const {
5286
5488
  linesToConvoStep: linesToConvoStep$1,
5287
- validSenders: validSenders$1
5489
+ validSenders: validSenders$1,
5490
+ linesToScriptingMemories
5288
5491
  } = helper;
5289
5492
  var CompilerObjectBase_1 = class CompilerObjectBase extends CompilerBase_1 {
5290
5493
  constructor(context, caps = {}) {
@@ -5393,29 +5596,12 @@ var CompilerObjectBase_1 = class CompilerObjectBase extends CompilerBase_1 {
5393
5596
  if (lines && lines.length > 0) {
5394
5597
  if (lodash__default["default"].isString(lines[0])) {
5395
5598
  if (lines.length > 1) {
5396
- const names = lines[0].split('|').map(name => name.trim()).slice(1);
5397
- const scriptingMemories = [];
5398
-
5399
- for (let row = 1; row < lines.length; row++) {
5400
- const rawRow = lines[row].split('|').map(name => name.trim());
5401
- const caseName = rawRow[0];
5402
- const values = rawRow.slice(1);
5403
- const json = {};
5599
+ const scriptingMemories = linesToScriptingMemories(lines, this.caps[Capabilities.SCRIPTING_MEMORY_COLUMN_MODE]);
5404
5600
 
5405
- for (let col = 0; col < names.length; col++) {
5406
- json[names[col]] = values[col];
5407
- }
5408
-
5409
- const scriptingMemory = {
5410
- header: {
5411
- name: caseName
5412
- },
5413
- values: json
5414
- };
5415
- scriptingMemories.push(scriptingMemory);
5601
+ if (scriptingMemories && scriptingMemories.length > 0) {
5602
+ this.context.AddScriptingMemories(scriptingMemories);
5416
5603
  }
5417
5604
 
5418
- this.context.AddScriptingMemories(scriptingMemories);
5419
5605
  return scriptingMemories;
5420
5606
  }
5421
5607
  } else {
@@ -5608,7 +5794,7 @@ const {
5608
5794
  ConvoStep
5609
5795
  } = Convo_1;
5610
5796
  const {
5611
- BotiumError: BotiumError$1,
5797
+ BotiumError: BotiumError$2,
5612
5798
  botiumErrorFromList,
5613
5799
  botiumErrorFromErr
5614
5800
  } = BotiumError_1;
@@ -5888,7 +6074,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
5888
6074
  message += ' expected to match ';
5889
6075
  message += tomatch && tomatch.length > 1 ? 'one of ' : '';
5890
6076
  message += `${tomatch.map(e => e ? '"' + e + '"' : '<any response>').join(', ')}`;
5891
- throw new BotiumError$1(message, {
6077
+ throw new BotiumError$2(message, {
5892
6078
  type: 'asserter',
5893
6079
  source: 'TextMatchAsserter',
5894
6080
  context: {
@@ -5918,7 +6104,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
5918
6104
  message += ' expected NOT to match ';
5919
6105
  message += nottomatch && nottomatch.length > 1 ? 'one of ' : '';
5920
6106
  message += `${nottomatch.map(e => e ? '"' + e + '"' : '<any response>').join(', ')}`;
5921
- throw new BotiumError$1(message, {
6107
+ throw new BotiumError$2(message, {
5922
6108
  type: 'asserter',
5923
6109
  source: 'TextMatchAsserter',
5924
6110
  context: {
@@ -5965,7 +6151,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
5965
6151
  if (asserter[notAsserterType]) {
5966
6152
  return p(this.retryHelperAsserter, () => asserter[notAsserterType](params));
5967
6153
  } else {
5968
- return pnot(this.retryHelperAsserter, () => asserter[asserterType](params), new BotiumError$1(`${convoStep.stepTag}: Expected asserter ${asserter.name || asserterSpec.name} with args "${params.args}" to fail`, {
6154
+ return pnot(this.retryHelperAsserter, () => asserter[asserterType](params), new BotiumError$2(`${convoStep.stepTag}: Expected asserter ${asserter.name || asserterSpec.name} with args "${params.args}" to fail`, {
5969
6155
  type: 'asserter',
5970
6156
  source: asserter.name || asserterSpec.name,
5971
6157
  params: {
@@ -6399,7 +6585,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
6399
6585
  });
6400
6586
 
6401
6587
  if (aggregatedNoNames.length) {
6402
- throw new BotiumError$1('Scripting Memory Definition(s) without name', {
6588
+ throw new BotiumError$2('Scripting Memory Definition(s) without name', {
6403
6589
  type: 'Scripting Memory',
6404
6590
  subtype: 'Scripting Memory without name',
6405
6591
  source: 'ScriptingProvider',
@@ -6415,7 +6601,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
6415
6601
  });
6416
6602
 
6417
6603
  if (aggregatedNoVariables.length) {
6418
- throw new BotiumError$1(`Scripting Memory Definition(s) ${aggregatedNoVariables.map(e => e.header.name).join(', ')} without variable`, {
6604
+ throw new BotiumError$2(`Scripting Memory Definition(s) ${aggregatedNoVariables.map(e => e.header.name).join(', ')} without variable`, {
6419
6605
  type: 'Scripting Memory',
6420
6606
  subtype: 'Scripting Memory without variable',
6421
6607
  source: 'ScriptingProvider',
@@ -6431,7 +6617,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
6431
6617
  });
6432
6618
 
6433
6619
  if (aggregatedNoVariableNames.length) {
6434
- throw new BotiumError$1(`Scripting Memory Definition(s) ${aggregatedNoVariableNames.map(e => e.header.name).join(', ')} without variable name`, {
6620
+ throw new BotiumError$2(`Scripting Memory Definition(s) ${aggregatedNoVariableNames.map(e => e.header.name).join(', ')} without variable name`, {
6435
6621
  type: 'Scripting Memory',
6436
6622
  subtype: 'Scripting Memory without variable name',
6437
6623
  source: 'ScriptingProvider',
@@ -6463,7 +6649,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
6463
6649
  }
6464
6650
 
6465
6651
  if (aggregatedDuplicates.length) {
6466
- throw new BotiumError$1(`Scripting Memory Definition name(s) "${lodash__default["default"].uniq(aggregatedDuplicates.map(d => d.scriptingMemory.header.name)).join(', ')}" are not unique`, {
6652
+ throw new BotiumError$2(`Scripting Memory Definition name(s) "${lodash__default["default"].uniq(aggregatedDuplicates.map(d => d.scriptingMemory.header.name)).join(', ')}" are not unique`, {
6467
6653
  type: 'Scripting Memory',
6468
6654
  subtype: 'Scripting Memory name collision',
6469
6655
  source: 'ScriptingProvider',
@@ -6500,7 +6686,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
6500
6686
  }
6501
6687
 
6502
6688
  if (aggregatedIntersections.length) {
6503
- throw new BotiumError$1(`Scripting Memory Definitions "${aggregatedIntersections.map(i => i.scriptingMemory.header.name).join(', ')}" are invalid because variable name collision"`, {
6689
+ throw new BotiumError$2(`Scripting Memory Definitions "${aggregatedIntersections.map(i => i.scriptingMemory.header.name).join(', ')}" are invalid because variable name collision"`, {
6504
6690
  type: 'Scripting Memory',
6505
6691
  subtype: 'Scripting Memory variable name collision',
6506
6692
  source: 'ScriptingProvider',
@@ -6589,6 +6775,8 @@ var ScriptingProvider_1 = class ScriptingProvider {
6589
6775
 
6590
6776
  debug$9(`ExpandScriptingMemoryToConvos - ${convosExpandedAll.length} convo expanded, added to convos (${this.convos.length}). Result ${convosExpandedAll.length + this.convos.length} convo`);
6591
6777
  this.convos = this.convos.concat(convosExpandedAll);
6778
+
6779
+ this._sortConvos();
6592
6780
  }
6593
6781
 
6594
6782
  ExpandUtterancesToConvos({
@@ -6628,6 +6816,9 @@ var ScriptingProvider_1 = class ScriptingProvider {
6628
6816
  },
6629
6817
  conversation: [{
6630
6818
  sender: 'me',
6819
+ logicHooks: [{
6820
+ name: 'SKIP_BOT_UNCONSUMED'
6821
+ }],
6631
6822
  messageText: utt.name,
6632
6823
  stepTag: 'Step 1 - tell utterance'
6633
6824
  }, useNameAsIntent ? {
@@ -6943,7 +7134,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
6943
7134
  }
6944
7135
  } else if (scriptingMemories) {
6945
7136
  if (!scriptingMemories.header || !scriptingMemories.header.name) {
6946
- throw new BotiumError$1('Scripting Memory Definition has no name', {
7137
+ throw new BotiumError$2('Scripting Memory Definition has no name', {
6947
7138
  type: 'Compiler',
6948
7139
  subtype: 'Scripting memory without name',
6949
7140
  source: 'ScriptingProvider',
@@ -6954,7 +7145,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
6954
7145
  }
6955
7146
 
6956
7147
  if (!scriptingMemories.values || !Object.keys(scriptingMemories.values).length) {
6957
- throw new BotiumError$1('Scripting Memory Definition has no variables', {
7148
+ throw new BotiumError$2('Scripting Memory Definition has no variables', {
6958
7149
  type: 'Compiler',
6959
7150
  subtype: 'Scripting memory without variable',
6960
7151
  source: 'ScriptingProvider',
@@ -6965,7 +7156,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
6965
7156
  }
6966
7157
 
6967
7158
  if (scriptingMemories.values && !lodash__default["default"].isUndefined(scriptingMemories.values[''])) {
6968
- throw new BotiumError$1('Scripting Memory Definition variable has no name', {
7159
+ throw new BotiumError$2('Scripting Memory Definition variable has no name', {
6969
7160
  type: 'Compiler',
6970
7161
  subtype: 'Scripting memory without variable name',
6971
7162
  source: 'ScriptingProvider',
@@ -7400,7 +7591,7 @@ var BaseContainer_1 = class BaseContainer {
7400
7591
  this.tempDirectory = tempDirectory;
7401
7592
  this.cleanupTasks = [];
7402
7593
  this.queues = {};
7403
- this.userSaysLimiter = null;
7594
+ this.bottleneck = null;
7404
7595
  }
7405
7596
 
7406
7597
  Validate() {
@@ -7410,18 +7601,33 @@ var BaseContainer_1 = class BaseContainer {
7410
7601
  this.onBotResponseHook = getHook$1(this.caps, this.caps[Capabilities.CUSTOMHOOK_ONBOTRESPONSE]);
7411
7602
  this.onStopHook = getHook$1(this.caps, this.caps[Capabilities.CUSTOMHOOK_ONSTOP]);
7412
7603
  this.onCleanHook = getHook$1(this.caps, this.caps[Capabilities.CUSTOMHOOK_ONCLEAN]);
7413
- return Promise.resolve();
7414
- }
7415
7604
 
7416
- Build() {
7417
- if (this.caps[Capabilities.RATELIMIT_USERSAYS_MAXCONCURRENT] || this.caps[Capabilities.RATELIMIT_USERSAYS_MINTIME]) {
7605
+ if (this.caps[Capabilities.RATELIMIT_BOTTLENECK_FN]) {
7606
+ if (lodash__default["default"].isFunction(this.caps[Capabilities.RATELIMIT_BOTTLENECK_FN])) {
7607
+ this.bottleneck = this.caps[Capabilities.RATELIMIT_BOTTLENECK_FN];
7608
+ debug$7('Validate: Applying userSays rate limits from capability');
7609
+ } else {
7610
+ const limiter = new bottleneck__default["default"](this.caps[Capabilities.RATELIMIT_BOTTLENECK_FN]);
7611
+
7612
+ this.bottleneck = fn => limiter.schedule(fn);
7613
+
7614
+ debug$7(`Validate: Applying userSays rate limits ${util__default["default"].inspect(this.caps[Capabilities.RATELIMIT_BOTTLENECK_FN])}`);
7615
+ }
7616
+ } else if (this.caps[Capabilities.RATELIMIT_USERSAYS_MAXCONCURRENT] || this.caps[Capabilities.RATELIMIT_USERSAYS_MINTIME]) {
7418
7617
  const opts = {};
7419
7618
  if (this.caps[Capabilities.RATELIMIT_USERSAYS_MAXCONCURRENT]) opts.maxConcurrent = this.caps[Capabilities.RATELIMIT_USERSAYS_MAXCONCURRENT];
7420
7619
  if (this.caps[Capabilities.RATELIMIT_USERSAYS_MINTIME]) opts.minTime = this.caps[Capabilities.RATELIMIT_USERSAYS_MINTIME];
7421
- this.userSaysLimiter = new bottleneck__default["default"](opts);
7422
- debug$7(`Build: Applying userSays rate limits ${util__default["default"].inspect(opts)}`);
7620
+ const limiter = new bottleneck__default["default"](opts);
7621
+
7622
+ this.bottleneck = fn => limiter.schedule(fn);
7623
+
7624
+ debug$7(`Validate: Applying userSays rate limits ${util__default["default"].inspect(opts)}`);
7423
7625
  }
7424
7626
 
7627
+ return Promise.resolve();
7628
+ }
7629
+
7630
+ Build() {
7425
7631
  return new Promise((resolve, reject) => {
7426
7632
  this._RunCustomHook('onBuild', this.onBuildHook).then(() => resolve(this)).catch(err => reject(err));
7427
7633
  });
@@ -7447,8 +7653,8 @@ var BaseContainer_1 = class BaseContainer {
7447
7653
  meMsg
7448
7654
  }).then(() => this.UserSaysImpl(meMsg));
7449
7655
 
7450
- if (this.userSaysLimiter) {
7451
- return this.userSaysLimiter.schedule(run);
7656
+ if (this.bottleneck) {
7657
+ return this.bottleneck(run);
7452
7658
  } else {
7453
7659
  return run();
7454
7660
  }
@@ -7927,16 +8133,23 @@ const {
7927
8133
  const {
7928
8134
  escapeJSONString
7929
8135
  } = Utils;
8136
+ const {
8137
+ BotiumError: BotiumError$1
8138
+ } = BotiumError_1;
7930
8139
 
7931
8140
  mustache__default["default"].escape = s => s;
7932
8141
 
7933
8142
  var SimpleRestContainer_1 = class SimpleRestContainer {
7934
8143
  constructor({
7935
8144
  queueBotSays,
7936
- caps
8145
+ caps,
8146
+ bottleneck
7937
8147
  }) {
7938
8148
  this.queueBotSays = queueBotSays;
7939
8149
  this.caps = Object.assign({}, Defaults, caps);
8150
+
8151
+ this.bottleneck = bottleneck || (fn => fn());
8152
+
7940
8153
  this.processInbound = false;
7941
8154
  this.redisTopic = this.caps[Capabilities.SIMPLEREST_REDIS_TOPIC] || 'SIMPLEREST_INBOUND_SUBSCRIPTION';
7942
8155
 
@@ -8223,31 +8436,82 @@ var SimpleRestContainer_1 = class SimpleRestContainer {
8223
8436
  }
8224
8437
 
8225
8438
  for (const jsonPathRoot of jsonPathRoots) {
8226
- const media = [];
8227
- const buttons = [];
8228
- const jsonPathsMedia = getAllCapValues(Capabilities.SIMPLEREST_MEDIA_JSONPATH, this.caps);
8229
- jsonPathsMedia.forEach(jsonPath => {
8230
- const responseMedia = jsonpath__default["default"].query(jsonPathRoot, jsonPath);
8231
-
8232
- if (responseMedia) {
8233
- (lodash__default["default"].isArray(responseMedia) ? lodash__default["default"].flattenDeep(responseMedia) : [responseMedia]).forEach(m => media.push({
8234
- mediaUri: m,
8235
- mimeType: mimeTypes__default["default"].lookup(m) || 'application/unknown'
8236
- }));
8237
- debug$4(`found response media: ${util__default["default"].inspect(media)}`);
8439
+ const _retrieveMedia = (jsonPathMediaRoot, jsonPathsMedia) => {
8440
+ const retrievedMedia = [];
8441
+ jsonPathsMedia.forEach(jsonPath => {
8442
+ const responseMedia = jsonpath__default["default"].query(jsonPathMediaRoot, jsonPath);
8443
+
8444
+ if (responseMedia) {
8445
+ (lodash__default["default"].isArray(responseMedia) ? lodash__default["default"].flattenDeep(responseMedia) : [responseMedia]).forEach(m => retrievedMedia.push({
8446
+ mediaUri: m,
8447
+ mimeType: mimeTypes__default["default"].lookup(m) || 'application/unknown'
8448
+ }));
8449
+ }
8450
+ });
8451
+ return retrievedMedia;
8452
+ };
8453
+
8454
+ const _retrieveButtons = (jsonPathButtonRoot, jsonPathsButtons) => {
8455
+ const retrievedButtons = [];
8456
+ jsonPathsButtons.forEach(jsonPath => {
8457
+ const responseButtons = jsonpath__default["default"].query(jsonPathButtonRoot, jsonPath);
8458
+
8459
+ if (responseButtons) {
8460
+ (lodash__default["default"].isArray(responseButtons) ? lodash__default["default"].flattenDeep(responseButtons) : [responseButtons]).forEach(b => retrievedButtons.push({
8461
+ text: b
8462
+ }));
8463
+ }
8464
+ });
8465
+ return retrievedButtons;
8466
+ };
8467
+
8468
+ const _getCardText = responseCardText => {
8469
+ if (responseCardText) {
8470
+ const texts = lodash__default["default"].isArray(responseCardText) ? lodash__default["default"].flattenDeep(responseCardText) : [responseCardText];
8471
+
8472
+ if (texts.length > 1) {
8473
+ debug$4(`more than one text found for card: ${util__default["default"].inspect(texts)}`);
8474
+ }
8475
+
8476
+ if (texts.length > 0) {
8477
+ return texts[0];
8478
+ }
8238
8479
  }
8239
- });
8240
- const jsonPathsButtons = getAllCapValues(Capabilities.SIMPLEREST_BUTTONS_JSONPATH, this.caps);
8241
- jsonPathsButtons.forEach(jsonPath => {
8242
- const responseButtons = jsonpath__default["default"].query(jsonPathRoot, jsonPath);
8243
-
8244
- if (responseButtons) {
8245
- (lodash__default["default"].isArray(responseButtons) ? lodash__default["default"].flattenDeep(responseButtons) : [responseButtons]).forEach(b => buttons.push({
8246
- text: b
8247
- }));
8248
- debug$4(`found response buttons: ${util__default["default"].inspect(buttons)}`);
8480
+ };
8481
+
8482
+ const media = _retrieveMedia(jsonPathRoot, getAllCapValues(Capabilities.SIMPLEREST_MEDIA_JSONPATH, this.caps));
8483
+
8484
+ debug$4(`found response media: ${util__default["default"].inspect(media)}`);
8485
+
8486
+ const buttons = _retrieveButtons(jsonPathRoot, getAllCapValues(Capabilities.SIMPLEREST_BUTTONS_JSONPATH, this.caps));
8487
+
8488
+ debug$4(`found response buttons: ${util__default["default"].inspect(buttons)}`);
8489
+ const cards = [];
8490
+ const jsonPathsCards = getAllCapValues(Capabilities.SIMPLEREST_CARDS_JSONPATH, this.caps);
8491
+ jsonPathsCards.forEach(jsonPath => {
8492
+ const responseCards = jsonpath__default["default"].query(jsonPathRoot, jsonPath);
8493
+
8494
+ if (responseCards) {
8495
+ (lodash__default["default"].isArray(responseCards) ? lodash__default["default"].flattenDeep(responseCards) : [responseCards]).forEach(c => {
8496
+ const card = {};
8497
+ const jsonPathsCardText = getAllCapValues(Capabilities.SIMPLEREST_CARD_TEXT_JSONPATH, this.caps);
8498
+ jsonPathsCardText.forEach(jsonPath => {
8499
+ card.text = _getCardText(jsonpath__default["default"].query(c, jsonPath));
8500
+ });
8501
+ const jsonPathsCardSubText = getAllCapValues(Capabilities.SIMPLEREST_CARD_SUBTEXT_JSONPATH, this.caps);
8502
+ jsonPathsCardSubText.forEach(jsonPath => {
8503
+ card.subtext = _getCardText(jsonpath__default["default"].query(c, jsonPath));
8504
+ });
8505
+ card.buttons = _retrieveButtons(c, getAllCapValues(Capabilities.SIMPLEREST_CARD_BUTTONS_JSONPATH, this.caps));
8506
+ card.media = _retrieveMedia(c, getAllCapValues(Capabilities.SIMPLEREST_CARD_ATTACHMENTS_JSONPATH, this.caps));
8507
+
8508
+ if (lodash__default["default"].keys(card).length > 0) {
8509
+ cards.push(card);
8510
+ }
8511
+ });
8249
8512
  }
8250
8513
  });
8514
+ debug$4(`found response cards: ${util__default["default"].inspect(cards)}`);
8251
8515
  let hasMessageText = false;
8252
8516
  const jsonPathsTexts = getAllCapValues(Capabilities.SIMPLEREST_RESPONSE_JSONPATH, this.caps);
8253
8517
 
@@ -8264,7 +8528,8 @@ var SimpleRestContainer_1 = class SimpleRestContainer {
8264
8528
  sourceData: body,
8265
8529
  messageText,
8266
8530
  media,
8267
- buttons
8531
+ buttons,
8532
+ cards
8268
8533
  };
8269
8534
  await executeHook(this.caps, this.responseHook, Object.assign({
8270
8535
  botMsg,
@@ -8280,7 +8545,8 @@ var SimpleRestContainer_1 = class SimpleRestContainer {
8280
8545
  messageText: '',
8281
8546
  sourceData: body,
8282
8547
  media,
8283
- buttons
8548
+ buttons,
8549
+ cards
8284
8550
  };
8285
8551
  const beforeHookKeys = Object.keys(botMsg);
8286
8552
  await executeHook(this.caps, this.responseHook, Object.assign({
@@ -8289,7 +8555,7 @@ var SimpleRestContainer_1 = class SimpleRestContainer {
8289
8555
  }, this.view));
8290
8556
  const afterHookKeys = Object.keys(botMsg);
8291
8557
 
8292
- if (beforeHookKeys.length !== afterHookKeys.length || !!(botMsg.messageText && botMsg.messageText.length > 0) || botMsg.media.length > 0 || botMsg.buttons.length > 0 || !this.caps[Capabilities.SIMPLEREST_IGNORE_EMPTY]) {
8558
+ if (beforeHookKeys.length !== afterHookKeys.length || !!(botMsg.messageText && botMsg.messageText.length > 0) || botMsg.media.length > 0 || botMsg.buttons.length > 0 || botMsg.cards.length > 0 || !this.caps[Capabilities.SIMPLEREST_IGNORE_EMPTY]) {
8293
8559
  result.push(botMsg);
8294
8560
  }
8295
8561
  }
@@ -8316,6 +8582,17 @@ var SimpleRestContainer_1 = class SimpleRestContainer {
8316
8582
  debug$4(Utils.shortenJsonString(body));
8317
8583
  }
8318
8584
 
8585
+ if (body) {
8586
+ const jsonBody = Utils.toJsonWeak(body);
8587
+ const errKey = Object.keys(jsonBody).find(k => k.startsWith('err') || k.startsWith('fail'));
8588
+
8589
+ if (errKey) {
8590
+ return reject(new BotiumError$1(`got error response: ${response.statusCode}/${response.statusMessage} - ${jsonBody[errKey]}`, {
8591
+ message: Utils.shortenJsonString(body)
8592
+ }));
8593
+ }
8594
+ }
8595
+
8319
8596
  return reject(new Error(`got error response: ${response.statusCode}/${response.statusMessage}`));
8320
8597
  }
8321
8598
 
@@ -8413,6 +8690,16 @@ var SimpleRestContainer_1 = class SimpleRestContainer {
8413
8690
  }
8414
8691
  }
8415
8692
 
8693
+ if (msg.ADD_FORM_PARAM && Object.keys(msg.ADD_FORM_PARAM).length > 0) {
8694
+ requestOptions.form = {};
8695
+
8696
+ for (const formKey of Object.keys(msg.ADD_FORM_PARAM)) {
8697
+ const formValue = this._getMustachedVal(lodash__default["default"].isString(msg.ADD_FORM_PARAM[formKey]) ? msg.ADD_FORM_PARAM[formKey] : JSON.stringify(msg.ADD_FORM_PARAM[formKey]), false);
8698
+
8699
+ requestOptions.form[formKey] = formValue;
8700
+ }
8701
+ }
8702
+
8416
8703
  if (msg.ADD_HEADER && Object.keys(msg.ADD_HEADER).length > 0) {
8417
8704
  requestOptions.headers = requestOptions.headers || {};
8418
8705
 
@@ -8454,7 +8741,7 @@ var SimpleRestContainer_1 = class SimpleRestContainer {
8454
8741
  err,
8455
8742
  response,
8456
8743
  body
8457
- } = await new Promise(resolve => {
8744
+ } = await this.bottleneck(() => new Promise(resolve => {
8458
8745
  request__default["default"](pingConfig, (err, response, body) => {
8459
8746
  resolve({
8460
8747
  err,
@@ -8462,7 +8749,7 @@ var SimpleRestContainer_1 = class SimpleRestContainer {
8462
8749
  body
8463
8750
  });
8464
8751
  });
8465
- });
8752
+ }));
8466
8753
 
8467
8754
  if (err) {
8468
8755
  debug$4(`_waitForUrlResponse error on url check ${pingConfig.uri}: ${err}`);
@@ -8986,6 +9273,7 @@ var PluginConnectorContainer_1 = class PluginConnectorContainer extends BaseCont
8986
9273
  this.pluginInstance = tryLoadPlugin(this.caps[Capabilities.CONTAINERMODE], this.caps[Capabilities.PLUGINMODULEPATH], {
8987
9274
  container: this,
8988
9275
  queueBotSays: msg => this._QueueBotSays(msg),
9276
+ bottleneck: this.bottleneck,
8989
9277
  eventEmitter: this.eventEmitter,
8990
9278
  caps: this.caps,
8991
9279
  sources: this.sources,
@@ -9233,9 +9521,9 @@ var BotDriver_1 = class BotDriver {
9233
9521
 
9234
9522
  Build() {
9235
9523
  debug$1(`Build - Botium Core Version: ${version}`);
9236
- debug$1(`Build - Capabilites: ${util__default["default"].inspect(this.caps)}`);
9237
- debug$1(`Build - Sources : ${util__default["default"].inspect(this.sources)}`);
9238
- debug$1(`Build - Envs : ${util__default["default"].inspect(this.envs)}`);
9524
+ debug$1(`Build - Capabilites: ${JSON.stringify(lodash__default["default"].pickBy(this.caps, (value, key) => Defaults$1.Capabilities[key] !== value), null, 2)}`);
9525
+ debug$1(`Build - Sources: ${JSON.stringify(lodash__default["default"].pickBy(this.sources, (value, key) => Defaults$1.Sources[key] !== value), null, 2)}`);
9526
+ debug$1(`Build - Envs: ${JSON.stringify(lodash__default["default"].pickBy(this.envs, (value, key) => Defaults$1.Envs[key] !== value), null, 2)}`);
9239
9527
  this.eventEmitter.emit(Events.CONTAINER_BUILDING);
9240
9528
  return new Promise((resolve, reject) => {
9241
9529
  let repo = null;
@@ -9683,6 +9971,7 @@ var botiumCore = {
9683
9971
  ScriptingConstants: Constants,
9684
9972
  Capabilities: Capabilities,
9685
9973
  Defaults: Defaults$1,
9974
+ Enums: Enums,
9686
9975
  Source: Source,
9687
9976
  Events: Events,
9688
9977
  Plugins: Plugins,
@@ -9702,31 +9991,33 @@ var botiumCore_2 = botiumCore.ScriptingProvider;
9702
9991
  var botiumCore_3 = botiumCore.ScriptingConstants;
9703
9992
  var botiumCore_4 = botiumCore.Capabilities;
9704
9993
  var botiumCore_5 = botiumCore.Defaults;
9705
- var botiumCore_6 = botiumCore.Source;
9706
- var botiumCore_7 = botiumCore.Events;
9707
- var botiumCore_8 = botiumCore.Plugins;
9708
- var botiumCore_9 = botiumCore.BotiumError;
9709
- var botiumCore_10 = botiumCore.ScriptingMemory;
9710
- var botiumCore_11 = botiumCore.HookUtils;
9711
- var botiumCore_12 = botiumCore.LogicHookConstants;
9712
- var botiumCore_13 = botiumCore.Lib;
9713
- var botiumCore_14 = botiumCore.InboundProxy;
9714
- var botiumCore_15 = botiumCore.BotiumMockRichMessageTypes;
9994
+ var botiumCore_6 = botiumCore.Enums;
9995
+ var botiumCore_7 = botiumCore.Source;
9996
+ var botiumCore_8 = botiumCore.Events;
9997
+ var botiumCore_9 = botiumCore.Plugins;
9998
+ var botiumCore_10 = botiumCore.BotiumError;
9999
+ var botiumCore_11 = botiumCore.ScriptingMemory;
10000
+ var botiumCore_12 = botiumCore.HookUtils;
10001
+ var botiumCore_13 = botiumCore.LogicHookConstants;
10002
+ var botiumCore_14 = botiumCore.Lib;
10003
+ var botiumCore_15 = botiumCore.InboundProxy;
10004
+ var botiumCore_16 = botiumCore.BotiumMockRichMessageTypes;
9715
10005
 
9716
10006
  exports.BotDriver = botiumCore_1;
9717
- exports.BotiumError = botiumCore_9;
9718
- exports.BotiumMockRichMessageTypes = botiumCore_15;
10007
+ exports.BotiumError = botiumCore_10;
10008
+ exports.BotiumMockRichMessageTypes = botiumCore_16;
9719
10009
  exports.Capabilities = botiumCore_4;
9720
10010
  exports.Defaults = botiumCore_5;
9721
- exports.Events = botiumCore_7;
9722
- exports.HookUtils = botiumCore_11;
9723
- exports.InboundProxy = botiumCore_14;
9724
- exports.Lib = botiumCore_13;
9725
- exports.LogicHookConstants = botiumCore_12;
9726
- exports.Plugins = botiumCore_8;
10011
+ exports.Enums = botiumCore_6;
10012
+ exports.Events = botiumCore_8;
10013
+ exports.HookUtils = botiumCore_12;
10014
+ exports.InboundProxy = botiumCore_15;
10015
+ exports.Lib = botiumCore_14;
10016
+ exports.LogicHookConstants = botiumCore_13;
10017
+ exports.Plugins = botiumCore_9;
9727
10018
  exports.ScriptingConstants = botiumCore_3;
9728
- exports.ScriptingMemory = botiumCore_10;
10019
+ exports.ScriptingMemory = botiumCore_11;
9729
10020
  exports.ScriptingProvider = botiumCore_2;
9730
- exports.Source = botiumCore_6;
10021
+ exports.Source = botiumCore_7;
9731
10022
  exports["default"] = botiumCore;
9732
10023
  //# sourceMappingURL=botium-cjs.js.map