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 @@
153
153
  rej(e);
154
154
  }
155
155
  }));
156
- api.Cache.Set(key, prom, exports.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 @@
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
  }
@@ -225,7 +233,11 @@
225
233
  rej(err);
226
234
  }
227
235
  }));
228
- api.Cache.Set(GetCacheKey(id), prom, exports.Api.DEFAULT_CACHE_DURATION);
236
+ api.SetCacheItem({
237
+ key: GetCacheKey(id),
238
+ value: prom,
239
+ req: reqParams
240
+ });
229
241
  return prom;
230
242
  });
231
243
  }
@@ -255,7 +267,11 @@
255
267
  forms: data.Items
256
268
  };
257
269
  });
258
- api.Cache.Set(GetListCacheKey(typeId), prom, exports.Api.DEFAULT_CACHE_DURATION);
270
+ api.SetCacheItem({
271
+ key: GetListCacheKey(typeId),
272
+ value: prom,
273
+ req: reqParams
274
+ });
259
275
  return prom;
260
276
  });
261
277
  }
@@ -535,6 +551,20 @@
535
551
  }
536
552
  return this.Cache.Get(key);
537
553
  }
554
+ SetCacheItem(params) {
555
+ let { key, value, duration, req } = params;
556
+ let noCache = req === null || req === void 0 ? void 0 : req.noCache;
557
+ if (noCache == null) {
558
+ noCache = exports.Api.DEFAULT_NO_CACHE;
559
+ }
560
+ if (noCache) {
561
+ return;
562
+ }
563
+ if (isNaN(duration)) {
564
+ duration = exports.Api.DEFAULT_CACHE_DURATION;
565
+ }
566
+ this.Cache.Set(key, value, duration);
567
+ }
538
568
  GetSessionId() {
539
569
  return this.ssid;
540
570
  }
@@ -738,7 +768,11 @@
738
768
  const resData = {
739
769
  account: req
740
770
  };
741
- api.Cache.Set(GetCacheKey(id), resData, exports.Api.DEFAULT_CACHE_DURATION);
771
+ api.SetCacheItem({
772
+ key: GetCacheKey(id),
773
+ value: resData,
774
+ req: reqParams
775
+ });
742
776
  return resData;
743
777
  });
744
778
  }
@@ -763,7 +797,11 @@
763
797
  rej(e);
764
798
  }
765
799
  }));
766
- api.Cache.Set(GetListCacheKey(api.GetSessionId()), prom, exports.Api.DEFAULT_CACHE_DURATION);
800
+ api.SetCacheItem({
801
+ key: GetListCacheKey(api.GetSessionId()),
802
+ value: prom,
803
+ req: reqParams
804
+ });
767
805
  return prom;
768
806
  });
769
807
  }
@@ -789,7 +827,11 @@
789
827
  rej(e);
790
828
  }
791
829
  }));
792
- api.Cache.Set(GetCacheKey(id, appId), prom, exports.Api.DEFAULT_CACHE_DURATION);
830
+ api.SetCacheItem({
831
+ key: GetCacheKey(id, appId),
832
+ value: prom,
833
+ req: reqParams
834
+ });
793
835
  return prom;
794
836
  });
795
837
  }
@@ -854,7 +896,11 @@
854
896
  rej(e);
855
897
  }
856
898
  }));
857
- api.Cache.Set(GetDbRegionListCacheKey(), prom, exports.Api.DEFAULT_CACHE_DURATION);
899
+ api.SetCacheItem({
900
+ key: GetDbRegionListCacheKey(),
901
+ value: prom,
902
+ req: reqParams
903
+ });
858
904
  return prom;
859
905
  });
860
906
  }
@@ -1154,31 +1200,35 @@
1154
1200
  }
1155
1201
  this.baseUrl = endpoint;
1156
1202
  }
