@digipair/skill-web-chatbot 0.70.4 → 0.71.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/index.cjs2.js CHANGED
@@ -37752,14 +37752,14 @@ function indent(str, spaces) {
37752
37752
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
37753
37753
  // match is required
37754
37754
  if (!match) {
37755
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
37755
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
37756
37756
  v: nextMatch1
37757
37757
  };
37758
37758
  }
37759
37759
  var token = match.token, offset = match.offset;
37760
37760
  i1 += offset;
37761
37761
  if (token === " ") {
37762
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
37762
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
37763
37763
  }
37764
37764
  tokens1 = _to_consumable_array$c(tokens1).concat([
37765
37765
  token
@@ -37778,7 +37778,7 @@ function indent(str, spaces) {
37778
37778
  if (contextKeys.some(function(el) {
37779
37779
  return el.startsWith(name);
37780
37780
  })) {
37781
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
37781
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
37782
37782
  }
37783
37783
  if (dateTimeIdentifiers.some(function(el) {
37784
37784
  return el === name;
@@ -37797,9 +37797,9 @@ function indent(str, spaces) {
37797
37797
  if (dateTimeIdentifiers.some(function(el) {
37798
37798
  return el.startsWith(name);
37799
37799
  })) {
37800
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
37800
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
37801
37801
  }
37802
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
37802
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
37803
37803
  v: nextMatch1
37804
37804
  };
37805
37805
  };
@@ -41688,7 +41688,8 @@ var _globalInstance___DIGIPAIR_CONFIG__;
41688
41688
  const _config$1 = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__) != null ? _globalInstance___DIGIPAIR_CONFIG__ : {
41689
41689
  LIBRARIES: {},
41690
41690
  BASE_URL: 'https://cdn.jsdelivr.net/npm',
41691
- ALIAS: []
41691
+ ALIAS: [],
41692
+ LOGGER: (level, path, message, context, data)=>{}
41692
41693
  };
41693
41694
  const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
41694
41695
  const isPinsSettings = (value)=>{
@@ -41697,7 +41698,8 @@ const isPinsSettings = (value)=>{
41697
41698
  const config$1 = {
41698
41699
  set: (key, value)=>{
41699
41700
  _config$1[key] = key === 'LIBRARIES' && _config$1[key] ? _extends({}, _config$1[key], value) : value;
41700
- }
41701
+ },
41702
+ log: (level, path, message, context, data)=>_config$1.LOGGER(level, path, message, context, data)
41701
41703
  };
41702
41704
  const applyTemplate = (value, context)=>{
41703
41705
  let result = value;
@@ -41734,6 +41736,7 @@ const applyTemplate = (value, context)=>{
41734
41736
  };
41735
41737
  const executePins = async (settingsOrigin, context = {})=>{
41736
41738
  var _settings_conditions, _settings_conditions1;
41739
+ _config$1.LOGGER('INFO', context.__PATH__, 'execute:start', context);
41737
41740
  let settings = preparePinsSettings(settingsOrigin, context);
41738
41741
  const alias = _config$1.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
41739
41742
  const config = context.config || {};
@@ -41781,6 +41784,7 @@ const executePins = async (settingsOrigin, context = {})=>{
41781
41784
  }
41782
41785
  results.push(itemResult);
41783
41786
  }
41787
+ _config$1.LOGGER('INFO', context.__PATH__, 'execute:end', context, results);
41784
41788
  return results;
41785
41789
  }
41786
41790
  if (typeof ((_settings_conditions1 = settings.conditions) == null ? void 0 : _settings_conditions1.if) !== 'undefined' && !settings.conditions.if) {
@@ -41793,7 +41797,7 @@ const executePins = async (settingsOrigin, context = {})=>{
41793
41797
  }
41794
41798
  return await pins(settings.properties, settings.pins, context);
41795
41799
  };
41796
- const executePinsList = async (pinsSettingsList, context)=>{
41800
+ const executePinsList = async (pinsSettingsList, context, path = 'root')=>{
41797
41801
  let previous = {};
41798
41802
  for(let i = 0; i < pinsSettingsList.length; i++){
41799
41803
  const settings = pinsSettingsList[i];
@@ -41803,7 +41807,8 @@ const executePinsList = async (pinsSettingsList, context)=>{
41803
41807
  parent: {
41804
41808
  previous: context.previous,
41805
41809
  parent: context.parent
41806
- }
41810
+ },
41811
+ __PATH__: `${path}[${i}]`
41807
41812
  }));
41808
41813
  } catch (error) {
41809
41814
  if (error === 'DIGIPAIR_CONDITIONS_IF_FALSE') {
@@ -41873,7 +41878,7 @@ const generateElementFromPins = async (pinsSettings, parent, context, document =
41873
41878
  const event = _event;
41874
41879
  executePinsList(pinsList, _extends({}, context, {
41875
41880
  event: event.detail
41876
- }));
41881
+ }), `${context.__PATH__}.events[${key}]`);
41877
41882
  });
41878
41883
  });
