bruce-models 1.9.9 → 2.0.1

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.
Files changed (63) hide show
  1. package/dist/bruce-models.es5.js +324 -83
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +324 -83
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account.js +20 -4
  6. package/dist/lib/account/account.js.map +1 -1
  7. package/dist/lib/ann-document/ann-document.js +10 -2
  8. package/dist/lib/ann-document/ann-document.js.map +1 -1
  9. package/dist/lib/api/abstract-api.js +14 -0
  10. package/dist/lib/api/abstract-api.js.map +1 -1
  11. package/dist/lib/api/bruce-api.js +27 -23
  12. package/dist/lib/api/bruce-api.js.map +1 -1
  13. package/dist/lib/client-file/client-file.js +5 -1
  14. package/dist/lib/client-file/client-file.js.map +1 -1
  15. package/dist/lib/custom-form/custom-form.js +10 -2
  16. package/dist/lib/custom-form/custom-form.js.map +1 -1
  17. package/dist/lib/entity/entity-attachment-type.js +5 -1
  18. package/dist/lib/entity/entity-attachment-type.js.map +1 -1
  19. package/dist/lib/entity/entity-attachment.js +5 -1
  20. package/dist/lib/entity/entity-attachment.js.map +1 -1
  21. package/dist/lib/entity/entity-comment.js +5 -1
  22. package/dist/lib/entity/entity-comment.js.map +1 -1
  23. package/dist/lib/entity/entity-coords.js +5 -1
  24. package/dist/lib/entity/entity-coords.js.map +1 -1
  25. package/dist/lib/entity/entity-link.js +5 -1
  26. package/dist/lib/entity/entity-link.js.map +1 -1
  27. package/dist/lib/entity/entity-lod-category.js +10 -2
  28. package/dist/lib/entity/entity-lod-category.js.map +1 -1
  29. package/dist/lib/entity/entity-lod.js +15 -3
  30. package/dist/lib/entity/entity-lod.js.map +1 -1
  31. package/dist/lib/entity/entity-relation-type.js +10 -2
  32. package/dist/lib/entity/entity-relation-type.js.map +1 -1
  33. package/dist/lib/entity/entity-relation.js +10 -2
  34. package/dist/lib/entity/entity-relation.js.map +1 -1
  35. package/dist/lib/entity/entity-tag.js +10 -2
  36. package/dist/lib/entity/entity-tag.js.map +1 -1
  37. package/dist/lib/entity/entity-type.js +10 -2
  38. package/dist/lib/entity/entity-type.js.map +1 -1
  39. package/dist/lib/entity/entity.js +17 -5
  40. package/dist/lib/entity/entity.js.map +1 -1
  41. package/dist/lib/entity/getters/entity-filter-getter.js +4 -1
  42. package/dist/lib/entity/getters/entity-filter-getter.js.map +1 -1
  43. package/dist/lib/import/imported-file.js +10 -2
  44. package/dist/lib/import/imported-file.js.map +1 -1
  45. package/dist/lib/plugin/plugin.js +10 -2
  46. package/dist/lib/plugin/plugin.js.map +1 -1
  47. package/dist/lib/program-key/program-key.js +10 -2
  48. package/dist/lib/program-key/program-key.js.map +1 -1
  49. package/dist/lib/project/project-view-bookmark.js +15 -3
  50. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  51. package/dist/lib/project/project-view.js +10 -2
  52. package/dist/lib/project/project-view.js.map +1 -1
  53. package/dist/lib/style/style.js +10 -2
  54. package/dist/lib/style/style.js.map +1 -1
  55. package/dist/lib/tileset/tileset.js +20 -4
  56. package/dist/lib/tileset/tileset.js.map +1 -1
  57. package/dist/lib/user/session.js +5 -1
  58. package/dist/lib/user/session.js.map +1 -1
  59. package/dist/lib/user/user.js +37 -9
  60. package/dist/lib/user/user.js.map +1 -1
  61. package/dist/types/account/account-settings.d.ts +1 -0
  62. package/dist/types/api/abstract-api.d.ts +6 -0
  63. package/package.json +1 -1
@@ -153,7 +153,11 @@ var AnnDocument;
153
153
  rej(e);
154
154
  }
155
155
  }));
