lf-pagebuilder-vue 0.0.121 → 0.0.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/atenea.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={production:"https://atenea.lefebvre.es",development:"https://led-dev-atenea-dev.eu.els.local"};function E(a){try{const n=a.split(".");if(n.length===3){const o=JSON.parse(atob(n[1].replace(/-/g,"+").replace(/_/g,"/")));if(o.exp)return o.exp}}catch{}return Math.floor(Date.now()/1e3)+3600}async function l(a){const{username:n,apiKey:o,isProduction:p=!1,ateneaApiUrl:c}=a;if(!n||!o)throw new Error("[Atenea] username y apiKey son requeridos para obtener token");const A=c||(p?s.production:s.development),r=await fetch(`${A}/api/tokenBundle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:n,apikey:o})});if(!r.ok){const e=await r.text();throw new Error(`[Atenea] Error obteniendo token: ${r.status} - ${e}`)}const i=await r.text();let t;try{const e=JSON.parse(i);t=typeof e=="string"?e:e.result??e.token??e}catch{t=i.trim()}if(!t||typeof t!="string")throw new Error("[Atenea] La respuesta no contiene token válido");return{token:t,expiresAt:E(t)}}const d={USERNAME:"ATENEA_USERNAME",APIKEY:"ATENEA_APIKEY"};exports.ATENEA_API_URLS=s;exports.ATENEA_ENV_VARS=d;exports.fetchAteneaToken=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={production:"https://atenea.lefebvre.es",development:"https://led-dev-atenea-dev.eu.els.local"};function l(a){try{const n=a.split(".");if(n.length===3){const o=JSON.parse(atob(n[1].replace(/-/g,"+").replace(/_/g,"/")));if(o.exp)return o.exp}}catch{}return Math.floor(Date.now()/1e3)+3600}async function E(a){const{username:n,apiKey:o,isProduction:p=!1,ateneaApiUrl:c}=a;if(!n||!o)throw new Error("[Atenea] username y apiKey son requeridos para obtener token");const A=c||(p?s.production:s.development),r=await fetch(`${A}/api/tokenBundle`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:n,apikey:o})});if(!r.ok){const e=await r.text();throw new Error(`[Atenea] Error obteniendo token: ${r.status} - ${e}`)}const i=await r.text();let t;try{const e=JSON.parse(i);t=typeof e=="string"?e:e.result??e.token??e.sResultado??e}catch{t=i.trim()}if(!t||typeof t!="string")throw new Error("[Atenea] La respuesta no contiene token válido");return{token:t,expiresAt:l(t)}}const d={USERNAME:"ATENEA_USERNAME",APIKEY:"ATENEA_APIKEY"};exports.ATENEA_API_URLS=s;exports.ATENEA_ENV_VARS=d;exports.fetchAteneaToken=E;
package/dist/atenea.js CHANGED
@@ -34,7 +34,7 @@ async function E(a) {
34
34
  let t;
35
35
  try {
36
36
  const e = JSON.parse(s);
37
- t = typeof e == "string" ? e : e.result ?? e.token ?? e;
37
+ t = typeof e == "string" ? e : e.result ?? e.token ?? e.sResultado ?? e;
38
38
  } catch {
39
39
  t = s.trim();
40
40
  }