1157
- const api = new BruceApi.Api({
1158
- accountId: this.accountId,
1159
- cam: cam,
1160
- env: this.env,
1161
- // Must be false.
1162
- // Else we get stuck in nested init loop.
1163
- loadConfig: false
1164
- });
1165
- // CDN urls.
1166
- const region = (yield exports.Account.GetDbRegions({
1167
- api,
1168
- key: settings.DBServer
1169
- })).regions[0];
1170
- if (region === null || region === void 0 ? void 0 : region.CDN) {
1171
- this.EntityCdnUrl = (_b = region.CDN.entityURL) === null || _b === void 0 ? void 0 : _b[env];
1172
- // We need to fix our configs.
1173
- if (this.EntityCdnUrl) {
1174
- if (this.EntityCdnUrl.includes("entitiesListForCDN")) {
1175
- this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", this.accountId);
1176
- }
1177
- else {
1178
- this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", "entitiesListForCDN/" + this.accountId);
1203
+ if (settings.DBLocation) {
1204
+ const dbLocation = settings.DBLocation.trim();
1205
+ const api = new BruceApi.Api({
1206
+ accountId: this.accountId,
1207
+ cam: cam,
1208
+ env: this.env,
1209
+ // Must be false.
1210
+ // Else we get stuck in nested init loop.
1211
+ loadConfig: false
1212
+ });
1213
+ // CDN urls.
1214
+ const regions = (yield exports.Account.GetDbRegions({
1215
+ api,
1216
+ key: dbLocation
1217
+ })).regions;
1218
+ const region = regions.find(x => { var _a; return ((_a = x.key) === null || _a === void 0 ? void 0 : _a.trim()) == dbLocation; });
1219
+ if (region === null || region === void 0 ? void 0 : region.CDN) {
1220
+ this.EntityCdnUrl = (_b = region.CDN.entityURL) === null || _b === void 0 ? void 0 : _b[env];
1221
+ // We need to fix our configs.
1222
+ if (this.EntityCdnUrl) {
1223
+ if (this.EntityCdnUrl.includes("entitiesListForCDN")) {
1224
+ this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", this.accountId);
1225
+ }
1226
+ else {
1227
+ this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", "entitiesListForCDN/" + this.accountId);
1228
+ }
1179
1229
  }
1230
+ this.LegacyTilesetCdnUrl = (_c = region.CDN.legacyTilesetURL) === null || _c === void 0 ? void 0 : _c[env];
1180
1231
  }
1181
- this.LegacyTilesetCdnUrl = (_c = region.CDN.legacyTilesetURL) === null || _c === void 0 ? void 0 : _c[env];
1182
1232
  }
1183
1233
  }
1184
1234
  catch (e) {
@@ -1711,7 +1761,11 @@
1711
1761
  rej(e);
1712
1762
  }
1713
1763
  }));
1714
- api.Cache.Set(key, prom, exports.Api.DEFAULT_CACHE_DURATION);
1764
+ api.SetCacheItem({
1765
+ key,
1766
+ value: prom,
1767
+ req: reqParams
1768
+ });
1715
1769
  return prom;
1716
1770
  });
1717
1771
  }
@@ -1761,7 +1815,11 @@
1761
1815
  }
1762
1816
  res(null);
1763
1817
  }));
1764
- api.Cache.Set(key, prom, exports.Api.DEFAULT_CACHE_DURATION);
1818
+ api.SetCacheItem({
1819
+ key,
1820
+ value: prom,
1821
+ req: reqParams
1822
+ });
1765
1823
  reqs.push(prom);
1766
1824
  }
1767
1825
  }
@@ -1970,9 +2028,13 @@
1970
2028
  for (let i = 0; i < entities.length; i++) {
1971
2029
  const entity = entities[i];
1972
2030
  const id = entity.Bruce.ID;
1973
- api.Cache.Set(GetCacheKey(id), {
1974
- entity: entity
1975
- }, exports.Api.DEFAULT_CACHE_DURATION);
2031
+ api.SetCacheItem({
2032
+ key: GetCacheKey(id),
2033
+ value: {
2034
+ entity: entity
2035
+ },
2036
+ req: reqParams
2037
+ });
1976
2038
  }
1977
2039
  }
1978
2040
  return {
@@ -2912,7 +2974,11 @@
2912
2974
  rej(e);
2913
2975
  }
2914
2976
  }));
2915
- api.Cache.Set(GetListCacheKey(), req);
2977
+ api.SetCacheItem({
2978
+ key: GetListCacheKey(),
2979
+ value: req,
2980
+ req: reqParams
2981
+ });
2916
2982
  return req;