156
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
156
+ api.SetCacheItem({
157
+ key,
158
+ value: prom,
159
+ req: reqParams
160
+ });
157
161
  return prom;
158
162
  });
159
163
  }
@@ -180,7 +184,11 @@ var AnnDocument;
180
184
  rej(e);
181
185
  }
182
186
  }));
183
- api.Cache.Set(GetListCacheKey(type), req);
187
+ api.SetCacheItem({
188
+ key: GetListCacheKey(type),
189
+ value: req,
190
+ req: reqParams
191
+ });
184
192
  return req;
185
193
  });
186
194
  }
@@ -230,7 +238,11 @@ var CustomForm;
230
238
  rej(err);
231
239
  }
232
240
  }));
233
- api.Cache.Set(GetCacheKey(id), prom, Api.DEFAULT_CACHE_DURATION);
241
+ api.SetCacheItem({
242
+ key: GetCacheKey(id),
243
+ value: prom,
244
+ req: reqParams
245
+ });
234
246
  return prom;
235
247
  });
236
248
  }
@@ -260,7 +272,11 @@ var CustomForm;
260
272
  forms: data.Items
261
273
  };
262
274
  });
263
- api.Cache.Set(GetListCacheKey(typeId), prom, Api.DEFAULT_CACHE_DURATION);
275
+ api.SetCacheItem({
276
+ key: GetListCacheKey(typeId),
277
+ value: prom,
278
+ req: reqParams
279
+ });
264
280
  return prom;
265
281
  });
266
282
  }
@@ -541,6 +557,20 @@ class AbstractApi {
541
557
  }
542
558
  return this.Cache.Get(key);
543
559
  }
560
+ SetCacheItem(params) {
561
+ let { key, value, duration, req } = params;
562
+ let noCache = req === null || req === void 0 ? void 0 : req.noCache;
563
+ if (noCache == null) {
564
+ noCache = Api.DEFAULT_NO_CACHE;
565
+ }
566
+ if (noCache) {
567
+ return;
568
+ }
569
+ if (isNaN(duration)) {
570
+ duration = Api.DEFAULT_CACHE_DURATION;
571
+ }
572
+ this.Cache.Set(key, value, duration);
573
+ }
544
574
  GetSessionId() {
545
575
  return this.ssid;
546
576
  }
@@ -749,7 +779,11 @@ var Account;
749
779
  const resData = {
750
780
  account: req
751
781
  };
752
- api.Cache.Set(GetCacheKey(id), resData, Api.DEFAULT_CACHE_DURATION);
782
+ api.SetCacheItem({
783
+ key: GetCacheKey(id),
784
+ value: resData,
785
+ req: reqParams
786
+ });
753
787
  return resData;
754
788
  });
755
789
  }
@@ -774,7 +808,11 @@ var Account;
774
808
  rej(e);
775
809
  }
776
810
  }));
777
- api.Cache.Set(GetListCacheKey(api.GetSessionId()), prom, Api.DEFAULT_CACHE_DURATION);
811
+ api.SetCacheItem({
812
+ key: GetListCacheKey(api.GetSessionId()),
813
+ value: prom,
814
+ req: reqParams
815
+ });
778
816
  return prom;
779
817
  });
780
818
  }
@@ -800,7 +838,11 @@ var Account;
800
838
  rej(e);
801
839
  }
802
840
  }));
803
- api.Cache.Set(GetCacheKey(id, appId), prom, Api.DEFAULT_CACHE_DURATION);
841
+ api.SetCacheItem({
842
+ key: GetCacheKey(id, appId),
843
+ value: prom,
844
+ req: reqParams
845
+ });
804
846
  return prom;
805
847
  });
806
848
  }
@@ -865,7 +907,11 @@ var Account;
865
907
  rej(e);
866
908
  }
867
909
  }));
868
- api.Cache.Set(GetDbRegionListCacheKey(), prom, Api.DEFAULT_CACHE_DURATION);
910
+ api.SetCacheItem({
911
+ key: GetDbRegionListCacheKey(),
912
+ value: prom,
913
+ req: reqParams
914
+ });
869
915
  return prom;
870
916
  });
871
917
  }
@@ -1172,31 +1218,35 @@ var BruceApi;
1172
1218
  }
1173
1219
  this.baseUrl = endpoint;
1174
1220
  }