41879
41884
  const pinsList = settings.pins || [];
@@ -59976,7 +59981,7 @@ class ChatbotElement extends r$3 {
59976
59981
  config: {
59977
59982
  VERSIONS: this.metadata.config.VERSIONS
59978
59983
  }
59979
- });
59984
+ }, 'boost');
59980
59985
  this.currentBoost = detail.boost ? _extends({
59981
59986
  parent_history: detail.uuid,
59982
59987
  parent_conversation: detail.parent_conversation || detail.uuid
@@ -59996,7 +60001,7 @@ class ChatbotElement extends r$3 {
59996
60001
  config: {
59997
60002
  VERSIONS: this.metadata.config.VERSIONS
59998
60003
  }
59999
- });
60004
+ }, 'boost.command');
60000
60005
  }
60001
60006
  } catch (error) {
60002
60007
  this.pushMessage({
@@ -60407,7 +60412,7 @@ class DigipairFullElement extends r$3 {
60407
60412
  config: {
60408
60413
  VERSIONS: this.metadata.config.VERSIONS
60409
60414
  }
60410
- });
60415
+ }, 'boost');
60411
60416
  this.currentBoost = detail.boost ? _extends({
60412
60417
  parent_history: detail.uuid,
60413
60418
  parent_conversation: detail.parent_conversation || detail.uuid
@@ -60427,7 +60432,7 @@ class DigipairFullElement extends r$3 {
60427
60432
  config: {
60428
60433
  VERSIONS: this.metadata.config.VERSIONS
60429
60434
  }
60430
- });
60435
+ }, 'boost.command');
60431
60436
  }
60432
60437
  } catch (error) {
60433
60438
  this.pushMessage({
package/index.esm2.js CHANGED
@@ -37732,14 +37732,14 @@ function indent(str, spaces) {
37732
37732
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
37733
37733
  // match is required
37734
37734
  if (!match) {
37735
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
37735
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
37736
37736
  v: nextMatch1
37737
37737
  };
37738
37738
  }
37739
37739
  var token = match.token, offset = match.offset;
37740
37740
  i1 += offset;
37741
37741
  if (token === " ") {
37742
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
37742
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
37743
37743
  }
37744
37744
  tokens1 = _to_consumable_array$c(tokens1).concat([
37745
37745
  token
@@ -37758,7 +37758,7 @@ function indent(str, spaces) {
37758
37758
  if (contextKeys.some(function(el) {
37759
37759
  return el.startsWith(name);
37760
37760
  })) {
37761
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
37761
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
37762
37762
  }
37763
37763
  if (dateTimeIdentifiers.some(function(el) {
37764
37764
  return el === name;
@@ -37777,9 +37777,9 @@ function indent(str, spaces) {
37777
37777
  if (dateTimeIdentifiers.some(function(el) {
37778
37778
  return el.startsWith(name);
37779
37779
  })) {
37780
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
37780
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
37781
37781
  }
37782
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
37782
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
37783
37783
  v: nextMatch1
37784
37784
  };
37785
37785
  };
@@ -41668,7 +41668,8 @@ var _globalInstance___DIGIPAIR_CONFIG__;
41668
41668
  const _config$1 = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__) != null ? _globalInstance___DIGIPAIR_CONFIG__ : {
41669
41669
  LIBRARIES: {},
41670
41670
  BASE_URL: 'https://cdn.jsdelivr.net/npm',
41671
- ALIAS: []
41671
+ ALIAS: [],
41672
+ LOGGER: (level, path, message, context, data)=>{}
41672
41673
  };
41673
41674
  const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
41674
41675
  const isPinsSettings = (value)=>{
@@ -41677,7 +41678,8 @@ const isPinsSettings = (value)=>{
41677
41678
  const config$1 = {
41678
41679
  set: (key, value)=>{
41679
41680
  _config$1[key] = key === 'LIBRARIES' && _config$1[key] ? _extends({}, _config$1[key], value) : value;
41680
- }
41681
+ },
41682
+ log: (level, path, message, context, data)=>_config$1.LOGGER(level, path, message, context, data)
41681
41683
  };
41682
41684
  const applyTemplate = (value, context)=>{
41683
41685
  let result = value;
@@ -41714,6 +41716,7 @@ const applyTemplate = (value, context)=>{
41714
41716
  };
41715
41717
  const executePins = async (settingsOrigin, context = {})=>{
41716
41718
  var _settings_conditions, _settings_conditions1;
41719
+ _config$1.LOGGER('INFO', context.__PATH__, 'execute:start', context);
41717
41720
  let settings = preparePinsSettings(settingsOrigin, context);
41718
41721
  const alias = _config$1.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
41719
41722
  const config = context.config || {};
@@ -41761,6 +41764,7 @@ const executePins = async (settingsOrigin, context = {})=>{
41761
41764
  }
41762
41765
  results.push(itemResult);
41763
41766
  }
41767
+ _config$1.LOGGER('INFO', context.__PATH__, 'execute:end', context, results);
41764
41768
  return results;
41765
41769
  }
41766
41770
  if (typeof ((_settings_conditions1 = settings.conditions) == null ? void 0 : _settings_conditions1.if) !== 'undefined' && !settings.conditions.if) {
@@ -41773,7 +41777,7 @@ const executePins = async (settingsOrigin, context = {})=>{
41773
41777
  }
41774
41778
  return await pins(settings.properties, settings.pins, context);
41775
41779
  };
41776
- const executePinsList = async (pinsSettingsList, context)=>{
41780
+ const executePinsList = async (pinsSettingsList, context, path = 'root')=>{
41777
41781
  let previous = {};
41778
41782
  for(let i = 0; i < pinsSettingsList.length; i++){
41779
41783
  const settings = pinsSettingsList[i];
@@ -41783,7 +41787,8 @@ const executePinsList = async (pinsSettingsList, context)=>{
41783
41787
  parent: {
41784
41788
  previous: context.previous,
41785
41789
  parent: context.parent
41786
- }
41790
+ },
41791
+ __PATH__: `${path}[${i}]`
41787
41792
  }));
41788
41793
  } catch (error) {
41789
41794
  if (error === 'DIGIPAIR_CONDITIONS_IF_FALSE') {
@@ -41853,7 +41858,7 @@ const generateElementFromPins = async (pinsSettings, parent, context, document =
41853
41858
  const event = _event;
41854
41859
  executePinsList(pinsList, _extends({}, context, {
41855
41860
  event: event.detail
41856
- }));
41861
+ }), `${context.__PATH__}.events[${key}]`);
41857
41862
  });
41858
41863
  });
41859
41864
  const pinsList = settings.pins || [];
@@ -59956,7 +59961,7 @@ class ChatbotElement extends r$3 {
59956
59961
  config: {
59957
59962
  VERSIONS: this.metadata.config.VERSIONS
59958
59963
  }
59959
- });
59964
+ }, 'boost');
59960
59965
  this.currentBoost = detail.boost ? _extends({
59961
59966
  parent_history: detail.uuid,
59962
59967
  parent_conversation: detail.parent_conversation || detail.uuid
@@ -59976,7 +59981,7 @@ class ChatbotElement extends r$3 {
59976
59981
  config: {
59977
59982
  VERSIONS: this.metadata.config.VERSIONS
59978
59983
  }
59979
- });
59984
+ }, 'boost.command');
59980
59985
  }
