agilebuilder-ui 1.0.2 → 1.0.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.
package/lib/super-ui.js CHANGED
@@ -5332,10 +5332,15 @@ function init(e, t) {
5332
5332
  );
5333
5333
  }
5334
5334
  var api = init(defaultConverter, { path: "/" });
5335
- const jwtKey = "JWT", currentUserNameKey = "USERNAME", currentUserInfoKey = "CURRENT_USER", currentSystemUrlKey = "CURRENT_SYSTEM_URL_", langKey = "CURRENT_LANGUAGE", allLangKey = "AMB_LANG_INFO", versionEnv = "VERSION_ENVIRONMENT", userVersion = "CURRENT_USER_SYSTEM_VERSION";
5335
+ const jwtKey = "JWT", currentUserNameKey = "USERNAME", currentUserInfoKey = "CURRENT_USER", currentSystemUrlKey = "CURRENT_SYSTEM_URL_", langKey = "CURRENT_LANGUAGE", allLangKey = "AMB_LANG_INFO", versionEnv = "VERSION_ENVIRONMENT", userVersion = "CURRENT_USER_SYSTEM_VERSION", runDevpJwtKey = "_runDevpJWT";
5336
5336
  function getToken$1() {
5337
- let t = getSessionCache("_runDevpJWT");
5338
- return t || (t = getMyToken()), t;
5337
+ let e = isDevpSystem(), t;
5338
+ return e ? t = getMyToken() : (t = getSessionCache(runDevpJwtKey), t || (t = getMyToken())), t;
5339
+ }
5340
+ function isDevpSystem() {
5341
+ let e = !1;
5342
+ const t = window.$vueApp.config.globalProperties.systemCode;
5343
+ return t && t === "devp" && (e = !0), e;
5339
5344
  }
5340
5345
  function getMyToken() {
5341
5346
  let e = getCookieCache(jwtKey);
@@ -5348,21 +5353,19 @@ function removeToken() {
5348
5353
  removeCookieCache(jwtKey), removeSessionCache(jwtKey);
5349
5354
  }
5350
5355
  function getUsername() {
5351
- let t = getSessionCache("_runDevpJWT"), n = currentUserNameKey;
5352
- t && (n = "_run_" + n);
5353
- let a = getCookieCache(n);
5354
- return a || (a = getSessionCache(n)), a;
5356
+ let e = getRunInfoKey(currentUserNameKey), t = getCookieCache(e);
5357
+ return t || (t = getSessionCache(e)), t;
5355
5358
  }
5356
5359
  function setUsername(e) {
5357
- let n = getSessionCache("_runDevpJWT"), a = currentUserNameKey;
5358
- n && (a = "_run_" + a), setSessionCache(a, e), setCookieCache(a, e);
5360
+ let t = getRunInfoKey(currentUserNameKey);
5361
+ setSessionCache(t, e), setCookieCache(t, e);
5359
5362
  }
5360
5363
  function removeUsername() {
5361
5364
  removeSessionCache(currentUserNameKey), removeCookieCache(currentUserNameKey);
5362
5365
  }
5363
5366
  function getCurrentUser() {
5364
- let t = getSessionCache("_runDevpJWT"), n = currentUserInfoKey;
5365
- return t && (n = "_run_" + n), getCurrentUserByKey(n);
5367
+ const e = getRunInfoKey(currentUserInfoKey);
5368
+ return getCurrentUserByKey(e);
5366
5369
  }
5367
5370
  function getCurrentUserByKey(e) {
5368
5371
  let t = getCookieCache(e);
@@ -5370,13 +5373,17 @@ function getCurrentUserByKey(e) {
5370
5373
  return JSON.parse(t);
5371
5374
  }
5372
5375
  function setCurrentUser(e) {
5373
- let n = getSessionCache("_runDevpJWT"), a = currentUserInfoKey;
5374
- if (n && (a = "_run_" + a), e) {
5376
+ const t = getRunInfoKey(currentUserInfoKey);
5377
+ if (e) {
5375
5378
  e.password && (e.password = null);
5376
- const i = JSON.stringify(e);
5377
- setSessionCache(a, i), setCookieCache(a, i);
5379
+ const n = JSON.stringify(e);
5380
+ setSessionCache(t, n), setCookieCache(t, n);
5378
5381
  }
5379
5382
  }
5383
+ function getRunInfoKey(e) {
5384
+ let t = e;
5385
+ return isDevpSystem() || getSessionCache(runDevpJwtKey) && (t = "_run_" + t), t;
5386
+ }
5380
5387
  function removeCurrentUser() {
5381
5388
  removeSessionCache(currentUserInfoKey), removeCookieCache(currentUserInfoKey);
5382
5389
  }
@@ -5474,7 +5481,9 @@ const authApi = {
5474
5481
  getAllLanguages: getAllLanguages$1,
5475
5482
  setAllLanguages,
5476
5483
  removeAllLanguages,
5477
- removePublishControl
5484
+ removePublishControl,
5485
+ isDevpSystem,
5486
+ getRunInfoKey
5478
5487
  };
5479
5488
  function getToken() {
5480
5489
  return authApi.getToken();