1175
- const api = new BruceApi.Api({
1176
- accountId: this.accountId,
1177
- cam: cam,
1178
- env: this.env,
1179
- // Must be false.
1180
- // Else we get stuck in nested init loop.
1181
- loadConfig: false
1182
- });
1183
- // CDN urls.
1184
- const region = (yield Account.GetDbRegions({
1185
- api,
1186
- key: settings.DBServer
1187
- })).regions[0];
1188
- if (region === null || region === void 0 ? void 0 : region.CDN) {
1189
- this.EntityCdnUrl = (_b = region.CDN.entityURL) === null || _b === void 0 ? void 0 : _b[env];
1190
- // We need to fix our configs.
1191
- if (this.EntityCdnUrl) {
1192
- if (this.EntityCdnUrl.includes("entitiesListForCDN")) {
1193
- this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", this.accountId);
1194
- }
1195
- else {
1196
- this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", "entitiesListForCDN/" + this.accountId);
1221
+ if (settings.DBLocation) {
1222
+ const dbLocation = settings.DBLocation.trim();
1223
+ const api = new BruceApi.Api({
1224
+ accountId: this.accountId,
1225
+ cam: cam,
1226
+ env: this.env,
1227
+ // Must be false.
1228
+ // Else we get stuck in nested init loop.
1229
+ loadConfig: false
1230
+ });
1231
+ // CDN urls.
1232
+ const regions = (yield Account.GetDbRegions({
1233
+ api,
1234
+ key: dbLocation
1235
+ })).regions;
1236
+ const region = regions.find(x => { var _a; return ((_a = x.key) === null || _a === void 0 ? void 0 : _a.trim()) == dbLocation; });
1237
+ if (region === null || region === void 0 ? void 0 : region.CDN) {
1238
+ this.EntityCdnUrl = (_b = region.CDN.entityURL) === null || _b === void 0 ? void 0 : _b[env];
1239
+ // We need to fix our configs.
1240
+ if (this.EntityCdnUrl) {
1241
+ if (this.EntityCdnUrl.includes("entitiesListForCDN")) {
1242
+ this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", this.accountId);
1243
+ }
1244
+ else {
1245
+ this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", "entitiesListForCDN/" + this.accountId);
1246
+ }
1197
1247
  }
1248
+ this.LegacyTilesetCdnUrl = (_c = region.CDN.legacyTilesetURL) === null || _c === void 0 ? void 0 : _c[env];
1198
1249
  }
1199
- this.LegacyTilesetCdnUrl = (_c = region.CDN.legacyTilesetURL) === null || _c === void 0 ? void 0 : _c[env];
1200
1250
  }
1201
1251
  }
1202
1252
  catch (e) {
@@ -1740,7 +1790,11 @@ var Entity;
1740
1790
  rej(e);
1741
1791
  }
1742
1792
  }));
1743
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
1793
+ api.SetCacheItem({
1794
+ key,
1795
+ value: prom,
1796
+ req: reqParams
1797
+ });
1744
1798
  return prom;
1745
1799
  });
1746
1800
  }
@@ -1790,7 +1844,11 @@ var Entity;
1790
1844
  }
1791
1845
  res(null);
1792
1846
  }));
1793
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
1847
+ api.SetCacheItem({
1848
+ key,
1849
+ value: prom,
1850
+ req: reqParams
1851
+ });
1794
1852
  reqs.push(prom);
1795
1853
  }
1796
1854
  }
@@ -1999,9 +2057,13 @@ var Entity;
1999
2057
  for (let i = 0; i < entities.length; i++) {
2000
2058
  const entity = entities[i];
2001
2059
  const id = entity.Bruce.ID;
2002
- api.Cache.Set(GetCacheKey(id), {
2003
- entity: entity
2004
- }, Api.DEFAULT_CACHE_DURATION);
2060
+ api.SetCacheItem({
2061
+ key: GetCacheKey(id),
2062
+ value: {
2063
+ entity: entity
2064
+ },
2065
+ req: reqParams
2066
+ });
2005
2067
  }
2006
2068
  }
2007
2069
  return {
@@ -2964,7 +3026,11 @@ var EntityAttachmentType;
2964
3026
  rej(e);
2965
3027
  }
2966
3028
  }));
