bruce-models 1.2.4 → 1.2.6

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.
@@ -50,6 +50,7 @@ var Api;
50
50
  ECacheKey["Relation"] = "relation";
51
51
  ECacheKey["RelationType"] = "relationtype";
52
52
  ECacheKey["Lod"] = "lod";
53
+ ECacheKey["LodCategory"] = "lodcategory";
53
54
  ECacheKey["Style"] = "style";
54
55
  ECacheKey["PublishTileset"] = "publishtileset";
55
56
  ECacheKey["User"] = "user";
@@ -2906,6 +2907,22 @@ var EntityLod;
2906
2907
  });
2907
2908
  }
2908
2909
  EntityLod.Update = Update;
2910
+ function Delete(api, entityId, lodCategoryId, level, reqParams) {
2911
+ return __awaiter(this, void 0, void 0, function* () {
2912
+ if (!entityId || !lodCategoryId) {
2913
+ throw ("Entity ID and LOD Category ID are required.");
2914
+ }
2915
+ level = +level;
2916
+ if (isNaN(level)) {
2917
+ throw ("Level is required. It must be a number.");
2918
+ }
2919
+ yield api.POST(`entity/${entityId}/deleteLODs`, {
2920
+ Items: [{ "LODCategory.Key": lodCategoryId, "Level": level }]
2921
+ }, Api.PrepReqParams(reqParams));
2922
+ api.Cache.Remove(GetEntityListKey(entityId));
2923
+ });
2924
+ }
2925
+ EntityLod.Delete = Delete;
2909
2926
  })(EntityLod || (EntityLod = {}));
2910
2927
 
2911
2928
  /**
@@ -6204,5 +6221,83 @@ var Markup;
6204
6221
  })(Entity3d = Markup.Entity3d || (Markup.Entity3d = {}));
6205
6222
  })(Markup || (Markup = {}));
6206
6223
 
6207
- 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, 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 };
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
+ 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 };
6208
6303
  //# sourceMappingURL=bruce-models.es5.js.map