bruce-models 0.1.5 → 0.1.7
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 +479 -67
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +331 -65
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/ann-document/ann-document.js +4 -0
- package/dist/lib/ann-document/ann-document.js.map +1 -1
- package/dist/lib/api/abstract-api.js +3 -0
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/api/api.js +25 -7
- package/dist/lib/api/api.js.map +1 -1
- package/dist/lib/api/bruce-api.js +10 -0
- package/dist/lib/api/bruce-api.js.map +1 -1
- package/dist/lib/api/cam-api.js +10 -0
- package/dist/lib/api/cam-api.js.map +1 -1
- package/dist/lib/api/global-api.js +10 -0
- package/dist/lib/api/global-api.js.map +1 -1
- package/dist/lib/api/idm-api.js +10 -0
- package/dist/lib/api/idm-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/calculator/calculator.js +12 -0
- package/dist/lib/calculator/calculator.js.map +1 -1
- package/dist/lib/common/bruce-event.js +4 -0
- package/dist/lib/common/bruce-event.js.map +1 -1
- package/dist/lib/common/bruce-variable.js +13 -0
- package/dist/lib/common/bruce-variable.js.map +1 -1
- package/dist/lib/common/cache.js +3 -0
- package/dist/lib/common/cache.js.map +1 -1
- package/dist/lib/common/cartes.js +6 -0
- package/dist/lib/common/cartes.js.map +1 -1
- package/dist/lib/common/carto.js +5 -0
- package/dist/lib/common/carto.js.map +1 -1
- package/dist/lib/common/color.js +5 -0
- package/dist/lib/common/color.js.map +1 -1
- package/dist/lib/common/delay-queue.js +4 -0
- package/dist/lib/common/delay-queue.js.map +1 -1
- package/dist/lib/common/geometry.js +21 -0
- package/dist/lib/common/geometry.js.map +1 -1
- package/dist/lib/common/utc.js +3 -0
- package/dist/lib/common/utc.js.map +1 -1
- package/dist/lib/custom-form/custom-form.js +137 -0
- package/dist/lib/custom-form/custom-form.js.map +1 -0
- package/dist/lib/entity/entity-attachment-type.js +4 -3
- package/dist/lib/entity/entity-attachment-type.js.map +1 -1
- package/dist/lib/entity/entity-attachment.js +5 -0
- package/dist/lib/entity/entity-attachment.js.map +1 -1
- package/dist/lib/entity/entity-comment.js +4 -0
- package/dist/lib/entity/entity-comment.js.map +1 -1
- package/dist/lib/entity/entity-link.js +4 -0
- package/dist/lib/entity/entity-link.js.map +1 -1
- package/dist/lib/entity/entity-lod.js +6 -0
- package/dist/lib/entity/entity-lod.js.map +1 -1
- package/dist/lib/entity/entity-relation-type.js +4 -0
- package/dist/lib/entity/entity-relation-type.js.map +1 -1
- package/dist/lib/entity/entity-relation.js +5 -0
- package/dist/lib/entity/entity-relation.js.map +1 -1
- package/dist/lib/entity/entity-source.js +5 -0
- package/dist/lib/entity/entity-source.js.map +1 -1
- package/dist/lib/entity/entity-tag.js +5 -0
- package/dist/lib/entity/entity-tag.js.map +1 -1
- package/dist/lib/entity/entity-type.js +5 -0
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/entity/entity.js +22 -0
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/entity/getters/batched-data-getter.js +4 -0
- package/dist/lib/entity/getters/batched-data-getter.js.map +1 -1
- package/dist/lib/entity/getters/entity-filter-getter.js +5 -0
- package/dist/lib/entity/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/entity/getters/entity-globe.js +5 -0
- package/dist/lib/entity/getters/entity-globe.js.map +1 -1
- package/dist/lib/file/client-file.js +4 -0
- package/dist/lib/file/client-file.js.map +1 -1
- package/dist/lib/markup/markup.js +3 -0
- package/dist/lib/markup/markup.js.map +1 -1
- package/dist/lib/program-key/program-key.js +4 -0
- package/dist/lib/program-key/program-key.js.map +1 -1
- package/dist/lib/project/menu-item.js +5 -0
- package/dist/lib/project/menu-item.js.map +1 -1
- package/dist/lib/project/project-view-bookmark.js +6 -0
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/project/project-view-tile-source.js +5 -0
- package/dist/lib/project/project-view-tile-source.js.map +1 -1
- package/dist/lib/project/project-view.js +5 -0
- package/dist/lib/project/project-view.js.map +1 -1
- package/dist/lib/project/zoom-control.js +4 -0
- package/dist/lib/project/zoom-control.js.map +1 -1
- package/dist/lib/server/pending-action.js +5 -0
- package/dist/lib/server/pending-action.js.map +1 -1
- package/dist/lib/style/style.js +7 -0
- package/dist/lib/style/style.js.map +1 -1
- package/dist/lib/tileset/tileset-entities-map-tiles.js +5 -0
- package/dist/lib/tileset/tileset-entities-map-tiles.js.map +1 -1
- package/dist/lib/tileset/tileset-ext-map-tiles.js +4 -0
- package/dist/lib/tileset/tileset-ext-map-tiles.js.map +1 -1
- package/dist/lib/tileset/tileset.js +10 -0
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/lib/ucs/ucs.js +5 -0
- package/dist/lib/ucs/ucs.js.map +1 -1
- package/dist/lib/user/session.js +5 -0
- package/dist/lib/user/session.js.map +1 -1
- package/dist/lib/user/user-group.js +4 -0
- package/dist/lib/user/user-group.js.map +1 -1
- package/dist/lib/user/user.js +7 -0
- package/dist/lib/user/user.js.map +1 -1
- package/dist/lib/util/math-utils.js +12 -0
- package/dist/lib/util/math-utils.js.map +1 -1
- package/dist/lib/util/object-utils.js +4 -0
- package/dist/lib/util/object-utils.js.map +1 -1
- package/dist/lib/util/path-utils.js +3 -0
- package/dist/lib/util/path-utils.js.map +1 -1
- package/dist/lib/util/url-utils.js +6 -0
- package/dist/lib/util/url-utils.js.map +1 -1
- package/dist/types/ann-document/ann-document.d.ts +4 -0
- package/dist/types/api/abstract-api.d.ts +3 -0
- package/dist/types/api/api.d.ts +26 -8
- package/dist/types/api/bruce-api.d.ts +5 -0
- package/dist/types/api/cam-api.d.ts +5 -0
- package/dist/types/api/global-api.d.ts +5 -0
- package/dist/types/api/idm-api.d.ts +5 -0
- package/dist/types/bruce-models.d.ts +1 -0
- package/dist/types/calculator/calculator.d.ts +12 -0
- package/dist/types/common/bounds.d.ts +6 -0
- package/dist/types/common/bruce-event.d.ts +4 -0
- package/dist/types/common/bruce-variable.d.ts +13 -0
- package/dist/types/common/cache.d.ts +3 -0
- package/dist/types/common/cartes.d.ts +6 -0
- package/dist/types/common/carto.d.ts +5 -0
- package/dist/types/common/color.d.ts +5 -0
- package/dist/types/common/delay-queue.d.ts +4 -0
- package/dist/types/common/geometry.d.ts +21 -0
- package/dist/types/common/transform.d.ts +4 -0
- package/dist/types/common/utc.d.ts +3 -0
- package/dist/types/custom-form/custom-form.d.ts +25 -0
- package/dist/types/entity/entity-attachment-type.d.ts +5 -4
- package/dist/types/entity/entity-attachment.d.ts +5 -0
- package/dist/types/entity/entity-comment.d.ts +4 -0
- package/dist/types/entity/entity-link.d.ts +4 -0
- package/dist/types/entity/entity-lod.d.ts +6 -0
- package/dist/types/entity/entity-relation-type.d.ts +4 -0
- package/dist/types/entity/entity-relation.d.ts +5 -0
- package/dist/types/entity/entity-source.d.ts +5 -0
- package/dist/types/entity/entity-tag.d.ts +5 -0
- package/dist/types/entity/entity-type.d.ts +5 -0
- package/dist/types/entity/entity.d.ts +8 -1
- package/dist/types/entity/getters/batched-data-getter.d.ts +4 -0
- package/dist/types/entity/getters/entity-filter-getter.d.ts +5 -0
- package/dist/types/entity/getters/entity-globe.d.ts +5 -0
- package/dist/types/file/client-file.d.ts +4 -0
- package/dist/types/markup/markup.d.ts +3 -0
- package/dist/types/program-key/program-key.d.ts +4 -0
- package/dist/types/project/menu-item.d.ts +5 -0
- package/dist/types/project/project-view-bookmark.d.ts +6 -0
- package/dist/types/project/project-view-tile-source.d.ts +5 -0
- package/dist/types/project/project-view.d.ts +5 -0
- package/dist/types/project/zoom-control.d.ts +4 -0
- package/dist/types/server/pending-action.d.ts +5 -0
- package/dist/types/style/style.d.ts +7 -0
- package/dist/types/tileset/tileset-cad.d.ts +4 -0
- package/dist/types/tileset/tileset-entities-map-tiles.d.ts +5 -0
- package/dist/types/tileset/tileset-entities.d.ts +4 -0
- package/dist/types/tileset/tileset-ext-map-tiles.d.ts +4 -0
- package/dist/types/tileset/tileset-ext-terrain-tiles.d.ts +4 -0
- package/dist/types/tileset/tileset-map-tiles.d.ts +4 -0
- package/dist/types/tileset/tileset-pointcloud.d.ts +4 -0
- package/dist/types/tileset/tileset-terrain-tiles.d.ts +4 -0
- package/dist/types/tileset/tileset.d.ts +10 -0
- package/dist/types/ucs/ucs.d.ts +5 -0
- package/dist/types/user/session.d.ts +5 -0
- package/dist/types/user/user-group.d.ts +4 -0
- package/dist/types/user/user.d.ts +7 -0
- package/dist/types/util/math-utils.d.ts +12 -0
- package/dist/types/util/object-utils.d.ts +4 -0
- package/dist/types/util/path-utils.d.ts +3 -0
- package/dist/types/util/url-utils.d.ts +6 -0
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -75,6 +75,9 @@ function __generator(thisArg, body) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Contains generic descriptions used for Bruce requests.
|
|
80
|
+
*/
|
|
78
81
|
var Api;
|
|
79
82
|
(function (Api) {
|
|
80
83
|
var ECacheKey;
|
|
@@ -106,10 +109,27 @@ var Api;
|
|
|
106
109
|
ECacheKey["AccessToken"] = "accesstoken";
|
|
107
110
|
ECacheKey["UserGroup"] = "usergroup";
|
|
108
111
|
ECacheKey["Account"] = "account";
|
|
112
|
+
ECacheKey["CustomForm"] = "customform";
|
|
109
113
|
})(ECacheKey = Api.ECacheKey || (Api.ECacheKey = {}));
|
|
110
114
|
Api.DEFAULT_CACHE_DURATION = 60 * 5; // 5 minutes.
|
|
111
115
|
Api.TEMPLATE_ACCOUNT_ID = "template";
|
|
112
116
|
Api.ACCESS_TOKEN_HEADER = "X-Access-Token";
|
|
117
|
+
/**
|
|
118
|
+
* Possible environments we host Bruce apps on.
|
|
119
|
+
* When these are matched, they should be case-insensitive.
|
|
120
|
+
*/
|
|
121
|
+
var EEnv;
|
|
122
|
+
(function (EEnv) {
|
|
123
|
+
EEnv["DEV"] = "DEV";
|
|
124
|
+
EEnv["STG"] = "STG";
|
|
125
|
+
EEnv["UAT"] = "UAT";
|
|
126
|
+
EEnv["PROD"] = "PROD";
|
|
127
|
+
})(EEnv = Api.EEnv || (Api.EEnv = {}));
|
|
128
|
+
/**
|
|
129
|
+
* Prepares a string to be included in a url.
|
|
130
|
+
* @param str
|
|
131
|
+
* @returns
|
|
132
|
+
*/
|
|
113
133
|
function Encode(str) {
|
|
114
134
|
return encodeURIComponent(str.replace(/\+/g, "%2B").replace(/\./g, "%2E"));
|
|
115
135
|
}
|
|
@@ -125,19 +145,21 @@ var Api;
|
|
|
125
145
|
EEncoding["UTF8"] = "UTF-8";
|
|
126
146
|
EEncoding["UTF16"] = "UTF-16BE";
|
|
127
147
|
})(EEncoding = Api.EEncoding || (Api.EEncoding = {}));
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
EEnv["PROD"] = "PROD";
|
|
134
|
-
})(EEnv = Api.EEnv || (Api.EEnv = {}));
|
|
148
|
+
/**
|
|
149
|
+
* Prepares default settings for a request to Bruce Api.
|
|
150
|
+
* Our requests WRONGLY have utf-16 for 95% of them. Please be wary of that.
|
|
151
|
+
* @returns
|
|
152
|
+
*/
|
|
135
153
|
function PrepReqParams() {
|
|
136
154
|
return { response: { encoding: Api.EEncoding.UTF16 } };
|
|
137
155
|
}
|
|
138
156
|
Api.PrepReqParams = PrepReqParams;
|
|
139
157
|
})(Api || (Api = {}));
|
|
140
158
|
|
|
159
|
+
/**
|
|
160
|
+
* Describes communication with the "Annotated Document" concept in Bruce.
|
|
161
|
+
* Annotated documents are files with hotspots that can link to Entity records.
|
|
162
|
+
*/
|
|
141
163
|
var AnnDocument;
|
|
142
164
|
(function (AnnDocument) {
|
|
143
165
|
function GetCacheKey(id) {
|
|
@@ -211,6 +233,103 @@ var AnnDocument;
|
|
|
211
233
|
AnnDocument.GetList = GetList;
|
|
212
234
|
})(AnnDocument || (AnnDocument = {}));
|
|
213
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Describes the "Custom Form" concept within Bruce.
|
|
238
|
+
* Custom forms are dynamic dialogs that get populated with Entity data.
|
|
239
|
+
*/
|
|
240
|
+
var CustomForm;
|
|
241
|
+
(function (CustomForm) {
|
|
242
|
+
function GetCacheKey(id) {
|
|
243
|
+
return Api.ECacheKey.CustomForm + Api.ECacheKey.Id + id;
|
|
244
|
+
}
|
|
245
|
+
CustomForm.GetCacheKey = GetCacheKey;
|
|
246
|
+
function GetListCacheKey(typeId) {
|
|
247
|
+
if (typeId) {
|
|
248
|
+
return Api.ECacheKey.CustomForm + Api.ECacheKey.EntityType + Api.ECacheKey.Id + typeId;
|
|
249
|
+
}
|
|
250
|
+
return Api.ECacheKey.CustomForm;
|
|
251
|
+
}
|
|
252
|
+
CustomForm.GetListCacheKey = GetListCacheKey;
|
|
253
|
+
var EType;
|
|
254
|
+
(function (EType) {
|
|
255
|
+
EType["Form"] = "GENERIC";
|
|
256
|
+
EType["Markup"] = "MARKUP";
|
|
257
|
+
})(EType = CustomForm.EType || (CustomForm.EType = {}));
|
|
258
|
+
function Get(api, id) {
|
|
259
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
260
|
+
var cacheData, req;
|
|
261
|
+
return __generator(this, function (_a) {
|
|
262
|
+
if (!id) {
|
|
263
|
+
throw ("Id is required.");
|
|
264
|
+
}
|
|
265
|
+
cacheData = api.Cache.Get(GetCacheKey(id));
|
|
266
|
+
if (cacheData) {
|
|
267
|
+
return [2 /*return*/, cacheData];
|
|
268
|
+
}
|
|
269
|
+
req = api.GET("customForm/" + id, Api.PrepReqParams());
|
|
270
|
+
api.Cache.Set(GetCacheKey(id), req, Api.DEFAULT_CACHE_DURATION);
|
|
271
|
+
return [2 /*return*/, req];
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
CustomForm.Get = Get;
|
|
276
|
+
function Delete(api, id) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
278
|
+
return __generator(this, function (_a) {
|
|
279
|
+
switch (_a.label) {
|
|
280
|
+
case 0:
|
|
281
|
+
if (!id) {
|
|
282
|
+
throw ("Id is required.");
|
|
283
|
+
}
|
|
284
|
+
return [4 /*yield*/, api.DELETE("customForm/" + id, Api.PrepReqParams())];
|
|
285
|
+
case 1:
|
|
286
|
+
_a.sent();
|
|
287
|
+
api.Cache.RemoveByStartsWith(Api.ECacheKey.CustomForm);
|
|
288
|
+
return [2 /*return*/];
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
CustomForm.Delete = Delete;
|
|
294
|
+
function GetList(api, typeId) {
|
|
295
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
296
|
+
var url, cacheData, req, prom;
|
|
297
|
+
return __generator(this, function (_a) {
|
|
298
|
+
url = typeId ? "entityType/" + typeId + "/customForms" : "customForms";
|
|
299
|
+
cacheData = api.Cache.Get(GetListCacheKey(typeId));
|
|
300
|
+
if (cacheData) {
|
|
301
|
+
return [2 /*return*/, cacheData];
|
|
302
|
+
}
|
|
303
|
+
req = api.GET(url, Api.PrepReqParams());
|
|
304
|
+
prom = req.then(function (data) {
|
|
305
|
+
return data.Items;
|
|
306
|
+
});
|
|
307
|
+
api.Cache.Set(GetListCacheKey(typeId), prom, Api.DEFAULT_CACHE_DURATION);
|
|
308
|
+
return [2 /*return*/, prom];
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
CustomForm.GetList = GetList;
|
|
313
|
+
function Update(api, data) {
|
|
314
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
315
|
+
return __generator(this, function (_a) {
|
|
316
|
+
switch (_a.label) {
|
|
317
|
+
case 0:
|
|
318
|
+
if (!data.ID) {
|
|
319
|
+
data.ID = 0;
|
|
320
|
+
}
|
|
321
|
+
return [4 /*yield*/, api.POST("customForm/" + data.ID, data, Api.PrepReqParams())];
|
|
322
|
+
case 1:
|
|
323
|
+
data = _a.sent();
|
|
324
|
+
api.Cache.RemoveByStartsWith(Api.ECacheKey.CustomForm);
|
|
325
|
+
return [2 /*return*/, data];
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
CustomForm.Update = Update;
|
|
331
|
+
})(CustomForm || (CustomForm = {}));
|
|
332
|
+
|
|
214
333
|
var CacheItem = /** @class */ (function () {
|
|
215
334
|
function CacheItem(id, data, duration) {
|
|
216
335
|
this.Id = id;
|
|
@@ -226,6 +345,9 @@ var CacheItem = /** @class */ (function () {
|
|
|
226
345
|
};
|
|
227
346
|
return CacheItem;
|
|
228
347
|
}());
|
|
348
|
+
/**
|
|
349
|
+
* Simple local cache controller.
|
|
350
|
+
*/
|
|
229
351
|
var CacheControl = /** @class */ (function () {
|
|
230
352
|
function CacheControl() {
|
|
231
353
|
this.data = {};
|
|
@@ -314,6 +436,9 @@ function parseResult(data, encoding) {
|
|
|
314
436
|
});
|
|
315
437
|
});
|
|
316
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* This is a base class for communication with an arbitrary Bruce Api.
|
|
441
|
+
*/
|
|
317
442
|
var AbstractApi = /** @class */ (function () {
|
|
318
443
|
function AbstractApi(ssidHeader) {
|
|
319
444
|
this.ssid = "";
|
|
@@ -468,6 +593,10 @@ var AbstractApi = /** @class */ (function () {
|
|
|
468
593
|
return AbstractApi;
|
|
469
594
|
}());
|
|
470
595
|
|
|
596
|
+
/**
|
|
597
|
+
* This is the request handler for Bruce Api,
|
|
598
|
+
* it should be passed to any method that wants to communicate with this particular api.
|
|
599
|
+
*/
|
|
471
600
|
var BruceApi = /** @class */ (function (_super) {
|
|
472
601
|
__extends(BruceApi, _super);
|
|
473
602
|
function BruceApi(accountId, env) {
|
|
@@ -503,6 +632,12 @@ var BruceApi = /** @class */ (function (_super) {
|
|
|
503
632
|
BruceApi.prototype.GetBaseUrl = function () {
|
|
504
633
|
return this.baseUrl;
|
|
505
634
|
};
|
|
635
|
+
BruceApi.prototype.SetBaseUrl = function (url) {
|
|
636
|
+
this.baseUrl = url;
|
|
637
|
+
if (!this.baseUrl.endsWith("/")) {
|
|
638
|
+
this.baseUrl += "/";
|
|
639
|
+
}
|
|
640
|
+
};
|
|
506
641
|
BruceApi.prototype.GET = function (url, params) {
|
|
507
642
|
return __awaiter(this, void 0, void 0, function () {
|
|
508
643
|
return __generator(this, function (_a) {
|
|
@@ -534,6 +669,10 @@ var BruceApi = /** @class */ (function (_super) {
|
|
|
534
669
|
return BruceApi;
|
|
535
670
|
}(AbstractApi));
|
|
536
671
|
|
|
672
|
+
/**
|
|
673
|
+
* This is the request handler for Cam Api,
|
|
674
|
+
* it should be passed to any method that wants to communicate with this particular api.
|
|
675
|
+
*/
|
|
537
676
|
var CamApi = /** @class */ (function (_super) {
|
|
538
677
|
__extends(CamApi, _super);
|
|
539
678
|
function CamApi(env) {
|
|
@@ -568,6 +707,12 @@ var CamApi = /** @class */ (function (_super) {
|
|
|
568
707
|
CamApi.prototype.GetBaseUrl = function () {
|
|
569
708
|
return this.baseUrl;
|
|
570
709
|
};
|
|
710
|
+
CamApi.prototype.SetBaseUrl = function (url) {
|
|
711
|
+
this.baseUrl = url;
|
|
712
|
+
if (!this.baseUrl.endsWith("/")) {
|
|
713
|
+
this.baseUrl += "/";
|
|
714
|
+
}
|
|
715
|
+
};
|
|
571
716
|
CamApi.prototype.GET = function (url, params) {
|
|
572
717
|
return __awaiter(this, void 0, void 0, function () {
|
|
573
718
|
return __generator(this, function (_a) {
|
|
@@ -599,6 +744,10 @@ var CamApi = /** @class */ (function (_super) {
|
|
|
599
744
|
return CamApi;
|
|
600
745
|
}(AbstractApi));
|
|
601
746
|
|
|
747
|
+
/**
|
|
748
|
+
* This is the request handler for Idm Api,
|
|
749
|
+
* it should be passed to any method that wants to communicate with this particular api.
|
|
750
|
+
*/
|
|
602
751
|
var IdmApi = /** @class */ (function (_super) {
|
|
603
752
|
__extends(IdmApi, _super);
|
|
604
753
|
function IdmApi(env) {
|
|
@@ -633,6 +782,12 @@ var IdmApi = /** @class */ (function (_super) {
|
|
|
633
782
|
IdmApi.prototype.GetBaseUrl = function () {
|
|
634
783
|
return this.baseUrl;
|
|
635
784
|
};
|
|
785
|
+
IdmApi.prototype.SetBaseUrl = function (url) {
|
|
786
|
+
this.baseUrl = url;
|
|
787
|
+
if (!this.baseUrl.endsWith("/")) {
|
|
788
|
+
this.baseUrl += "/";
|
|
789
|
+
}
|
|
790
|
+
};
|
|
636
791
|
IdmApi.prototype.GET = function (url, params) {
|
|
637
792
|
return __awaiter(this, void 0, void 0, function () {
|
|
638
793
|
return __generator(this, function (_a) {
|
|
@@ -684,6 +839,11 @@ var Color;
|
|
|
684
839
|
return ColorFromStr(str);
|
|
685
840
|
}
|
|
686
841
|
Color.RandomColor = RandomColor;
|
|
842
|
+
/**
|
|
843
|
+
* Attempts to parse a given color string into a model.
|
|
844
|
+
* @param str
|
|
845
|
+
* @returns
|
|
846
|
+
*/
|
|
687
847
|
function ColorFromStr(str) {
|
|
688
848
|
var r, g, b, a;
|
|
689
849
|
var rgba = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([^\)]+)\s*)?\)$/.exec(str);
|
|
@@ -745,6 +905,10 @@ var Color;
|
|
|
745
905
|
|
|
746
906
|
var ObjectUtils;
|
|
747
907
|
(function (ObjectUtils) {
|
|
908
|
+
/**
|
|
909
|
+
* Generates a Bruce compatible UID.
|
|
910
|
+
* @returns
|
|
911
|
+
*/
|
|
748
912
|
function UId() {
|
|
749
913
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
750
914
|
var r = Math.random() * 16 | 0, v = c == "x" ? r : (r & 0x3 | 0x8);
|
|
@@ -754,6 +918,70 @@ var ObjectUtils;
|
|
|
754
918
|
ObjectUtils.UId = UId;
|
|
755
919
|
})(ObjectUtils || (ObjectUtils = {}));
|
|
756
920
|
|
|
921
|
+
/**
|
|
922
|
+
* Utility to help with parsing and wrapping Bruce paths.
|
|
923
|
+
*/
|
|
924
|
+
var PathUtils;
|
|
925
|
+
(function (PathUtils) {
|
|
926
|
+
function Parse(str) {
|
|
927
|
+
if (!str) {
|
|
928
|
+
return [];
|
|
929
|
+
}
|
|
930
|
+
var broken = str.split("\"/\"");
|
|
931
|
+
if (broken.length > 0) {
|
|
932
|
+
var top_1 = broken[0];
|
|
933
|
+
if (top_1.length > 0) {
|
|
934
|
+
if (top_1.charAt(0) == "\"") {
|
|
935
|
+
top_1 = top_1.substring(1);
|
|
936
|
+
}
|
|
937
|
+
broken[0] = top_1;
|
|
938
|
+
}
|
|
939
|
+
var endIndex = broken.length - 1;
|
|
940
|
+
var bot = broken[endIndex];
|
|
941
|
+
if (bot.length > 0) {
|
|
942
|
+
if (bot.charAt(bot.length - 1) == "\"") {
|
|
943
|
+
bot = bot.substring(0, bot.length - 1);
|
|
944
|
+
}
|
|
945
|
+
broken[endIndex] = bot;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
return broken;
|
|
949
|
+
}
|
|
950
|
+
PathUtils.Parse = Parse;
|
|
951
|
+
function Wrap(path) {
|
|
952
|
+
var tmp = "\"";
|
|
953
|
+
for (var i = 0; i < path.length; i++) {
|
|
954
|
+
var section = path[i];
|
|
955
|
+
tmp += section;
|
|
956
|
+
if (i < path.length - 1) {
|
|
957
|
+
tmp += "\"/\"";
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
tmp += "\"";
|
|
961
|
+
return tmp;
|
|
962
|
+
}
|
|
963
|
+
PathUtils.Wrap = Wrap;
|
|
964
|
+
function ParseLegacy(str) {
|
|
965
|
+
var broken = str.split(".");
|
|
966
|
+
for (var i = 0; i < broken.length; i++) {
|
|
967
|
+
var piece = broken[0];
|
|
968
|
+
if (piece.charAt(0) == "\"") {
|
|
969
|
+
piece = broken[0] = piece.substring(1);
|
|
970
|
+
}
|
|
971
|
+
if (piece.charAt(piece.length - 1) == "\"") {
|
|
972
|
+
broken[0] = piece.substring(0, piece.length - 1);
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
return broken;
|
|
976
|
+
}
|
|
977
|
+
PathUtils.ParseLegacy = ParseLegacy;
|
|
978
|
+
})(PathUtils || (PathUtils = {}));
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* Describes the "Entity" concept within Bruce.
|
|
982
|
+
* An entity is a JSON blob containing both internal data and user-defined data.
|
|
983
|
+
* Entity records have many thinks linked to them through their UIDs such as links, files and relationships.
|
|
984
|
+
*/
|
|
757
985
|
var Entity;
|
|
758
986
|
(function (Entity) {
|
|
759
987
|
function GetCacheKey(entityId) {
|
|
@@ -941,6 +1169,22 @@ var Entity;
|
|
|
941
1169
|
return null;
|
|
942
1170
|
}
|
|
943
1171
|
Entity.GetValue = GetValue;
|
|
1172
|
+
function CalculateName(entity, type) {
|
|
1173
|
+
var attrStr = type.DisplayNameAttributePath;
|
|
1174
|
+
if (attrStr) {
|
|
1175
|
+
var attrPaths = attrStr.split(",");
|
|
1176
|
+
for (var i = 0; i < attrPaths.length; i++) {
|
|
1177
|
+
var pathStr = attrPaths[i];
|
|
1178
|
+
var path = PathUtils.Parse(pathStr);
|
|
1179
|
+
var name_1 = Entity.GetValue(entity, path);
|
|
1180
|
+
if (name_1) {
|
|
1181
|
+
return name_1;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
return entity.Bruce.ID;
|
|
1186
|
+
}
|
|
1187
|
+
Entity.CalculateName = CalculateName;
|
|
944
1188
|
var Filter;
|
|
945
1189
|
(function (Filter) {
|
|
946
1190
|
var V1;
|
|
@@ -1006,62 +1250,6 @@ var Entity;
|
|
|
1006
1250
|
})(Filter = Entity.Filter || (Entity.Filter = {}));
|
|
1007
1251
|
})(Entity || (Entity = {}));
|
|
1008
1252
|
|
|
1009
|
-
var PathUtils;
|
|
1010
|
-
(function (PathUtils) {
|
|
1011
|
-
function Parse(str) {
|
|
1012
|
-
if (!str) {
|
|
1013
|
-
return [];
|
|
1014
|
-
}
|
|
1015
|
-
var broken = str.split("\"/\"");
|
|
1016
|
-
if (broken.length > 0) {
|
|
1017
|
-
var top_1 = broken[0];
|
|
1018
|
-
if (top_1.length > 0) {
|
|
1019
|
-
if (top_1.charAt(0) == "\"") {
|
|
1020
|
-
top_1 = top_1.substring(1);
|
|
1021
|
-
}
|
|
1022
|
-
broken[0] = top_1;
|
|
1023
|
-
}
|
|
1024
|
-
var endIndex = broken.length - 1;
|
|
1025
|
-
var bot = broken[endIndex];
|
|
1026
|
-
if (bot.length > 0) {
|
|
1027
|
-
if (bot.charAt(bot.length - 1) == "\"") {
|
|
1028
|
-
bot = bot.substring(0, bot.length - 1);
|
|
1029
|
-
}
|
|
1030
|
-
broken[endIndex] = bot;
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
return broken;
|
|
1034
|
-
}
|
|
1035
|
-
PathUtils.Parse = Parse;
|
|
1036
|
-
function Wrap(path) {
|
|
1037
|
-
var tmp = "\"";
|
|
1038
|
-
for (var i = 0; i < path.length; i++) {
|
|
1039
|
-
var section = path[i];
|
|
1040
|
-
tmp += section;
|
|
1041
|
-
if (i < path.length - 1) {
|
|
1042
|
-
tmp += "\"/\"";
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
tmp += "\"";
|
|
1046
|
-
return tmp;
|
|
1047
|
-
}
|
|
1048
|
-
PathUtils.Wrap = Wrap;
|
|
1049
|
-
function ParseLegacy(str) {
|
|
1050
|
-
var broken = str.split(".");
|
|
1051
|
-
for (var i = 0; i < broken.length; i++) {
|
|
1052
|
-
var piece = broken[0];
|
|
1053
|
-
if (piece.charAt(0) == "\"") {
|
|
1054
|
-
piece = broken[0] = piece.substring(1);
|
|
1055
|
-
}
|
|
1056
|
-
if (piece.charAt(piece.length - 1) == "\"") {
|
|
1057
|
-
broken[0] = piece.substring(0, piece.length - 1);
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
return broken;
|
|
1061
|
-
}
|
|
1062
|
-
PathUtils.ParseLegacy = ParseLegacy;
|
|
1063
|
-
})(PathUtils || (PathUtils = {}));
|
|
1064
|
-
|
|
1065
1253
|
function getVariable(str) {
|
|
1066
1254
|
var start = str.indexOf("${");
|
|
1067
1255
|
if (start > -1) {
|
|
@@ -1074,8 +1262,21 @@ function getVariable(str) {
|
|
|
1074
1262
|
}
|
|
1075
1263
|
return null;
|
|
1076
1264
|
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Utilities for parsing "Bruce variables", typically within strings.
|
|
1267
|
+
*
|
|
1268
|
+
* A Bruce variable is a string that starts with "${" and ends with "}".
|
|
1269
|
+
* Within those brackets is a path to an attribute in an entity.
|
|
1270
|
+
*/
|
|
1077
1271
|
var BruceVariable;
|
|
1078
1272
|
(function (BruceVariable) {
|
|
1273
|
+
/**
|
|
1274
|
+
* Replaces all Bruce variables in a string with the value of the attribute.
|
|
1275
|
+
* @param str
|
|
1276
|
+
* @param data
|
|
1277
|
+
* @param legacyParse
|
|
1278
|
+
* @returns
|
|
1279
|
+
*/
|
|
1079
1280
|
function SwapValues(str, data, legacyParse) {
|
|
1080
1281
|
if (!legacyParse) {
|
|
1081
1282
|
legacyParse = false;
|
|
@@ -1099,6 +1300,10 @@ var BruceVariable;
|
|
|
1099
1300
|
BruceVariable.SwapValues = SwapValues;
|
|
1100
1301
|
})(BruceVariable || (BruceVariable = {}));
|
|
1101
1302
|
|
|
1303
|
+
/**
|
|
1304
|
+
* Utility for calculating values from Bruce fields.
|
|
1305
|
+
* These fields are typically found in entity styles.
|
|
1306
|
+
*/
|
|
1102
1307
|
var Calculator;
|
|
1103
1308
|
(function (Calculator) {
|
|
1104
1309
|
var EValueType;
|
|
@@ -1110,6 +1315,14 @@ var Calculator;
|
|
|
1110
1315
|
EValueType[EValueType["TagColor"] = 4] = "TagColor";
|
|
1111
1316
|
EValueType[EValueType["RandomColor"] = 5] = "RandomColor";
|
|
1112
1317
|
})(EValueType = Calculator.EValueType || (Calculator.EValueType = {}));
|
|
1318
|
+
/**
|
|
1319
|
+
* Calculates the value of arbitrary field options.
|
|
1320
|
+
* The context calling this should validate results and parse stuff if needed.
|
|
1321
|
+
* @param fields
|
|
1322
|
+
* @param entity
|
|
1323
|
+
* @param tags
|
|
1324
|
+
* @returns
|
|
1325
|
+
*/
|
|
1113
1326
|
function GetValue(fields, entity, tags) {
|
|
1114
1327
|
if (!tags) {
|
|
1115
1328
|
tags = [];
|
|
@@ -1231,6 +1444,10 @@ var Calculator;
|
|
|
1231
1444
|
Calculator.GetInputValue = GetInputValue;
|
|
1232
1445
|
})(Calculator || (Calculator = {}));
|
|
1233
1446
|
|
|
1447
|
+
/**
|
|
1448
|
+
* Simple event utility.
|
|
1449
|
+
* Instantiate the model, then subscribe and trigger events.
|
|
1450
|
+
*/
|
|
1234
1451
|
var BruceEvent = /** @class */ (function () {
|
|
1235
1452
|
function BruceEvent() {
|
|
1236
1453
|
// Counter to help differentiate subscriptions.
|
|
@@ -1281,6 +1498,12 @@ var Camera;
|
|
|
1281
1498
|
})(EFrustum = Camera.EFrustum || (Camera.EFrustum = {}));
|
|
1282
1499
|
})(Camera || (Camera = {}));
|
|
1283
1500
|
|
|
1501
|
+
/**
|
|
1502
|
+
* Describes 2d and 3d coordinates.
|
|
1503
|
+
*
|
|
1504
|
+
* In 2d the x/y typically refers to a window left/top offset.
|
|
1505
|
+
* In 3d the x/y/z, the units are in meters.
|
|
1506
|
+
*/
|
|
1284
1507
|
var Cartes;
|
|
1285
1508
|
(function (Cartes) {
|
|
1286
1509
|
function ValidateCartes2(cartes) {
|
|
@@ -1328,6 +1551,11 @@ var Cartes;
|
|
|
1328
1551
|
Cartes.IsEqualCartes3 = IsEqualCartes3;
|
|
1329
1552
|
})(Cartes || (Cartes = {}));
|
|
1330
1553
|
|
|
1554
|
+
/**
|
|
1555
|
+
* Describes a geographic point.
|
|
1556
|
+
* The units of the stored data should be in Degrees.
|
|
1557
|
+
* Utilities may use this in Radians for temporary calculations.
|
|
1558
|
+
*/
|
|
1331
1559
|
var Carto;
|
|
1332
1560
|
(function (Carto) {
|
|
1333
1561
|
function ValidateCarto(carto) {
|
|
@@ -1381,6 +1609,10 @@ var Carto;
|
|
|
1381
1609
|
Carto.GetCenter = GetCenter;
|
|
1382
1610
|
})(Carto || (Carto = {}));
|
|
1383
1611
|
|
|
1612
|
+
/**
|
|
1613
|
+
* Controls the flow of method calls.
|
|
1614
|
+
* If you have a method that may be called often, but you don't want it to run often, use this.
|
|
1615
|
+
*/
|
|
1384
1616
|
var DelayQueue = /** @class */ (function () {
|
|
1385
1617
|
function DelayQueue(callback, delay) {
|
|
1386
1618
|
if (delay === void 0) { delay = 200; }
|
|
@@ -1434,6 +1666,9 @@ var DelayQueue = /** @class */ (function () {
|
|
|
1434
1666
|
return DelayQueue;
|
|
1435
1667
|
}());
|
|
1436
1668
|
|
|
1669
|
+
/**
|
|
1670
|
+
* Describes vector geometry that Bruce uses.
|
|
1671
|
+
*/
|
|
1437
1672
|
var Geometry;
|
|
1438
1673
|
(function (Geometry) {
|
|
1439
1674
|
var EPolygonRingType;
|
|
@@ -1441,6 +1676,12 @@ var Geometry;
|
|
|
1441
1676
|
EPolygonRingType["Boundaries"] = "out";
|
|
1442
1677
|
EPolygonRingType["Hole"] = "in";
|
|
1443
1678
|
})(EPolygonRingType = Geometry.EPolygonRingType || (Geometry.EPolygonRingType = {}));
|
|
1679
|
+
/**
|
|
1680
|
+
* Turns an array of points into string vector geometry that Bruce can use.
|
|
1681
|
+
* This is used for saving polyline and polygon data.
|
|
1682
|
+
* @param points
|
|
1683
|
+
* @returns
|
|
1684
|
+
*/
|
|
1444
1685
|
function LineStrFromPoints(points) {
|
|
1445
1686
|
if (!points.length) {
|
|
1446
1687
|
throw ("points is empty.");
|
|
@@ -1454,6 +1695,12 @@ var Geometry;
|
|
|
1454
1695
|
return lineString;
|
|
1455
1696
|
}
|
|
1456
1697
|
Geometry.LineStrFromPoints = LineStrFromPoints;
|
|
1698
|
+
/**
|
|
1699
|
+
* Removes same points that occur in a row.
|
|
1700
|
+
* This will not modify the original array.
|
|
1701
|
+
* @param positions
|
|
1702
|
+
* @returns
|
|
1703
|
+
*/
|
|
1457
1704
|
function RemoveRepeatPoints(positions) {
|
|
1458
1705
|
var filteredList = [];
|
|
1459
1706
|
for (var i = 0; i < positions.length; i++) {
|
|
@@ -1501,6 +1748,12 @@ var Geometry;
|
|
|
1501
1748
|
return result;
|
|
1502
1749
|
}
|
|
1503
1750
|
Geometry.ParsePoints = ParsePoints;
|
|
1751
|
+
/**
|
|
1752
|
+
* Parses both string and object Bruce geometry.
|
|
1753
|
+
* String geometry is legacy Bruce data.
|
|
1754
|
+
* @param geometry
|
|
1755
|
+
* @returns
|
|
1756
|
+
*/
|
|
1504
1757
|
function ParseGeometry(geometry) {
|
|
1505
1758
|
if (typeof geometry == "string") {
|
|
1506
1759
|
var positions = [];
|
|
@@ -1531,6 +1784,9 @@ var Geometry;
|
|
|
1531
1784
|
Geometry.ParseGeometry = ParseGeometry;
|
|
1532
1785
|
})(Geometry || (Geometry = {}));
|
|
1533
1786
|
|
|
1787
|
+
/**
|
|
1788
|
+
* Describes a Bruce stored date.
|
|
1789
|
+
*/
|
|
1534
1790
|
var UTC;
|
|
1535
1791
|
(function (UTC) {
|
|
1536
1792
|
var EMonth;
|
|
@@ -1565,6 +1821,10 @@ var UTC;
|
|
|
1565
1821
|
UTC.FromDate = FromDate;
|
|
1566
1822
|
})(UTC || (UTC = {}));
|
|
1567
1823
|
|
|
1824
|
+
/**
|
|
1825
|
+
* Describes the "Entity Attachment Type" concept within Bruce.
|
|
1826
|
+
* It is a record that describes the purpose of an attachment.
|
|
1827
|
+
*/
|
|
1568
1828
|
var EntityAttachmentType;
|
|
1569
1829
|
(function (EntityAttachmentType) {
|
|
1570
1830
|
function GetCacheKey(id) {
|
|
@@ -1579,9 +1839,6 @@ var EntityAttachmentType;
|
|
|
1579
1839
|
(function (EType) {
|
|
1580
1840
|
EType["Photo"] = "photo";
|
|
1581
1841
|
EType["Document"] = "document";
|
|
1582
|
-
EType["Video"] = "video";
|
|
1583
|
-
EType["Drawing"] = "drawing";
|
|
1584
|
-
EType["Model"] = "model";
|
|
1585
1842
|
})(EType = EntityAttachmentType.EType || (EntityAttachmentType.EType = {}));
|
|
1586
1843
|
function Delete(api, id) {
|
|
1587
1844
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1657,6 +1914,11 @@ var EntityAttachmentType;
|
|
|
1657
1914
|
EntityAttachmentType.GetList = GetList;
|
|
1658
1915
|
})(EntityAttachmentType || (EntityAttachmentType = {}));
|
|
1659
1916
|
|
|
1917
|
+
/**
|
|
1918
|
+
* Describes the "Entity Attachment" concept within Bruce.
|
|
1919
|
+
* An entity attachment is an arbitrary file record that is linked to an entity record.
|
|
1920
|
+
* The same file can be attached to multiple entities.
|
|
1921
|
+
*/
|
|
1660
1922
|
var EntityAttachment;
|
|
1661
1923
|
(function (EntityAttachment) {
|
|
1662
1924
|
function GetCacheKey(entityId, typeId, fileId) {
|
|
@@ -1821,6 +2083,10 @@ var EntityAttachment;
|
|
|
1821
2083
|
EntityAttachment.Upload = Upload;
|
|
1822
2084
|
})(EntityAttachment || (EntityAttachment = {}));
|
|
1823
2085
|
|
|
2086
|
+
/**
|
|
2087
|
+
* Describes the "Entity Comment" concept within Bruce.
|
|
2088
|
+
* An entity comment is a user written message that is linked to an entity record.
|
|
2089
|
+
*/
|
|
1824
2090
|
var EntityComment;
|
|
1825
2091
|
(function (EntityComment) {
|
|
1826
2092
|
function GetCacheKey(id) {
|
|
@@ -1910,6 +2176,10 @@ var EntityComment;
|
|
|
1910
2176
|
EntityComment.GetListByEntityId = GetListByEntityId;
|
|
1911
2177
|
})(EntityComment || (EntityComment = {}));
|
|
1912
2178
|
|
|
2179
|
+
/**
|
|
2180
|
+
* Describes the "Entity Link" concept within Bruce.
|
|
2181
|
+
* An entity link is a URL linked to an entity record.
|
|
2182
|
+
*/
|
|
1913
2183
|
var EntityLink;
|
|
1914
2184
|
(function (EntityLink) {
|
|
1915
2185
|
function GetCacheKey(id) {
|
|
@@ -1999,6 +2269,12 @@ var EntityLink;
|
|
|
1999
2269
|
EntityLink.GetListByEntityId = GetListByEntityId;
|
|
2000
2270
|
})(EntityLink || (EntityLink = {}));
|
|
2001
2271
|
|
|
2272
|
+
/**
|
|
2273
|
+
* Describes the "Entity LOD" concept within Bruce.
|
|
2274
|
+
* LOD stands for Level of Detail.
|
|
2275
|
+
* An lod record is a possible 2d/3d visualization of the entity record.
|
|
2276
|
+
* The most common kind is a GLB.
|
|
2277
|
+
*/
|
|
2002
2278
|
var EntityLod;
|
|
2003
2279
|
(function (EntityLod) {
|
|
2004
2280
|
function GetCacheKey(url) {
|
|
@@ -2080,6 +2356,10 @@ var EntityLod;
|
|
|
2080
2356
|
EntityLod.GetLods = GetLods;
|
|
2081
2357
|
})(EntityLod || (EntityLod = {}));
|
|
2082
2358
|
|
|
2359
|
+
/**
|
|
2360
|
+
* Describes the "Entity Relationship Type" concept within Bruce.
|
|
2361
|
+
* A relationship type record describes the purpose of a relationship.
|
|
2362
|
+
*/
|
|
2083
2363
|
var EntityRelationType;
|
|
2084
2364
|
(function (EntityRelationType) {
|
|
2085
2365
|
function GetCacheKey(id) {
|
|
@@ -2186,6 +2466,11 @@ var EntityRelationType;
|
|
|
2186
2466
|
EntityRelationType.Update = Update;
|
|
2187
2467
|
})(EntityRelationType || (EntityRelationType = {}));
|
|
2188
2468
|
|
|
2469
|
+
/**
|
|
2470
|
+
* Describes the "Entity Relationship" concept within Bruce.
|
|
2471
|
+
* An entity relationship is an arbitrary link between two entity records.
|
|
2472
|
+
* The relationship can have a "data entity" linked to it as well for the relationship to store arbitrary data about itself.
|
|
2473
|
+
*/
|
|
2189
2474
|
var EntityRelation;
|
|
2190
2475
|
(function (EntityRelation) {
|
|
2191
2476
|
function GetCacheKey(entityA, entityB, typeId) {
|
|
@@ -2288,6 +2573,11 @@ var EntityRelation;
|
|
|
2288
2573
|
EntityRelation.GetByDataEntityId = GetByDataEntityId;
|
|
2289
2574
|
})(EntityRelation || (EntityRelation = {}));
|
|
2290
2575
|
|
|
2576
|
+
/**
|
|
2577
|
+
* Describes the "Entity Source" concept within Bruce.
|
|
2578
|
+
* An entity source is a record which links an arbitrary source id to a Bruce entity id.
|
|
2579
|
+
* For example an OSM building id to a Bruce entity id.
|
|
2580
|
+
*/
|
|
2291
2581
|
var EntitySource;
|
|
2292
2582
|
(function (EntitySource) {
|
|
2293
2583
|
function GetCacheKey(sourceId, sourceKey) {
|
|
@@ -2420,6 +2710,11 @@ var EntitySource;
|
|
|
2420
2710
|
EntitySource.GetEntityIdsBySourceKeys = GetEntityIdsBySourceKeys;
|
|
2421
2711
|
})(EntitySource || (EntitySource = {}));
|
|
2422
2712
|
|
|
2713
|
+
/**
|
|
2714
|
+
* Describes the "Entity Tag" concept within Bruce.
|
|
2715
|
+
* An entity tag is used to categorize an entity record.
|
|
2716
|
+
* Entity tags can be used in filters, or to restrict entity access.
|
|
2717
|
+
*/
|
|
2423
2718
|
var EntityTag;
|
|
2424
2719
|
(function (EntityTag) {
|
|
2425
2720
|
function GetCacheKey(tagId) {
|
|
@@ -2605,6 +2900,11 @@ var EntityTag;
|
|
|
2605
2900
|
EntityTag.Update = Update;
|
|
2606
2901
|
})(EntityTag || (EntityTag = {}));
|
|
2607
2902
|
|
|
2903
|
+
/**
|
|
2904
|
+
* Describes the "Entity Type" concept within Bruce.
|
|
2905
|
+
* An entity type is an "expectation" of what data "should" look like in a particular entity record.
|
|
2906
|
+
* The schema is stencils onto entity data to filter out what we should display or search against.
|
|
2907
|
+
*/
|
|
2608
2908
|
var EntityType;
|
|
2609
2909
|
(function (EntityType) {
|
|
2610
2910
|
function GetCacheKey(typeId) {
|
|
@@ -2815,6 +3115,11 @@ function getOrCreateCell(cells, cellSize, lon, maxLon, lat, maxLat) {
|
|
|
2815
3115
|
}
|
|
2816
3116
|
return cell;
|
|
2817
3117
|
}
|
|
3118
|
+
/**
|
|
3119
|
+
* This is a helper for making entity requests based on a grid area.
|
|
3120
|
+
* It will return grid cells based on given view-area then will remember when stuff-
|
|
3121
|
+
* was fully-fetched for those cells to avoid making duplicate requests.
|
|
3122
|
+
*/
|
|
2818
3123
|
var EntityGlobe;
|
|
2819
3124
|
(function (EntityGlobe) {
|
|
2820
3125
|
var Grid = /** @class */ (function () {
|
|
@@ -2874,6 +3179,11 @@ function delay(milliseconds) {
|
|
|
2874
3179
|
});
|
|
2875
3180
|
});
|
|
2876
3181
|
}
|
|
3182
|
+
/**
|
|
3183
|
+
* This is a batched entity getter.
|
|
3184
|
+
* It will scan for entity records in a view-area and emit them in batches.
|
|
3185
|
+
* It will restart scanning if the camera moves.
|
|
3186
|
+
*/
|
|
2877
3187
|
var EntityFilterGetter;
|
|
2878
3188
|
(function (EntityFilterGetter) {
|
|
2879
3189
|
var EStatus;
|
|
@@ -3149,6 +3459,10 @@ var EntityFilterGetter;
|
|
|
3149
3459
|
|
|
3150
3460
|
var MAX_AREA_IN_DEGREES$1 = 90;
|
|
3151
3461
|
var GETTER_DELAY = 50;
|
|
3462
|
+
/**
|
|
3463
|
+
* This is a batched "arbitrary data" getter.
|
|
3464
|
+
* You feed it an array of data, then it will emit that data in batches when the view changes.
|
|
3465
|
+
*/
|
|
3152
3466
|
var BatchedDataGetter;
|
|
3153
3467
|
(function (BatchedDataGetter) {
|
|
3154
3468
|
var Getter = /** @class */ (function () {
|
|
@@ -3220,6 +3534,10 @@ var BatchedDataGetter;
|
|
|
3220
3534
|
BatchedDataGetter.Getter = Getter;
|
|
3221
3535
|
})(BatchedDataGetter || (BatchedDataGetter = {}));
|
|
3222
3536
|
|
|
3537
|
+
/**
|
|
3538
|
+
* Describes the "Client File" concept within Bruce.
|
|
3539
|
+
* A client file is a record of a file uploaded to Bruce.
|
|
3540
|
+
*/
|
|
3223
3541
|
var ClientFile;
|
|
3224
3542
|
(function (ClientFile) {
|
|
3225
3543
|
function GetCacheKey(fileId) {
|
|
@@ -3332,6 +3650,10 @@ var ClientFile;
|
|
|
3332
3650
|
})(Filter = ClientFile.Filter || (ClientFile.Filter = {}));
|
|
3333
3651
|
})(ClientFile || (ClientFile = {}));
|
|
3334
3652
|
|
|
3653
|
+
/**
|
|
3654
|
+
* Describes the "Program Key" concept within Bruce.
|
|
3655
|
+
* A program key is an access token for an arbitrary software.
|
|
3656
|
+
*/
|
|
3335
3657
|
var ProgramKey;
|
|
3336
3658
|
(function (ProgramKey) {
|
|
3337
3659
|
function GetCacheKey(programId) {
|
|
@@ -3441,6 +3763,10 @@ var ProgramKey;
|
|
|
3441
3763
|
ProgramKey.Update = Update;
|
|
3442
3764
|
})(ProgramKey || (ProgramKey = {}));
|
|
3443
3765
|
|
|
3766
|
+
/**
|
|
3767
|
+
* Describes an expectation on what should be rendered for a menu item-
|
|
3768
|
+
* between a min-max distance of an entity to the camera.
|
|
3769
|
+
*/
|
|
3444
3770
|
var ZoomControl;
|
|
3445
3771
|
(function (ZoomControl) {
|
|
3446
3772
|
var EDisplayType;
|
|
@@ -3452,6 +3778,16 @@ var ZoomControl;
|
|
|
3452
3778
|
})(EDisplayType = ZoomControl.EDisplayType || (ZoomControl.EDisplayType = {}));
|
|
3453
3779
|
})(ZoomControl || (ZoomControl = {}));
|
|
3454
3780
|
|
|
3781
|
+
/**
|
|
3782
|
+
* Describes the "Tileset" concept in Bruce.
|
|
3783
|
+
*
|
|
3784
|
+
* Tilesets come in three possible variants,
|
|
3785
|
+
* 1- A set of instructions to generate a tileset.
|
|
3786
|
+
* 2- Settings to load a tileset hosted elsewhere.
|
|
3787
|
+
* 3- A set of user-provided files to serve.
|
|
3788
|
+
*
|
|
3789
|
+
* Read the individual tileset-type settings for each variant.
|
|
3790
|
+
*/
|
|
3455
3791
|
var Tileset;
|
|
3456
3792
|
(function (Tileset) {
|
|
3457
3793
|
function GetCacheKey(tilesetId, loadFiles) {
|
|
@@ -3789,6 +4125,11 @@ var Tileset;
|
|
|
3789
4125
|
})(Publish = Tileset.Publish || (Tileset.Publish = {}));
|
|
3790
4126
|
})(Tileset || (Tileset = {}));
|
|
3791
4127
|
|
|
4128
|
+
/**
|
|
4129
|
+
* Describes a menu item found in project views.
|
|
4130
|
+
* Menu items are used to dictate what data to load in a scene.
|
|
4131
|
+
* A menu item may be a container for other items.
|
|
4132
|
+
*/
|
|
3792
4133
|
var MenuItem;
|
|
3793
4134
|
(function (MenuItem) {
|
|
3794
4135
|
var EType;
|
|
@@ -3894,6 +4235,12 @@ var MenuItem;
|
|
|
3894
4235
|
MenuItem.CreateFromTilesetId = CreateFromTilesetId;
|
|
3895
4236
|
})(MenuItem || (MenuItem = {}));
|
|
3896
4237
|
|
|
4238
|
+
/**
|
|
4239
|
+
* Describe the "Project View Bookmark" concept within Bruce.
|
|
4240
|
+
* This is referred to as "slides" in older code.
|
|
4241
|
+
*
|
|
4242
|
+
* A bookmark is a snapshot of what should be displayed and how in a particular project view.
|
|
4243
|
+
*/
|
|
3897
4244
|
var ProjectViewBookmark;
|
|
3898
4245
|
(function (ProjectViewBookmark) {
|
|
3899
4246
|
function GetCacheKey(viewId, bookmarkId) {
|
|
@@ -4003,6 +4350,11 @@ var ProjectViewBookmark;
|
|
|
4003
4350
|
ProjectViewBookmark.Update = Update;
|
|
4004
4351
|
})(ProjectViewBookmark || (ProjectViewBookmark = {}));
|
|
4005
4352
|
|
|
4353
|
+
/**
|
|
4354
|
+
* Describes the "Project View" concept within Bruce.
|
|
4355
|
+
* A project view is a collection of settings for a visualization application we support.
|
|
4356
|
+
* It will describe what panels to show and how, it will also describe all possible ways data can be displayed.
|
|
4357
|
+
*/
|
|
4006
4358
|
var ProjectView;
|
|
4007
4359
|
(function (ProjectView) {
|
|
4008
4360
|
function GetCacheKey(viewId) {
|
|
@@ -4109,6 +4461,11 @@ var ProjectView;
|
|
|
4109
4461
|
ProjectView.Update = Update;
|
|
4110
4462
|
})(ProjectView || (ProjectView = {}));
|
|
4111
4463
|
|
|
4464
|
+
/**
|
|
4465
|
+
* Describes the "Pending Action" concept within Bruce.
|
|
4466
|
+
* A pending action is a record of a server-side background process.
|
|
4467
|
+
* This record is used to monitor its progress and completion state.
|
|
4468
|
+
*/
|
|
4112
4469
|
var PendingAction;
|
|
4113
4470
|
(function (PendingAction) {
|
|
4114
4471
|
var EStatus;
|
|
@@ -4171,6 +4528,13 @@ var PendingAction;
|
|
|
4171
4528
|
PendingAction.GetMessages = GetMessages;
|
|
4172
4529
|
})(PendingAction || (PendingAction = {}));
|
|
4173
4530
|
|
|
4531
|
+
/**
|
|
4532
|
+
* Describes the "Style" concept within Bruce.
|
|
4533
|
+
* A legacy way of referring to styles is "entity display settings".
|
|
4534
|
+
*
|
|
4535
|
+
* A style is a collection of settings (which can be calculations to perform on entity data) that
|
|
4536
|
+
* describe how an entity should be displayed.
|
|
4537
|
+
*/
|
|
4174
4538
|
var Style;
|
|
4175
4539
|
(function (Style) {
|
|
4176
4540
|
function GetCacheKey(id) {
|
|
@@ -4277,6 +4641,11 @@ var Style;
|
|
|
4277
4641
|
Style.Delete = Delete;
|
|
4278
4642
|
})(Style || (Style = {}));
|
|
4279
4643
|
|
|
4644
|
+
/**
|
|
4645
|
+
* Describes expected settings for an entities-map tileset.
|
|
4646
|
+
* This is the kind of tileset generated from arbitrary Bruce entities-
|
|
4647
|
+
* which produced map tiles of the entity vector geometry.
|
|
4648
|
+
*/
|
|
4280
4649
|
var TilesetEntitiesMapTiles;
|
|
4281
4650
|
(function (TilesetEntitiesMapTiles) {
|
|
4282
4651
|
var ETileSize;
|
|
@@ -4288,6 +4657,10 @@ var TilesetEntitiesMapTiles;
|
|
|
4288
4657
|
})(ETileSize = TilesetEntitiesMapTiles.ETileSize || (TilesetEntitiesMapTiles.ETileSize = {}));
|
|
4289
4658
|
})(TilesetEntitiesMapTiles || (TilesetEntitiesMapTiles = {}));
|
|
4290
4659
|
|
|
4660
|
+
/**
|
|
4661
|
+
* Describes settings for an external map-tiles tileset.
|
|
4662
|
+
* This will serve content from elsewhere with the assumption that the data is valid map tiles.
|
|
4663
|
+
*/
|
|
4291
4664
|
var TilesetExtMapTiles;
|
|
4292
4665
|
(function (TilesetExtMapTiles) {
|
|
4293
4666
|
var EType;
|
|
@@ -4299,6 +4672,11 @@ var TilesetExtMapTiles;
|
|
|
4299
4672
|
})(EType = TilesetExtMapTiles.EType || (TilesetExtMapTiles.EType = {}));
|
|
4300
4673
|
})(TilesetExtMapTiles || (TilesetExtMapTiles = {}));
|
|
4301
4674
|
|
|
4675
|
+
/**
|
|
4676
|
+
* Describes the "UCS" concept within Bruce.
|
|
4677
|
+
* A UCS is a user-coordinate-system.
|
|
4678
|
+
* It is a description of an offset to apply to tilesets so that they can all align with each other.
|
|
4679
|
+
*/
|
|
4302
4680
|
var Ucs;
|
|
4303
4681
|
(function (Ucs) {
|
|
4304
4682
|
function GetCacheKey(id, expandUsage) {
|
|
@@ -4408,6 +4786,11 @@ var Permission;
|
|
|
4408
4786
|
})(EPermPrefix = Permission.EPermPrefix || (Permission.EPermPrefix = {}));
|
|
4409
4787
|
})(Permission || (Permission = {}));
|
|
4410
4788
|
|
|
4789
|
+
/**
|
|
4790
|
+
* Describes the "Session" concept within Bruce.
|
|
4791
|
+
* A session is a set of settings produced from a user or access token login.
|
|
4792
|
+
* The session describes what the access should be allowed to do.
|
|
4793
|
+
*/
|
|
4411
4794
|
var Session;
|
|
4412
4795
|
(function (Session) {
|
|
4413
4796
|
function GetCacheKey(sessionId) {
|
|
@@ -4507,6 +4890,10 @@ var Session;
|
|
|
4507
4890
|
Session.IsSuperAdmin = IsSuperAdmin;
|
|
4508
4891
|
})(Session || (Session = {}));
|
|
4509
4892
|
|
|
4893
|
+
/**
|
|
4894
|
+
* Describes the "User Group" concept within Bruce.
|
|
4895
|
+
* A user group is a collection of permissions ("Features") and what users should be in the group.
|
|
4896
|
+
*/
|
|
4510
4897
|
var UserGroup;
|
|
4511
4898
|
(function (UserGroup) {
|
|
4512
4899
|
function GetByName(api, accountId, name) {
|
|
@@ -4604,6 +4991,13 @@ var UserGroup;
|
|
|
4604
4991
|
UserGroup.Update = Update;
|
|
4605
4992
|
})(UserGroup || (UserGroup = {}));
|
|
4606
4993
|
|
|
4994
|
+
/**
|
|
4995
|
+
* Describes the "User" concept within Bruce.
|
|
4996
|
+
* A user is either a login-user or an access-token.
|
|
4997
|
+
*
|
|
4998
|
+
* You cannot login using an access-token, but both concepts are-
|
|
4999
|
+
* treated the same way in terms of permissions and user groups.
|
|
5000
|
+
*/
|
|
4607
5001
|
var User;
|
|
4608
5002
|
(function (User) {
|
|
4609
5003
|
function GetCacheKey(userId, accountId) {
|
|
@@ -4823,6 +5217,12 @@ var EncryptUtils;
|
|
|
4823
5217
|
|
|
4824
5218
|
var MathUtils;
|
|
4825
5219
|
(function (MathUtils) {
|
|
5220
|
+
/**
|
|
5221
|
+
* Rounds a number to a given number of decimal places.
|
|
5222
|
+
* @param num
|
|
5223
|
+
* @param decimals
|
|
5224
|
+
* @returns
|
|
5225
|
+
*/
|
|
4826
5226
|
function Round(num, decimals) {
|
|
4827
5227
|
if (decimals === void 0) { decimals = 0; }
|
|
4828
5228
|
if (decimals <= 0) {
|
|
@@ -4836,6 +5236,12 @@ var MathUtils;
|
|
|
4836
5236
|
return Math.round((num + Number.EPSILON) * d) / d;
|
|
4837
5237
|
}
|
|
4838
5238
|
MathUtils.Round = Round;
|
|
5239
|
+
/**
|
|
5240
|
+
* Returns a random integer between min (inclusive) and max (inclusive).
|
|
5241
|
+
* @param min
|
|
5242
|
+
* @param max
|
|
5243
|
+
* @returns
|
|
5244
|
+
*/
|
|
4839
5245
|
function RandInt(min, max) {
|
|
4840
5246
|
if (min == max) {
|
|
4841
5247
|
return min;
|
|
@@ -4848,6 +5254,9 @@ var MathUtils;
|
|
|
4848
5254
|
MathUtils.RandInt = RandInt;
|
|
4849
5255
|
})(MathUtils || (MathUtils = {}));
|
|
4850
5256
|
|
|
5257
|
+
/**
|
|
5258
|
+
* Utility to help with url manipulation.
|
|
5259
|
+
*/
|
|
4851
5260
|
var UrlUtils;
|
|
4852
5261
|
(function (UrlUtils) {
|
|
4853
5262
|
function GetQueryString(doc) {
|
|
@@ -4866,6 +5275,9 @@ var UrlUtils;
|
|
|
4866
5275
|
return qs;
|
|
4867
5276
|
}
|
|
4868
5277
|
UrlUtils.GetQueryString = GetQueryString;
|
|
5278
|
+
/**
|
|
5279
|
+
* Helper to get and set url params for a given window.
|
|
5280
|
+
*/
|
|
4869
5281
|
var Handler = /** @class */ (function () {
|
|
4870
5282
|
function Handler(window, allowedKeys) {
|
|
4871
5283
|
this._allowedKeys = null;
|
|
@@ -4947,5 +5359,5 @@ var UrlUtils;
|
|
|
4947
5359
|
UrlUtils.Handler = Handler;
|
|
4948
5360
|
})(UrlUtils || (UrlUtils = {}));
|
|
4949
5361
|
|
|
4950
|
-
export { AnnDocument, AbstractApi, Api, BruceApi, CamApi, IdmApi, Calculator, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, BatchedDataGetter, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, PendingAction, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Ucs, Permission, Session, UserGroup, User, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils };
|
|
5362
|
+
export { AnnDocument, CustomForm, AbstractApi, Api, BruceApi, CamApi, IdmApi, Calculator, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, BatchedDataGetter, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, PendingAction, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Ucs, Permission, Session, UserGroup, User, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils };
|
|
4951
5363
|
//# sourceMappingURL=bruce-models.es5.js.map
|