2967
- api.Cache.Set(GetListCacheKey(), req);
3029
+ api.SetCacheItem({
3030
+ key: GetListCacheKey(),
3031
+ value: req,
3032
+ req: reqParams
3033
+ });
2968
3034
  return req;
2969
3035
  });
2970
3036
  }
@@ -3059,7 +3125,11 @@ var EntityAttachment;
3059
3125
  rej(e);
3060
3126
  }
3061
3127
  }));
3062
- api.Cache.Set(GetListCacheKey(entityId), req);
3128
+ api.SetCacheItem({
3129
+ key: GetListCacheKey(entityId),
3130
+ value: req,
3131
+ req: reqParams
3132
+ });
3063
3133
  return req;
3064
3134
  });
3065
3135
  }
@@ -3144,7 +3214,11 @@ var EntityComment;
3144
3214
  rej(e);
3145
3215
  }
3146
3216
  }));
3147
- api.Cache.Set(GetListCacheKey(entityId), req);
3217
+ api.SetCacheItem({
3218
+ key: GetListCacheKey(entityId),
3219
+ value: req,
3220
+ req: reqParams
3221
+ });
3148
3222
  return req;
3149
3223
  });
3150
3224
  }
@@ -3214,7 +3288,11 @@ var EntityLink;
3214
3288
  rej(e);
3215
3289
  }
3216
3290
  }));
3217
- api.Cache.Set(GetListCacheKey(entityId), req);
3291
+ api.SetCacheItem({
3292
+ key: GetListCacheKey(entityId),
3293
+ value: req,
3294
+ req: reqParams
3295
+ });
3218
3296
  return req;
3219
3297
  });
3220
3298
  }
@@ -3282,7 +3360,11 @@ var EntityLod;
3282
3360
  rej(e);
3283
3361
  }
3284
3362
  }));
3285
- api.Cache.Set(GetCacheKey(url), req, Api.DEFAULT_CACHE_DURATION);
3363
+ api.SetCacheItem({
3364
+ key: GetCacheKey(url),
3365
+ value: req,
3366
+ req: reqParams
3367
+ });
3286
3368
  return req;
3287
3369
  });
3288
3370
  }
@@ -3323,7 +3405,11 @@ var EntityLod;
3323
3405
  rej(e);
3324
3406
  }
3325
3407
  }));
3326
- api.Cache.Set(GetEntityListKey(entityId), prom, Api.DEFAULT_CACHE_DURATION);
3408
+ api.SetCacheItem({
3409
+ key: GetEntityListKey(entityId),
3410
+ value: prom,
3411
+ req: reqParams
3412
+ });
3327
3413
  return prom;
3328
3414
  });
3329
3415
  }
@@ -3355,7 +3441,11 @@ var EntityLod;
3355
3441
  rej(e);
3356
3442
  }
3357
3443
  }));
3358
- api.Cache.Set(GetTypeListKey(typeId, group), prom, Api.DEFAULT_CACHE_DURATION);
3444
+ api.SetCacheItem({
3445
+ key: GetTypeListKey(typeId, group),
3446
+ value: prom,
3447
+ req: reqParams
3448
+ });
3359
3449
  return prom;
3360
3450
  });
3361
3451
  }
@@ -3422,7 +3512,11 @@ var EntityLodCategory;
3422
3512
  rej(e);
3423
3513
  }
3424
3514
  }));
3425
- api.Cache.Set(GetListCacheKey(), req);
3515
+ api.SetCacheItem({
3516
+ key: GetListCacheKey(),
3517
+ value: req,
3518
+ req: reqParams
3519
+ });
3426
3520
  return req;
3427
3521
  });
3428
3522
  }
@@ -3448,7 +3542,11 @@ var EntityLodCategory;
3448
3542
  rej(e);
3449
3543
  }
3450
3544
  }));
3451
- api.Cache.Set(GetCacheKey(id), req);
3545
+ api.SetCacheItem({
3546
+ key: GetCacheKey(id),
3547
+ value: req,
3548
+ req: reqParams
3549
+ });
3452
3550
  return req;
3453
3551
  });
3454
3552
  }
@@ -3518,7 +3616,11 @@ var EntityRelationType;
3518
3616
  rej(e);
3519
3617
  }
3520
3618
  }));
