bruce-models 4.9.6 → 4.9.8
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 +43 -6
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +43 -6
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/entity/entity-attribute.js +2 -0
- package/dist/lib/entity/entity-attribute.js.map +1 -1
- package/dist/lib/entity/entity-type.js +40 -5
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity-attribute.d.ts +2 -1
- package/dist/types/entity/entity-type.d.ts +8 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -2266,6 +2266,8 @@
|
|
|
2266
2266
|
EType["Geometry"] = "Geometry";
|
|
2267
2267
|
// True/false attribute.
|
|
2268
2268
|
EType["Boolean"] = "Boolean";
|
|
2269
|
+
// String User ID.
|
|
2270
|
+
EType["User"] = "User";
|
|
2269
2271
|
})(EType = EntityAttribute.EType || (EntityAttribute.EType = {}));
|
|
2270
2272
|
/**
|
|
2271
2273
|
* Returns an attribute from a provided hierarchy of attributes.
|
|
@@ -2421,11 +2423,16 @@
|
|
|
2421
2423
|
*/
|
|
2422
2424
|
function GetList(params) {
|
|
2423
2425
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2424
|
-
let { entityTypeIds, api, req: reqParams, parentTypeId } = params;
|
|
2426
|
+
let { entityTypeIds, api, req: reqParams, parentTypeId, expandSettings, search } = params;
|
|
2425
2427
|
if (!api) {
|
|
2426
2428
|
api = exports.ENVIRONMENT.Api().GetBruceApi();
|
|
2427
2429
|
}
|
|
2428
|
-
const cache =
|
|
2430
|
+
const cache = yield api.GetCacheItem(GetListCacheKey({
|
|
2431
|
+
typeIds: entityTypeIds,
|
|
2432
|
+
parentTypeId,
|
|
2433
|
+
expandSettings,
|
|
2434
|
+
search
|
|
2435
|
+
}), reqParams);
|
|
2429
2436
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
2430
2437
|
return cache.data;
|
|
2431
2438
|
}
|
|
@@ -2444,6 +2451,12 @@
|
|
|
2444
2451
|
if (parentTypeId) {
|
|
2445
2452
|
urlParams.append("parentEntityTypeID", parentTypeId);
|
|
2446
2453
|
}
|
|
2454
|
+
if (expandSettings) {
|
|
2455
|
+
urlParams.append("expandSettings", "true");
|
|
2456
|
+
}
|
|
2457
|
+
if (search) {
|
|
2458
|
+
urlParams.append("search", search);
|
|
2459
|
+
}
|
|
2447
2460
|
reqs.push(api.GET("entitytypes?" + urlParams.toString(), exports.Api.PrepReqParams(reqParams)));
|
|
2448
2461
|
}
|
|
2449
2462
|
}
|
|
@@ -2452,6 +2465,12 @@
|
|
|
2452
2465
|
if (parentTypeId) {
|
|
2453
2466
|
urlParams.append("parentEntityTypeID", parentTypeId);
|
|
2454
2467
|
}
|
|
2468
|
+
if (expandSettings) {
|
|
2469
|
+
urlParams.append("expandSettings", "true");
|
|
2470
|
+
}
|
|
2471
|
+
if (search) {
|
|
2472
|
+
urlParams.append("search", search);
|
|
2473
|
+
}
|
|
2455
2474
|
reqs.push(api.GET("entitytypes?" + urlParams.toString(), exports.Api.PrepReqParams(reqParams)));
|
|
2456
2475
|
}
|
|
2457
2476
|
const data = yield Promise.all(reqs);
|
|
@@ -2475,7 +2494,12 @@
|
|
|
2475
2494
|
}));
|
|
2476
2495
|
if (!parentTypeId) {
|
|
2477
2496
|
yield api.SetCacheItem({
|
|
2478
|
-
key: GetListCacheKey(
|
|
2497
|
+
key: GetListCacheKey({
|
|
2498
|
+
typeIds: entityTypeIds,
|
|
2499
|
+
parentTypeId,
|
|
2500
|
+
expandSettings,
|
|
2501
|
+
search
|
|
2502
|
+
}),
|
|
2479
2503
|
value: req,
|
|
2480
2504
|
req: reqParams,
|
|
2481
2505
|
duration: 60 * 5 // 5 minutes.
|
|
@@ -2589,11 +2613,24 @@
|
|
|
2589
2613
|
* @param typeIds
|
|
2590
2614
|
* @returns
|
|
2591
2615
|
*/
|
|
2592
|
-
function GetListCacheKey(
|
|
2616
|
+
function GetListCacheKey(params) {
|
|
2617
|
+
if (!params) {
|
|
2618
|
+
params = {};
|
|
2619
|
+
}
|
|
2620
|
+
let { typeIds, expandSettings, parentTypeId, search } = params;
|
|
2621
|
+
let key = exports.Api.ECacheKey.EntityType;
|
|
2593
2622
|
if (!typeIds) {
|
|
2594
2623
|
typeIds = [];
|
|
2595
2624
|
}
|
|
2596
|
-
|
|
2625
|
+
key += (typeIds.length ? exports.Api.ECacheKey.Id : "") + typeIds.join(",");
|
|
2626
|
+
if (parentTypeId) {
|
|
2627
|
+
key += "_PARENT_" + parentTypeId;
|
|
2628
|
+
}
|
|
2629
|
+
if (!expandSettings) {
|
|
2630
|
+
expandSettings = false;
|
|
2631
|
+
}
|
|
2632
|
+
key += "_EXPAND_" + expandSettings;
|
|
2633
|
+
return key;
|
|
2597
2634
|
}
|
|
2598
2635
|
EntityType.GetListCacheKey = GetListCacheKey;
|
|
2599
2636
|
})(exports.EntityType || (exports.EntityType = {}));
|
|
@@ -14084,7 +14121,7 @@
|
|
|
14084
14121
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
14085
14122
|
|
|
14086
14123
|
// This is updated with the package.json version on build.
|
|
14087
|
-
const VERSION = "4.9.
|
|
14124
|
+
const VERSION = "4.9.8";
|
|
14088
14125
|
|
|
14089
14126
|
exports.VERSION = VERSION;
|
|
14090
14127
|
exports.AbstractApi = AbstractApi;
|