@digipair/skill-keycloak 0.70.4 → 0.71.2

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.cjs.js CHANGED
@@ -16615,12 +16615,12 @@ let KeycloakService = class KeycloakService {
16615
16615
  if ((typeof ((_pinsSettings_properties1 = pinsSettings.properties) == null ? void 0 : _pinsSettings_properties1['secured']) === 'undefined' || ((_pinsSettings_properties2 = pinsSettings.properties) == null ? void 0 : _pinsSettings_properties2['secured'])) && !context.keycloak.decodedToken) {
16616
16616
  throw new Error('Unauthorized');
16617
16617
  }
16618
- return JSON.stringify(await engine.executePinsList(pinsSettingsList, this.mergeConttext(context.request.body.context, context)));
16618
+ return JSON.stringify(await engine.executePinsList(pinsSettingsList, this.mergeConttext(context.request.body.context, context), `${context.request.body.params.path}.execute`));
16619
16619
  }
16620
16620
  const path = context.protected.req.path.replace(/\/$/g, '');
16621
16621
  var _context_request_headers_xforwardedproto;
16622
16622
  const baseUrl = ((_context_request_headers_xforwardedproto = context.request.headers['x-forwarded-proto']) != null ? _context_request_headers_xforwardedproto : context.protected.req.protocol) + '://' + context.request.headers.host + (context.request.params.length <= 0 || context.request.params[0] === '' ? path : path.substring(0, path.length - context.request.params.join('/').length - 1)) + '/__digipair_www__';