59981
59986
  } catch (error) {
59982
59987
  this.pushMessage({
@@ -60387,7 +60392,7 @@ class DigipairFullElement extends r$3 {
60387
60392
  config: {
60388
60393
  VERSIONS: this.metadata.config.VERSIONS
60389
60394
  }
60390
- });
60395
+ }, 'boost');
60391
60396
  this.currentBoost = detail.boost ? _extends({
60392
60397
  parent_history: detail.uuid,
60393
60398
  parent_conversation: detail.parent_conversation || detail.uuid
@@ -60407,7 +60412,7 @@ class DigipairFullElement extends r$3 {
60407
60412
  config: {
60408
60413
  VERSIONS: this.metadata.config.VERSIONS
60409
60414
  }
60410
- });
60415
+ }, 'boost.command');
60411
60416
  }
60412
60417
  } catch (error) {
60413
60418
  this.pushMessage({
@@ -2,9 +2,10 @@ import { PinsSettings } from './pins-settings.interface';
2
2
  type CONFIG_KEY = 'BASE_URL' | 'LIBRARIES' | 'ALIAS';
3
3
  export declare const config: {
4
4
  set: (key: CONFIG_KEY, value: any) => void;
5
+ log: (level: string, path: string, message: string, context: any, data?: any) => any;
5
6
  };
6
7
  export declare const applyTemplate: (value: any, context: any) => any;
7
- export declare const executePinsList: (pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
8
+ export declare const executePinsList: (pinsSettingsList: PinsSettings[], context: any, path?: string) => Promise<any>;
8
9
  export declare const generateElementFromPins: (pinsSettings: PinsSettings, parent: Element, context: any, document?: Document, options?: {
9
10
  import: boolean;
10
11
  }) => Promise<Element | void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-chatbot",
3
- "version": "0.70.4",
3
+ "version": "0.71.1",
4
4
  "keywords": [
5
5
  "digipair",
6
6
  "web"