bruce-models 2.0.8 → 2.1.0
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 +19 -6
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +19 -6
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/entity/entity.js +15 -5
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/entity/getters/entity-filter-getter.js +4 -1
- package/dist/lib/entity/getters/entity-filter-getter.js.map +1 -1
- package/dist/types/entity/entity.d.ts +2 -1
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -4724,24 +4724,34 @@ var PathUtils;
|
|
|
4724
4724
|
*/
|
|
4725
4725
|
var Entity;
|
|
4726
4726
|
(function (Entity) {
|
|
4727
|
-
function GetCacheKey(entityId, expandLocation) {
|
|
4728
|
-
|
|
4727
|
+
function GetCacheKey(entityId, entityTypeId, expandLocation) {
|
|
4728
|
+
if (!entityTypeId) {
|
|
4729
|
+
entityTypeId = "";
|
|
4730
|
+
}
|
|
4731
|
+
return `${Api.ECacheKey.Entity}${Api.ECacheKey.Id}${entityId}${String(entityTypeId)}${String(Boolean(expandLocation))}`;
|
|
4729
4732
|
}
|
|
4730
4733
|
Entity.GetCacheKey = GetCacheKey;
|
|
4731
4734
|
function Get(params) {
|
|
4732
4735
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4733
|
-
const { api, entityId, req: reqParams, expandLocation } = params;
|
|
4736
|
+
const { api, entityId, req: reqParams, expandLocation, entityTypeId } = params;
|
|
4734
4737
|
if (!entityId) {
|
|
4735
4738
|
throw ("Entity ID is required.");
|
|
4736
4739
|
}
|
|
4737
|
-
const key = GetCacheKey(entityId, expandLocation);
|
|
4740
|
+
const key = GetCacheKey(entityId, entityTypeId, expandLocation);
|
|
4738
4741
|
const cacheData = yield api.GetCacheItem(key, reqParams);
|
|
4739
4742
|
if (cacheData) {
|
|
4740
4743
|
return cacheData;
|
|
4741
4744
|
}
|
|
4742
4745
|
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
4743
4746
|
try {
|
|
4744
|
-
const
|
|
4747
|
+
const urlParams = new URLSearchParams();
|
|
4748
|
+
if (expandLocation) {
|
|
4749
|
+
urlParams.append("$expand", "location");
|
|
4750
|
+
}
|
|
4751
|
+
if (entityTypeId) {
|
|
4752
|
+
urlParams.append("BruceEntityType", entityTypeId);
|
|
4753
|
+
}
|
|
4754
|
+
const data = yield api.GET(`entity/${entityId}?${urlParams.toString()}`, Api.PrepReqParams(reqParams));
|
|
4745
4755
|
res({
|
|
4746
4756
|
entity: data
|
|
4747
4757
|
});
|
|
@@ -7602,7 +7612,10 @@ var EntityFilterGetter;
|
|
|
7602
7612
|
sortOrder: Api.ESortOrder.Asc,
|
|
7603
7613
|
entityTypeConditions: this.attrFilter
|
|
7604
7614
|
},
|
|
7605
|
-
viaCdn: this.viaCdn
|
|
7615
|
+
viaCdn: this.viaCdn,
|
|
7616
|
+
req: {
|
|
7617
|
+
noCache: true
|
|
7618
|
+
}
|
|
7606
7619
|
});
|
|
7607
7620
|
const integrity = this.getIntegrityId();
|
|
7608
7621
|
if (loopIntegrity == integrity && entities) {
|