bruce-models 4.9.7 → 4.9.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.
- package/dist/bruce-models.es5.js +213 -160
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +213 -160
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-features.js +1 -1
- package/dist/lib/account/account-features.js.map +1 -1
- package/dist/lib/account/account.js +11 -11
- package/dist/lib/account/account.js.map +1 -1
- package/dist/lib/ann-document/ann-document.js +4 -4
- package/dist/lib/ann-document/ann-document.js.map +1 -1
- package/dist/lib/api/abstract-api.js +1 -1
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/api/api-getters.js +12 -3
- package/dist/lib/api/api-getters.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/client-file/client-file.js +2 -2
- package/dist/lib/client-file/client-file.js.map +1 -1
- package/dist/lib/custom-form/custom-form.js +6 -6
- package/dist/lib/custom-form/custom-form.js.map +1 -1
- package/dist/lib/data-source/data-source.js +6 -6
- package/dist/lib/data-source/data-source.js.map +1 -1
- package/dist/lib/entity/entity-attachment-type.js +2 -2
- package/dist/lib/entity/entity-attachment-type.js.map +1 -1
- package/dist/lib/entity/entity-attachment.js +6 -6
- package/dist/lib/entity/entity-attachment.js.map +1 -1
- package/dist/lib/entity/entity-comment.js +4 -4
- package/dist/lib/entity/entity-comment.js.map +1 -1
- package/dist/lib/entity/entity-coords.js +2 -2
- package/dist/lib/entity/entity-coords.js.map +1 -1
- package/dist/lib/entity/entity-link.js +4 -4
- package/dist/lib/entity/entity-link.js.map +1 -1
- package/dist/lib/entity/entity-lod-category.js +4 -4
- package/dist/lib/entity/entity-lod-category.js.map +1 -1
- package/dist/lib/entity/entity-lod.js +6 -6
- package/dist/lib/entity/entity-lod.js.map +1 -1
- package/dist/lib/entity/entity-relation-type.js +4 -4
- package/dist/lib/entity/entity-relation-type.js.map +1 -1
- package/dist/lib/entity/entity-relation.js +15 -15
- package/dist/lib/entity/entity-relation.js.map +1 -1
- package/dist/lib/entity/entity-source.js +2 -2
- package/dist/lib/entity/entity-source.js.map +1 -1
- package/dist/lib/entity/entity-tag.js +5 -5
- package/dist/lib/entity/entity-tag.js.map +1 -1
- package/dist/lib/entity/entity-type.js +43 -8
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/environment.js +1 -1
- package/dist/lib/environment.js.map +1 -1
- package/dist/lib/import/imported-file.js +6 -6
- package/dist/lib/import/imported-file.js.map +1 -1
- package/dist/lib/plugin/plugin.js +4 -4
- package/dist/lib/plugin/plugin.js.map +1 -1
- package/dist/lib/program-key/program-key.js +4 -4
- package/dist/lib/program-key/program-key.js.map +1 -1
- package/dist/lib/project/project-view-bookmark.js +6 -6
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/project/project-view.js +4 -4
- package/dist/lib/project/project-view.js.map +1 -1
- package/dist/lib/style/style.js +4 -4
- package/dist/lib/style/style.js.map +1 -1
- package/dist/lib/tileset/tileset.js +15 -15
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/lib/user/session.js +2 -2
- package/dist/lib/user/session.js.map +1 -1
- package/dist/lib/user/user.js +26 -17
- package/dist/lib/user/user.js.map +1 -1
- package/dist/types/api/api-getters.d.ts +1 -0
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity-type.d.ts +8 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -373,7 +373,7 @@
|
|
|
373
373
|
if (noCache) {
|
|
374
374
|
return;
|
|
375
375
|
}
|
|
376
|
-
if (isNaN(duration)) {
|
|
376
|
+
if (isNaN(duration) || duration == null) {
|
|
377
377
|
duration = exports.Api.DEFAULT_CACHE_DURATION;
|
|
378
378
|
}
|
|
379
379
|
this.Cache.Set({
|
|
@@ -1384,6 +1384,15 @@
|
|
|
1384
1384
|
this.env = (params === null || params === void 0 ? void 0 : params.env) ? params.env : exports.Api.EEnv.PROD;
|
|
1385
1385
|
this.sessionId = params === null || params === void 0 ? void 0 : params.sessionId;
|
|
1386
1386
|
}
|
|
1387
|
+
prepEnv(_env) {
|
|
1388
|
+
if (!_env) {
|
|
1389
|
+
_env = this.env;
|
|
1390
|
+
}
|
|
1391
|
+
if (!_env) {
|
|
1392
|
+
_env = exports.Api.EEnv.PROD;
|
|
1393
|
+
}
|
|
1394
|
+
return _env.toUpperCase();
|
|
1395
|
+
}
|
|
1387
1396
|
/**
|
|
1388
1397
|
* Clears all cache items in all API instances.
|
|
1389
1398
|
*/
|
|
@@ -1474,7 +1483,7 @@
|
|
|
1474
1483
|
}
|
|
1475
1484
|
let { accountId, env, loadConfig, loadWebSocket } = params;
|
|
1476
1485
|
accountId = accountId ? accountId : this.accountId;
|
|
1477
|
-
env =
|
|
1486
|
+
env = this.prepEnv(env);
|
|
1478
1487
|
const key = `${accountId}-${env}`;
|
|
1479
1488
|
if (!this.bruce[key]) {
|
|
1480
1489
|
this.bruce[key] = new exports.BruceApi.Api({
|
|
@@ -1518,7 +1527,7 @@
|
|
|
1518
1527
|
params = {};
|
|
1519
1528
|
}
|
|
1520
1529
|
let { env } = params;
|
|
1521
|
-
env =
|
|
1530
|
+
env = this.prepEnv(env);
|
|
1522
1531
|
const key = `${env}`;
|
|
1523
1532
|
if (!this.global[key]) {
|
|
1524
1533
|
this.global[key] = new exports.GlobalApi.Api({
|
|
@@ -1538,7 +1547,7 @@
|
|
|
1538
1547
|
params = {};
|
|
1539
1548
|
}
|
|
1540
1549
|
let { env } = params;
|
|
1541
|
-
env =
|
|
1550
|
+
env = this.prepEnv(env);
|
|
1542
1551
|
const key = `${env}`;
|
|
1543
1552
|
if (!this.guardian[key]) {
|
|
1544
1553
|
this.guardian[key] = new exports.GuardianApi.Api({
|
|
@@ -1641,7 +1650,7 @@
|
|
|
1641
1650
|
if (!_getters) {
|
|
1642
1651
|
_getters = new ApiGetters({
|
|
1643
1652
|
accountId: ENVIRONMENT.PARAMS.accountId,
|
|
1644
|
-
env: ENVIRONMENT.PARAMS.env ? ENVIRONMENT.PARAMS.env : exports.Api.EEnv.
|
|
1653
|
+
env: ENVIRONMENT.PARAMS.env ? ENVIRONMENT.PARAMS.env : exports.Api.EEnv.PROD,
|
|
1645
1654
|
sessionId: ENVIRONMENT.PARAMS.sessionId
|
|
1646
1655
|
});
|
|
1647
1656
|
}
|
|
@@ -1698,7 +1707,7 @@
|
|
|
1698
1707
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
1699
1708
|
}
|
|
1700
1709
|
const key = GetCacheKey(docId);
|
|
1701
|
-
const cache =
|
|
1710
|
+
const cache = api.GetCacheItem(key, reqParams);
|
|
1702
1711
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
1703
1712
|
return cache.data;
|
|
1704
1713
|
}
|
|
@@ -1713,7 +1722,7 @@
|
|
|
1713
1722
|
rej(e);
|
|
1714
1723
|
}
|
|
1715
1724
|
}));
|
|
1716
|
-
|
|
1725
|
+
api.SetCacheItem({
|
|
1717
1726
|
key,
|
|
1718
1727
|
value: prom,
|
|
1719
1728
|
req: reqParams
|
|
@@ -1736,7 +1745,7 @@
|
|
|
1736
1745
|
if (!type) {
|
|
1737
1746
|
type = "";
|
|
1738
1747
|
}
|
|
1739
|
-
const cache =
|
|
1748
|
+
const cache = api.GetCacheItem(GetListCacheKey(type, entityId, expandSettings), reqParams);
|
|
1740
1749
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
1741
1750
|
return cache.data;
|
|
1742
1751
|
}
|
|
@@ -1762,7 +1771,7 @@
|
|
|
1762
1771
|
rej(e);
|
|
1763
1772
|
}
|
|
1764
1773
|
}));
|
|
1765
|
-
|
|
1774
|
+
api.SetCacheItem({
|
|
1766
1775
|
key: GetListCacheKey(type, entityId, expandSettings),
|
|
1767
1776
|
value: req,
|
|
1768
1777
|
req: reqParams
|
|
@@ -1835,7 +1844,7 @@
|
|
|
1835
1844
|
if (!api) {
|
|
1836
1845
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
1837
1846
|
}
|
|
1838
|
-
const cache =
|
|
1847
|
+
const cache = api.GetCacheItem(GetCacheKey(id), reqParams);
|
|
1839
1848
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
1840
1849
|
return cache.data;
|
|
1841
1850
|
}
|
|
@@ -1850,7 +1859,7 @@
|
|
|
1850
1859
|
rej(err);
|
|
1851
1860
|
}
|
|
1852
1861
|
}));
|
|
1853
|
-
|
|
1862
|
+
api.SetCacheItem({
|
|
1854
1863
|
key: GetCacheKey(id),
|
|
1855
1864
|
value: prom,
|
|
1856
1865
|
req: reqParams
|
|
@@ -1873,7 +1882,7 @@
|
|
|
1873
1882
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
1874
1883
|
}
|
|
1875
1884
|
yield api.DELETE(`customForm/${id}`, exports.Api.PrepReqParams(reqParams));
|
|
1876
|
-
|
|
1885
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.CustomForm);
|
|
1877
1886
|
});
|
|
1878
1887
|
}
|
|
1879
1888
|
CustomForm.Delete = Delete;
|
|
@@ -1889,7 +1898,7 @@
|
|
|
1889
1898
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
1890
1899
|
}
|
|
1891
1900
|
const url = typeId ? `entityType/${typeId}/customForms` : "customForms";
|
|
1892
|
-
const cache =
|
|
1901
|
+
const cache = api.GetCacheItem(GetListCacheKey(typeId), reqParams);
|
|
1893
1902
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
1894
1903
|
return cache.data;
|
|
1895
1904
|
}
|
|
@@ -1899,7 +1908,7 @@
|
|
|
1899
1908
|
forms: data.Items
|
|
1900
1909
|
};
|
|
1901
1910
|
});
|
|
1902
|
-
|
|
1911
|
+
api.SetCacheItem({
|
|
1903
1912
|
key: GetListCacheKey(typeId),
|
|
1904
1913
|
value: prom,
|
|
1905
1914
|
req: reqParams
|
|
@@ -1923,7 +1932,7 @@
|
|
|
1923
1932
|
data.ID = 0;
|
|
1924
1933
|
}
|
|
1925
1934
|
const res = yield api.POST(`customForm/${data.ID}`, data, exports.Api.PrepReqParams(reqParams));
|
|
1926
|
-
|
|
1935
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.CustomForm);
|
|
1927
1936
|
return {
|
|
1928
1937
|
form: res
|
|
1929
1938
|
};
|
|
@@ -2372,7 +2381,7 @@
|
|
|
2372
2381
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
2373
2382
|
}
|
|
2374
2383
|
const key = GetCacheKey(typeId);
|
|
2375
|
-
const cache =
|
|
2384
|
+
const cache = api.GetCacheItem(key, reqParams);
|
|
2376
2385
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
2377
2386
|
return cache.data;
|
|
2378
2387
|
}
|
|
@@ -2388,7 +2397,7 @@
|
|
|
2388
2397
|
rej(e);
|
|
2389
2398
|
}
|
|
2390
2399
|
}));
|
|
2391
|
-
|
|
2400
|
+
api.SetCacheItem({
|
|
2392
2401
|
key,
|
|
2393
2402
|
value: prom,
|
|
2394
2403
|
req: reqParams
|
|
@@ -2423,11 +2432,16 @@
|
|
|
2423
2432
|
*/
|
|
2424
2433
|
function GetList(params) {
|
|
2425
2434
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2426
|
-
let { entityTypeIds, api, req: reqParams, parentTypeId } = params;
|
|
2435
|
+
let { entityTypeIds, api, req: reqParams, parentTypeId, expandSettings, search } = params;
|
|
2427
2436
|
if (!api) {
|
|
2428
2437
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
2429
2438
|
}
|
|
2430
|
-
const cache =
|
|
2439
|
+
const cache = api.GetCacheItem(GetListCacheKey({
|
|
2440
|
+
typeIds: entityTypeIds,
|
|
2441
|
+
parentTypeId,
|
|
2442
|
+
expandSettings,
|
|
2443
|
+
search
|
|
2444
|
+
}), reqParams);
|
|
2431
2445
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
2432
2446
|
return cache.data;
|
|
2433
2447
|
}
|
|
@@ -2446,6 +2460,12 @@
|
|
|
2446
2460
|
if (parentTypeId) {
|
|
2447
2461
|
urlParams.append("parentEntityTypeID", parentTypeId);
|
|
2448
2462
|
}
|
|
2463
|
+
if (expandSettings) {
|
|
2464
|
+
urlParams.append("expandSettings", "true");
|
|
2465
|
+
}
|
|
2466
|
+
if (search) {
|
|
2467
|
+
urlParams.append("search", search);
|
|
2468
|
+
}
|
|
2449
2469
|
reqs.push(api.GET("entitytypes?" + urlParams.toString(), exports.Api.PrepReqParams(reqParams)));
|
|
2450
2470
|
}
|
|
2451
2471
|
}
|
|
@@ -2454,6 +2474,12 @@
|
|
|
2454
2474
|
if (parentTypeId) {
|
|
2455
2475
|
urlParams.append("parentEntityTypeID", parentTypeId);
|
|
2456
2476
|
}
|
|
2477
|
+
if (expandSettings) {
|
|
2478
|
+
urlParams.append("expandSettings", "true");
|
|
2479
|
+
}
|
|
2480
|
+
if (search) {
|
|
2481
|
+
urlParams.append("search", search);
|
|
2482
|
+
}
|
|
2457
2483
|
reqs.push(api.GET("entitytypes?" + urlParams.toString(), exports.Api.PrepReqParams(reqParams)));
|
|
2458
2484
|
}
|
|
2459
2485
|
const data = yield Promise.all(reqs);
|
|
@@ -2476,8 +2502,13 @@
|
|
|
2476
2502
|
}
|
|
2477
2503
|
}));
|
|
2478
2504
|
if (!parentTypeId) {
|
|
2479
|
-
|
|
2480
|
-
key: GetListCacheKey(
|
|
2505
|
+
api.SetCacheItem({
|
|
2506
|
+
key: GetListCacheKey({
|
|
2507
|
+
typeIds: entityTypeIds,
|
|
2508
|
+
parentTypeId,
|
|
2509
|
+
expandSettings,
|
|
2510
|
+
search
|
|
2511
|
+
}),
|
|
2481
2512
|
value: req,
|
|
2482
2513
|
req: reqParams,
|
|
2483
2514
|
duration: 60 * 5 // 5 minutes.
|
|
@@ -2591,11 +2622,24 @@
|
|
|
2591
2622
|
* @param typeIds
|
|
2592
2623
|
* @returns
|
|
2593
2624
|
*/
|
|
2594
|
-
function GetListCacheKey(
|
|
2625
|
+
function GetListCacheKey(params) {
|
|
2626
|
+
if (!params) {
|
|
2627
|
+
params = {};
|
|
2628
|
+
}
|
|
2629
|
+
let { typeIds, expandSettings, parentTypeId, search } = params;
|
|
2630
|
+
let key = exports.Api.ECacheKey.EntityType;
|
|
2595
2631
|
if (!typeIds) {
|
|
2596
2632
|
typeIds = [];
|
|
2597
2633
|
}
|
|
2598
|
-
|
|
2634
|
+
key += (typeIds.length ? exports.Api.ECacheKey.Id : "") + typeIds.join(",");
|
|
2635
|
+
if (parentTypeId) {
|
|
2636
|
+
key += "_PARENT_" + parentTypeId;
|
|
2637
|
+
}
|
|
2638
|
+
if (!expandSettings) {
|
|
2639
|
+
expandSettings = false;
|
|
2640
|
+
}
|
|
2641
|
+
key += "_EXPAND_" + expandSettings;
|
|
2642
|
+
return key;
|
|
2599
2643
|
}
|
|
2600
2644
|
EntityType.GetListCacheKey = GetListCacheKey;
|
|
2601
2645
|
})(exports.EntityType || (exports.EntityType = {}));
|
|
@@ -5506,7 +5550,7 @@
|
|
|
5506
5550
|
if (!api) {
|
|
5507
5551
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
5508
5552
|
}
|
|
5509
|
-
const cache =
|
|
5553
|
+
const cache = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
5510
5554
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
5511
5555
|
return cache.data;
|
|
5512
5556
|
}
|
|
@@ -5521,7 +5565,7 @@
|
|
|
5521
5565
|
rej(e);
|
|
5522
5566
|
}
|
|
5523
5567
|
}));
|
|
5524
|
-
|
|
5568
|
+
api.SetCacheItem({
|
|
5525
5569
|
key: GetListCacheKey(),
|
|
5526
5570
|
value: req,
|
|
5527
5571
|
req: reqParams
|
|
@@ -5585,7 +5629,7 @@
|
|
|
5585
5629
|
api.Cache.Remove(GetCacheKey(attachments[i].ID));
|
|
5586
5630
|
}
|
|
5587
5631
|
}
|
|
5588
|
-
|
|
5632
|
+
api.Cache.Remove(GetListCacheKey(entityId));
|
|
5589
5633
|
return {
|
|
5590
5634
|
attachments: res.attachments
|
|
5591
5635
|
};
|
|
@@ -5616,7 +5660,7 @@
|
|
|
5616
5660
|
for (let i = 0; i < attachments.length; i++) {
|
|
5617
5661
|
api.Cache.Remove(GetCacheKey(attachments[i].ID));
|
|
5618
5662
|
}
|
|
5619
|
-
|
|
5663
|
+
api.Cache.RemoveByStartsWith(GetListCacheKey(entityId));
|
|
5620
5664
|
});
|
|
5621
5665
|
}
|
|
5622
5666
|
EntityAttachment.UpdateOrder = UpdateOrder;
|
|
@@ -5634,8 +5678,8 @@
|
|
|
5634
5678
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
5635
5679
|
}
|
|
5636
5680
|
yield api.DELETE(`entity/${entityId}/attachments/${attachmentId}`, exports.Api.PrepReqParams(req));
|
|
5637
|
-
|
|
5638
|
-
|
|
5681
|
+
api.Cache.Remove(GetCacheKey(attachmentId));
|
|
5682
|
+
api.Cache.Remove(GetListCacheKey(params.entityId));
|
|
5639
5683
|
});
|
|
5640
5684
|
}
|
|
5641
5685
|
EntityAttachment.Delete = Delete;
|
|
@@ -5653,7 +5697,7 @@
|
|
|
5653
5697
|
if (!api) {
|
|
5654
5698
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
5655
5699
|
}
|
|
5656
|
-
const cache =
|
|
5700
|
+
const cache = api.GetCacheItem(GetListCacheKey(entityId), reqParams);
|
|
5657
5701
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
5658
5702
|
return cache.data;
|
|
5659
5703
|
}
|
|
@@ -5668,7 +5712,7 @@
|
|
|
5668
5712
|
rej(e);
|
|
5669
5713
|
}
|
|
5670
5714
|
}));
|
|
5671
|
-
|
|
5715
|
+
api.SetCacheItem({
|
|
5672
5716
|
key: GetListCacheKey(entityId),
|
|
5673
5717
|
value: req,
|
|
5674
5718
|
req: reqParams
|
|
@@ -5749,7 +5793,7 @@
|
|
|
5749
5793
|
const url = `entity/${data["TargetObject.ID"]}/comment` + (data.ID == null ? "" : "/" + data.ID);
|
|
5750
5794
|
const res = yield api.POST(url, data, exports.Api.PrepReqParams(reqParams));
|
|
5751
5795
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
5752
|
-
|
|
5796
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Comment + exports.Api.ECacheKey.Entity);
|
|
5753
5797
|
return {
|
|
5754
5798
|
comment: res
|
|
5755
5799
|
};
|
|
@@ -5771,7 +5815,7 @@
|
|
|
5771
5815
|
}
|
|
5772
5816
|
yield api.DELETE(`entity/${entityId}/comment/${commentId}`, exports.Api.PrepReqParams(reqParams));
|
|
5773
5817
|
api.Cache.Remove(GetCacheKey(commentId));
|
|
5774
|
-
|
|
5818
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Comment + exports.Api.ECacheKey.Entity);
|
|
5775
5819
|
});
|
|
5776
5820
|
}
|
|
5777
5821
|
EntityComment.Delete = Delete;
|
|
@@ -5789,7 +5833,7 @@
|
|
|
5789
5833
|
if (!api) {
|
|
5790
5834
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
5791
5835
|
}
|
|
5792
|
-
const cache =
|
|
5836
|
+
const cache = api.GetCacheItem(GetListCacheKey(entityId), reqParams);
|
|
5793
5837
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
5794
5838
|
return cache.data;
|
|
5795
5839
|
}
|
|
@@ -5804,7 +5848,7 @@
|
|
|
5804
5848
|
rej(e);
|
|
5805
5849
|
}
|
|
5806
5850
|
}));
|
|
5807
|
-
|
|
5851
|
+
api.SetCacheItem({
|
|
5808
5852
|
key: GetListCacheKey(entityId),
|
|
5809
5853
|
value: req,
|
|
5810
5854
|
req: reqParams
|
|
@@ -5861,7 +5905,7 @@
|
|
|
5861
5905
|
const url = `entity/${data["Entity.ID"]}/link` + (data.ID == null ? "" : "/" + data.ID);
|
|
5862
5906
|
const res = yield api.POST(url, data, exports.Api.PrepReqParams(reqParams));
|
|
5863
5907
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
5864
|
-
|
|
5908
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Link + exports.Api.ECacheKey.Entity);
|
|
5865
5909
|
return {
|
|
5866
5910
|
link: res
|
|
5867
5911
|
};
|
|
@@ -5883,7 +5927,7 @@
|
|
|
5883
5927
|
}
|
|
5884
5928
|
yield api.DELETE(`entity/${entityId}/link/${linkId}`, exports.Api.PrepReqParams(reqParams));
|
|
5885
5929
|
api.Cache.Remove(GetCacheKey(linkId));
|
|
5886
|
-
|
|
5930
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Link + exports.Api.ECacheKey.Entity);
|
|
5887
5931
|
});
|
|
5888
5932
|
}
|
|
5889
5933
|
EntityLink.Delete = Delete;
|
|
@@ -5901,7 +5945,7 @@
|
|
|
5901
5945
|
if (!api) {
|
|
5902
5946
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
5903
5947
|
}
|
|
5904
|
-
const cache =
|
|
5948
|
+
const cache = api.GetCacheItem(GetListCacheKey(entityId), reqParams);
|
|
5905
5949
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
5906
5950
|
return cache.data;
|
|
5907
5951
|
}
|
|
@@ -5916,7 +5960,7 @@
|
|
|
5916
5960
|
rej(e);
|
|
5917
5961
|
}
|
|
5918
5962
|
}));
|
|
5919
|
-
|
|
5963
|
+
api.SetCacheItem({
|
|
5920
5964
|
key: GetListCacheKey(entityId),
|
|
5921
5965
|
value: req,
|
|
5922
5966
|
req: reqParams
|
|
@@ -5999,7 +6043,7 @@
|
|
|
5999
6043
|
if (!api) {
|
|
6000
6044
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
6001
6045
|
}
|
|
6002
|
-
const cache =
|
|
6046
|
+
const cache = api.GetCacheItem(GetCacheKey(url), reqParams);
|
|
6003
6047
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6004
6048
|
return cache.data;
|
|
6005
6049
|
}
|
|
@@ -6014,7 +6058,7 @@
|
|
|
6014
6058
|
rej(e);
|
|
6015
6059
|
}
|
|
6016
6060
|
}));
|
|
6017
|
-
|
|
6061
|
+
api.SetCacheItem({
|
|
6018
6062
|
key: GetCacheKey(url),
|
|
6019
6063
|
value: req,
|
|
6020
6064
|
req: reqParams
|
|
@@ -6061,7 +6105,7 @@
|
|
|
6061
6105
|
if (!entityId) {
|
|
6062
6106
|
throw ("Entity id is required.");
|
|
6063
6107
|
}
|
|
6064
|
-
const cache =
|
|
6108
|
+
const cache = api.GetCacheItem(GetEntityListKey(entityId), reqParams);
|
|
6065
6109
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6066
6110
|
return cache.data;
|
|
6067
6111
|
}
|
|
@@ -6077,7 +6121,7 @@
|
|
|
6077
6121
|
rej(e);
|
|
6078
6122
|
}
|
|
6079
6123
|
}));
|
|
6080
|
-
|
|
6124
|
+
api.SetCacheItem({
|
|
6081
6125
|
key: GetEntityListKey(entityId),
|
|
6082
6126
|
value: prom,
|
|
6083
6127
|
req: reqParams
|
|
@@ -6099,7 +6143,7 @@
|
|
|
6099
6143
|
if (!group) {
|
|
6100
6144
|
group = "DEFAULT";
|
|
6101
6145
|
}
|
|
6102
|
-
const cache =
|
|
6146
|
+
const cache = api.GetCacheItem(GetTypeListKey(typeId, group), reqParams);
|
|
6103
6147
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6104
6148
|
return cache.data;
|
|
6105
6149
|
}
|
|
@@ -6116,7 +6160,7 @@
|
|
|
6116
6160
|
rej(e);
|
|
6117
6161
|
}
|
|
6118
6162
|
}));
|
|
6119
|
-
|
|
6163
|
+
api.SetCacheItem({
|
|
6120
6164
|
key: GetTypeListKey(typeId, group),
|
|
6121
6165
|
value: prom,
|
|
6122
6166
|
req: reqParams
|
|
@@ -6229,7 +6273,7 @@
|
|
|
6229
6273
|
if (!api) {
|
|
6230
6274
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
6231
6275
|
}
|
|
6232
|
-
const cache =
|
|
6276
|
+
const cache = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
6233
6277
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6234
6278
|
return cache.data;
|
|
6235
6279
|
}
|
|
@@ -6244,7 +6288,7 @@
|
|
|
6244
6288
|
rej(e);
|
|
6245
6289
|
}
|
|
6246
6290
|
}));
|
|
6247
|
-
|
|
6291
|
+
api.SetCacheItem({
|
|
6248
6292
|
key: GetListCacheKey(),
|
|
6249
6293
|
value: req,
|
|
6250
6294
|
req: reqParams
|
|
@@ -6267,7 +6311,7 @@
|
|
|
6267
6311
|
if (!api) {
|
|
6268
6312
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
6269
6313
|
}
|
|
6270
|
-
const cache =
|
|
6314
|
+
const cache = api.GetCacheItem(GetCacheKey(id), reqParams);
|
|
6271
6315
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6272
6316
|
return cache.data;
|
|
6273
6317
|
}
|
|
@@ -6282,7 +6326,7 @@
|
|
|
6282
6326
|
rej(e);
|
|
6283
6327
|
}
|
|
6284
6328
|
}));
|
|
6285
|
-
|
|
6329
|
+
api.SetCacheItem({
|
|
6286
6330
|
key: GetCacheKey(id),
|
|
6287
6331
|
value: req,
|
|
6288
6332
|
req: reqParams
|
|
@@ -6378,7 +6422,7 @@
|
|
|
6378
6422
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
6379
6423
|
}
|
|
6380
6424
|
const key = GetCacheKey(typeId);
|
|
6381
|
-
const cache =
|
|
6425
|
+
const cache = api.GetCacheItem(key, reqParams);
|
|
6382
6426
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6383
6427
|
return cache.data;
|
|
6384
6428
|
}
|
|
@@ -6393,7 +6437,7 @@
|
|
|
6393
6437
|
rej(e);
|
|
6394
6438
|
}
|
|
6395
6439
|
}));
|
|
6396
|
-
|
|
6440
|
+
api.SetCacheItem({
|
|
6397
6441
|
key,
|
|
6398
6442
|
value: prom,
|
|
6399
6443
|
req: reqParams
|
|
@@ -6432,7 +6476,7 @@
|
|
|
6432
6476
|
if (!api) {
|
|
6433
6477
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
6434
6478
|
}
|
|
6435
|
-
const cache =
|
|
6479
|
+
const cache = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
6436
6480
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6437
6481
|
return cache.data;
|
|
6438
6482
|
}
|
|
@@ -6447,7 +6491,7 @@
|
|
|
6447
6491
|
rej(e);
|
|
6448
6492
|
}
|
|
6449
6493
|
}));
|
|
6450
|
-
|
|
6494
|
+
api.SetCacheItem({
|
|
6451
6495
|
key: GetListCacheKey(),
|
|
6452
6496
|
value: req,
|
|
6453
6497
|
req: reqParams
|
|
@@ -6530,11 +6574,11 @@
|
|
|
6530
6574
|
};
|
|
6531
6575
|
const url = `entity/${data["Principal.Entity.ID"]}/relation/${data["Relation.Type.ID"]}/add`;
|
|
6532
6576
|
yield api.POST(url, reqData, exports.Api.PrepReqParams(reqParams));
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6577
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + data["Principal.Entity.ID"]);
|
|
6578
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + data["Related.Entity.ID"]);
|
|
6579
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.RelationType);
|
|
6536
6580
|
if (data["Data.Entity.ID"]) {
|
|
6537
|
-
|
|
6581
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + data["Data.Entity.ID"]);
|
|
6538
6582
|
}
|
|
6539
6583
|
});
|
|
6540
6584
|
}
|
|
@@ -6557,9 +6601,9 @@
|
|
|
6557
6601
|
"Related.Entity.ID": [relatedEntityId]
|
|
6558
6602
|
}, exports.Api.PrepReqParams(reqParams));
|
|
6559
6603
|
// Remove related cache entries
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6604
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + principalEntityId);
|
|
6605
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + relatedEntityId);
|
|
6606
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.RelationType + exports.Api.ECacheKey.Id + relationTypeId);
|
|
6563
6607
|
});
|
|
6564
6608
|
}
|
|
6565
6609
|
EntityRelation.Delete = Delete;
|
|
@@ -6579,11 +6623,11 @@
|
|
|
6579
6623
|
}
|
|
6580
6624
|
const url = `entity/${data["Principal.Entity.ID"]}/otherEntityID/${data["Related.Entity.ID"]}/relation/${data["Relation.Type.ID"]}/update`;
|
|
6581
6625
|
const res = yield api.POST(url, data, exports.Api.PrepReqParams(reqParams));
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6626
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + data["Principal.Entity.ID"]);
|
|
6627
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + data["Related.Entity.ID"]);
|
|
6628
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.RelationType + exports.Api.ECacheKey.Id + data["Relation.Type.ID"]);
|
|
6585
6629
|
if (data["Data.Entity.ID"]) {
|
|
6586
|
-
|
|
6630
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + data["Data.Entity.ID"]);
|
|
6587
6631
|
}
|
|
6588
6632
|
});
|
|
6589
6633
|
}
|
|
@@ -6603,7 +6647,7 @@
|
|
|
6603
6647
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
6604
6648
|
}
|
|
6605
6649
|
filter = Object.assign({ relationTypeId: "", oneWayOnly: false, loadEntityData: false }, filter);
|
|
6606
|
-
const cache =
|
|
6650
|
+
const cache = api.GetCacheItem(GetListCacheKey(entityId, filter), reqParams);
|
|
6607
6651
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6608
6652
|
return cache.data;
|
|
6609
6653
|
}
|
|
@@ -6623,7 +6667,7 @@
|
|
|
6623
6667
|
rej(e);
|
|
6624
6668
|
}
|
|
6625
6669
|
}));
|
|
6626
|
-
|
|
6670
|
+
api.SetCacheItem({
|
|
6627
6671
|
key: GetListCacheKey(entityId, filter),
|
|
6628
6672
|
value: req,
|
|
6629
6673
|
req: reqParams
|
|
@@ -6646,7 +6690,7 @@
|
|
|
6646
6690
|
if (!api) {
|
|
6647
6691
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
6648
6692
|
}
|
|
6649
|
-
const cache =
|
|
6693
|
+
const cache = api.GetCacheItem(GetEntityCacheKey(entityId), reqParams);
|
|
6650
6694
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6651
6695
|
return cache.data;
|
|
6652
6696
|
}
|
|
@@ -6661,7 +6705,7 @@
|
|
|
6661
6705
|
rej(e);
|
|
6662
6706
|
}
|
|
6663
6707
|
}));
|
|
6664
|
-
|
|
6708
|
+
api.SetCacheItem({
|
|
6665
6709
|
key: GetEntityCacheKey(entityId),
|
|
6666
6710
|
value: prom,
|
|
6667
6711
|
req: reqParams
|
|
@@ -6769,7 +6813,7 @@
|
|
|
6769
6813
|
const reqs = [];
|
|
6770
6814
|
for (let i = 0; i < sourceKeys.length; i++) {
|
|
6771
6815
|
const sourceKey = sourceKeys[i];
|
|
6772
|
-
const cache =
|
|
6816
|
+
const cache = api.GetCacheItem(GetCacheKey(sourceId, sourceKey), reqParams);
|
|
6773
6817
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
6774
6818
|
reqs.push(cache.data);
|
|
6775
6819
|
}
|
|
@@ -6865,7 +6909,7 @@
|
|
|
6865
6909
|
}
|
|
6866
6910
|
const res = yield api.POST("entitysource", source);
|
|
6867
6911
|
const cacheKey = GetCacheKey(source["Source.ID"], source["SourceRecord.Key"]);
|
|
6868
|
-
|
|
6912
|
+
api.Cache.Remove(cacheKey);
|
|
6869
6913
|
return {
|
|
6870
6914
|
source: res
|
|
6871
6915
|
};
|
|
@@ -6982,7 +7026,7 @@
|
|
|
6982
7026
|
rej(e);
|
|
6983
7027
|
}
|
|
6984
7028
|
}));
|
|
6985
|
-
|
|
7029
|
+
api.SetCacheItem({
|
|
6986
7030
|
key: GetCacheKey(id),
|
|
6987
7031
|
value: req,
|
|
6988
7032
|
req: reqParams
|
|
@@ -7007,7 +7051,7 @@
|
|
|
7007
7051
|
if (!api) {
|
|
7008
7052
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
7009
7053
|
}
|
|
7010
|
-
const cache =
|
|
7054
|
+
const cache = api.GetCacheItem(GetListCacheKey(entityTypeId), reqParams);
|
|
7011
7055
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
7012
7056
|
return cache.data;
|
|
7013
7057
|
}
|
|
@@ -7022,7 +7066,7 @@
|
|
|
7022
7066
|
rej(e);
|
|
7023
7067
|
}
|
|
7024
7068
|
}));
|
|
7025
|
-
|
|
7069
|
+
api.SetCacheItem({
|
|
7026
7070
|
key: GetListCacheKey(entityTypeId),
|
|
7027
7071
|
value: req,
|
|
7028
7072
|
req: reqParams
|
|
@@ -7046,7 +7090,7 @@
|
|
|
7046
7090
|
}
|
|
7047
7091
|
yield api.DELETE(`layer/${tagId}`, exports.Api.PrepReqParams(reqParams));
|
|
7048
7092
|
api.Cache.Remove(GetCacheKey(tagId));
|
|
7049
|
-
|
|
7093
|
+
api.Cache.RemoveByStartsWith(GetListCacheKey());
|
|
7050
7094
|
});
|
|
7051
7095
|
}
|
|
7052
7096
|
EntityTag.Delete = Delete;
|
|
@@ -7064,7 +7108,7 @@
|
|
|
7064
7108
|
const url = data.ID ? `layer/${data.ID}` : "layer";
|
|
7065
7109
|
const res = yield api.POST(url, data, exports.Api.PrepReqParams(reqParams));
|
|
7066
7110
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
7067
|
-
|
|
7111
|
+
api.Cache.RemoveByStartsWith(GetListCacheKey());
|
|
7068
7112
|
return {
|
|
7069
7113
|
tag: res
|
|
7070
7114
|
};
|
|
@@ -7154,7 +7198,7 @@
|
|
|
7154
7198
|
if (!api) {
|
|
7155
7199
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
7156
7200
|
}
|
|
7157
|
-
const cache =
|
|
7201
|
+
const cache = api.GetCacheItem(GetCacheKey(entityId), reqParams);
|
|
7158
7202
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
7159
7203
|
return cache.data;
|
|
7160
7204
|
}
|
|
@@ -7169,7 +7213,7 @@
|
|
|
7169
7213
|
rej(e);
|
|
7170
7214
|
}
|
|
7171
7215
|
}));
|
|
7172
|
-
|
|
7216
|
+
api.SetCacheItem({
|
|
7173
7217
|
key: GetCacheKey(entityId),
|
|
7174
7218
|
value: prom,
|
|
7175
7219
|
req: reqParams
|
|
@@ -7461,7 +7505,7 @@
|
|
|
7461
7505
|
if (!api) {
|
|
7462
7506
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
7463
7507
|
}
|
|
7464
|
-
const cache =
|
|
7508
|
+
const cache = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
7465
7509
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
7466
7510
|
return cache.data;
|
|
7467
7511
|
}
|
|
@@ -7476,7 +7520,7 @@
|
|
|
7476
7520
|
rej(e);
|
|
7477
7521
|
}
|
|
7478
7522
|
}));
|
|
7479
|
-
|
|
7523
|
+
api.SetCacheItem({
|
|
7480
7524
|
key: GetListCacheKey(),
|
|
7481
7525
|
value: res,
|
|
7482
7526
|
req: reqParams
|
|
@@ -7499,7 +7543,7 @@
|
|
|
7499
7543
|
if (!api) {
|
|
7500
7544
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
7501
7545
|
}
|
|
7502
|
-
const cache =
|
|
7546
|
+
const cache = api.GetCacheItem(GetCacheKey(id), reqParams);
|
|
7503
7547
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
7504
7548
|
return cache.data;
|
|
7505
7549
|
}
|
|
@@ -7514,7 +7558,7 @@
|
|
|
7514
7558
|
rej(e);
|
|
7515
7559
|
}
|
|
7516
7560
|
}));
|
|
7517
|
-
|
|
7561
|
+
api.SetCacheItem({
|
|
7518
7562
|
key: GetCacheKey(id),
|
|
7519
7563
|
value: prom,
|
|
7520
7564
|
req: reqParams
|
|
@@ -8192,7 +8236,7 @@
|
|
|
8192
8236
|
throw ("File ID is required.");
|
|
8193
8237
|
}
|
|
8194
8238
|
const key = GetCacheKey(fileId);
|
|
8195
|
-
const cache =
|
|
8239
|
+
const cache = api.GetCacheItem(key, reqParams);
|
|
8196
8240
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
8197
8241
|
return cache.data;
|
|
8198
8242
|
}
|
|
@@ -8207,7 +8251,7 @@
|
|
|
8207
8251
|
rej(e);
|
|
8208
8252
|
}
|
|
8209
8253
|
}));
|
|
8210
|
-
|
|
8254
|
+
api.SetCacheItem({
|
|
8211
8255
|
key,
|
|
8212
8256
|
value: prom,
|
|
8213
8257
|
req: reqParams
|
|
@@ -8713,7 +8757,7 @@
|
|
|
8713
8757
|
});
|
|
8714
8758
|
const key = prom.programKeys.find(k => k.ProgramId === programId);
|
|
8715
8759
|
// const key = GetCacheKey(programId);
|
|
8716
|
-
// const cache =
|
|
8760
|
+
// const cache = api.GetCacheItem(key, reqParams);
|
|
8717
8761
|
// if (cache?.found) {
|
|
8718
8762
|
// return cache.data;
|
|
8719
8763
|
// }
|
|
@@ -8728,7 +8772,7 @@
|
|
|
8728
8772
|
// rej(e);
|
|
8729
8773
|
// }
|
|
8730
8774
|
// });
|
|
8731
|
-
//
|
|
8775
|
+
// api.SetCacheItem({
|
|
8732
8776
|
// key,
|
|
8733
8777
|
// value: prom,
|
|
8734
8778
|
// req: reqParams
|
|
@@ -8750,7 +8794,7 @@
|
|
|
8750
8794
|
if (!api) {
|
|
8751
8795
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
8752
8796
|
}
|
|
8753
|
-
const cache =
|
|
8797
|
+
const cache = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
8754
8798
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
8755
8799
|
return cache.data;
|
|
8756
8800
|
}
|
|
@@ -8765,7 +8809,7 @@
|
|
|
8765
8809
|
rej(e);
|
|
8766
8810
|
}
|
|
8767
8811
|
}));
|
|
8768
|
-
|
|
8812
|
+
api.SetCacheItem({
|
|
8769
8813
|
key: GetListCacheKey(),
|
|
8770
8814
|
value: req,
|
|
8771
8815
|
req: reqParams
|
|
@@ -8988,7 +9032,7 @@
|
|
|
8988
9032
|
if (!api) {
|
|
8989
9033
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
8990
9034
|
}
|
|
8991
|
-
const cache =
|
|
9035
|
+
const cache = api.GetCacheItem(GetCacheKey(tilesetId, loadFiles), reqParams);
|
|
8992
9036
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
8993
9037
|
return cache.data;
|
|
8994
9038
|
}
|
|
@@ -9008,7 +9052,7 @@
|
|
|
9008
9052
|
rej(e);
|
|
9009
9053
|
}
|
|
9010
9054
|
}));
|
|
9011
|
-
|
|
9055
|
+
api.SetCacheItem({
|
|
9012
9056
|
key: GetCacheKey(tilesetId, loadFiles),
|
|
9013
9057
|
value: prom,
|
|
9014
9058
|
req: reqParams
|
|
@@ -9064,7 +9108,7 @@
|
|
|
9064
9108
|
if (!api) {
|
|
9065
9109
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
9066
9110
|
}
|
|
9067
|
-
const cache =
|
|
9111
|
+
const cache = api.GetCacheItem(GetListCacheKey({
|
|
9068
9112
|
assertLocation: assertLocation,
|
|
9069
9113
|
expandSettings: expandSettings,
|
|
9070
9114
|
type: type
|
|
@@ -9104,7 +9148,7 @@
|
|
|
9104
9148
|
rej(e);
|
|
9105
9149
|
}
|
|
9106
9150
|
}));
|
|
9107
|
-
|
|
9151
|
+
api.SetCacheItem({
|
|
9108
9152
|
key: GetListCacheKey({
|
|
9109
9153
|
assertLocation: assertLocation,
|
|
9110
9154
|
expandSettings: expandSettings,
|
|
@@ -9131,8 +9175,8 @@
|
|
|
9131
9175
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
9132
9176
|
}
|
|
9133
9177
|
yield api.DELETE(`tileset/delete/${tilesetId}`, reqParams);
|
|
9134
|
-
|
|
9135
|
-
|
|
9178
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Tileset + exports.Api.ECacheKey.Id + tilesetId);
|
|
9179
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Tileset);
|
|
9136
9180
|
});
|
|
9137
9181
|
}
|
|
9138
9182
|
Tileset.Delete = Delete;
|
|
@@ -9169,8 +9213,8 @@
|
|
|
9169
9213
|
yield api.POST(`tileset/update/${data.id}`, data, exports.Api.PrepReqParams(reqParams));
|
|
9170
9214
|
}
|
|
9171
9215
|
}
|
|
9172
|
-
|
|
9173
|
-
|
|
9216
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Tileset + exports.Api.ECacheKey.Id + data.id);
|
|
9217
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Tileset);
|
|
9174
9218
|
return {
|
|
9175
9219
|
tileset: data
|
|
9176
9220
|
};
|
|
@@ -9455,9 +9499,9 @@
|
|
|
9455
9499
|
};
|
|
9456
9500
|
data.ID = res.ID;
|
|
9457
9501
|
yield api.POST(`tileset/${data.ID}/enableForAccounts`, req, reqParams);
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9502
|
+
api.Cache.Remove(GetCacheKey(data["PublishedBy.ClientAccount.ID"], data["Tileset.ID"]));
|
|
9503
|
+
api.Cache.Remove(GetCacheKey(data["PublishedBy.ClientAccount.ID"]));
|
|
9504
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.PublishTileset + exports.Api.ECacheKey.TilesetAccess);
|
|
9461
9505
|
return {
|
|
9462
9506
|
published: data
|
|
9463
9507
|
};
|
|
@@ -9473,7 +9517,7 @@
|
|
|
9473
9517
|
if (!accountId || !tilesetId) {
|
|
9474
9518
|
throw ("Client account ID and tileset ID are required.");
|
|
9475
9519
|
}
|
|
9476
|
-
const cache =
|
|
9520
|
+
const cache = api.GetCacheItem(GetCacheKey(accountId, tilesetId), reqParams);
|
|
9477
9521
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
9478
9522
|
return cache.data;
|
|
9479
9523
|
}
|
|
@@ -9488,7 +9532,7 @@
|
|
|
9488
9532
|
rej(e);
|
|
9489
9533
|
}
|
|
9490
9534
|
}));
|
|
9491
|
-
|
|
9535
|
+
api.SetCacheItem({
|
|
9492
9536
|
key: GetCacheKey(accountId, tilesetId),
|
|
9493
9537
|
value: prom,
|
|
9494
9538
|
req: reqParams
|
|
@@ -9506,7 +9550,7 @@
|
|
|
9506
9550
|
if (!accountId) {
|
|
9507
9551
|
throw ("Client account ID is required.");
|
|
9508
9552
|
}
|
|
9509
|
-
const cache =
|
|
9553
|
+
const cache = api.GetCacheItem(GetCacheKey(accountId), reqParams);
|
|
9510
9554
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
9511
9555
|
return cache.data;
|
|
9512
9556
|
}
|
|
@@ -9521,7 +9565,7 @@
|
|
|
9521
9565
|
rej(e);
|
|
9522
9566
|
}
|
|
9523
9567
|
}));
|
|
9524
|
-
|
|
9568
|
+
api.SetCacheItem({
|
|
9525
9569
|
key: GetCacheKey(accountId),
|
|
9526
9570
|
value: req,
|
|
9527
9571
|
req: reqParams
|
|
@@ -9847,7 +9891,7 @@
|
|
|
9847
9891
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
9848
9892
|
}
|
|
9849
9893
|
const key = GetCacheKey(viewId, bookmarkId);
|
|
9850
|
-
const cache =
|
|
9894
|
+
const cache = api.GetCacheItem(key, reqParams);
|
|
9851
9895
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
9852
9896
|
return cache.data;
|
|
9853
9897
|
}
|
|
@@ -9862,7 +9906,7 @@
|
|
|
9862
9906
|
rej(e);
|
|
9863
9907
|
}
|
|
9864
9908
|
}));
|
|
9865
|
-
|
|
9909
|
+
api.SetCacheItem({
|
|
9866
9910
|
key,
|
|
9867
9911
|
value: prom,
|
|
9868
9912
|
req: reqParams
|
|
@@ -9904,7 +9948,7 @@
|
|
|
9904
9948
|
if (!api) {
|
|
9905
9949
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
9906
9950
|
}
|
|
9907
|
-
const cache =
|
|
9951
|
+
const cache = api.GetCacheItem(GetListCacheKey(viewId), reqParams);
|
|
9908
9952
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
9909
9953
|
return cache.data;
|
|
9910
9954
|
}
|
|
@@ -9922,7 +9966,7 @@
|
|
|
9922
9966
|
bookmark: item
|
|
9923
9967
|
});
|
|
9924
9968
|
});
|
|
9925
|
-
|
|
9969
|
+
api.SetCacheItem({
|
|
9926
9970
|
key: GetCacheKey(viewId, item.ID),
|
|
9927
9971
|
value: prom,
|
|
9928
9972
|
req: reqParams
|
|
@@ -9936,7 +9980,7 @@
|
|
|
9936
9980
|
rej(e);
|
|
9937
9981
|
}
|
|
9938
9982
|
}));
|
|
9939
|
-
|
|
9983
|
+
api.SetCacheItem({
|
|
9940
9984
|
key: GetListCacheKey(viewId),
|
|
9941
9985
|
value: req,
|
|
9942
9986
|
req: reqParams
|
|
@@ -9983,7 +10027,7 @@
|
|
|
9983
10027
|
"DisplayOrder.Start": 0
|
|
9984
10028
|
};
|
|
9985
10029
|
yield api.POST(`ui.view/${viewId}/slides/setOrder`, reqData, exports.Api.PrepReqParams(reqParams));
|
|
9986
|
-
|
|
10030
|
+
api.Cache.RemoveByStartsWith(GetListCacheKey(viewId));
|
|
9987
10031
|
});
|
|
9988
10032
|
}
|
|
9989
10033
|
ProjectViewBookmark.SetOrder = SetOrder;
|
|
@@ -10043,7 +10087,7 @@
|
|
|
10043
10087
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
10044
10088
|
}
|
|
10045
10089
|
const key = GetCacheKey(viewId);
|
|
10046
|
-
const cache =
|
|
10090
|
+
const cache = api.GetCacheItem(key, reqParams);
|
|
10047
10091
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10048
10092
|
return cache.data;
|
|
10049
10093
|
}
|
|
@@ -10058,7 +10102,7 @@
|
|
|
10058
10102
|
rej(e);
|
|
10059
10103
|
}
|
|
10060
10104
|
}));
|
|
10061
|
-
|
|
10105
|
+
api.SetCacheItem({
|
|
10062
10106
|
key,
|
|
10063
10107
|
value: prom,
|
|
10064
10108
|
req: reqParams
|
|
@@ -10078,7 +10122,7 @@
|
|
|
10078
10122
|
if (!api) {
|
|
10079
10123
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
10080
10124
|
}
|
|
10081
|
-
const cache =
|
|
10125
|
+
const cache = api.GetCacheItem(GetListCacheKey(type), reqParams);
|
|
10082
10126
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10083
10127
|
return cache.data;
|
|
10084
10128
|
}
|
|
@@ -10093,7 +10137,7 @@
|
|
|
10093
10137
|
rej(e);
|
|
10094
10138
|
}
|
|
10095
10139
|
}));
|
|
10096
|
-
|
|
10140
|
+
api.SetCacheItem({
|
|
10097
10141
|
key: GetListCacheKey(type),
|
|
10098
10142
|
value: prom,
|
|
10099
10143
|
req: reqParams
|
|
@@ -10687,7 +10731,7 @@
|
|
|
10687
10731
|
if (!api) {
|
|
10688
10732
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
10689
10733
|
}
|
|
10690
|
-
const cache =
|
|
10734
|
+
const cache = api.GetCacheItem(GetCacheKey(id), reqParams);
|
|
10691
10735
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10692
10736
|
return cache.data;
|
|
10693
10737
|
}
|
|
@@ -10696,7 +10740,7 @@
|
|
|
10696
10740
|
const data = yield api.GET(`accountbyid/${id}`, reqParams);
|
|
10697
10741
|
// Update the cache by subdomain as well in case it's different to the ID.
|
|
10698
10742
|
if ((data === null || data === void 0 ? void 0 : data.ID) && (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) != false) {
|
|
10699
|
-
|
|
10743
|
+
api.SetCacheItem({
|
|
10700
10744
|
key: data.Subdomain,
|
|
10701
10745
|
value: prom,
|
|
10702
10746
|
req: reqParams
|
|
@@ -10710,7 +10754,7 @@
|
|
|
10710
10754
|
rej(e);
|
|
10711
10755
|
}
|
|
10712
10756
|
}));
|
|
10713
|
-
|
|
10757
|
+
api.SetCacheItem({
|
|
10714
10758
|
key: GetCacheKey(id),
|
|
10715
10759
|
value: prom,
|
|
10716
10760
|
req: reqParams
|
|
@@ -10730,7 +10774,7 @@
|
|
|
10730
10774
|
if (!api) {
|
|
10731
10775
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
10732
10776
|
}
|
|
10733
|
-
const cache =
|
|
10777
|
+
const cache = api.GetCacheItem(GetCacheKey(subdomain), reqParams);
|
|
10734
10778
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10735
10779
|
return cache.data;
|
|
10736
10780
|
}
|
|
@@ -10739,7 +10783,7 @@
|
|
|
10739
10783
|
const data = yield api.GET(`account/${subdomain}`, reqParams);
|
|
10740
10784
|
// Update the cache by ID as well in case it's different to the subdomain.
|
|
10741
10785
|
if ((data === null || data === void 0 ? void 0 : data.ID) && (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) != false) {
|
|
10742
|
-
|
|
10786
|
+
api.SetCacheItem({
|
|
10743
10787
|
key: data.ID,
|
|
10744
10788
|
value: prom,
|
|
10745
10789
|
req: reqParams
|
|
@@ -10753,7 +10797,7 @@
|
|
|
10753
10797
|
rej(e);
|
|
10754
10798
|
}
|
|
10755
10799
|
}));
|
|
10756
|
-
|
|
10800
|
+
api.SetCacheItem({
|
|
10757
10801
|
key: GetCacheKey(subdomain),
|
|
10758
10802
|
value: prom,
|
|
10759
10803
|
req: reqParams
|
|
@@ -10773,7 +10817,7 @@
|
|
|
10773
10817
|
if (!api) {
|
|
10774
10818
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
10775
10819
|
}
|
|
10776
|
-
const cache =
|
|
10820
|
+
const cache = api.GetCacheItem(GetListCacheKey(api.GetSessionId()), reqParams);
|
|
10777
10821
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10778
10822
|
return cache.data;
|
|
10779
10823
|
}
|
|
@@ -10790,7 +10834,7 @@
|
|
|
10790
10834
|
rej(e);
|
|
10791
10835
|
}
|
|
10792
10836
|
}));
|
|
10793
|
-
|
|
10837
|
+
api.SetCacheItem({
|
|
10794
10838
|
key: GetListCacheKey(api.GetSessionId()),
|
|
10795
10839
|
value: prom,
|
|
10796
10840
|
req: reqParams
|
|
@@ -10810,7 +10854,7 @@
|
|
|
10810
10854
|
if (!api) {
|
|
10811
10855
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
10812
10856
|
}
|
|
10813
|
-
const cache =
|
|
10857
|
+
const cache = api.GetCacheItem(GetCacheKey(id, appId), reqParams);
|
|
10814
10858
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
10815
10859
|
return cache.data;
|
|
10816
10860
|
}
|
|
@@ -10828,7 +10872,7 @@
|
|
|
10828
10872
|
rej(e);
|
|
10829
10873
|
}
|
|
10830
10874
|
}));
|
|
10831
|
-
|
|
10875
|
+
api.SetCacheItem({
|
|
10832
10876
|
key: GetCacheKey(id, appId),
|
|
10833
10877
|
value: prom,
|
|
10834
10878
|
req: reqParams
|
|
@@ -10850,7 +10894,7 @@
|
|
|
10850
10894
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
10851
10895
|
}
|
|
10852
10896
|
const res = yield api.POST(`account/${id}/applicationSettings/${appId}`, data, reqParams);
|
|
10853
|
-
|
|
10897
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + id);
|
|
10854
10898
|
return {
|
|
10855
10899
|
settings: res
|
|
10856
10900
|
};
|
|
@@ -11179,7 +11223,7 @@
|
|
|
11179
11223
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
11180
11224
|
}
|
|
11181
11225
|
const key = GetCacheKey(sessionId);
|
|
11182
|
-
const cache =
|
|
11226
|
+
const cache = api.GetCacheItem(key, reqParams);
|
|
11183
11227
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
11184
11228
|
return cache.data;
|
|
11185
11229
|
}
|
|
@@ -11194,7 +11238,7 @@
|
|
|
11194
11238
|
rej(e);
|
|
11195
11239
|
}
|
|
11196
11240
|
}));
|
|
11197
|
-
|
|
11241
|
+
api.SetCacheItem({
|
|
11198
11242
|
key,
|
|
11199
11243
|
value: prom,
|
|
11200
11244
|
req: reqParams,
|
|
@@ -11571,13 +11615,22 @@
|
|
|
11571
11615
|
if (!api) {
|
|
11572
11616
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
11573
11617
|
}
|
|
11574
|
-
const
|
|
11618
|
+
const cacheKey = GetCacheKey(id, accountId);
|
|
11619
|
+
const cache = api.GetCacheItem(cacheKey, reqParams);
|
|
11575
11620
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
11576
11621
|
return cache.data;
|
|
11577
11622
|
}
|
|
11578
11623
|
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
11579
11624
|
try {
|
|
11580
|
-
const
|
|
11625
|
+
const urlParams = new URLSearchParams();
|
|
11626
|
+
if (accountId) {
|
|
11627
|
+
urlParams.append("clientAccountID", accountId);
|
|
11628
|
+
}
|
|
11629
|
+
let url = `user/${id}`;
|
|
11630
|
+
if (urlParams.toString().length) {
|
|
11631
|
+
url += "?" + urlParams.toString();
|
|
11632
|
+
}
|
|
11633
|
+
const data = yield api.GET(url, reqParams);
|
|
11581
11634
|
res({
|
|
11582
11635
|
user: data
|
|
11583
11636
|
});
|
|
@@ -11586,8 +11639,8 @@
|
|
|
11586
11639
|
rej(e);
|
|
11587
11640
|
}
|
|
11588
11641
|
}));
|
|
11589
|
-
|
|
11590
|
-
key:
|
|
11642
|
+
api.SetCacheItem({
|
|
11643
|
+
key: cacheKey,
|
|
11591
11644
|
value: prom,
|
|
11592
11645
|
req: reqParams
|
|
11593
11646
|
});
|
|
@@ -11626,10 +11679,10 @@
|
|
|
11626
11679
|
const res = yield api.POST(`user/${data.ID}`, data, reqParams);
|
|
11627
11680
|
api.Cache.RemoveByContains(exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + data.ID);
|
|
11628
11681
|
if (data.Type == EType.AccessToken) {
|
|
11629
|
-
|
|
11682
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.AccessToken + exports.Api.ECacheKey.Account);
|
|
11630
11683
|
}
|
|
11631
11684
|
else if (data.Type == EType.User) {
|
|
11632
|
-
|
|
11685
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.User + exports.Api.ECacheKey.Account);
|
|
11633
11686
|
}
|
|
11634
11687
|
return {
|
|
11635
11688
|
user: res
|
|
@@ -11651,7 +11704,7 @@
|
|
|
11651
11704
|
if (!api) {
|
|
11652
11705
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
11653
11706
|
}
|
|
11654
|
-
const cache =
|
|
11707
|
+
const cache = api.GetCacheItem(GetSettingsCacheKey(userId, appId), req);
|
|
11655
11708
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
11656
11709
|
return cache.data;
|
|
11657
11710
|
}
|
|
@@ -11677,7 +11730,7 @@
|
|
|
11677
11730
|
rej(e);
|
|
11678
11731
|
}
|
|
11679
11732
|
}));
|
|
11680
|
-
|
|
11733
|
+
api.SetCacheItem({
|
|
11681
11734
|
key: GetSettingsCacheKey(userId, appId),
|
|
11682
11735
|
value: prom,
|
|
11683
11736
|
req: req
|
|
@@ -11773,7 +11826,7 @@
|
|
|
11773
11826
|
if (!api) {
|
|
11774
11827
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
11775
11828
|
}
|
|
11776
|
-
const cache =
|
|
11829
|
+
const cache = api.GetCacheItem(GetEmailCacheKey(email, accountId), reqParams);
|
|
11777
11830
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
11778
11831
|
return cache.data;
|
|
11779
11832
|
}
|
|
@@ -11788,7 +11841,7 @@
|
|
|
11788
11841
|
rej(e);
|
|
11789
11842
|
}
|
|
11790
11843
|
}));
|
|
11791
|
-
|
|
11844
|
+
api.SetCacheItem({
|
|
11792
11845
|
key: GetEmailCacheKey(email, accountId),
|
|
11793
11846
|
value: prom,
|
|
11794
11847
|
req: reqParams
|
|
@@ -11814,7 +11867,7 @@
|
|
|
11814
11867
|
if (!exclusive) {
|
|
11815
11868
|
exclusive = false;
|
|
11816
11869
|
}
|
|
11817
|
-
const cache = exclusive ? null :
|
|
11870
|
+
const cache = exclusive ? null : api.GetCacheItem(GetListCacheKey(accountId), reqParams);
|
|
11818
11871
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
11819
11872
|
return cache.data;
|
|
11820
11873
|
}
|
|
@@ -11832,7 +11885,7 @@
|
|
|
11832
11885
|
req.then((data) => __awaiter(this, void 0, void 0, function* () {
|
|
11833
11886
|
const users = data.users;
|
|
11834
11887
|
for (let i = 0; i < users.length; i++) {
|
|
11835
|
-
|
|
11888
|
+
api.SetCacheItem({
|
|
11836
11889
|
key: GetCacheKey(users[i].ID, accountId),
|
|
11837
11890
|
value: {
|
|
11838
11891
|
user: users[i]
|
|
@@ -11842,7 +11895,7 @@
|
|
|
11842
11895
|
}
|
|
11843
11896
|
}));
|
|
11844
11897
|
if (!exclusive) {
|
|
11845
|
-
|
|
11898
|
+
api.SetCacheItem({
|
|
11846
11899
|
key: GetListCacheKey(accountId),
|
|
11847
11900
|
value: req,
|
|
11848
11901
|
req: reqParams
|
|
@@ -12009,7 +12062,7 @@
|
|
|
12009
12062
|
if (!api) {
|
|
12010
12063
|
api = exports.ENVIRONMENT.Api().GetGuardianApi();
|
|
12011
12064
|
}
|
|
12012
|
-
const cache =
|
|
12065
|
+
const cache = api.GetCacheItem(GetListCacheKey(accountId), reqParams);
|
|
12013
12066
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
12014
12067
|
return cache.data;
|
|
12015
12068
|
}
|
|
@@ -12024,7 +12077,7 @@
|
|
|
12024
12077
|
rej(e);
|
|
12025
12078
|
}
|
|
12026
12079
|
}));
|
|
12027
|
-
|
|
12080
|
+
api.SetCacheItem({
|
|
12028
12081
|
key: GetListCacheKey(accountId),
|
|
12029
12082
|
value: req,
|
|
12030
12083
|
req: reqParams
|
|
@@ -12045,7 +12098,7 @@
|
|
|
12045
12098
|
}
|
|
12046
12099
|
yield api.DELETE(`accessToken/${id}`, reqParams);
|
|
12047
12100
|
api.Cache.RemoveByContains(exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + id);
|
|
12048
|
-
|
|
12101
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.AccessToken + exports.Api.ECacheKey.Account);
|
|
12049
12102
|
});
|
|
12050
12103
|
}
|
|
12051
12104
|
AccessToken.Delete = Delete;
|
|
@@ -12070,7 +12123,7 @@
|
|
|
12070
12123
|
data.Type = EType.AccessToken;
|
|
12071
12124
|
}
|
|
12072
12125
|
data = yield api.POST("accessToken", data, reqParams);
|
|
12073
|
-
|
|
12126
|
+
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.AccessToken + exports.Api.ECacheKey.Account);
|
|
12074
12127
|
return {
|
|
12075
12128
|
user: data
|
|
12076
12129
|
};
|
|
@@ -12274,7 +12327,7 @@
|
|
|
12274
12327
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
12275
12328
|
}
|
|
12276
12329
|
const accountId = api.AccountId;
|
|
12277
|
-
const cache =
|
|
12330
|
+
const cache = api.GetCacheItem(GetCacheKey(accountId), reqParams);
|
|
12278
12331
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
12279
12332
|
return cache.data;
|
|
12280
12333
|
}
|
|
@@ -13287,7 +13340,7 @@
|
|
|
13287
13340
|
if (!pageIndex) {
|
|
13288
13341
|
pageIndex = 0;
|
|
13289
13342
|
}
|
|
13290
|
-
const cache =
|
|
13343
|
+
const cache = api.GetCacheItem(GetListCacheKey(type, pageIndex), reqParams);
|
|
13291
13344
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
13292
13345
|
return cache.data;
|
|
13293
13346
|
}
|
|
@@ -13312,7 +13365,7 @@
|
|
|
13312
13365
|
rej(e);
|
|
13313
13366
|
}
|
|
13314
13367
|
}));
|
|
13315
|
-
|
|
13368
|
+
api.SetCacheItem({
|
|
13316
13369
|
key: GetListCacheKey(type, pageIndex),
|
|
13317
13370
|
value: prom,
|
|
13318
13371
|
req: reqParams
|
|
@@ -13332,7 +13385,7 @@
|
|
|
13332
13385
|
if (!api) {
|
|
13333
13386
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
13334
13387
|
}
|
|
13335
|
-
const cache =
|
|
13388
|
+
const cache = api.GetCacheItem(GetCacheKeyByRootId(rootId), reqParams);
|
|
13336
13389
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
13337
13390
|
return cache.data;
|
|
13338
13391
|
}
|
|
@@ -13347,7 +13400,7 @@
|
|
|
13347
13400
|
rej(e);
|
|
13348
13401
|
}
|
|
13349
13402
|
}));
|
|
13350
|
-
|
|
13403
|
+
api.SetCacheItem({
|
|
13351
13404
|
key: GetCacheKeyByRootId(rootId),
|
|
13352
13405
|
value: prom,
|
|
13353
13406
|
req: reqParams
|
|
@@ -13367,7 +13420,7 @@
|
|
|
13367
13420
|
if (!api) {
|
|
13368
13421
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
13369
13422
|
}
|
|
13370
|
-
const cache =
|
|
13423
|
+
const cache = api.GetCacheItem(GetCacheKey(fileId), reqParams);
|
|
13371
13424
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
13372
13425
|
return cache.data;
|
|
13373
13426
|
}
|
|
@@ -13382,7 +13435,7 @@
|
|
|
13382
13435
|
rej(e);
|
|
13383
13436
|
}
|
|
13384
13437
|
}));
|
|
13385
|
-
|
|
13438
|
+
api.SetCacheItem({
|
|
13386
13439
|
key: GetCacheKey(fileId),
|
|
13387
13440
|
value: prom,
|
|
13388
13441
|
req: reqParams
|
|
@@ -13602,7 +13655,7 @@
|
|
|
13602
13655
|
if (!api) {
|
|
13603
13656
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
13604
13657
|
}
|
|
13605
|
-
const cache =
|
|
13658
|
+
const cache = api.GetCacheItem(GetCacheKey(pluginId), req);
|
|
13606
13659
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
13607
13660
|
return cache.data;
|
|
13608
13661
|
}
|
|
@@ -13617,7 +13670,7 @@
|
|
|
13617
13670
|
rej(e);
|
|
13618
13671
|
}
|
|
13619
13672
|
}));
|
|
13620
|
-
|
|
13673
|
+
api.SetCacheItem({
|
|
13621
13674
|
key: GetCacheKey(pluginId),
|
|
13622
13675
|
value: prom,
|
|
13623
13676
|
req: req
|
|
@@ -13637,7 +13690,7 @@
|
|
|
13637
13690
|
if (!api) {
|
|
13638
13691
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
13639
13692
|
}
|
|
13640
|
-
const cache =
|
|
13693
|
+
const cache = api.GetCacheItem(GetListCacheKey(), req);
|
|
13641
13694
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
13642
13695
|
return cache.data;
|
|
13643
13696
|
}
|
|
@@ -13652,7 +13705,7 @@
|
|
|
13652
13705
|
rej(e);
|
|
13653
13706
|
}
|
|
13654
13707
|
}));
|
|
13655
|
-
|
|
13708
|
+
api.SetCacheItem({
|
|
13656
13709
|
key: GetListCacheKey(),
|
|
13657
13710
|
value: prom,
|
|
13658
13711
|
req: req
|
|
@@ -13936,8 +13989,8 @@
|
|
|
13936
13989
|
}
|
|
13937
13990
|
const url = `source` + (data.ID == null ? "" : "/" + data.ID);
|
|
13938
13991
|
const res = yield api.POST(url, data, exports.Api.PrepReqParams(reqParams));
|
|
13939
|
-
|
|
13940
|
-
|
|
13992
|
+
api.Cache.Remove(GetCacheKey(data.ID));
|
|
13993
|
+
api.Cache.Remove(GetListCacheKey());
|
|
13941
13994
|
return {
|
|
13942
13995
|
source: res
|
|
13943
13996
|
};
|
|
@@ -13955,8 +14008,8 @@
|
|
|
13955
14008
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
13956
14009
|
}
|
|
13957
14010
|
yield api.DELETE(`source/${id}`, exports.Api.PrepReqParams(reqParams));
|
|
13958
|
-
|
|
13959
|
-
|
|
14011
|
+
api.Cache.Remove(GetCacheKey(id));
|
|
14012
|
+
api.Cache.Remove(GetListCacheKey());
|
|
13960
14013
|
});
|
|
13961
14014
|
}
|
|
13962
14015
|
DataSource.Delete = Delete;
|
|
@@ -13972,7 +14025,7 @@
|
|
|
13972
14025
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
13973
14026
|
}
|
|
13974
14027
|
reqParams = exports.Api.PrepReqParams(reqParams);
|
|
13975
|
-
const cacheData =
|
|
14028
|
+
const cacheData = api.GetCacheItem(GetCacheKey(id), reqParams);
|
|
13976
14029
|
if (cacheData === null || cacheData === void 0 ? void 0 : cacheData.found) {
|
|
13977
14030
|
return cacheData.data;
|
|
13978
14031
|
}
|
|
@@ -14008,7 +14061,7 @@
|
|
|
14008
14061
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
14009
14062
|
}
|
|
14010
14063
|
reqParams = exports.Api.PrepReqParams(reqParams);
|
|
14011
|
-
const cacheData =
|
|
14064
|
+
const cacheData = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
14012
14065
|
if (cacheData === null || cacheData === void 0 ? void 0 : cacheData.found) {
|
|
14013
14066
|
return cacheData.data;
|
|
14014
14067
|
}
|
|
@@ -14086,7 +14139,7 @@
|
|
|
14086
14139
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
14087
14140
|
|
|
14088
14141
|
// This is updated with the package.json version on build.
|
|
14089
|
-
const VERSION = "4.9.
|
|
14142
|
+
const VERSION = "4.9.9";
|
|
14090
14143
|
|
|
14091
14144
|
exports.VERSION = VERSION;
|
|
14092
14145
|
exports.AbstractApi = AbstractApi;
|