bruce-models 6.4.8 → 6.4.9

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.
@@ -11916,7 +11916,8 @@ var Account;
11916
11916
  if (!api) {
11917
11917
  api = ENVIRONMENT.Api().GetGuardianApi();
11918
11918
  }
11919
- const cache = api.GetCacheItem(GetCacheKey(id), reqParams);
11919
+ const cacheKey = GetCacheKey(api.GetSessionId(), id);
11920
+ const cache = api.GetCacheItem(cacheKey, reqParams);
11920
11921
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
11921
11922
  return cache.data;
11922
11923
  }
@@ -11940,7 +11941,7 @@ var Account;
11940
11941
  }
11941
11942
  }));
11942
11943
  api.SetCacheItem({
11943
- key: GetCacheKey(id),
11944
+ key: cacheKey,
11944
11945
  value: prom,
11945
11946
  req: reqParams
11946
11947
  });
@@ -11959,7 +11960,8 @@ var Account;
11959
11960
  if (!api) {
11960
11961
  api = ENVIRONMENT.Api().GetGuardianApi();
11961
11962
  }
11962
- const cache = api.GetCacheItem(GetCacheKey(subdomain), reqParams);
11963
+ const cacheKey = GetCacheKey(api.GetSessionId(), subdomain);
11964
+ const cache = api.GetCacheItem(cacheKey, reqParams);
11963
11965
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
11964
11966
  return cache.data;
11965
11967
  }
@@ -11983,7 +11985,7 @@ var Account;
11983
11985
  }
11984
11986
  }));
11985
11987
  api.SetCacheItem({
11986
- key: GetCacheKey(subdomain),
11988
+ key: cacheKey,
11987
11989
  value: prom,
11988
11990
  req: reqParams
11989
11991
  });
@@ -12002,7 +12004,8 @@ var Account;
12002
12004
  if (!api) {
12003
12005
  api = ENVIRONMENT.Api().GetGuardianApi();
12004
12006
  }
12005
- const cache = api.GetCacheItem(GetListCacheKey(api.GetSessionId(), owned), reqParams);
12007
+ const cacheKey = GetListCacheKey(api.GetSessionId(), userId, owned);
12008
+ const cache = api.GetCacheItem(cacheKey, reqParams);
12006
12009
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
12007
12010
  return cache.data;
12008
12011
  }
@@ -12028,7 +12031,7 @@ var Account;
12028
12031
  }
12029
12032
  }));
12030
12033
  api.SetCacheItem({
12031
- key: GetListCacheKey(api.GetSessionId(), owned),
12034
+ key: cacheKey,
12032
12035
  value: prom,
12033
12036
  req: reqParams
12034
12037
  });
@@ -12047,7 +12050,8 @@ var Account;
12047
12050
  if (!api) {
12048
12051
  api = ENVIRONMENT.Api().GetGuardianApi();
12049
12052
  }
12050
- const cache = api.GetCacheItem(GetCacheKey(id, appId), reqParams);
12053
+ const cacheKey = GetCacheKey(api.GetSessionId(), id, appId);
12054
+ const cache = api.GetCacheItem(cacheKey, reqParams);
12051
12055
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
12052
12056
  return cache.data;
12053
12057
  }
@@ -12066,7 +12070,7 @@ var Account;
12066
12070
  }
12067
12071
  }));
12068
12072
  api.SetCacheItem({
12069
- key: GetCacheKey(id, appId),
12073
+ key: cacheKey,
12070
12074
  value: prom,
12071
12075
  req: reqParams
12072
12076
  });
@@ -12087,7 +12091,7 @@ var Account;
12087
12091
  api = ENVIRONMENT.Api().GetGuardianApi();
12088
12092
  }
12089
12093
  const res = yield api.POST(`account/${id}/applicationSettings/${appId}?Override=${override ? "true" : "false"}`, data, reqParams);