3521
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
3619
+ api.SetCacheItem({
3620
+ key,
3621
+ value: prom,
3622
+ req: reqParams
3623
+ });
3522
3624
  return prom;
3523
3625
  });
3524
3626
  }
@@ -3553,7 +3655,11 @@ var EntityRelationType;
3553
3655
  rej(e);
3554
3656
  }
3555
3657
  }));
3556
- api.Cache.Set(GetListCacheKey(), req);
3658
+ api.SetCacheItem({
3659
+ key: GetListCacheKey(),
3660
+ value: req,
3661
+ req: reqParams
3662
+ });
3557
3663
  return req;
3558
3664
  });
3559
3665
  }
@@ -3665,7 +3771,11 @@ var EntityRelation;
3665
3771
  rej(e);
3666
3772
  }
3667
3773
  }));
3668
- api.Cache.Set(GetListCacheKey(entityId, filter), req);
3774
+ api.SetCacheItem({
3775
+ key: GetListCacheKey(entityId, filter),
3776
+ value: req,
3777
+ req: reqParams
3778
+ });
3669
3779
  return req;
3670
3780
  });
3671
3781
  }
@@ -3691,7 +3801,11 @@ var EntityRelation;
3691
3801
  rej(e);
3692
3802
  }
3693
3803
  }));
3694
- api.Cache.Set(GetEntityCacheKey(entityId), prom);
3804
+ api.SetCacheItem({
3805
+ key: GetEntityCacheKey(entityId),
3806
+ value: prom,
3807
+ req: reqParams
3808
+ });
3695
3809
  return prom;
3696
3810
  });
3697
3811
  }
@@ -3899,7 +4013,11 @@ var EntityTag;
3899
4013
  rej(e);
3900
4014
  }
3901
4015
  }));
3902
- api.Cache.Set(GetCacheKey(id), req, Api.DEFAULT_CACHE_DURATION);
4016
+ api.SetCacheItem({
4017
+ key: GetCacheKey(id),
4018
+ value: req,
4019
+ req: reqParams
4020
+ });
3903
4021
  reqs.push(req);
3904
4022
  }
3905
4023
  }
@@ -3927,7 +4045,11 @@ var EntityTag;
3927
4045
  rej(e);
3928
4046
  }
3929
4047
  }));
3930
- api.Cache.Set(GetListCacheKey(entityTypeId), req, Api.DEFAULT_CACHE_DURATION);
4048
+ api.SetCacheItem({
4049
+ key: GetListCacheKey(entityTypeId),
4050
+ value: req,
4051
+ req: reqParams
4052
+ });
3931
4053
  return req;
3932
4054
  });
3933
4055
  }
@@ -3996,7 +4118,11 @@ var EntityType;
3996
4118
  rej(e);
3997
4119
  }
3998
4120
  }));
3999
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
4121
+ api.SetCacheItem({
4122
+ key,
4123
+ value: prom,
4124
+ req: reqParams
4125
+ });
4000
4126
  return prom;
4001
4127
  });
4002
4128
  }
@@ -4031,7 +4157,11 @@ var EntityType;
4031
4157
  rej(e);
4032
4158
  }
4033
4159
  }));
4034
- api.Cache.Set(GetListCacheKey(), req, Api.DEFAULT_CACHE_DURATION);
4160
+ api.SetCacheItem({
4161
+ key: GetListCacheKey(),
4162
+ value: req,
4163
+ req: reqParams
4164
+ });
4035
4165
  return req;
4036
4166
  });
4037
4167
  }
@@ -4472,7 +4602,10 @@ var EntityFilterGetter;
4472
4602
  sortOrder: Api.ESortOrder.Asc,
4473
4603
  entityTypeConditions: this.attrFilter
4474
4604
  },
4475
- viaCdn: this.viaCdn
4605
+ viaCdn: this.viaCdn,
4606
+ req: {
4607
+ noCache: true
4608
+ }
4476
4609
  });
4477
4610
  const integrity = this.getIntegrityId();
4478
4611
  if (loopIntegrity == integrity && entities) {
@@ -4675,7 +4808,11 @@ var EntityCoords;
4675
4808
  rej(e);
4676
4809
  }
4677
4810
  }));
