bruce-models 4.3.2 → 4.3.4
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 +28 -24
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +28 -24
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/entity/entity-type.js +16 -7
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/util/path-utils.js +11 -16
- package/dist/lib/util/path-utils.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity-type.d.ts +3 -1
- package/dist/types/util/path-utils.d.ts +2 -1
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -2836,7 +2836,7 @@ var EntityType;
|
|
|
2836
2836
|
}
|
|
2837
2837
|
yield api.DELETE(`entitytype/${typeId}`, Api.PrepReqParams(reqParams));
|
|
2838
2838
|
api.Cache.Remove(GetCacheKey(typeId));
|
|
2839
|
-
api.Cache.
|
|
2839
|
+
api.Cache.RemoveByStartsWith(GetListCacheKey());
|
|
2840
2840
|
});
|
|
2841
2841
|
}
|
|
2842
2842
|
EntityType.Delete = Delete;
|
|
@@ -2847,11 +2847,11 @@ var EntityType;
|
|
|
2847
2847
|
*/
|
|
2848
2848
|
function GetList(params) {
|
|
2849
2849
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2850
|
-
let { api, req: reqParams, parentTypeId } = params;
|
|
2850
|
+
let { entityTypeIds, api, req: reqParams, parentTypeId } = params;
|
|
2851
2851
|
if (!api) {
|
|
2852
2852
|
api = ENVIRONMENT.Api().GetBruceApi();
|
|
2853
2853
|
}
|
|
2854
|
-
const cache = parentTypeId ? null : yield api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
2854
|
+
const cache = parentTypeId ? null : yield api.GetCacheItem(GetListCacheKey(entityTypeIds), reqParams);
|
|
2855
2855
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
2856
2856
|
return cache.data;
|
|
2857
2857
|
}
|
|
@@ -2861,6 +2861,11 @@ var EntityType;
|
|
|
2861
2861
|
if (parentTypeId) {
|
|
2862
2862
|
urlParams.append("parentEntityTypeID", parentTypeId);
|
|
2863
2863
|
}
|
|
2864
|
+
if (entityTypeIds) {
|
|
2865
|
+
for (const id of entityTypeIds) {
|
|
2866
|
+
urlParams.append("typeId", id);
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2864
2869
|
const data = yield api.GET("entitytypes?" + urlParams.toString(), Api.PrepReqParams(reqParams));
|
|
2865
2870
|
res({
|
|
2866
2871
|
entityTypes: data.Items
|
|
@@ -2872,7 +2877,7 @@ var EntityType;
|
|
|
2872
2877
|
}));
|
|
2873
2878
|
if (!parentTypeId) {
|
|
2874
2879
|
yield api.SetCacheItem({
|
|
2875
|
-
key: GetListCacheKey(),
|
|
2880
|
+
key: GetListCacheKey(entityTypeIds),
|
|
2876
2881
|
value: req,
|
|
2877
2882
|
req: reqParams,
|
|
2878
2883
|
duration: 60 * 5 // 5 minutes.
|
|
@@ -2904,7 +2909,7 @@ var EntityType;
|
|
|
2904
2909
|
}
|
|
2905
2910
|
const res = yield api.POST(`entitytype/${data.ID}`, data, Api.PrepReqParams(reqParams));
|
|
2906
2911
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
2907
|
-
api.Cache.
|
|
2912
|
+
api.Cache.RemoveByStartsWith(GetListCacheKey());
|
|
2908
2913
|
return {
|
|
2909
2914
|
entityType: res
|
|
2910
2915
|
};
|
|
@@ -2979,10 +2984,14 @@ var EntityType;
|
|
|
2979
2984
|
* const key = GetListCacheKey();
|
|
2980
2985
|
* api.Cache.Remove(key);
|
|
2981
2986
|
* }
|
|
2987
|
+
* @param typeIds
|
|
2982
2988
|
* @returns
|
|
2983
2989
|
*/
|
|
2984
|
-
function GetListCacheKey() {
|
|
2985
|
-
|
|
2990
|
+
function GetListCacheKey(typeIds) {
|
|
2991
|
+
if (!typeIds) {
|
|
2992
|
+
typeIds = [];
|
|
2993
|
+
}
|
|
2994
|
+
return Api.ECacheKey.EntityType + (typeIds.length ? Api.ECacheKey.Id : "") + typeIds.join(",");
|
|
2986
2995
|
}
|
|
2987
2996
|
EntityType.GetListCacheKey = GetListCacheKey;
|
|
2988
2997
|
})(EntityType || (EntityType = {}));
|
|
@@ -2993,7 +3002,8 @@ var EntityType;
|
|
|
2993
3002
|
var PathUtils;
|
|
2994
3003
|
(function (PathUtils) {
|
|
2995
3004
|
/**
|
|
2996
|
-
* Parses a string path into an array of strings.
|
|
3005
|
+
* Parses a Bruce string path into an array of strings.
|
|
3006
|
+
* Example of path: "\"location\"/\"latitude\"" or "location/latitude".
|
|
2997
3007
|
* @param str
|
|
2998
3008
|
* @returns
|
|
2999
3009
|
*/
|
|
@@ -3001,23 +3011,17 @@ var PathUtils;
|
|
|
3001
3011
|
if (!(str === null || str === void 0 ? void 0 : str.length)) {
|
|
3002
3012
|
return [];
|
|
3003
3013
|
}
|
|
3004
|
-
const broken = str.split("
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
}
|
|
3011
|
-
broken[0] = top;
|
|
3014
|
+
const broken = str.split("/");
|
|
3015
|
+
// Remove quotes from the first and last chars.
|
|
3016
|
+
for (let i = 0; i < broken.length; i++) {
|
|
3017
|
+
let piece = broken[i];
|
|
3018
|
+
if (piece.startsWith("\"")) {
|
|
3019
|
+
piece = piece.substring(1);
|
|
3012
3020
|
}
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
if (bot.length > 0) {
|
|
3016
|
-
if (bot.charAt(bot.length - 1) == "\"") {
|
|
3017
|
-
bot = bot.substring(0, bot.length - 1);
|
|
3018
|
-
}
|
|
3019
|
-
broken[endIndex] = bot;
|
|
3021
|
+
if (piece.endsWith("\"")) {
|
|
3022
|
+
piece = piece.substring(0, piece.length - 1);
|
|
3020
3023
|
}
|
|
3024
|
+
broken[i] = piece;
|
|
3021
3025
|
}
|
|
3022
3026
|
return broken;
|
|
3023
3027
|
}
|
|
@@ -13341,7 +13345,7 @@ var DataSource;
|
|
|
13341
13345
|
})(DataSource || (DataSource = {}));
|
|
13342
13346
|
|
|
13343
13347
|
// This is updated with the package.json version on build.
|
|
13344
|
-
const VERSION = "4.3.
|
|
13348
|
+
const VERSION = "4.3.4";
|
|
13345
13349
|
|
|
13346
13350
|
export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
|
|
13347
13351
|
//# sourceMappingURL=bruce-models.es5.js.map
|