12090
- api.Cache.RemoveByStartsWith(Api.ECacheKey.Account + Api.ECacheKey.Id + id);
12094
+ api.Cache.RemoveByContains(Api.ECacheKey.Account + Api.ECacheKey.Id + id);
12091
12095
  return {
12092
12096
  settings: res
12093
12097
  };
@@ -12120,7 +12124,7 @@ var Account;
12120
12124
  const resData = {
12121
12125
  account: res
12122
12126
  };
12123
- api.Cache.RemoveByStartsWith(GetListCacheKey(api.GetSessionId()));
12127
+ api.Cache.RemoveByContains(GetListCacheKey(api.GetSessionId()));
12124
12128
  return resData;
12125
12129
  });
12126
12130
  }
@@ -12153,15 +12157,19 @@ var Account;
12153
12157
  * const key = GetCacheKey(1);
12154
12158
  * api.Cache.Remove(key);
12155
12159
  * }
12160
+ * @param sessionId
12156
12161
  * @param accountId
12157
12162
  * @param appSettingsId
12158
12163
  * @returns
12159
12164
  */
12160
- function GetCacheKey(accountId, appSettingsId) {
12165
+ function GetCacheKey(sessionId, accountId, appSettingsId) {
12166
+ if (!sessionId) {
12167
+ sessionId = "anonymous";
12168
+ }
12161
12169
  if (appSettingsId) {
12162
- return Api.ECacheKey.Account + Api.ECacheKey.Id + accountId + Api.ECacheKey + appSettingsId;
12170
+ return Api.ECacheKey.Account + Api.ECacheKey.Id + accountId + Api.ECacheKey + appSettingsId + Api.ECacheKey.Session + Api.ECacheKey.Id + sessionId;
12163
12171
  }
12164
- return Api.ECacheKey.Account + Api.ECacheKey.Id + accountId;
12172
+ return Api.ECacheKey.Account + Api.ECacheKey.Id + accountId + Api.ECacheKey.Session + Api.ECacheKey.Id + sessionId;
12165
12173
  }
12166
12174
  Account.GetCacheKey = GetCacheKey;
12167
12175
  /**
@@ -12174,11 +12182,17 @@ var Account;
12174
12182
  * @param ssid
12175
12183
  * @returns
12176
12184
  */
12177
- function GetListCacheKey(ssid, owned) {
12185
+ function GetListCacheKey(ssid, userId, owned) {
12178
12186
  if (!owned) {
12179
12187
  owned = false;
12180
12188
  }
12181
- return Api.ECacheKey.Account + Api.ECacheKey.Session + Api.ECacheKey.Id + ssid + Api.ECacheKey.Id + (owned ? "owned" : "related");
12189
+ if (!ssid) {
12190
+ ssid = "anonymous";
12191
+ }
12192
+ if (!userId) {
12193
+ userId = "anonymous";
12194
+ }
12195
+ return Api.ECacheKey.Account + Api.ECacheKey.Session + Api.ECacheKey.Id + ssid + Api.ECacheKey.Id + (owned ? "owned" : "related") + Api.ECacheKey.User + Api.ECacheKey.Id + userId;
12182
12196
  }
12183
12197
  Account.GetListCacheKey = GetListCacheKey;
12184
12198
  /**
@@ -12761,7 +12775,7 @@ var User;
12761
12775
  if (!api) {
12762
12776
  api = ENVIRONMENT.Api().GetGuardianApi();
12763
12777
  }
12764
- const cacheKey = GetCacheKey(id, accountId);
12778
+ const cacheKey = GetCacheKey(api.GetSessionId(), id, accountId);
12765
12779
  const cache = api.GetCacheItem(cacheKey, reqParams);
12766
12780
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
12767
12781
  return cache.data;
@@ -12825,10 +12839,10 @@ var User;
12825
12839
  const res = yield api.POST(`user/${data.ID}`, data, reqParams);
12826
12840
  api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Id + data.ID);
12827
12841
  if (data.Type == EType.AccessToken) {
12828
- api.Cache.RemoveByStartsWith(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
12842
+ api.Cache.RemoveByContains(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
12829
12843
  }
12830
12844
  else if (data.Type == EType.User) {
12831
- api.Cache.RemoveByStartsWith(Api.ECacheKey.User + Api.ECacheKey.Account);
12845
+ api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Account);
12832
12846
  }
12833
12847
  return {
12834
12848
  user: res
@@ -12859,7 +12873,7 @@ var User;
12859
12873
  }
12860
12874
  const res = yield api.POST("user", data, reqParams);
12861
12875
  api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Id + data.ID);
12862
- api.Cache.RemoveByStartsWith(Api.ECacheKey.User + Api.ECacheKey.Account);
12876
+ api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Account);
12863
12877
  return {
12864
12878
  user: res
12865
12879
  };
@@ -12880,7 +12894,8 @@ var User;
12880
12894
  if (!api) {
12881
12895
  api = ENVIRONMENT.Api().GetGuardianApi();
12882
12896
  }
12883
- const cache = api.GetCacheItem(GetSettingsCacheKey(userId, appId), req);
12897
+ const cacheKey = GetSettingsCacheKey(api.GetSessionId(), userId, appId);
12898
+ const cache = api.GetCacheItem(cacheKey, req);
12884
12899
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
12885
12900
  return cache.data;
12886
12901
  }
@@ -12907,7 +12922,7 @@ var User;
12907
12922
  }
12908
12923
  }));
12909
12924
  api.SetCacheItem({
12910
- key: GetSettingsCacheKey(userId, appId),
12925
+ key: cacheKey,
12911
12926
  value: prom,
12912
12927
  req: req
12913
12928
  });
@@ -12937,7 +12952,7 @@ var User;
12937
12952
  UserID: userId
12938
12953
  };
12939
12954
  const prom = api.POST(`user/${userId}/application/${appId}/settings?Override=${override ? "true" : "false"}`, postBody, req);
12940
- api.Cache.Remove(GetSettingsCacheKey(userId, appId));
12955
+ api.Cache.Remove(GetSettingsCacheKey(api.GetSessionId(), userId, appId));
12941
12956
  return prom;
12942
12957
  });
12943
12958
  }
@@ -12986,14 +13001,20 @@ var User;
12986
13001
  * @param search
12987
13002
  * @returns
12988
13003
  */
12989
- function GetListCacheKey(accountId, exclusive, search) {
13004
+ function GetListCacheKey(sessionId, accountId, exclusive, search) {
12990
13005
  if (!exclusive) {
12991
13006
  exclusive = false;
12992
13007
  }
12993
13008
  if (!search) {
12994
13009
  search = "";
12995
13010
  }
12996
- return Api.ECacheKey.User + Api.ECacheKey.Account + Api.ECacheKey.Id + accountId + Api.ECacheKey.Id + exclusive + Api.ECacheKey.Id + search;
13011
+ if (!sessionId) {
13012
+ sessionId = "anonymous";
13013
+ }
13014
+ if (!accountId) {
13015
+ accountId = "";
13016
+ }
13017
+ return Api.ECacheKey.User + Api.ECacheKey.Account + Api.ECacheKey.Id + accountId + Api.ECacheKey.Id + exclusive + Api.ECacheKey.Id + search + Api.ECacheKey.Session + Api.ECacheKey.Id + sessionId;
12997
13018
  }
12998
13019
  LoginUser.GetListCacheKey = GetListCacheKey;
12999
13020
  /**
@@ -13010,7 +13031,8 @@ var User;
13010
13031
  if (!api) {
13011
13032
  api = ENVIRONMENT.Api().GetGuardianApi();
13012
13033
  }
13013
- const cache = api.GetCacheItem(GetEmailCacheKey(email, accountId), reqParams);
13034
+ const cacheKey = GetEmailCacheKey(api.GetSessionId(), email, accountId);
13035
+ const cache = api.GetCacheItem(cacheKey, reqParams);
13014
13036
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
13015
13037
  return cache.data;
13016
13038
  }
@@ -13026,7 +13048,7 @@ var User;
13026
13048
  }
13027
13049
  }));
13028
13050
  api.SetCacheItem({
13029
- key: GetEmailCacheKey(email, accountId),
13051
+ key: cacheKey,
13030
13052
  value: prom,
13031
13053
  req: reqParams
13032
13054
  });
@@ -13048,7 +13070,8 @@ var User;
13048
13070
  if (!exclusive) {
13049
13071
  exclusive = false;
13050
13072
  }
13051
- const cacheKey = GetListCacheKey(accountId, exclusive, search);
13073
+ const sessionId = api.GetSessionId();
13074
+ const cacheKey = GetListCacheKey(sessionId, accountId, exclusive, search);
13052
13075
  const cache = exclusive ? null : api.GetCacheItem(cacheKey, reqParams);
13053
13076
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
13054
13077
  return cache.data;
@@ -13078,7 +13101,7 @@ var User;
13078
13101
  const users = data.users;
13079
13102
  for (let i = 0; i < users.length; i++) {
13080
13103
  api.SetCacheItem({
13081
- key: GetCacheKey(users[i].ID, accountId),
13104
+ key: GetCacheKey(sessionId, users[i].ID, accountId),
13082
13105
  value: {
13083
13106
  user: users[i]
13084
13107
  },
@@ -13236,11 +13259,18 @@ var User;
13236
13259
  * const key = GetListCacheKey("abc");
13237
13260
  * api.Cache.Remove(key);
13238
13261
  * }
13262
+ * @param sessionId
13239
13263
  * @param accountId
13240
13264
  * @returns
13241
13265
  */
13242
- function GetListCacheKey(accountId) {
13243
- return Api.ECacheKey.AccessToken + Api.ECacheKey.Account + Api.ECacheKey.Id + accountId;
13266
+ function GetListCacheKey(sessionId, accountId) {
13267
+ if (!sessionId) {
13268
+ sessionId = "anonymous";
13269
+ }
13270
+ if (!accountId) {
13271
+ accountId = "";
13272
+ }
13273
+ return Api.ECacheKey.AccessToken + Api.ECacheKey.Account + Api.ECacheKey.Id + accountId + Api.ECacheKey.Session + Api.ECacheKey.Id + sessionId;
13244
13274
  }
13245
13275
  AccessToken.GetListCacheKey = GetListCacheKey;
13246
13276
  /**
@@ -13254,7 +13284,8 @@ var User;
13254
13284
  if (!api) {
13255
13285
  api = ENVIRONMENT.Api().GetGuardianApi();
13256
13286
  }
13257
- const cache = api.GetCacheItem(GetListCacheKey(accountId), reqParams);
13287
+ const cacheKey = GetListCacheKey(api.GetSessionId(), accountId);
13288
+ const cache = api.GetCacheItem(cacheKey, reqParams);
13258
13289
  if (cache === null || cache === void 0 ? void 0 : cache.found) {
13259
13290
  return cache.data;
13260
13291
  }
@@ -13270,7 +13301,7 @@ var User;
13270
13301
  }
13271
13302
  }));
13272
13303
  api.SetCacheItem({
13273
- key: GetListCacheKey(accountId),
13304
+ key: cacheKey,
13274
13305
  value: req,
13275
13306
  req: reqParams
13276
13307
  });
@@ -13290,7 +13321,7 @@ var User;
13290
13321
  }
13291
13322
  yield api.DELETE(`accessToken/${id}`, reqParams);
13292
13323
  api.Cache.RemoveByContains(Api.ECacheKey.User + Api.ECacheKey.Id + id);
13293
- api.Cache.RemoveByStartsWith(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
13324
+ api.Cache.RemoveByContains(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
13294
13325
  });
13295
13326
  }
13296
13327
  AccessToken.Delete = Delete;
@@ -13315,7 +13346,7 @@ var User;
13315
13346
  data.Type = EType.AccessToken;
13316
13347
  }
13317
13348
  data = yield api.POST("accessToken", data, reqParams);
13318
- api.Cache.RemoveByStartsWith(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
13349
+ api.Cache.RemoveByContains(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
13319
13350
  return {
13320
13351
  user: data
13321
13352
  };
@@ -13350,15 +13381,19 @@ var User;
13350
13381
  * const key = GetCacheKey("abc", "def");
13351
13382
  * api.Cache.Remove(key);
13352
13383
  * }
13384
+ * @param sessionId
13353
13385
  * @param userId
13354
13386
  * @param accountId
13355
13387
  * @returns
13356
13388
  */
13357
- function GetCacheKey(userId, accountId) {
13389
+ function GetCacheKey(sessionId, userId, accountId) {
13358
13390
  if (!accountId) {
13359
13391
  accountId = "";
13360
13392
  }
13361
- return Api.ECacheKey.User + Api.ECacheKey.Id + userId + Api.ECacheKey.Id + accountId;
13393
+ if (!sessionId) {
13394
+ sessionId = "anonymous";
13395
+ }
13396
+ return Api.ECacheKey.User + Api.ECacheKey.Id + userId + Api.ECacheKey.Id + accountId + Api.ECacheKey.Session + Api.ECacheKey.Id + sessionId;
13362
13397
  }
13363
13398
  User$$1.GetCacheKey = GetCacheKey;
13364
13399
  /**
@@ -13372,11 +13407,17 @@ var User;
13372
13407
  * @param accountId
13373
13408
  * @returns
13374
13409
  */
13375
- function GetEmailCacheKey(email, accountId) {
13410
+ function GetEmailCacheKey(sessionId, email, accountId) {
13376
13411
  if (!accountId) {
13377
13412
  accountId = "";
13378
13413
  }
13379
- return Api.ECacheKey.User + Api.ECacheKey.UserEmail + email + Api.ECacheKey.Id + accountId;
13414
+ if (!sessionId) {
13415
+ sessionId = "anonymous";
13416
+ }
13417
+ if (!email) {
13418
+ email = "";
13419
+ }
13420
+ return Api.ECacheKey.User + Api.ECacheKey.UserEmail + email + Api.ECacheKey.Id + accountId + Api.ECacheKey.Session + Api.ECacheKey.Id + sessionId;
13380
13421
  }
13381
13422
  User$$1.GetEmailCacheKey = GetEmailCacheKey;
13382
13423
  /**
@@ -13386,11 +13427,15 @@ var User;
13386
13427
  * const key = GetCacheKey("abc", "def");
13387
13428
  * api.Cache.Remove(key);
13388
13429
  * }
13430
+ * @param sessionId
13389
13431
  * @param userId
13390
13432
  * @param appId
13391
13433
  * @returns
13392
13434
  */
13393
- function GetSettingsCacheKey(userId, appId) {
13435
+ function GetSettingsCacheKey(sessionId, userId, appId) {
13436
+ if (!sessionId) {
13437
+ sessionId = "anonymous";
13438
+ }
13394
13439
  return Api.ECacheKey.User + Api.ECacheKey.UserSettings + userId + Api.ECacheKey.Id + appId;
13395
13440
  }
13396
13441
  User$$1.GetSettingsCacheKey = GetSettingsCacheKey;
@@ -16064,7 +16109,7 @@ var Tracking;
16064
16109
  })(Tracking || (Tracking = {}));
16065
16110
 
16066
16111
  // This is updated with the package.json version on build.
16067
- const VERSION = "6.4.8";
16112
+ const VERSION = "6.4.9";
16068
16113
 
16069
16114
  export { VERSION, Assembly, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario, Tracking };
16070
16115
  //# sourceMappingURL=bruce-models.es5.js.map