4678
- api.Cache.Set(GetCacheKey(entityId), prom, Api.DEFAULT_CACHE_DURATION);
4811
+ api.SetCacheItem({
4812
+ key: GetCacheKey(entityId),
4813
+ value: prom,
4814
+ req: reqParams
4815
+ });
4679
4816
  return prom;
4680
4817
  });
4681
4818
  }
@@ -4929,7 +5066,11 @@ var ClientFile;
4929
5066
  rej(e);
4930
5067
  }
4931
5068
  }));
4932
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
5069
+ api.SetCacheItem({
5070
+ key,
5071
+ value: prom,
5072
+ req: reqParams
5073
+ });
4933
5074
  return prom;
4934
5075
  });
4935
5076
  }
@@ -5161,7 +5302,11 @@ var ProgramKey;
5161
5302
  rej(e);
5162
5303
  }
5163
5304
  }));
5164
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
5305
+ api.SetCacheItem({
5306
+ key,
5307
+ value: prom,
5308
+ req: reqParams
5309
+ });
5165
5310
  return prom;
5166
5311
  });
5167
5312
  }
@@ -5184,7 +5329,11 @@ var ProgramKey;
5184
5329
  rej(e);
5185
5330
  }
5186
5331
  }));
5187
- api.Cache.Set(GetListCacheKey(), req, Api.DEFAULT_CACHE_DURATION);
5332
+ api.SetCacheItem({
5333
+ key: GetListCacheKey(),
5334
+ value: req,
5335
+ req: reqParams
5336
+ });
5188
5337
  return req;
5189
5338
  });
5190
5339
  }
@@ -5295,7 +5444,11 @@ var Tileset;
5295
5444
  rej(e);
5296
5445
  }
5297
5446
  }));
5298
- api.Cache.Set(GetCacheKey(tilesetId, loadFiles), prom, Api.DEFAULT_CACHE_DURATION);
5447
+ api.SetCacheItem({
5448
+ key: GetCacheKey(tilesetId, loadFiles),
5449
+ value: prom,
5450
+ req: reqParams
5451
+ });
5299
5452
  return prom;
5300
5453
  });
5301
5454
  }
@@ -5349,7 +5502,11 @@ var Tileset;
5349
5502
  rej(e);
5350
5503
  }
5351
5504
  }));
5352
- api.Cache.Set(GetListCacheKey(), req, Api.DEFAULT_CACHE_DURATION);
5505
+ api.SetCacheItem({
5506
+ key: GetListCacheKey(),
5507
+ value: req,
5508
+ req: reqParams
5509
+ });
5353
5510
  return req;
5354
5511
  });
5355
5512
  }
@@ -5584,7 +5741,11 @@ var Tileset;
5584
5741
  rej(e);
5585
5742
  }
5586
5743
  }));
5587
- api.Cache.Set(GetCacheKey(accountId, tilesetId), prom);
5744
+ api.SetCacheItem({
5745
+ key: GetCacheKey(accountId, tilesetId),
5746
+ value: prom,
5747
+ req: reqParams
5748
+ });
5588
5749
  return prom;
5589
5750
  });
5590
5751
  }
@@ -5610,7 +5771,11 @@ var Tileset;
5610
5771
  rej(e);
5611
5772
  }
5612
5773
  }));
5613
- api.Cache.Set(GetCacheKey(accountId), req);
5774
+ api.SetCacheItem({
5775
+ key: GetCacheKey(accountId),
5776
+ value: req,
5777
+ req: reqParams
5778
+ });
5614
5779
  return req;
5615
5780
  });
5616
5781
  }
@@ -5799,7 +5964,11 @@ var ProjectViewBookmark;
5799
5964
  rej(e);
5800
5965
  }
5801
5966
  }));
5802
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
5967
+ api.SetCacheItem({
5968
+ key,
5969
+ value: prom,
5970
+ req: reqParams
5971
+ });
5803
5972
  return prom;
5804
5973
  });
5805
5974
  }
@@ -5840,7 +6009,11 @@ var ProjectViewBookmark;
5840
6009
  bookmark: item
5841
6010
  });
5842
6011
  });
5843
- api.Cache.Set(GetCacheKey(viewId, item.ID), prom, Api.DEFAULT_CACHE_DURATION);
6012
+ api.SetCacheItem({
6013
+ key: GetCacheKey(viewId, item.ID),
6014
+ value: prom,
6015
+ req: reqParams
6016
+ });
5844
6017
  }
