@topconsultnpm/sdk-ts 6.21.0-dev2.6 → 6.21.0-dev2.8
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.
|
@@ -988,6 +988,28 @@ export class UserListCacheService {
|
|
|
988
988
|
return ud;
|
|
989
989
|
});
|
|
990
990
|
}
|
|
991
|
+
static GetAllAdminAsync() {
|
|
992
|
+
return __awaiter(this, arguments, void 0, function* (tmSession = undefined, deepCopy = false) {
|
|
993
|
+
var _a;
|
|
994
|
+
const release = yield this._mutex.acquire();
|
|
995
|
+
try {
|
|
996
|
+
let tms = tmSession !== null && tmSession !== void 0 ? tmSession : SDK_Globals.tmSession;
|
|
997
|
+
let accessToken = (_a = tms === null || tms === void 0 ? void 0 : tms.SessionDescr) === null || _a === void 0 ? void 0 : _a.accessToken;
|
|
998
|
+
let users = this._cacheAdmin.get(accessToken);
|
|
999
|
+
if (!users) {
|
|
1000
|
+
users = yield (tms === null || tms === void 0 ? void 0 : tms.NewUserEngine().RetrieveAllAdminAsync(true));
|
|
1001
|
+
if (!users)
|
|
1002
|
+
users = [];
|
|
1003
|
+
this.RemoveAllAdmin(tmSession);
|
|
1004
|
+
this._cacheAdmin.set(accessToken, users);
|
|
1005
|
+
}
|
|
1006
|
+
return deepCopy ? users.map(u => { let d = new UserDescriptor(); d.init(Object.assign({}, u)); return d; }) : users;
|
|
1007
|
+
}
|
|
1008
|
+
finally {
|
|
1009
|
+
release();
|
|
1010
|
+
}
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
991
1013
|
static RemoveAll(tmSession = undefined) {
|
|
992
1014
|
var _a;
|
|
993
1015
|
let tms = tmSession !== null && tmSession !== void 0 ? tmSession : SDK_Globals.tmSession;
|
|
@@ -995,9 +1017,17 @@ export class UserListCacheService {
|
|
|
995
1017
|
if (this._cache.has(accessToken))
|
|
996
1018
|
this._cache.delete(accessToken);
|
|
997
1019
|
}
|
|
1020
|
+
static RemoveAllAdmin(tmSession = undefined) {
|
|
1021
|
+
var _a;
|
|
1022
|
+
let tms = tmSession !== null && tmSession !== void 0 ? tmSession : SDK_Globals.tmSession;
|
|
1023
|
+
let accessToken = (_a = tms === null || tms === void 0 ? void 0 : tms.SessionDescr) === null || _a === void 0 ? void 0 : _a.accessToken;
|
|
1024
|
+
if (this._cacheAdmin.has(accessToken))
|
|
1025
|
+
this._cacheAdmin.delete(accessToken);
|
|
1026
|
+
}
|
|
998
1027
|
}
|
|
999
1028
|
UserListCacheService._mutex = new Mutex();
|
|
1000
1029
|
UserListCacheService._cache = new Map();
|
|
1030
|
+
UserListCacheService._cacheAdmin = new Map();
|
|
1001
1031
|
export class LayoutCacheService {
|
|
1002
1032
|
static getCacheKey(TID, layoutMode) {
|
|
1003
1033
|
return `${TID}_${layoutMode}`;
|