@topconsultnpm/sdk-ts 6.21.0-dev2.6 → 6.21.0-dev2.7

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}`;
@@ -121,9 +121,12 @@ export declare class TSACacheService {
121
121
  export declare class UserListCacheService {
122
122
  private static _mutex;
123
123
  private static _cache;
124
+ private static _cacheAdmin;
124
125
  static GetAllAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<UserDescriptor[]>;
125
126
  static GetAsync(userId: number | undefined, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<UserDescriptor | undefined>;
127
+ static GetAllAdminAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<UserDescriptor[]>;
126
128
  static RemoveAll(tmSession?: ITopMediaSession | undefined): void;
129
+ static RemoveAllAdmin(tmSession?: ITopMediaSession | undefined): void;
127
130
  }
128
131
  export declare class LayoutCacheService {
129
132
  private static readonly _mutex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdk-ts",
3
- "version": "6.21.0-dev2.6",
3
+ "version": "6.21.0-dev2.7",
4
4
  "description": "TopMedia SDK typescript",
5
5
  "main": "dist/lib/index.js",
6
6
  "types": "dist/types/index.d.ts",