5845
6018
  res({
5846
6019
  bookmarks: items
@@ -5850,7 +6023,11 @@ var ProjectViewBookmark;
5850
6023
  rej(e);
5851
6024
  }
5852
6025
  }));
5853
- api.Cache.Set(GetListCacheKey(viewId), req, Api.DEFAULT_CACHE_DURATION);
6026
+ api.SetCacheItem({
6027
+ key: GetListCacheKey(viewId),
6028
+ value: req,
6029
+ req: reqParams
6030
+ });
5854
6031
  return req;
5855
6032
  });
5856
6033
  }
@@ -5932,7 +6109,11 @@ var ProjectView;
5932
6109
  rej(e);
5933
6110
  }
5934
6111
  }));
5935
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
6112
+ api.SetCacheItem({
6113
+ key,
6114
+ value: prom,
6115
+ req: reqParams
6116
+ });
5936
6117
  return prom;
5937
6118
  });
5938
6119
  }
@@ -5955,7 +6136,11 @@ var ProjectView;
5955
6136
  rej(e);
5956
6137
  }
5957
6138
  }));
5958
- api.Cache.Set(GetListCacheKey(), prom, Api.DEFAULT_CACHE_DURATION);
6139
+ api.SetCacheItem({
6140
+ key: GetListCacheKey(),
6141
+ value: prom,
6142
+ req: reqParams
6143
+ });
5959
6144
  return prom;
5960
6145
  });
5961
6146
  }
@@ -6295,7 +6480,11 @@ var Style;
6295
6480
  rej(e);
6296
6481
  }
6297
6482
  }));
6298
- api.Cache.Set(GetListCacheKey(), res, Api.DEFAULT_CACHE_DURATION);
6483
+ api.SetCacheItem({
6484
+ key: GetListCacheKey(),
6485
+ value: res,
6486
+ req: reqParams
6487
+ });
6299
6488
  return res;
6300
6489
  }
6301
6490
  Style.GetList = GetList;
@@ -6319,7 +6508,11 @@ var Style;
6319
6508
  rej(e);
6320
6509
  }
6321
6510
  }));
6322
- api.Cache.Set(GetCacheKey(id), prom, Api.DEFAULT_CACHE_DURATION);
6511
+ api.SetCacheItem({
6512
+ key: GetCacheKey(id),
6513
+ value: prom,
6514
+ req: reqParams
6515
+ });
6323
6516
  return prom;
6324
6517
  }
6325
6518
  Style.Get = Get;
@@ -6405,7 +6598,11 @@ var Session;
6405
6598
  rej(e);
6406
6599
  }
6407
6600
  }));
6408
- api.Cache.Set(key, prom, Api.DEFAULT_CACHE_DURATION);
6601
+ api.SetCacheItem({
6602
+ key,
6603
+ value: prom,
6604
+ req: reqParams
6605
+ });
6409
6606
  return prom;
6410
6607
  });
6411
6608
  }
@@ -6633,7 +6830,11 @@ var User;
6633
6830
  rej(e);
6634
6831
  }
6635
6832
  }));
6636
- api.Cache.Set(GetCacheKey(id, accountId), prom, Api.DEFAULT_CACHE_DURATION);
6833
+ api.SetCacheItem({
6834
+ key: GetCacheKey(id, accountId),
6835
+ value: prom,
6836
+ req: reqParams
6837
+ });
6637
6838
  return prom;
6638
6839
  });
6639
6840
  }
@@ -6709,7 +6910,11 @@ var User;
6709
6910
  rej(e);
6710
6911
  }
6711
6912
  }));
6712
- api.Cache.Set(GetSettingsCacheKey(userId, appId), prom, Api.DEFAULT_CACHE_DURATION);
6913
+ api.SetCacheItem({
6914
+ key: GetSettingsCacheKey(userId, appId),
6915
+ value: prom,
6916
+ req: req
6917
+ });
6713
6918
  return prom;
6714
6919
  });
6715
6920
  }
@@ -6786,7 +6991,11 @@ var User;
6786
6991
  rej(e);
6787
6992
  }
6788
6993
  }));
