bruce-models 1.2.7 → 1.2.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.
@@ -1637,9 +1637,6 @@ var Entity;
1637
1637
  (function (V1) {
1638
1638
  function GetList(api, filter, reqParams) {
1639
1639
  return __awaiter(this, void 0, void 0, function* () {
1640
- if (!(filter === null || filter === void 0 ? void 0 : filter.entityTypeId)) {
1641
- throw ("Entity Type ID is required.");
1642
- }
1643
1640
  let requestFilter = {};
1644
1641
  if (filter.entityTypeConditions) {
1645
1642
  requestFilter = Object.assign({}, filter.entityTypeConditions);
@@ -2925,6 +2922,84 @@ var EntityLod;
2925
2922
  EntityLod.Delete = Delete;
2926
2923
  })(EntityLod || (EntityLod = {}));
2927
2924
 
2925
+ var EntityLodCategory;
2926
+ (function (EntityLodCategory) {
2927
+ function GetCacheKey(id) {
2928
+ return Api.ECacheKey.LodCategory + Api.ECacheKey.Id + id;
2929
+ }
2930
+ EntityLodCategory.GetCacheKey = GetCacheKey;
2931
+ function GetListCacheKey() {
2932
+ return Api.ECacheKey.LodCategory;
2933
+ }
2934
+ EntityLodCategory.GetListCacheKey = GetListCacheKey;
2935
+ function GetList(api, reqParams) {
2936
+ return __awaiter(this, void 0, void 0, function* () {
2937
+ const cacheKey = api.GetCacheItem(GetListCacheKey(), reqParams);
2938
+ if (cacheKey) {
2939
+ return cacheKey;
2940
+ }
2941
+ const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
2942
+ try {
2943
+ const data = yield api.GET("lodCategories", Api.PrepReqParams(reqParams));
2944
+ res(data.Items);
2945
+ }
2946
+ catch (e) {
2947
+ rej(e);
2948
+ }
2949
+ }));
2950
+ api.Cache.Set(GetListCacheKey(), req);
2951
+ return req;
2952
+ });
2953
+ }
2954
+ EntityLodCategory.GetList = GetList;
2955
+ function Get(api, id, reqParams) {
2956
+ return __awaiter(this, void 0, void 0, function* () {
2957
+ if (!id) {
2958
+ throw ("Lod category id is required.");
2959
+ }
2960
+ const cacheData = api.GetCacheItem(GetCacheKey(id), reqParams);
2961
+ if (cacheData) {
2962
+ return cacheData;
2963
+ }
2964
+ const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
2965
+ try {
2966
+ const data = yield api.GET(`lodCategory/${id}`, Api.PrepReqParams(reqParams));
2967
+ res(data);
2968
+ }
2969
+ catch (e) {
2970
+ rej(e);
2971
+ }
2972
+ }));
2973
+ api.Cache.Set(GetCacheKey(id), req);
2974
+ return req;
2975
+ });
2976
+ }
2977
+ EntityLodCategory.Get = Get;
2978
+ function Delete(api, id, reqParams) {
2979
+ return __awaiter(this, void 0, void 0, function* () {
2980
+ if (!id) {
2981
+ throw ("Lod category id is required.");
2982
+ }
2983
+ yield api.DELETE(`lodCategory/${id}`, Api.PrepReqParams(reqParams));
2984
+ api.Cache.Remove(GetCacheKey(id));
2985
+ api.Cache.Remove(GetListCacheKey());
2986
+ });
2987
+ }
2988
+ EntityLodCategory.Delete = Delete;
2989
+ function Update(api, data, reqParams) {
2990
+ return __awaiter(this, void 0, void 0, function* () {
2991
+ if (!data.Key || !data.Name) {
2992
+ throw ("Lod category key and name are required.");
2993
+ }
2994
+ data = yield api.POST(`lodCategory/${data.Key}`, data, Api.PrepReqParams(reqParams));
2995
+ api.Cache.Remove(GetCacheKey(data.Key));
2996
+ api.Cache.Remove(GetListCacheKey());
2997
+ return data;
2998
+ });
2999
+ }
3000
+ EntityLodCategory.Update = Update;
3001
+ })(EntityLodCategory || (EntityLodCategory = {}));
3002
+
2928
3003
  /**
2929
3004
  * Describes the "Entity Relationship Type" concept within Bruce.
2930
3005
  * A relationship type record describes the purpose of a relationship.
@@ -4115,6 +4190,18 @@ var EntityAttribute;
4115
4190
  EType["Dictionary"] = "Dictionary";
4116
4191
  EType["Boolean"] = "Boolean";
4117
4192
  })(EType = EntityAttribute.EType || (EntityAttribute.EType = {}));
4193
+ function GetAttribute(items, path) {
4194
+ if (!items || !path || !path.length) {
4195
+ return null;
4196
+ }
4197
+ const key = path[0];
4198
+ const item = items.find((i) => i.Key === key);
4199
+ if (!item || !item.Structure || !path.length) {
4200
+ return item;
4201
+ }
4202
+ return GetAttribute(item.Structure, path.slice(1));
4203
+ }
4204
+ EntityAttribute.GetAttribute = GetAttribute;
4118
4205
  })(EntityAttribute || (EntityAttribute = {}));
4119
4206
 
4120
4207
  /**
@@ -6221,83 +6308,5 @@ var Markup;
6221
6308
  })(Entity3d = Markup.Entity3d || (Markup.Entity3d = {}));
6222
6309
  })(Markup || (Markup = {}));
6223
6310
 
6224
- var EntityLodCategory;
6225
- (function (EntityLodCategory$$1) {
6226
- function GetCacheKey(id) {
6227
- return Api.ECacheKey.LodCategory + Api.ECacheKey.Id + id;
6228
- }
6229
- EntityLodCategory$$1.GetCacheKey = GetCacheKey;
6230
- function GetListCacheKey() {
6231
- return Api.ECacheKey.LodCategory;
6232
- }
6233
- EntityLodCategory$$1.GetListCacheKey = GetListCacheKey;
6234
- function GetList(api, reqParams) {
6235
- return __awaiter(this, void 0, void 0, function* () {
6236
- const cacheKey = api.GetCacheItem(GetListCacheKey(), reqParams);
6237
- if (cacheKey) {
6238
- return cacheKey;
6239
- }
6240
- const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
6241
- try {
6242
- const data = yield api.GET("lodCategories", Api.PrepReqParams(reqParams));
6243
- res(data.Items);
6244
- }
6245
- catch (e) {
6246
- rej(e);
6247
- }
6248
- }));
6249
- api.Cache.Set(GetListCacheKey(), req);
6250
- return req;
6251
- });
6252
- }
6253
- EntityLodCategory$$1.GetList = GetList;
6254
- function Get(api, id, reqParams) {
6255
- return __awaiter(this, void 0, void 0, function* () {
6256
- if (!id) {
6257
- throw ("Lod category id is required.");
6258
- }
6259
- const cacheData = api.GetCacheItem(GetCacheKey(id), reqParams);
6260
- if (cacheData) {
6261
- return cacheData;
6262
- }
6263
- const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
6264
- try {
6265
- const data = yield api.GET(`lodCategory/${id}`, Api.PrepReqParams(reqParams));
6266
- res(data);
6267
- }
6268
- catch (e) {
6269
- rej(e);
6270
- }
6271
- }));
6272
- api.Cache.Set(GetCacheKey(id), req);
6273
- return req;
6274
- });
6275
- }
6276
- EntityLodCategory$$1.Get = Get;
6277
- function Delete(api, id, reqParams) {
6278
- return __awaiter(this, void 0, void 0, function* () {
6279
- if (!id) {
6280
- throw ("Lod category id is required.");
6281
- }
6282
- yield api.DELETE(`lodCategory/${id}`, Api.PrepReqParams(reqParams));
6283
- api.Cache.Remove(GetCacheKey(id));
6284
- api.Cache.Remove(GetListCacheKey());
6285
- });
6286
- }
6287
- EntityLodCategory$$1.Delete = Delete;
6288
- function Update(api, data, reqParams) {
6289
- return __awaiter(this, void 0, void 0, function* () {
6290
- if (!data.Key || !data.Name) {
6291
- throw ("Lod category key and name are required.");
6292
- }
6293
- data = yield api.POST(`lodCategory/${data.Key}`, data, Api.PrepReqParams(reqParams));
6294
- api.Cache.Remove(GetCacheKey(data.Key));
6295
- api.Cache.Remove(GetListCacheKey());
6296
- return data;
6297
- });
6298
- }
6299
- EntityLodCategory$$1.Update = Update;
6300
- })(EntityLodCategory || (EntityLodCategory = {}));
6301
-
6302
6311
  export { AnnDocument, CustomForm, CustomFormContent, AbstractApi, Api, BruceApi, CamApi, IdmApi, GlobalApi, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, BatchedDataGetter, EntityCoords, EntityTypeVisualSettings, EntityAttribute, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, PendingAction, MessageBroker, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Permission, Session, UserGroup, User, Account, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup };
6303
6312
  //# sourceMappingURL=bruce-models.es5.js.map