2917
2983
  });
2918
2984
  }
@@ -3001,7 +3067,11 @@
3001
3067
  rej(e);
3002
3068
  }
3003
3069
  }));
3004
- api.Cache.Set(GetListCacheKey(entityId), req);
3070
+ api.SetCacheItem({
3071
+ key: GetListCacheKey(entityId),
3072
+ value: req,
3073
+ req: reqParams
3074
+ });
3005
3075
  return req;
3006
3076
  });
3007
3077
  }
@@ -3081,7 +3151,11 @@
3081
3151
  rej(e);
3082
3152
  }
3083
3153
  }));
3084
- api.Cache.Set(GetListCacheKey(entityId), req);
3154
+ api.SetCacheItem({
3155
+ key: GetListCacheKey(entityId),
3156
+ value: req,
3157
+ req: reqParams
3158
+ });
3085
3159
  return req;
3086
3160
  });
3087
3161
  }
@@ -3146,7 +3220,11 @@
3146
3220
  rej(e);
3147
3221
  }
3148
3222
  }));
3149
- api.Cache.Set(GetListCacheKey(entityId), req);
3223
+ api.SetCacheItem({
3224
+ key: GetListCacheKey(entityId),
3225
+ value: req,
3226
+ req: reqParams
3227
+ });
3150
3228
  return req;
3151
3229
  });
3152
3230
  }
@@ -3207,7 +3285,11 @@
3207
3285
  rej(e);
3208
3286
  }
3209
3287
  }));
3210
- api.Cache.Set(GetCacheKey(url), req, exports.Api.DEFAULT_CACHE_DURATION);
3288
+ api.SetCacheItem({
3289
+ key: GetCacheKey(url),
3290
+ value: req,
3291
+ req: reqParams
3292
+ });
3211
3293
  return req;
3212
3294
  });
3213
3295
  }
@@ -3248,7 +3330,11 @@
3248
3330
  rej(e);
3249
3331
  }
3250
3332
  }));
3251
- api.Cache.Set(GetEntityListKey(entityId), prom, exports.Api.DEFAULT_CACHE_DURATION);
3333
+ api.SetCacheItem({
3334
+ key: GetEntityListKey(entityId),
3335
+ value: prom,
3336
+ req: reqParams
3337
+ });
3252
3338
  return prom;
3253
3339
  });
3254
3340
  }
@@ -3280,7 +3366,11 @@
3280
3366
  rej(e);
3281
3367
  }
3282
3368
  }));
3283
- api.Cache.Set(GetTypeListKey(typeId, group), prom, exports.Api.DEFAULT_CACHE_DURATION);
3369
+ api.SetCacheItem({
3370
+ key: GetTypeListKey(typeId, group),
3371
+ value: prom,
3372
+ req: reqParams
3373
+ });
3284
3374
  return prom;
3285
3375
  });
3286
3376
  }
@@ -3346,7 +3436,11 @@
3346
3436
  rej(e);
3347
3437
  }
3348
3438
  }));
3349
- api.Cache.Set(GetListCacheKey(), req);
3439
+ api.SetCacheItem({
3440
+ key: GetListCacheKey(),
3441
+ value: req,
3442
+ req: reqParams
3443
+ });
3350
3444
  return req;
3351
3445
  });
3352
3446
  }
@@ -3372,7 +3466,11 @@
3372
3466
  rej(e);
3373
3467
  }
3374
3468
  }));
3375
- api.Cache.Set(GetCacheKey(id), req);
3469
+ api.SetCacheItem({
3470
+ key: GetCacheKey(id),
3471
+ value: req,
3472
+ req: reqParams
3473
+ });
3376
3474
  return req;
3377
3475
  });
3378
3476
  }
@@ -3437,7 +3535,11 @@
3437
3535
  rej(e);
3438
3536
  }
3439
3537
  }));
3440
- api.Cache.Set(key, prom, exports.Api.DEFAULT_CACHE_DURATION);
3538
+ api.SetCacheItem({
3539
+ key,
3540
+ value: prom,
3541
+ req: reqParams
3542
+ });
3441
3543
  return prom;
3442
3544
  });
3443
3545
  }
@@ -3472,7 +3574,11 @@
3472
3574
  rej(e);
