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.
Files changed (112) hide show
  1. package/dist/bruce-models.es5.js +317 -74
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +317 -74
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account-settings.js +2 -2
  6. package/dist/lib/account/account.js +201 -185
  7. package/dist/lib/account/account.js.map +1 -1
  8. package/dist/lib/ann-document/ann-document.js +94 -86
  9. package/dist/lib/ann-document/ann-document.js.map +1 -1
  10. package/dist/lib/api/abstract-api.js +260 -246
  11. package/dist/lib/api/abstract-api.js.map +1 -1
  12. package/dist/lib/api/api-getters.js +134 -134
  13. package/dist/lib/api/api.js +93 -93
  14. package/dist/lib/api/bruce-api.js +216 -216
  15. package/dist/lib/api/cam-api.js +85 -82
  16. package/dist/lib/api/cam-api.js.map +1 -1
  17. package/dist/lib/api/global-api.js +81 -81
  18. package/dist/lib/api/idm-api.js +85 -82
  19. package/dist/lib/api/idm-api.js.map +1 -1
  20. package/dist/lib/bruce-models.js +86 -86
  21. package/dist/lib/calculator/calculator.js +341 -341
  22. package/dist/lib/client-file/client-file.js +249 -245
  23. package/dist/lib/client-file/client-file.js.map +1 -1
  24. package/dist/lib/common/bounds.js +61 -61
  25. package/dist/lib/common/bruce-event.js +46 -46
  26. package/dist/lib/common/bruce-variable.js +60 -60
  27. package/dist/lib/common/cache.js +165 -165
  28. package/dist/lib/common/camera.js +11 -11
  29. package/dist/lib/common/cartes.js +123 -123
  30. package/dist/lib/common/carto.js +60 -60
  31. package/dist/lib/common/color.js +86 -86
  32. package/dist/lib/common/delay-queue.js +56 -56
  33. package/dist/lib/common/dictionary.js +2 -2
  34. package/dist/lib/common/geometry.js +120 -120
  35. package/dist/lib/common/transform.js +2 -2
  36. package/dist/lib/common/utc.js +39 -39
  37. package/dist/lib/custom-form/custom-form-content.js +26 -26
  38. package/dist/lib/custom-form/custom-form.js +114 -106
  39. package/dist/lib/custom-form/custom-form.js.map +1 -1
  40. package/dist/lib/data-lab/data-lab.js +49 -49
  41. package/dist/lib/entity/entity-attachment-type.js +87 -83
  42. package/dist/lib/entity/entity-attachment-type.js.map +1 -1
  43. package/dist/lib/entity/entity-attachment.js +126 -122
  44. package/dist/lib/entity/entity-attachment.js.map +1 -1
  45. package/dist/lib/entity/entity-attribute.js +29 -29
  46. package/dist/lib/entity/entity-comment.js +86 -82
  47. package/dist/lib/entity/entity-comment.js.map +1 -1
  48. package/dist/lib/entity/entity-coords.js +153 -149
  49. package/dist/lib/entity/entity-coords.js.map +1 -1
  50. package/dist/lib/entity/entity-link.js +86 -82
  51. package/dist/lib/entity/entity-link.js.map +1 -1
  52. package/dist/lib/entity/entity-lod-category.js +108 -100
  53. package/dist/lib/entity/entity-lod-category.js.map +1 -1
  54. package/dist/lib/entity/entity-lod.js +197 -185
  55. package/dist/lib/entity/entity-lod.js.map +1 -1
  56. package/dist/lib/entity/entity-relation-type.js +117 -109
  57. package/dist/lib/entity/entity-relation-type.js.map +1 -1
  58. package/dist/lib/entity/entity-relation.js +140 -132
  59. package/dist/lib/entity/entity-relation.js.map +1 -1
  60. package/dist/lib/entity/entity-source.js +136 -136
  61. package/dist/lib/entity/entity-tag.js +157 -149
  62. package/dist/lib/entity/entity-tag.js.map +1 -1
  63. package/dist/lib/entity/entity-type-visual-settings.js +13 -13
  64. package/dist/lib/entity/entity-type.js +121 -113
  65. package/dist/lib/entity/entity-type.js.map +1 -1
  66. package/dist/lib/entity/entity.js +331 -319
  67. package/dist/lib/entity/entity.js.map +1 -1
  68. package/dist/lib/entity/getters/batched-data-getter.js +84 -84
  69. package/dist/lib/entity/getters/entity-filter-getter.js +306 -303
  70. package/dist/lib/entity/getters/entity-filter-getter.js.map +1 -1
  71. package/dist/lib/entity/getters/entity-globe.js +211 -211
  72. package/dist/lib/entity/getters/view-monitor.js +2 -2
  73. package/dist/lib/import/import-cad.js +53 -53
  74. package/dist/lib/import/import-csv.js +23 -23
  75. package/dist/lib/import/import-json.js +23 -23
  76. package/dist/lib/import/import-kml.js +23 -23
  77. package/dist/lib/import/imported-file.js +99 -91
  78. package/dist/lib/import/imported-file.js.map +1 -1
  79. package/dist/lib/internal/uploader.js +76 -76
  80. package/dist/lib/markup/markup.js +185 -185
  81. package/dist/lib/plugin/plugin.js +91 -83
  82. package/dist/lib/plugin/plugin.js.map +1 -1
  83. package/dist/lib/program-key/program-key.js +119 -111
  84. package/dist/lib/program-key/program-key.js.map +1 -1
  85. package/dist/lib/project/menu-item.js +121 -121
  86. package/dist/lib/project/project-view-bookmark.js +159 -147
  87. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  88. package/dist/lib/project/project-view-legacy-tile.js +77 -77
  89. package/dist/lib/project/project-view-tile.js +125 -125
  90. package/dist/lib/project/project-view.js +141 -133
  91. package/dist/lib/project/project-view.js.map +1 -1
  92. package/dist/lib/project/zoom-control.js +17 -17
  93. package/dist/lib/server/message-broker.js +142 -142
  94. package/dist/lib/server/pending-action.js +71 -71
  95. package/dist/lib/server/task.js +63 -63
  96. package/dist/lib/style/style.js +125 -117
  97. package/dist/lib/style/style.js.map +1 -1
  98. package/dist/lib/tileset/tileset.js +431 -415
  99. package/dist/lib/tileset/tileset.js.map +1 -1
  100. package/dist/lib/user/permission.js +20 -20
  101. package/dist/lib/user/session.js +141 -137
  102. package/dist/lib/user/session.js.map +1 -1
  103. package/dist/lib/user/user-group.js +94 -94
  104. package/dist/lib/user/user.js +474 -446
  105. package/dist/lib/user/user.js.map +1 -1
  106. package/dist/lib/util/encrypt-utils.js +19 -19
  107. package/dist/lib/util/math-utils.js +40 -40
  108. package/dist/lib/util/object-utils.js +17 -17
  109. package/dist/lib/util/path-utils.js +61 -61
  110. package/dist/lib/util/url-utils.js +94 -94
  111. package/dist/types/api/abstract-api.d.ts +6 -0
  112. 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.Cache.Set(GetListCacheKey(), req);
