bruce-models 1.9.8 → 2.0.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 +317 -74
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +317 -74
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account-settings.js +2 -2
- package/dist/lib/account/account.js +201 -185
- package/dist/lib/account/account.js.map +1 -1
- package/dist/lib/ann-document/ann-document.js +94 -86
- package/dist/lib/ann-document/ann-document.js.map +1 -1
- package/dist/lib/api/abstract-api.js +260 -246
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/api/api-getters.js +134 -134
- package/dist/lib/api/api.js +93 -93
- package/dist/lib/api/bruce-api.js +216 -216
- package/dist/lib/api/cam-api.js +85 -82
- package/dist/lib/api/cam-api.js.map +1 -1
- package/dist/lib/api/global-api.js +81 -81
- package/dist/lib/api/idm-api.js +85 -82
- package/dist/lib/api/idm-api.js.map +1 -1
- package/dist/lib/bruce-models.js +86 -86
- package/dist/lib/calculator/calculator.js +341 -341
- package/dist/lib/client-file/client-file.js +249 -245
- package/dist/lib/client-file/client-file.js.map +1 -1
- package/dist/lib/common/bounds.js +61 -61
- package/dist/lib/common/bruce-event.js +46 -46
- package/dist/lib/common/bruce-variable.js +60 -60
- package/dist/lib/common/cache.js +165 -165
- package/dist/lib/common/camera.js +11 -11
- package/dist/lib/common/cartes.js +123 -123
- package/dist/lib/common/carto.js +60 -60
- package/dist/lib/common/color.js +86 -86
- package/dist/lib/common/delay-queue.js +56 -56
- package/dist/lib/common/dictionary.js +2 -2
- package/dist/lib/common/geometry.js +120 -120
- package/dist/lib/common/transform.js +2 -2
- package/dist/lib/common/utc.js +39 -39
- package/dist/lib/custom-form/custom-form-content.js +26 -26
- package/dist/lib/custom-form/custom-form.js +114 -106
- package/dist/lib/custom-form/custom-form.js.map +1 -1
- package/dist/lib/data-lab/data-lab.js +49 -49
- package/dist/lib/entity/entity-attachment-type.js +87 -83
- package/dist/lib/entity/entity-attachment-type.js.map +1 -1
- package/dist/lib/entity/entity-attachment.js +126 -122
- package/dist/lib/entity/entity-attachment.js.map +1 -1
- package/dist/lib/entity/entity-attribute.js +29 -29
- package/dist/lib/entity/entity-comment.js +86 -82
- package/dist/lib/entity/entity-comment.js.map +1 -1
- package/dist/lib/entity/entity-coords.js +153 -149
- package/dist/lib/entity/entity-coords.js.map +1 -1
- package/dist/lib/entity/entity-link.js +86 -82
- package/dist/lib/entity/entity-link.js.map +1 -1
- package/dist/lib/entity/entity-lod-category.js +108 -100
- package/dist/lib/entity/entity-lod-category.js.map +1 -1
- package/dist/lib/entity/entity-lod.js +197 -185
- package/dist/lib/entity/entity-lod.js.map +1 -1
- package/dist/lib/entity/entity-relation-type.js +117 -109
- package/dist/lib/entity/entity-relation-type.js.map +1 -1
- package/dist/lib/entity/entity-relation.js +140 -132
- package/dist/lib/entity/entity-relation.js.map +1 -1
- package/dist/lib/entity/entity-source.js +136 -136
- package/dist/lib/entity/entity-tag.js +157 -149
- package/dist/lib/entity/entity-tag.js.map +1 -1
- package/dist/lib/entity/entity-type-visual-settings.js +13 -13
- package/dist/lib/entity/entity-type.js +121 -113
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/entity/entity.js +331 -319
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/entity/getters/batched-data-getter.js +84 -84
- package/dist/lib/entity/getters/entity-filter-getter.js +306 -303
- package/dist/lib/entity/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/entity/getters/entity-globe.js +211 -211
- package/dist/lib/entity/getters/view-monitor.js +2 -2
- package/dist/lib/import/import-cad.js +53 -53
- package/dist/lib/import/import-csv.js +23 -23
- package/dist/lib/import/import-json.js +23 -23
- package/dist/lib/import/import-kml.js +23 -23
- package/dist/lib/import/imported-file.js +99 -91
- package/dist/lib/import/imported-file.js.map +1 -1
- package/dist/lib/internal/uploader.js +76 -76
- package/dist/lib/markup/markup.js +185 -185
- package/dist/lib/plugin/plugin.js +91 -83
- package/dist/lib/plugin/plugin.js.map +1 -1
- package/dist/lib/program-key/program-key.js +119 -111
- package/dist/lib/program-key/program-key.js.map +1 -1
- package/dist/lib/project/menu-item.js +121 -121
- package/dist/lib/project/project-view-bookmark.js +159 -147
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/project/project-view-legacy-tile.js +77 -77
- package/dist/lib/project/project-view-tile.js +125 -125
- package/dist/lib/project/project-view.js +141 -133
- package/dist/lib/project/project-view.js.map +1 -1
- package/dist/lib/project/zoom-control.js +17 -17
- package/dist/lib/server/message-broker.js +142 -142
- package/dist/lib/server/pending-action.js +71 -71
- package/dist/lib/server/task.js +63 -63
- package/dist/lib/style/style.js +125 -117
- package/dist/lib/style/style.js.map +1 -1
- package/dist/lib/tileset/tileset.js +431 -415
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/lib/user/permission.js +20 -20
- package/dist/lib/user/session.js +141 -137
- package/dist/lib/user/session.js.map +1 -1
- package/dist/lib/user/user-group.js +94 -94
- package/dist/lib/user/user.js +474 -446
- package/dist/lib/user/user.js.map +1 -1
- package/dist/lib/util/encrypt-utils.js +19 -19
- package/dist/lib/util/math-utils.js +40 -40
- package/dist/lib/util/object-utils.js +17 -17
- package/dist/lib/util/path-utils.js +61 -61
- package/dist/lib/util/url-utils.js +94 -94
- package/dist/types/api/abstract-api.d.ts +6 -0
- package/package.json +3 -2
|
@@ -1,101 +1,109 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.EntityLodCategory = void 0;
|
|
13
|
-
const api_1 = require("../api/api");
|
|
14
|
-
var EntityLodCategory;
|
|
15
|
-
(function (EntityLodCategory) {
|
|
16
|
-
function GetCacheKey(id) {
|
|
17
|
-
return api_1.Api.ECacheKey.LodCategory + api_1.Api.ECacheKey.Id + id;
|
|
18
|
-
}
|
|
19
|
-
EntityLodCategory.GetCacheKey = GetCacheKey;
|
|
20
|
-
function GetListCacheKey() {
|
|
21
|
-
return api_1.Api.ECacheKey.LodCategory;
|
|
22
|
-
}
|
|
23
|
-
EntityLodCategory.GetListCacheKey = GetListCacheKey;
|
|
24
|
-
function GetList(params) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const { api, req: reqParams } = params;
|
|
27
|
-
const cacheKey = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
28
|
-
if (cacheKey) {
|
|
29
|
-
return cacheKey;
|
|
30
|
-
}
|
|
31
|
-
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
try {
|
|
33
|
-
const data = yield api.GET("lodCategories", api_1.Api.PrepReqParams(reqParams));
|
|
34
|
-
res({
|
|
35
|
-
categories: data.Items
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
rej(e);
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
42
|
-
api.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EntityLodCategory = void 0;
|
|
13
|
+
const api_1 = require("../api/api");
|
|
14
|
+
var EntityLodCategory;
|
|
15
|
+
(function (EntityLodCategory) {
|
|
16
|
+
function GetCacheKey(id) {
|
|
17
|
+
return api_1.Api.ECacheKey.LodCategory + api_1.Api.ECacheKey.Id + id;
|
|
18
|
+
}
|
|
19
|
+
EntityLodCategory.GetCacheKey = GetCacheKey;
|
|
20
|
+
function GetListCacheKey() {
|
|
21
|
+
return api_1.Api.ECacheKey.LodCategory;
|
|
22
|
+
}
|
|
23
|
+
EntityLodCategory.GetListCacheKey = GetListCacheKey;
|
|
24
|
+
function GetList(params) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const { api, req: reqParams } = params;
|
|
27
|
+
const cacheKey = api.GetCacheItem(GetListCacheKey(), reqParams);
|
|
28
|
+
if (cacheKey) {
|
|
29
|
+
return cacheKey;
|
|
30
|
+
}
|
|
31
|
+
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
try {
|
|
33
|
+
const data = yield api.GET("lodCategories", api_1.Api.PrepReqParams(reqParams));
|
|
34
|
+
res({
|
|
35
|
+
categories: data.Items
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
rej(e);
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
api.SetCacheItem({
|
|
43
|
+
key: GetListCacheKey(),
|
|
44
|
+
value: req,
|
|
45
|
+
req: reqParams
|
|
46
|
+
});
|
|
47
|
+
return req;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
EntityLodCategory.GetList = GetList;
|
|
51
|
+
function Get(params) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const { api, categoryId: id, req: reqParams } = params;
|
|
54
|
+
if (!id) {
|
|
55
|
+
throw ("Lod category id is required.");
|
|
56
|
+
}
|
|
57
|
+
const cacheData = api.GetCacheItem(GetCacheKey(id), reqParams);
|
|
58
|
+
if (cacheData) {
|
|
59
|
+
return cacheData;
|
|
60
|
+
}
|
|
61
|
+
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
try {
|
|
63
|
+
const data = yield api.GET(`lodCategory/${id}`, api_1.Api.PrepReqParams(reqParams));
|
|
64
|
+
res({
|
|
65
|
+
category: data
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
rej(e);
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
api.SetCacheItem({
|
|
73
|
+
key: GetCacheKey(id),
|
|
74
|
+
value: req,
|
|
75
|
+
req: reqParams
|
|
76
|
+
});
|
|
77
|
+
return req;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
EntityLodCategory.Get = Get;
|
|
81
|
+
function Delete(params) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const { api, categoryId: id, req: reqParams } = params;
|
|
84
|
+
if (!id) {
|
|
85
|
+
throw ("Lod category id is required.");
|
|
86
|
+
}
|
|
87
|
+
yield api.DELETE(`lodCategory/${id}`, api_1.Api.PrepReqParams(reqParams));
|
|
88
|
+
api.Cache.Remove(GetCacheKey(id));
|
|
89
|
+
api.Cache.Remove(GetListCacheKey());
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
EntityLodCategory.Delete = Delete;
|
|
93
|
+
function Update(params) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const { api, category: data, req: reqParams } = params;
|
|
96
|
+
if (!data.Key || !data.Name) {
|
|
97
|
+
throw ("Lod category key and name are required.");
|
|
98
|
+
}
|
|
99
|
+
const res = yield api.POST(`lodCategory/${data.Key}`, data, api_1.Api.PrepReqParams(reqParams));
|
|
100
|
+
api.Cache.Remove(GetCacheKey(data.Key));
|
|
101
|
+
api.Cache.Remove(GetListCacheKey());
|
|
102
|
+
return {
|
|
103
|
+
category: res
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
EntityLodCategory.Update = Update;
|
|
108
|
+
})(EntityLodCategory = exports.EntityLodCategory || (exports.EntityLodCategory = {}));
|
|
101
109
|
//# sourceMappingURL=entity-lod-category.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-lod-category.js","sourceRoot":"","sources":["../../../src/entity/entity-lod-category.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAiC;AAGjC,IAAiB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"entity-lod-category.js","sourceRoot":"","sources":["../../../src/entity/entity-lod-category.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,186 +1,198 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.EntityLod = void 0;
|
|
13
|
-
const api_1 = require("../api/api");
|
|
14
|
-
/**
|
|
15
|
-
* Describes the "Entity LOD" concept within Bruce.
|
|
16
|
-
* LOD stands for Level of Detail.
|
|
17
|
-
* An lod record is a possible 2d/3d visualization of the entity record.
|
|
18
|
-
* The most common kind is a GLB.
|
|
19
|
-
*/
|
|
20
|
-
var EntityLod;
|
|
21
|
-
(function (EntityLod) {
|
|
22
|
-
function GetCacheKey(url) {
|
|
23
|
-
return api_1.Api.ECacheKey.Lod + api_1.Api.ECacheKey.Id + url;
|
|
24
|
-
}
|
|
25
|
-
EntityLod.GetCacheKey = GetCacheKey;
|
|
26
|
-
function GetTypeListKey(typeId, group) {
|
|
27
|
-
return api_1.Api.ECacheKey.Lod + api_1.Api.ECacheKey.EntityType + typeId + api_1.Api.ECacheKey.Id + group;
|
|
28
|
-
}
|
|
29
|
-
EntityLod.GetTypeListKey = GetTypeListKey;
|
|
30
|
-
function GetEntityListKey(entityId) {
|
|
31
|
-
return api_1.Api.ECacheKey.Lod + api_1.Api.ECacheKey.Entity + entityId;
|
|
32
|
-
}
|
|
33
|
-
EntityLod.GetEntityListKey = GetEntityListKey;
|
|
34
|
-
function GetUrl(params) {
|
|
35
|
-
let { api, entityId, categoryId, level, strict } = params;
|
|
36
|
-
if (!entityId) {
|
|
37
|
-
throw ("Entity ID is required.");
|
|
38
|
-
}
|
|
39
|
-
if (!categoryId) {
|
|
40
|
-
categoryId = "GLB";
|
|
41
|
-
}
|
|
42
|
-
if (!level) {
|
|
43
|
-
level = 0;
|
|
44
|
-
}
|
|
45
|
-
let url = api.GetBaseUrl() + `entity/${entityId}/lod/${categoryId}/${level}`;
|
|
46
|
-
if (strict) {
|
|
47
|
-
url = url + "?strict=true";
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
url: url
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
EntityLod.GetUrl = GetUrl;
|
|
54
|
-
function GetUrlFileId(params) {
|
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const { api, url, req: reqParams } = params;
|
|
57
|
-
if (!url) {
|
|
58
|
-
throw ("Url is required.");
|
|
59
|
-
}
|
|
60
|
-
const cacheData = api.GetCacheItem(GetCacheKey(url), reqParams);
|
|
61
|
-
if (cacheData) {
|
|
62
|
-
return cacheData;
|
|
63
|
-
}
|
|
64
|
-
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
-
try {
|
|
66
|
-
const record = yield api.get(url, api_1.Api.PrepReqParams(reqParams));
|
|
67
|
-
res({
|
|
68
|
-
clientFileId: record["ClientFile.ID"]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
catch (e) {
|
|
72
|
-
rej(e);
|
|
73
|
-
}
|
|
74
|
-
}));
|
|
75
|
-
api.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EntityLod = void 0;
|
|
13
|
+
const api_1 = require("../api/api");
|
|
14
|
+
/**
|
|
15
|
+
* Describes the "Entity LOD" concept within Bruce.
|
|
16
|
+
* LOD stands for Level of Detail.
|
|
17
|
+
* An lod record is a possible 2d/3d visualization of the entity record.
|
|
18
|
+
* The most common kind is a GLB.
|
|
19
|
+
*/
|
|
20
|
+
var EntityLod;
|
|
21
|
+
(function (EntityLod) {
|
|
22
|
+
function GetCacheKey(url) {
|
|
23
|
+
return api_1.Api.ECacheKey.Lod + api_1.Api.ECacheKey.Id + url;
|
|
24
|
+
}
|
|
25
|
+
EntityLod.GetCacheKey = GetCacheKey;
|
|
26
|
+
function GetTypeListKey(typeId, group) {
|
|
27
|
+
return api_1.Api.ECacheKey.Lod + api_1.Api.ECacheKey.EntityType + typeId + api_1.Api.ECacheKey.Id + group;
|
|
28
|
+
}
|
|
29
|
+
EntityLod.GetTypeListKey = GetTypeListKey;
|
|
30
|
+
function GetEntityListKey(entityId) {
|
|
31
|
+
return api_1.Api.ECacheKey.Lod + api_1.Api.ECacheKey.Entity + entityId;
|
|
32
|
+
}
|
|
33
|
+
EntityLod.GetEntityListKey = GetEntityListKey;
|
|
34
|
+
function GetUrl(params) {
|
|
35
|
+
let { api, entityId, categoryId, level, strict } = params;
|
|
36
|
+
if (!entityId) {
|
|
37
|
+
throw ("Entity ID is required.");
|
|
38
|
+
}
|
|
39
|
+
if (!categoryId) {
|
|
40
|
+
categoryId = "GLB";
|
|
41
|
+
}
|
|
42
|
+
if (!level) {
|
|
43
|
+
level = 0;
|
|
44
|
+
}
|
|
45
|
+
let url = api.GetBaseUrl() + `entity/${entityId}/lod/${categoryId}/${level}`;
|
|
46
|
+
if (strict) {
|
|
47
|
+
url = url + "?strict=true";
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
url: url
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
EntityLod.GetUrl = GetUrl;
|
|
54
|
+
function GetUrlFileId(params) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const { api, url, req: reqParams } = params;
|
|
57
|
+
if (!url) {
|
|
58
|
+
throw ("Url is required.");
|
|
59
|
+
}
|
|
60
|
+
const cacheData = api.GetCacheItem(GetCacheKey(url), reqParams);
|
|
61
|
+
if (cacheData) {
|
|
62
|
+
return cacheData;
|
|
63
|
+
}
|
|
64
|
+
const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
try {
|
|
66
|
+
const record = yield api.get(url, api_1.Api.PrepReqParams(reqParams));
|
|
67
|
+
res({
|
|
68
|
+
clientFileId: record["ClientFile.ID"]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
rej(e);
|
|
73
|
+
}
|
|
74
|
+
}));
|
|
75
|
+
api.SetCacheItem({
|
|
76
|
+
key: GetCacheKey(url),
|
|
77
|
+
value: req,
|
|
78
|
+
req: reqParams
|
|
79
|
+
});
|
|
80
|
+
return req;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
EntityLod.GetUrlFileId = GetUrlFileId;
|
|
84
|
+
function GetLods(params) {
|
|
85
|
+
var _a;
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
const { api, filter, req: reqParams } = params;
|
|
88
|
+
if (!((_a = filter === null || filter === void 0 ? void 0 : filter.Items) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
89
|
+
throw ("Items are required.");
|
|
90
|
+
}
|
|
91
|
+
const data = yield api.POST("entity/getlods", filter, reqParams);
|
|
92
|
+
return {
|
|
93
|
+
lods: data.Items
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
EntityLod.GetLods = GetLods;
|
|
98
|
+
function GetEntityLods(params) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const { api, entityId, req: reqParams } = params;
|
|
101
|
+
if (!entityId) {
|
|
102
|
+
throw ("Entity id is required.");
|
|
103
|
+
}
|
|
104
|
+
const cacheData = api.GetCacheItem(GetEntityListKey(entityId), reqParams);
|
|
105
|
+
if (cacheData) {
|
|
106
|
+
return cacheData;
|
|
107
|
+
}
|
|
108
|
+
const req = api.GET(`entity/${entityId}/lods?includeClientFiles=yes`, api_1.Api.PrepReqParams(reqParams));
|
|
109
|
+
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
try {
|
|
111
|
+
const data = yield req;
|
|
112
|
+
res({
|
|
113
|
+
lods: data.Items
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch (e) {
|
|
117
|
+
rej(e);
|
|
118
|
+
}
|
|
119
|
+
}));
|
|
120
|
+
api.SetCacheItem({
|
|
121
|
+
key: GetEntityListKey(entityId),
|
|
122
|
+
value: prom,
|
|
123
|
+
req: reqParams
|
|
124
|
+
});
|
|
125
|
+
return prom;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
EntityLod.GetEntityLods = GetEntityLods;
|
|
129
|
+
/**
|
|
130
|
+
* Returns lods for a specified entity type.
|
|
131
|
+
* @param params
|
|
132
|
+
*/
|
|
133
|
+
function GetTypeLods(params) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
let { api, entityTypeId: typeId, group, req: reqParams } = params;
|
|
136
|
+
if (!group) {
|
|
137
|
+
group = "DEFAULT";
|
|
138
|
+
}
|
|
139
|
+
const cacheData = api.GetCacheItem(GetTypeListKey(typeId, group), reqParams);
|
|
140
|
+
if (cacheData) {
|
|
141
|
+
return cacheData;
|
|
142
|
+
}
|
|
143
|
+
const url = `entityType/${typeId}/lods?includeClientFiles=yes` + (group ? "&group=" + group : "");
|
|
144
|
+
const req = api.GET(url, api_1.Api.PrepReqParams(reqParams));
|
|
145
|
+
const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
try {
|
|
147
|
+
const data = yield req;
|
|
148
|
+
res({
|
|
149
|
+
lods: data.Items
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
rej(e);
|
|
154
|
+
}
|
|
155
|
+
}));
|
|
156
|
+
api.SetCacheItem({
|
|
157
|
+
key: GetTypeListKey(typeId, group),
|
|
158
|
+
value: prom,
|
|
159
|
+
req: reqParams
|
|
160
|
+
});
|
|
161
|
+
return prom;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
EntityLod.GetTypeLods = GetTypeLods;
|
|
165
|
+
function Update(params) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
const { api, entityId, req: reqParams } = params;
|
|
168
|
+
if (!params["ClientFile.ID"] || !params["LODCategory.Key"] || (!params.Level && params.Level !== 0)) {
|
|
169
|
+
throw ("ClientFile.ID, LODCategory.Key and Level are required.");
|
|
170
|
+
}
|
|
171
|
+
const res = yield api.POST(`entity/${entityId}/lod/${params["LODCategory.Key"]}/${params.Level}`, {
|
|
172
|
+
"Level": params.Level,
|
|
173
|
+
"ClientFile.ID": params["ClientFile.ID"]
|
|
174
|
+
}, api_1.Api.PrepReqParams(reqParams));
|
|
175
|
+
api.Cache.Remove(GetEntityListKey(entityId));
|
|
176
|
+
return res;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
EntityLod.Update = Update;
|
|
180
|
+
function Delete(params) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
let { api, entityId, lodCategoryId, level, req: reqParams } = params;
|
|
183
|
+
if (!entityId || !lodCategoryId) {
|
|
184
|
+
throw ("Entity ID and LOD Category ID are required.");
|
|
185
|
+
}
|
|
186
|
+
level = +level;
|
|
187
|
+
if (isNaN(level)) {
|
|
188
|
+
throw ("Level is required. It must be a number.");
|
|
189
|
+
}
|
|
190
|
+
yield api.POST(`entity/${entityId}/deleteLODs`, {
|
|
191
|
+
Items: [{ "LODCategory.Key": lodCategoryId, "Level": level }]
|
|
192
|
+
}, api_1.Api.PrepReqParams(reqParams));
|
|
193
|
+
api.Cache.Remove(GetEntityListKey(entityId));
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
EntityLod.Delete = Delete;
|
|
197
|
+
})(EntityLod = exports.EntityLod || (exports.EntityLod = {}));
|
|
186
198
|
//# sourceMappingURL=entity-lod.js.map
|