3473
3575
  }
3474
3576
  }));
3475
- api.Cache.Set(GetListCacheKey(), req);
3577
+ api.SetCacheItem({
3578
+ key: GetListCacheKey(),
3579
+ value: req,
3580
+ req: reqParams
3581
+ });
3476
3582
  return req;
3477
3583
  });
3478
3584
  }
@@ -3578,7 +3684,11 @@
3578
3684
  rej(e);
3579
3685
  }
3580
3686
  }));
3581
- api.Cache.Set(GetListCacheKey(entityId, filter), req);
3687
+ api.SetCacheItem({
3688
+ key: GetListCacheKey(entityId, filter),
3689
+ value: req,
3690
+ req: reqParams
3691
+ });
3582
3692
  return req;
3583
3693
  });
3584
3694
  }
@@ -3604,7 +3714,11 @@
3604
3714
  rej(e);
3605
3715
  }
3606
3716
  }));
3607
- api.Cache.Set(GetEntityCacheKey(entityId), prom);
3717
+ api.SetCacheItem({
3718
+ key: GetEntityCacheKey(entityId),
3719
+ value: prom,
3720
+ req: reqParams
3721
+ });
3608
3722
  return prom;
3609
3723
  });
3610
3724
  }
@@ -3800,7 +3914,11 @@
3800
3914
  rej(e);
3801
3915
  }
3802
3916
  }));
3803
- api.Cache.Set(GetCacheKey(id), req, exports.Api.DEFAULT_CACHE_DURATION);
3917
+ api.SetCacheItem({
3918
+ key: GetCacheKey(id),
3919
+ value: req,
3920
+ req: reqParams
3921
+ });
3804
3922
  reqs.push(req);
3805
3923
  }
3806
3924
  }
@@ -3828,7 +3946,11 @@
3828
3946
  rej(e);
3829
3947
  }
3830
3948
  }));
3831
- api.Cache.Set(GetListCacheKey(entityTypeId), req, exports.Api.DEFAULT_CACHE_DURATION);
3949
+ api.SetCacheItem({
3950
+ key: GetListCacheKey(entityTypeId),
3951
+ value: req,
3952
+ req: reqParams
3953
+ });
3832
3954
  return req;
3833
3955
  });
3834
3956
  }
@@ -3891,7 +4013,11 @@
3891
4013
  rej(e);
3892
4014
  }
3893
4015
  }));
3894
- api.Cache.Set(key, prom, exports.Api.DEFAULT_CACHE_DURATION);
4016
+ api.SetCacheItem({
4017
+ key,
4018
+ value: prom,
4019
+ req: reqParams
4020
+ });
3895
4021
  return prom;
3896
4022
  });
3897
4023
  }
@@ -3926,7 +4052,11 @@
3926
4052
  rej(e);
3927
4053
  }
3928
4054
  }));
3929
- api.Cache.Set(GetListCacheKey(), req, exports.Api.DEFAULT_CACHE_DURATION);
4055
+ api.SetCacheItem({
4056
+ key: GetListCacheKey(),
4057
+ value: req,
4058
+ req: reqParams
4059
+ });
3930
4060
  return req;
3931
4061
  });
3932
4062
  }
@@ -4360,7 +4490,10 @@
4360
4490
  sortOrder: exports.Api.ESortOrder.Asc,
4361
4491
  entityTypeConditions: this.attrFilter
4362
4492
  },
4363
- viaCdn: this.viaCdn
4493
+ viaCdn: this.viaCdn,
4494
+ req: {
4495
+ noCache: true
4496
+ }
4364
4497
  });
4365
4498
  const integrity = this.getIntegrityId();
4366
4499
  if (loopIntegrity == integrity && entities) {
@@ -4556,7 +4689,11 @@
4556
4689
  rej(e);
4557
4690
  }
4558
4691
  }));
4559
- api.Cache.Set(GetCacheKey(entityId), prom, exports.Api.DEFAULT_CACHE_DURATION);
4692
+ api.SetCacheItem({
4693
+ key: GetCacheKey(entityId),
4694
+ value: prom,
4695
+ req: reqParams
4696
+ });
4560
4697
  return prom;
4561
4698
  });
4562
4699
  }
