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.
- package/dist/bruce-models.es5.js +96 -1
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +94 -0
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/api/api.js +1 -0
- package/dist/lib/api/api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -0
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/entity/entity-lod-category.js +91 -0
- package/dist/lib/entity/entity-lod-category.js.map +1 -0
- package/dist/lib/entity/entity-lod.js +16 -0
- package/dist/lib/entity/entity-lod.js.map +1 -1
- package/dist/types/api/api.d.ts +1 -0
- package/dist/types/bruce-models.d.ts +1 -0
- package/dist/types/entity/entity-lod-category.d.ts +14 -0
- package/dist/types/entity/entity-lod.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
ECacheKey["Relation"] = "relation";
|
|
56
56
|
ECacheKey["RelationType"] = "relationtype";
|
|
57
57
|
ECacheKey["Lod"] = "lod";
|
|
58
|
+
ECacheKey["LodCategory"] = "lodcategory";
|
|
58
59
|
ECacheKey["Style"] = "style";
|
|
59
60
|
ECacheKey["PublishTileset"] = "publishtileset";
|
|
60
61
|
ECacheKey["User"] = "user";
|
|
@@ -2831,6 +2832,22 @@
|
|
|
2831
2832
|
});
|
|
2832
2833
|
}
|
|
2833
2834
|
EntityLod.Update = Update;
|
|
2835
|
+
function Delete(api, entityId, lodCategoryId, level, reqParams) {
|
|
2836
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2837
|
+
if (!entityId || !lodCategoryId) {
|
|
2838
|
+
throw ("Entity ID and LOD Category ID are required.");
|
|
2839
|
+
}
|
|
2840
|
+
level = +level;
|
|
2841
|
+
if (isNaN(level)) {
|
|
2842
|
+
throw ("Level is required. It must be a number.");
|
|
2843
|
+
}
|
|
2844
|
+
yield api.POST(`entity/${entityId}/deleteLODs`, {
|
|
2845
|
+
Items: [{ "LODCategory.Key": lodCategoryId, "Level": level }]
|
|
2846
|
+
}, exports.Api.PrepReqParams(reqParams));
|
|
2847
|
+
api.Cache.Remove(GetEntityListKey(entityId));
|
|
2848
|
+
});
|
|
2849
|
+
}
|
|
2850
|
+
EntityLod.Delete = Delete;
|
|
2834
2851
|
})(exports.EntityLod || (exports.EntityLod = {}));
|
|
2835
2852
|
|
|
2836
2853
|
(function (EntityRelationType) {
|
|
@@ -5987,6 +6004,83 @@
|
|
|
5987
6004
|
})(Entity3d = Markup.Entity3d || (Markup.Entity3d = {}));
|
|
5988
6005
|
})(exports.Markup || (exports.Markup = {}));
|
|
5989
6006
|
|
|
6007
|
+
(function (EntityLodCategory) {
|
|
6008
|
+
function GetCacheKey(id) {
|
|
6009
|
+
return exports.Api.ECacheKey.LodCategory + exports.Api.ECacheKey.Id + id;
|
|
6010
|
+
}
|
|
6011
|
+
EntityLodCategory.GetCacheKey = GetCacheKey;
|
|
6012
|
+
function GetListCacheKey() {
|
|
6013
|
+
return exports.Api.ECacheKey.LodCategory;
|
|
6014
|
+
}
|
|
6015
|
+
EntityLodCategory.GetListCacheKey = GetListCacheKey;
|
|
6016
|
+
function GetList(api, reqParams) {
|
|
6017
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6018
|
+
const cacheKey = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
6019
|
+
if (cacheKey) {
|
|
6020
|
+
return cacheKey;
|
|
6021
|
+
}
|
|
6022
|
+
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
6023
|
+
try {
|
|
6024
|
+
const data = yield api.GET("lodCategories", exports.Api.PrepReqParams(reqParams));
|
|
6025
|
+
res(data.Items);
|
|
6026
|
+
}
|
|
6027
|
+
catch (e) {
|
|
6028
|
+
rej(e);
|
|
6029
|
+
}
|
|
6030
|
+
}));
|
|
6031
|
+
api.Cache.Set(GetListCacheKey(), req);
|
|
6032
|
+
return req;
|
|
6033
|
+
});
|
|
6034
|
+
}
|
|
6035
|
+
EntityLodCategory.GetList = GetList;
|
|
6036
|
+
function Get(api, id, reqParams) {
|
|
6037
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6038
|
+
if (!id) {
|
|
6039
|
+
throw ("Lod category id is required.");
|
|
6040
|
+
}
|
|
6041
|
+
const cacheData = api.GetCacheItem(GetCacheKey(id), reqParams);
|
|
6042
|
+
if (cacheData) {
|
|
6043
|
+
return cacheData;
|
|
6044
|
+
}
|
|
6045
|
+
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
6046
|
+
try {
|
|
6047
|
+
const data = yield api.GET(`lodCategory/${id}`, exports.Api.PrepReqParams(reqParams));
|
|
6048
|
+
res(data);
|
|
6049
|
+
}
|
|
6050
|
+
catch (e) {
|
|
6051
|
+
rej(e);
|
|
6052
|
+
}
|
|
6053
|
+
}));
|
|
6054
|
+
api.Cache.Set(GetCacheKey(id), req);
|
|
6055
|
+
return req;
|
|
6056
|
+
});
|
|
6057
|
+
}
|
|
6058
|
+
EntityLodCategory.Get = Get;
|
|
6059
|
+
function Delete(api, id, reqParams) {
|
|
6060
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6061
|
+
if (!id) {
|
|
6062
|
+
throw ("Lod category id is required.");
|
|
6063
|
+
}
|
|
6064
|
+
yield api.DELETE(`lodCategory/${id}`, exports.Api.PrepReqParams(reqParams));
|
|
6065
|
+
api.Cache.Remove(GetCacheKey(id));
|
|
6066
|
+
api.Cache.Remove(GetListCacheKey());
|
|
6067
|
+
});
|
|
6068
|
+
}
|
|
6069
|
+
EntityLodCategory.Delete = Delete;
|
|
6070
|
+
function Update(api, data, reqParams) {
|
|
6071
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6072
|
+
if (!data.Key || !data.Name) {
|
|
6073
|
+
throw ("Lod category key and name are required.");
|
|
6074
|
+
}
|
|
6075
|
+
data = yield api.POST(`lodCategory/${data.Key}`, data, exports.Api.PrepReqParams(reqParams));
|
|
6076
|
+
api.Cache.Remove(GetCacheKey(data.Key));
|
|
6077
|
+
api.Cache.Remove(GetListCacheKey());
|
|
6078
|
+
return data;
|
|
6079
|
+
});
|
|
6080
|
+
}
|
|
6081
|
+
EntityLodCategory.Update = Update;
|
|
6082
|
+
})(exports.EntityLodCategory || (exports.EntityLodCategory = {}));
|
|
6083
|
+
|
|
5990
6084
|
exports.AbstractApi = AbstractApi;
|
|
5991
6085
|
exports.BruceEvent = BruceEvent;
|
|
5992
6086
|
exports.CacheControl = CacheControl;
|