16623
- await engine.executePinsList(factoryInitialize, context);
16623
+ await engine.executePinsList(factoryInitialize, context, `${context.__PATH__}.factoryInitialize`);
16624
16624
  const html = `
16625
16625
  <!DOCTYPE html>
16626
16626
  <html style="${styleHtml}">
@@ -16693,16 +16693,17 @@ let KeycloakService = class KeycloakService {
16693
16693
  variables: ${JSON.stringify(context.variables || {})},
16694
16694
  request: ${JSON.stringify(context.request || {})},
16695
16695
  keycloak: { isLogged: keycloakService.isLogged },
16696
+ __PATH__: '${context.__PATH__}',
16696
16697
  };
16697
16698
 
16698
16699
  if (keycloakService.isLogged) {
16699
- await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('logged', logged))}, context);
16700
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('logged', logged))}, context, context.__PATH__ + '.logged');
16700
16701
  } else {
16701
- await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('unlogged', unlogged))}, context);
16702
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('unlogged', unlogged))}, context, context.__PATH__ + '.unlogged');
16702
16703
  }
16703
16704
 
16704
16705
  // Pins initialization
16705
- await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context);
16706
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context, context.__PATH__ + '.browserInitialize');
16706
16707
 
16707
16708
  const pinsList = ${JSON.stringify(this.prepareBrowserPinsSettings('body', body))};
16708
16709
  document.querySelectorAll('body > [data-digipair-pins]').forEach((element) => element.remove()); // Remove SSR elements
@@ -16712,7 +16713,7 @@ let KeycloakService = class KeycloakService {
16712
16713
  }
16713
16714
 
16714
16715
  setTimeout(async () => {
16715
- await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context);
16716
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context, context.__PATH__ + '.browserLoad');
16716
16717
  }, 1);
16717
16718
 
16718
16719
  window.addEventListener('beforeunload', (event) => {
@@ -16749,7 +16750,7 @@ let KeycloakService = class KeycloakService {
16749
16750
  if (secured && !context.keycloak.decodedToken) {
16750
16751
  throw new Error('Unauthorized');
16751
16752
  }
16752
- return await engine.executePinsList(execute, context);
16753
+ return await engine.executePinsList(execute, context, `${context.__PATH__}.execute`);
16753
16754
  }
16754
16755
  async boost(params, _pinsSettingsList, context) {
16755
16756
  var _context_request_headers_authorization, _steps_step;
@@ -16780,7 +16781,7 @@ let KeycloakService = class KeycloakService {
16780
16781
  boost: {
16781
16782
  steps
16782
16783
  }
16783
- }));
16784
+ }), `${context.__PATH__}.execute`);
16784
16785
  return result;
16785
16786
  }
16786
16787
  constructor(){
package/index.esm.js CHANGED
@@ -23907,14 +23907,14 @@ function indent(str, spaces) {
23907
23907
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23908
23908
  // match is required
23909
23909
  if (!match) {
23910
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
23910
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23911
23911
  v: nextMatch1
23912
23912
  };
23913
23913
  }
23914
23914
  var token = match.token, offset = match.offset;
23915
23915
  i1 += offset;
23916
23916
  if (token === " ") {
23917
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23917
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23918
23918
  }
23919
23919
  tokens1 = _to_consumable_array$3(tokens1).concat([
23920
23920
  token
@@ -23933,7 +23933,7 @@ function indent(str, spaces) {
23933
23933
  if (contextKeys.some(function(el) {
23934
23934
  return el.startsWith(name);
23935
23935
  })) {
23936
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23936
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23937
23937
  }
23938
23938
  if (dateTimeIdentifiers.some(function(el) {
23939
23939
  return el === name;
@@ -23952,9 +23952,9 @@ function indent(str, spaces) {
23952
23952
  if (dateTimeIdentifiers.some(function(el) {
23953
23953
  return el.startsWith(name);
23954
23954
  })) {
23955
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, "continue";
23955
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23956
23956
  }
23957
- return nextMatch = nextMatch1, tokens = tokens1, i = i1, {
23957
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23958
23958
  v: nextMatch1
23959
23959
  };
23960
23960
  };
@@ -27843,7 +27843,8 @@ var _globalInstance___DIGIPAIR_CONFIG__;
27843
27843
  const _config = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__) != null ? _globalInstance___DIGIPAIR_CONFIG__ : {
27844
27844
  LIBRARIES: {},
27845
27845
  BASE_URL: 'https://cdn.jsdelivr.net/npm',
27846
- ALIAS: []
27846
+ ALIAS: [],
27847
+ LOGGER: (level, path, message, context, data)=>{}
27847
27848
  };
27848
27849
  const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
27849
27850
  const isPinsSettings = (value)=>{
@@ -27884,6 +27885,7 @@ const applyTemplate = (value, context)=>{
27884
27885
  };
27885
27886
  const executePins = async (settingsOrigin, context = {})=>{
27886
27887
  var _settings_conditions, _settings_conditions1;
27888
+ _config.LOGGER('INFO', context.__PATH__, 'execute:start', context);
27887
27889
  let settings = preparePinsSettings(settingsOrigin, context);
27888
27890
  const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
27889
27891
  const config = context.config || {};
@@ -27931,6 +27933,7 @@ const executePins = async (settingsOrigin, context = {})=>{
27931
27933
  }
27932
27934
  results.push(itemResult);
27933
27935
  }
27936
+ _config.LOGGER('INFO', context.__PATH__, 'execute:end', context, results);
27934
27937
  return results;
27935
27938
  }
27936
27939
  if (typeof ((_settings_conditions1 = settings.conditions) == null ? void 0 : _settings_conditions1.if) !== 'undefined' && !settings.conditions.if) {
@@ -27943,7 +27946,7 @@ const executePins = async (settingsOrigin, context = {})=>{
27943
27946
  }
27944
27947
  return await pins(settings.properties, settings.pins, context);
27945
27948
  };
27946
- const executePinsList = async (pinsSettingsList, context)=>{
27949
+ const executePinsList = async (pinsSettingsList, context, path = 'root')=>{
27947
27950
  let previous = {};
27948
27951
  for(let i = 0; i < pinsSettingsList.length; i++){
27949
27952
  const settings = pinsSettingsList[i];
@@ -27953,7 +27956,8 @@ const executePinsList = async (pinsSettingsList, context)=>{
27953
27956
  parent: {
27954
27957
  previous: context.previous,
27955
27958
  parent: context.parent
27956
- }
27959
+ },
27960
+ __PATH__: `${path}[${i}]`
27957
27961
  }));
27958
27962
  } catch (error) {
27959
27963
  if (error === 'DIGIPAIR_CONDITIONS_IF_FALSE') {
@@ -28023,7 +28027,7 @@ const generateElementFromPins = async (pinsSettings, parent, context, document =
28023
28027
  const event = _event;
28024
28028
  executePinsList(pinsList, _extends({}, context, {
28025
28029
  event: event.detail
28026
- }));
28030
+ }), `${context.__PATH__}.events[${key}]`);
28027
28031
  });
28028
28032
  });
28029
28033
  const pinsList = settings.pins || [];
@@ -44642,12 +44646,12 @@ let KeycloakService = class KeycloakService {
44642
44646
  if ((typeof ((_pinsSettings_properties1 = pinsSettings.properties) == null ? void 0 : _pinsSettings_properties1['secured']) === 'undefined' || ((_pinsSettings_properties2 = pinsSettings.properties) == null ? void 0 : _pinsSettings_properties2['secured'])) && !context.keycloak.decodedToken) {
44643
44647
  throw new Error('Unauthorized');
44644
44648
  }
44645
- return JSON.stringify(await executePinsList(pinsSettingsList, this.mergeConttext(context.request.body.context, context)));
44649
+ return JSON.stringify(await executePinsList(pinsSettingsList, this.mergeConttext(context.request.body.context, context), `${context.request.body.params.path}.execute`));
44646
44650
  }
44647
44651
  const path = context.protected.req.path.replace(/\/$/g, '');
44648
44652
  var _context_request_headers_xforwardedproto;
44649
44653
  const baseUrl = ((_context_request_headers_xforwardedproto = context.request.headers['x-forwarded-proto']) != null ? _context_request_headers_xforwardedproto : context.protected.req.protocol) + '://' + context.request.headers.host + (context.request.params.length <= 0 || context.request.params[0] === '' ? path : path.substring(0, path.length - context.request.params.join('/').length - 1)) + '/__digipair_www__';
44650
- await executePinsList(factoryInitialize, context);
44654
+ await executePinsList(factoryInitialize, context, `${context.__PATH__}.factoryInitialize`);
44651
44655
  const html = `