@@ -4802,7 +4939,11 @@
4802
4939
  rej(e);
4803
4940
  }
4804
4941
  }));
4805
- api.Cache.Set(key, prom, exports.Api.DEFAULT_CACHE_DURATION);
4942
+ api.SetCacheItem({
4943
+ key,
4944
+ value: prom,
4945
+ req: reqParams
4946
+ });
4806
4947
  return prom;
4807
4948
  });
4808
4949
  }
@@ -5029,7 +5170,11 @@
5029
5170
  rej(e);
5030
5171
  }
5031
5172
  }));
5032
- api.Cache.Set(key, prom, exports.Api.DEFAULT_CACHE_DURATION);
5173
+ api.SetCacheItem({
5174
+ key,
5175
+ value: prom,
5176
+ req: reqParams
5177
+ });
5033
5178
  return prom;
5034
5179
  });
5035
5180
  }
@@ -5052,7 +5197,11 @@
5052
5197
  rej(e);
5053
5198
  }
5054
5199
  }));
5055
- api.Cache.Set(GetListCacheKey(), req, exports.Api.DEFAULT_CACHE_DURATION);
5200
+ api.SetCacheItem({
5201
+ key: GetListCacheKey(),
5202
+ value: req,
5203
+ req: reqParams
5204
+ });
5056
5205
  return req;
5057
5206
  });
5058
5207
  }
@@ -5151,7 +5300,11 @@
5151
5300
  rej(e);
5152
5301
  }
5153
5302
  }));
5154
- api.Cache.Set(GetCacheKey(tilesetId, loadFiles), prom, exports.Api.DEFAULT_CACHE_DURATION);
5303
+ api.SetCacheItem({
5304
+ key: GetCacheKey(tilesetId, loadFiles),
5305
+ value: prom,
5306
+ req: reqParams
5307
+ });
5155
5308
  return prom;
5156
5309
  });
5157
5310
  }
@@ -5205,7 +5358,11 @@
5205
5358
  rej(e);
5206
5359
  }
5207
5360
  }));
5208
- api.Cache.Set(GetListCacheKey(), req, exports.Api.DEFAULT_CACHE_DURATION);
5361
+ api.SetCacheItem({
5362
+ key: GetListCacheKey(),
5363
+ value: req,
5364
+ req: reqParams
5365
+ });
5209
5366
  return req;
5210
5367
  });
5211
5368
  }
@@ -5440,7 +5597,11 @@
5440
5597
  rej(e);
5441
5598
  }
5442
5599
  }));
5443
- api.Cache.Set(GetCacheKey(accountId, tilesetId), prom);
5600
+ api.SetCacheItem({
5601
+ key: GetCacheKey(accountId, tilesetId),
5602
+ value: prom,
5603
+ req: reqParams
5604
+ });
5444
5605
  return prom;
5445
5606
  });
5446
5607
  }
@@ -5466,7 +5627,11 @@
5466
5627
  rej(e);
5467
5628
  }
5468
5629
  }));
5469
- api.Cache.Set(GetCacheKey(accountId), req);
5630
+ api.SetCacheItem({
5631
+ key: GetCacheKey(accountId),
5632
+ value: req,
5633
+ req: reqParams
5634
+ });
5470
5635
  return req;
5471
5636
  });
5472
5637
  }
@@ -5642,7 +5807,11 @@
5642
5807
  rej(e);
5643
5808
  }
5644
5809
  }));
5645
- api.Cache.Set(key, prom, exports.Api.DEFAULT_CACHE_DURATION);
5810
+ api.SetCacheItem({
5811
+ key,
5812
+ value: prom,
5813
+ req: reqParams
5814
+ });
5646
5815
  return prom;
5647
5816
  });
5648
5817
  }
@@ -5683,7 +5852,11 @@
5683
5852
  bookmark: item
5684
5853
  });
5685
5854
  });
5686
- api.Cache.Set(GetCacheKey(viewId, item.ID), prom, exports.Api.DEFAULT_CACHE_DURATION);
5855
+ api.SetCacheItem({
5856
+ key: GetCacheKey(viewId, item.ID),
5857
+ value: prom,
5858
+ req: reqParams
5859
+ });
5687
5860
  }
