@digipair/skill-keycloak 0.8.4 → 0.8.5

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 (3) hide show
  1. package/index.cjs.js +14 -11
  2. package/index.esm.js +14 -11
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -23522,14 +23522,14 @@ function indent(str, spaces) {
23522
23522
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23523
23523
  // match is required
23524
23524
  if (!match) {
23525
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23525
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23526
23526
  v: nextMatch1
23527
23527
  };
23528
23528
  }
23529
23529
  var token = match.token, offset = match.offset;
23530
23530
  i1 += offset;
23531
23531
  if (token === " ") {
23532
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23532
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23533
23533
  }
23534
23534
  tokens1 = _to_consumable_array$3(tokens1).concat([
23535
23535
  token
@@ -23548,7 +23548,7 @@ function indent(str, spaces) {
23548
23548
  if (contextKeys.some(function(el) {
23549
23549
  return el.startsWith(name);
23550
23550
  })) {
23551
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23551
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23552
23552
  }
23553
23553
  if (dateTimeIdentifiers.some(function(el) {
23554
23554
  return el === name;
@@ -23567,9 +23567,9 @@ function indent(str, spaces) {
23567
23567
  if (dateTimeIdentifiers.some(function(el) {
23568
23568
  return el.startsWith(name);
23569
23569
  })) {
23570
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23570
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23571
23571
  }
23572
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23572
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23573
23573
  v: nextMatch1
23574
23574
  };
23575
23575
  };
@@ -33879,6 +33879,10 @@ let KeycloakService = class KeycloakService {
33879
33879
  });
33880
33880
  return decodedtoken;
33881
33881
  }
33882
+ async prepareBrowserPinsSettings(name, pinsSettings) {
33883
+ const preparedPinsSettings = pinsSettings.map((item, index)=>this.filteredWebPinsSettings(item, `${name}[${index}]`));
33884
+ return preparedPinsSettings;
33885
+ }
33882
33886
  async page(params, _pinsSettingsList, context) {
33883
33887
  var _context_request_body;
33884
33888
  const { body, title = 'Digipair', favicon = 'https://www.digipair.ai/assets/images/favicon.ico', styleHtml = '', styleBody = '', baseUrl = 'https://cdn.jsdelivr.net/npm', url = context.privates.KEYCLOAK_URL, realm = context.privates.KEYCLOAK_REALM, clientId = context.privates.KEYCLOAK_CLIENTID, libraries = {}, factoryInitialize = [], browserInitialize = [], browserLoad = [], logged = [], unlogged = [] } = params;
@@ -33905,7 +33909,6 @@ let KeycloakService = class KeycloakService {
33905
33909
  return await executePinsList(pinsSettingsList, _extends({}, context.request.body.context, context));
33906
33910
  }
33907
33911
  await executePinsList(factoryInitialize, context);
33908
- const preparedBody = body.map((item, index)=>this.filteredWebPinsSettings(item, `body[${index}]`));
33909
33912
  const html = `
33910
33913
  <!DOCTYPE html>
33911
33914
  <html style="${styleHtml}">
@@ -33957,25 +33960,25 @@ let KeycloakService = class KeycloakService {
33957
33960
  };
33958
33961
 
33959
33962
  if (keycloakService.isLogged) {
33960
- await executePinsList(${JSON.stringify(logged)}, context);
33963
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('logged', logged))}, context);
33961
33964
  } else {
33962
- await executePinsList(${JSON.stringify(unlogged)}, context);
33965
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('unlogged', unlogged))}, context);
33963
33966
  }
33964
33967
 
33965
33968
  // Pins initialization
33966
- await executePinsList(${JSON.stringify(browserInitialize)}, context);
33969
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context);
33967
33970
 
33968
33971
  const options = {
33969
33972
  libraries: {},
33970
33973
  };
33971
- const pinsList = ${JSON.stringify(preparedBody)};
33974
+ const pinsList = ${JSON.stringify(this.prepareBrowserPinsSettings('body', body))};
33972
33975
  for (let i = 0; i < pinsList.length; i++) {
33973
33976
  const item = pinsList[i];
33974
33977
  await generateElementFromPins(item, document.body, { ...context, data: ${JSON.stringify(preparedData)} }, options);
33975
33978
  }
33976
33979
 
33977
33980
  setTimeout(async () => {
33978
- await executePinsList(${JSON.stringify(browserLoad)}, context);
33981
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context);
33979
33982
  }, 1);
33980
33983
  </script>
33981
33984
  </body>
package/index.esm.js CHANGED
@@ -23493,14 +23493,14 @@ function indent(str, spaces) {
23493
23493
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23494
23494
  // match is required
23495
23495
  if (!match) {
23496
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23496
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23497
23497
  v: nextMatch1
23498
23498
  };
23499
23499
  }
23500
23500
  var token = match.token, offset = match.offset;
23501
23501
  i1 += offset;
23502
23502
  if (token === " ") {
23503
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23503
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23504
23504
  }
23505
23505
  tokens1 = _to_consumable_array$3(tokens1).concat([
23506
23506
  token
@@ -23519,7 +23519,7 @@ function indent(str, spaces) {
23519
23519
  if (contextKeys.some(function(el) {
23520
23520
  return el.startsWith(name);
23521
23521
  })) {
23522
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23522
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23523
23523
  }
23524
23524
  if (dateTimeIdentifiers.some(function(el) {
23525
23525
  return el === name;
@@ -23538,9 +23538,9 @@ function indent(str, spaces) {
23538
23538
  if (dateTimeIdentifiers.some(function(el) {
23539
23539
  return el.startsWith(name);
23540
23540
  })) {
23541
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, "continue";
23541
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23542
23542
  }
23543
- return i = i1, nextMatch = nextMatch1, tokens = tokens1, {
23543
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23544
23544
  v: nextMatch1
23545
23545
  };
23546
23546
  };
@@ -33850,6 +33850,10 @@ let KeycloakService = class KeycloakService {
33850
33850
  });
33851
33851
  return decodedtoken;
33852
33852
  }
33853
+ async prepareBrowserPinsSettings(name, pinsSettings) {
33854
+ const preparedPinsSettings = pinsSettings.map((item, index)=>this.filteredWebPinsSettings(item, `${name}[${index}]`));
33855
+ return preparedPinsSettings;
33856
+ }
33853
33857
  async page(params, _pinsSettingsList, context) {
33854
33858
  var _context_request_body;
33855
33859
  const { body, title = 'Digipair', favicon = 'https://www.digipair.ai/assets/images/favicon.ico', styleHtml = '', styleBody = '', baseUrl = 'https://cdn.jsdelivr.net/npm', url = context.privates.KEYCLOAK_URL, realm = context.privates.KEYCLOAK_REALM, clientId = context.privates.KEYCLOAK_CLIENTID, libraries = {}, factoryInitialize = [], browserInitialize = [], browserLoad = [], logged = [], unlogged = [] } = params;
@@ -33876,7 +33880,6 @@ let KeycloakService = class KeycloakService {
33876
33880
  return await executePinsList(pinsSettingsList, _extends({}, context.request.body.context, context));
33877
33881
  }
33878
33882
  await executePinsList(factoryInitialize, context);
33879
- const preparedBody = body.map((item, index)=>this.filteredWebPinsSettings(item, `body[${index}]`));
33880
33883
  const html = `
33881
33884
  <!DOCTYPE html>
33882
33885
  <html style="${styleHtml}">
@@ -33928,25 +33931,25 @@ let KeycloakService = class KeycloakService {
33928
33931
  };
33929
33932
 
33930
33933
  if (keycloakService.isLogged) {
33931
- await executePinsList(${JSON.stringify(logged)}, context);
33934
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('logged', logged))}, context);
33932
33935
  } else {
33933
- await executePinsList(${JSON.stringify(unlogged)}, context);
33936
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('unlogged', unlogged))}, context);
33934
33937
  }
33935
33938
 
33936
33939
  // Pins initialization
33937
- await executePinsList(${JSON.stringify(browserInitialize)}, context);
33940
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context);
33938
33941
 
33939
33942
  const options = {
33940
33943
  libraries: {},
33941
33944
  };
33942
- const pinsList = ${JSON.stringify(preparedBody)};
33945
+ const pinsList = ${JSON.stringify(this.prepareBrowserPinsSettings('body', body))};
33943
33946
  for (let i = 0; i < pinsList.length; i++) {
33944
33947
  const item = pinsList[i];
33945
33948
  await generateElementFromPins(item, document.body, { ...context, data: ${JSON.stringify(preparedData)} }, options);
33946
33949
  }
33947
33950
 
33948
33951
  setTimeout(async () => {
33949
- await executePinsList(${JSON.stringify(browserLoad)}, context);
33952
+ await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context);
33950
33953
  }, 1);
33951
33954
  </script>
33952
33955
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-keycloak",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"