44652
44656
  <!DOCTYPE html>
44653
44657
  <html style="${styleHtml}">
@@ -44720,16 +44724,17 @@ let KeycloakService = class KeycloakService {
44720
44724
  variables: ${JSON.stringify(context.variables || {})},
44721
44725
  request: ${JSON.stringify(context.request || {})},
44722
44726
  keycloak: { isLogged: keycloakService.isLogged },
44727
+ __PATH__: '${context.__PATH__}',
44723
44728
  };
44724
44729
 
44725
44730
  if (keycloakService.isLogged) {
44726
- await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('logged', logged))}, context);
44731
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('logged', logged))}, context, context.__PATH__ + '.logged');
44727
44732
  } else {
44728
- await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('unlogged', unlogged))}, context);
44733
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('unlogged', unlogged))}, context, context.__PATH__ + '.unlogged');
44729
44734
  }
44730
44735
 
44731
44736
  // Pins initialization
44732
- await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context);
44737
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context, context.__PATH__ + '.browserInitialize');
44733
44738
 
44734
44739
  const pinsList = ${JSON.stringify(this.prepareBrowserPinsSettings('body', body))};
44735
44740
  document.querySelectorAll('body > [data-digipair-pins]').forEach((element) => element.remove()); // Remove SSR elements
@@ -44739,7 +44744,7 @@ let KeycloakService = class KeycloakService {
44739
44744
  }
44740
44745
 
44741
44746
  setTimeout(async () => {
44742
- await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context);
44747
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context, context.__PATH__ + '.browserLoad');
44743
44748
  }, 1);
44744
44749
 
44745
44750
  window.addEventListener('beforeunload', (event) => {
@@ -44776,7 +44781,7 @@ let KeycloakService = class KeycloakService {
44776
44781
  if (secured && !context.keycloak.decodedToken) {
44777
44782
  throw new Error('Unauthorized');
44778
44783
  }
44779
- return await executePinsList(execute, context);
44784
+ return await executePinsList(execute, context, `${context.__PATH__}.execute`);
44780
44785
  }
44781
44786
  async boost(params, _pinsSettingsList, context) {
44782
44787
  var _context_request_headers_authorization, _steps_step;
@@ -44807,7 +44812,7 @@ let KeycloakService = class KeycloakService {
44807
44812
  boost: {
44808
44813
  steps
44809
44814
  }
44810
- }));
44815
+ }), `${context.__PATH__}.execute`);
44811
44816
  return result;
44812
44817
  }
44813
44818
  constructor(){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-keycloak",
3
- "version": "0.70.4",
3
+ "version": "0.71.2",
4
4
  "dependencies": {
5
5
  "jsdom": "^25.0.1"
6
6
  },