5688
5861
  res({
5689
5862
  bookmarks: items
@@ -5693,7 +5866,11 @@
5693
5866
  rej(e);
5694
5867
  }
5695
5868
  }));
5696
- api.Cache.Set(GetListCacheKey(viewId), req, exports.Api.DEFAULT_CACHE_DURATION);
5869
+ api.SetCacheItem({
5870
+ key: GetListCacheKey(viewId),
5871
+ value: req,
5872
+ req: reqParams
5873
+ });
5697
5874
  return req;
5698
5875
  });
5699
5876
  }
@@ -5769,7 +5946,11 @@
5769
5946
  rej(e);
5770
5947
  }
5771
5948
  }));
5772
- api.Cache.Set(key, prom, exports.Api.DEFAULT_CACHE_DURATION);
5949
+ api.SetCacheItem({
5950
+ key,
5951
+ value: prom,
5952
+ req: reqParams
5953
+ });
5773
5954
  return prom;
5774
5955
  });
5775
5956
  }
@@ -5792,7 +5973,11 @@
5792
5973
  rej(e);
5793
5974
  }
5794
5975
  }));
5795
- api.Cache.Set(GetListCacheKey(), prom, exports.Api.DEFAULT_CACHE_DURATION);
5976
+ api.SetCacheItem({
5977
+ key: GetListCacheKey(),
5978
+ value: prom,
5979
+ req: reqParams
5980
+ });
5796
5981
  return prom;
5797
5982
  });
5798
5983
  }
@@ -6111,7 +6296,11 @@
6111
6296
  rej(e);
6112
6297
  }
6113
6298
  }));
6114
- api.Cache.Set(GetListCacheKey(), res, exports.Api.DEFAULT_CACHE_DURATION);
6299
+ api.SetCacheItem({
6300
+ key: GetListCacheKey(),
6301
+ value: res,
6302
+ req: reqParams
6303
+ });
6115
6304
  return res;
6116
6305
  }
6117
6306
  Style.GetList = GetList;
@@ -6135,7 +6324,11 @@
6135
6324
  rej(e);
6136
6325
  }
6137
6326
  }));
6138
- api.Cache.Set(GetCacheKey(id), prom, exports.Api.DEFAULT_CACHE_DURATION);
6327
+ api.SetCacheItem({
6328
+ key: GetCacheKey(id),
6329
+ value: prom,
6330
+ req: reqParams
6331
+ });
6139
6332
  return prom;
6140
6333
  }
6141
6334
  Style.Get = Get;
@@ -6214,7 +6407,11 @@
6214
6407
  rej(e);
6215
6408
  }
6216
6409
  }));
6217
- api.Cache.Set(key, prom, exports.Api.DEFAULT_CACHE_DURATION);
6410
+ api.SetCacheItem({
6411
+ key,
6412
+ value: prom,
6413
+ req: reqParams
6414
+ });
6218
6415
  return prom;
6219
6416
  });
6220
6417
  }
@@ -6429,7 +6626,11 @@
6429
6626
  rej(e);
6430
6627
  }
6431
6628
  }));
6432
- api.Cache.Set(GetCacheKey(id, accountId), prom, exports.Api.DEFAULT_CACHE_DURATION);
6629
+ api.SetCacheItem({
6630
+ key: GetCacheKey(id, accountId),
6631
+ value: prom,
6632
+ req: reqParams
6633
+ });
6433
6634
  return prom;
6434
6635
  });
6435
6636
  }
@@ -6505,7 +6706,11 @@
6505
6706
  rej(e);
6506
6707
  }
6507
6708
  }));
6508
- api.Cache.Set(GetSettingsCacheKey(userId, appId), prom, exports.Api.DEFAULT_CACHE_DURATION);
6709
+ api.SetCacheItem({
6710
+ key: GetSettingsCacheKey(userId, appId),
6711
+ value: prom,
6712
+ req: req
6713
+ });
6509
6714
  return prom;
6510
6715
  });
6511
6716
  }
@@ -6582,7 +6787,11 @@
6582
6787
  rej(e);
6583
6788
  }
6584
6789
  }));