6789
- api.Cache.Set(GetEmailCacheKey(email, accountId), prom, Api.DEFAULT_CACHE_DURATION);
6994
+ api.SetCacheItem({
6995
+ key: GetEmailCacheKey(email, accountId),
6996
+ value: prom,
6997
+ req: reqParams
6998
+ });
6790
6999
  return prom;
6791
7000
  });
6792
7001
  }
@@ -6818,13 +7027,21 @@ var User;
6818
7027
  req.then((data) => {
6819
7028
  const users = data.users;
6820
7029
  for (let i = 0; i < users.length; i++) {
6821
- api.Cache.Set(GetCacheKey(users[i].ID, accountId), {
6822
- user: users[i]
7030
+ api.SetCacheItem({
7031
+ key: GetCacheKey(users[i].ID, accountId),
7032
+ value: {
7033
+ user: users[i]
7034
+ },
7035
+ req: reqParams
6823
7036
  });
6824
7037
  }
6825
7038
  });
6826
7039
  if (!exclusive) {
6827
- api.Cache.Set(GetListCacheKey(accountId), req, Api.DEFAULT_CACHE_DURATION);
7040
+ api.SetCacheItem({
7041
+ key: GetListCacheKey(accountId),
7042
+ value: req,
7043
+ req: reqParams
7044
+ });
6828
7045
  }
6829
7046
  return req;
6830
7047
  });
@@ -6972,12 +7189,20 @@ var User;
6972
7189
  req.then((data) => {
6973
7190
  const users = data.tokens;
6974
7191
  for (let i = 0; i < users.length; i++) {
6975
- api.Cache.Set(GetCacheKey(users[i].ID, accountId), {
6976
- user: users[i]
7192
+ api.SetCacheItem({
7193
+ key: GetCacheKey(users[i].ID, accountId),
7194
+ value: {
7195
+ user: users[i]
7196
+ },
7197
+ req: reqParams
6977
7198
  });
6978
7199
  }
6979
7200
  });
6980
- api.Cache.Set(GetListCacheKey(accountId), req, Api.DEFAULT_CACHE_DURATION);
7201
+ api.SetCacheItem({
7202
+ key: GetListCacheKey(accountId),
7203
+ value: req,
7204
+ req: reqParams
7205
+ });
6981
7206
  return req;
6982
7207
  });
6983
7208
  }
@@ -7283,7 +7508,11 @@ var ImportedFile;
7283
7508
  rej(e);
7284
7509
  }
7285
7510
  }));
7286
- api.Cache.Set(GetListCacheKey(type, pageIndex), prom, Api.DEFAULT_CACHE_DURATION);
7511
+ api.SetCacheItem({
7512
+ key: GetListCacheKey(type, pageIndex),
7513
+ value: prom,
7514
+ req: reqParams
7515
+ });
7287
7516
  return prom;
7288
7517
  });
7289
7518
  }
@@ -7306,7 +7535,11 @@ var ImportedFile;
7306
7535
  rej(e);
7307
7536
  }
7308
7537
  }));
7309
- api.Cache.Set(GetCacheKey(fileId), prom, Api.DEFAULT_CACHE_DURATION);
7538
+ api.SetCacheItem({
7539
+ key: GetCacheKey(fileId),
7540
+ value: prom,
7541
+ req: reqParams
7542
+ });
7310
7543
  return prom;
7311
7544
  });
7312
7545
  }
@@ -7527,7 +7760,11 @@ var Plugin;
7527
7760
  rej(e);
7528
7761
  }
7529
7762
  }));
7530
- api.Cache.Set(GetCacheKey(pluginId), prom, Api.DEFAULT_CACHE_DURATION);
7763
+ api.SetCacheItem({
7764
+ key: GetCacheKey(pluginId),
7765
+ value: prom,
7766
+ req: req
7767
+ });
7531
7768
  return prom;
7532
7769
  });
7533
7770
  }
@@ -7550,7 +7787,11 @@ var Plugin;
7550
7787
  rej(e);
7551
7788
  }
7552
7789
  }));
7553
- api.Cache.Set(GetListCacheKey(), prom, Api.DEFAULT_CACHE_DURATION);
7790
+ api.SetCacheItem({
7791
+ key: GetListCacheKey(),
7792
+ value: prom,
7793
+ req: req
7794
+ });
7554
7795
  return prom;
7555
7796
  });
7556
7797
  }