43
- return req;
44
- });
45
- }
46
- EntityLodCategory.GetList = GetList;
47
- function Get(params) {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- const { api, categoryId: id, req: reqParams } = params;
50
- if (!id) {
51
- throw ("Lod category id is required.");
52
- }
53
- const cacheData = api.GetCacheItem(GetCacheKey(id), reqParams);
54
- if (cacheData) {
55
- return cacheData;
56
- }
57
- const req = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
58
- try {
59
- const data = yield api.GET(`lodCategory/${id}`, api_1.Api.PrepReqParams(reqParams));
60
- res({
61
- category: data
62
- });
63
- }
64
- catch (e) {
65
- rej(e);
66
- }
67
- }));
68
- api.Cache.Set(GetCacheKey(id), req);
69
- return req;
70
- });
71
- }
72
- EntityLodCategory.Get = Get;
73
- function Delete(params) {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- const { api, categoryId: id, req: reqParams } = params;
76
- if (!id) {
77
- throw ("Lod category id is required.");
78
- }
79
- yield api.DELETE(`lodCategory/${id}`, api_1.Api.PrepReqParams(reqParams));
80
- api.Cache.Remove(GetCacheKey(id));
81
- api.Cache.Remove(GetListCacheKey());
82
- });
83
- }
84
- EntityLodCategory.Delete = Delete;
85
- function Update(params) {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- const { api, category: data, req: reqParams } = params;
88
- if (!data.Key || !data.Name) {
89
- throw ("Lod category key and name are required.");
90
- }
91
- const res = yield api.POST(`lodCategory/${data.Key}`, data, api_1.Api.PrepReqParams(reqParams));
92
- api.Cache.Remove(GetCacheKey(data.Key));
93
- api.Cache.Remove(GetListCacheKey());
94
- return {
95
- category: res
96
- };
97
- });
98
- }
99
- EntityLodCategory.Update = Update;
100
- })(EntityLodCategory = exports.EntityLodCategory || (exports.EntityLodCategory = {}));
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,CAuGjC;AAvGD,WAAiB,iBAAiB;IAC9B,SAAgB,WAAW,CAAC,EAAU;QAClC,OAAO,SAAG,CAAC,SAAS,CAAC,WAAW,GAAG,SAAG,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;IAC7D,CAAC;IAFe,6BAAW,cAE1B,CAAA;IAED,SAAgB,eAAe;QAC3B,OAAO,SAAG,CAAC,SAAS,CAAC,WAAW,CAAC;IACrC,CAAC;IAFe,iCAAe,kBAE9B,CAAA;IAQD,SAAsB,OAAO,CAAC,MAG7B;;YAGG,MAAM,EAAE,GAAG,EAAE,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AA;IAjBqB,wBAAM,SAiB3B,CAAA;AACL,CAAC,EA/GgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QA+GjC"}
@@ -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.Cache.Set(GetCacheKey(url), req, api_1.Api.DEFAULT_CACHE_DURATION);
76
- return req;
77
- });
78
- }
79
- EntityLod.GetUrlFileId = GetUrlFileId;
80
- function GetLods(params) {
81
- var _a;
82
- return __awaiter(this, void 0, void 0, function* () {
83
- const { api, filter, req: reqParams } = params;
84
- if (!((_a = filter === null || filter === void 0 ? void 0 : filter.Items) === null || _a === void 0 ? void 0 : _a.length)) {
85
- throw ("Items are required.");
86
- }
87
- const data = yield api.POST("entity/getlods", filter, reqParams);
88
- return {
89
- lods: data.Items
90
- };
91
- });
92
- }
93
- EntityLod.GetLods = GetLods;
94
- function GetEntityLods(params) {
95
- return __awaiter(this, void 0, void 0, function* () {
96
- const { api, entityId, req: reqParams } = params;
97
- if (!entityId) {
98
- throw ("Entity id is required.");
99
- }
100
- const cacheData = api.GetCacheItem(GetEntityListKey(entityId), reqParams);
101
- if (cacheData) {
102
- return cacheData;
103
- }
104
- const req = api.GET(`entity/${entityId}/lods?includeClientFiles=yes`, api_1.Api.PrepReqParams(reqParams));
105
- const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
106
- try {
107
- const data = yield req;
108
- res({
109
- lods: data.Items
110
- });
111
- }
112
- catch (e) {
113
- rej(e);
114
- }
115
- }));
116
- api.Cache.Set(GetEntityListKey(entityId), prom, api_1.Api.DEFAULT_CACHE_DURATION);
117
- return prom;
118
- });
119
- }
120
- EntityLod.GetEntityLods = GetEntityLods;
121
- /**
122
- * Returns lods for a specified entity type.
123
- * @param params
124
- */
125
- function GetTypeLods(params) {
126
- return __awaiter(this, void 0, void 0, function* () {
127
- let { api, entityTypeId: typeId, group, req: reqParams } = params;
128
- if (!group) {
129
- group = "DEFAULT";
130
- }
131
- const cacheData = api.GetCacheItem(GetTypeListKey(typeId, group), reqParams);
132
- if (cacheData) {
133
- return cacheData;
134
- }
135
- const url = `entityType/${typeId}/lods?includeClientFiles=yes` + (group ? "&group=" + group : "");
136
- const req = api.GET(url, api_1.Api.PrepReqParams(reqParams));
137
- const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
138
- try {
139
- const data = yield req;
140
- res({
141
- lods: data.Items
142
- });
143
- }
144
- catch (e) {
145
- rej(e);
146
- }
147
- }));
148
- api.Cache.Set(GetTypeListKey(typeId, group), prom, api_1.Api.DEFAULT_CACHE_DURATION);
149
- return prom;
150
- });
151
- }
152
- EntityLod.GetTypeLods = GetTypeLods;
153
- function Update(params) {
154
- return __awaiter(this, void 0, void 0, function* () {
155
- const { api, entityId, req: reqParams } = params;
156
- if (!params["ClientFile.ID"] || !params["LODCategory.Key"] || (!params.Level && params.Level !== 0)) {
157
- throw ("ClientFile.ID, LODCategory.Key and Level are required.");
158
- }
159
- const res = yield api.POST(`entity/${entityId}/lod/${params["LODCategory.Key"]}/${params.Level}`, {
160
- "Level": params.Level,
161
- "ClientFile.ID": params["ClientFile.ID"]
162
- }, api_1.Api.PrepReqParams(reqParams));
163
- api.Cache.Remove(GetEntityListKey(entityId));
164
- return res;
165
- });
166
- }
167
- EntityLod.Update = Update;
168
- function Delete(params) {
169
- return __awaiter(this, void 0, void 0, function* () {
170
- let { api, entityId, lodCategoryId, level, req: reqParams } = params;
171
- if (!entityId || !lodCategoryId) {
172
- throw ("Entity ID and LOD Category ID are required.");
173
- }
174
- level = +level;
175
- if (isNaN(level)) {
176
- throw ("Level is required. It must be a number.");
177
- }
178
- yield api.POST(`entity/${entityId}/deleteLODs`, {
179
- Items: [{ "LODCategory.Key": lodCategoryId, "Level": level }]
180
- }, api_1.Api.PrepReqParams(reqParams));
181
- api.Cache.Remove(GetEntityListKey(entityId));
182
- });
183
- }
184
- EntityLod.Delete = Delete;
185
- })(EntityLod = exports.EntityLod || (exports.EntityLod = {}));
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