6585
- api.Cache.Set(GetEmailCacheKey(email, accountId), prom, exports.Api.DEFAULT_CACHE_DURATION);
6790
+ api.SetCacheItem({
6791
+ key: GetEmailCacheKey(email, accountId),
6792
+ value: prom,
6793
+ req: reqParams
6794
+ });
6586
6795
  return prom;
6587
6796
  });
6588
6797
  }
@@ -6614,13 +6823,21 @@
6614
6823
  req.then((data) => {
6615
6824
  const users = data.users;
6616
6825
  for (let i = 0; i < users.length; i++) {
6617
- api.Cache.Set(GetCacheKey(users[i].ID, accountId), {
6618
- user: users[i]
6826
+ api.SetCacheItem({
6827
+ key: GetCacheKey(users[i].ID, accountId),
6828
+ value: {
6829
+ user: users[i]
6830
+ },
6831
+ req: reqParams
6619
6832
  });
6620
6833
  }
6621
6834
  });
6622
6835
  if (!exclusive) {
6623
- api.Cache.Set(GetListCacheKey(accountId), req, exports.Api.DEFAULT_CACHE_DURATION);
6836
+ api.SetCacheItem({
6837
+ key: GetListCacheKey(accountId),
6838
+ value: req,
6839
+ req: reqParams
6840
+ });
6624
6841
  }
6625
6842
  return req;
6626
6843
  });
@@ -6768,12 +6985,20 @@
6768
6985
  req.then((data) => {
6769
6986
  const users = data.tokens;
6770
6987
  for (let i = 0; i < users.length; i++) {
6771
- api.Cache.Set(GetCacheKey(users[i].ID, accountId), {
6772
- user: users[i]
6988
+ api.SetCacheItem({
6989
+ key: GetCacheKey(users[i].ID, accountId),
6990
+ value: {
6991
+ user: users[i]
6992
+ },
6993
+ req: reqParams
6773
6994
  });
6774
6995
  }
6775
6996
  });
6776
- api.Cache.Set(GetListCacheKey(accountId), req, exports.Api.DEFAULT_CACHE_DURATION);
6997
+ api.SetCacheItem({
6998
+ key: GetListCacheKey(accountId),
6999
+ value: req,
7000
+ req: reqParams
7001
+ });
6777
7002
  return req;
6778
7003
  });
6779
7004
  }
@@ -7067,7 +7292,11 @@
7067
7292
  rej(e);
7068
7293
  }
7069
7294
  }));
7070
- api.Cache.Set(GetListCacheKey(type, pageIndex), prom, exports.Api.DEFAULT_CACHE_DURATION);
7295
+ api.SetCacheItem({
7296
+ key: GetListCacheKey(type, pageIndex),
7297
+ value: prom,
7298
+ req: reqParams
7299
+ });
7071
7300
  return prom;
7072
7301
  });
7073
7302
  }
@@ -7090,7 +7319,11 @@
7090
7319
  rej(e);
7091
7320
  }
7092
7321
  }));
7093
- api.Cache.Set(GetCacheKey(fileId), prom, exports.Api.DEFAULT_CACHE_DURATION);
7322
+ api.SetCacheItem({
7323
+ key: GetCacheKey(fileId),
7324
+ value: prom,
7325
+ req: reqParams
7326
+ });
7094
7327
  return prom;
7095
7328
  });
7096
7329
  }
@@ -7309,7 +7542,11 @@
7309
7542
  rej(e);
7310
7543
  }
7311
7544
  }));
7312
- api.Cache.Set(GetCacheKey(pluginId), prom, exports.Api.DEFAULT_CACHE_DURATION);
7545
+ api.SetCacheItem({
7546
+ key: GetCacheKey(pluginId),
7547
+ value: prom,
7548
+ req: req
7549
+ });
7313
7550
  return prom;
7314
7551
  });
7315
7552
  }
@@ -7332,7 +7569,11 @@
7332
7569
  rej(e);
7333
7570
  }
7334
7571
  }));
7335
- api.Cache.Set(GetListCacheKey(), prom, exports.Api.DEFAULT_CACHE_DURATION);
7572
+ api.SetCacheItem({
7573
+ key: GetListCacheKey(),
7574
+ value: prom,
7575
+ req: req
7576
+ });
7336
7577
  return prom;
7337
7578
  });
7338
7579
  }