bruce-models 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/bruce-models.es5.js +176 -11
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +173 -9
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account.js +244 -244
  6. package/dist/lib/ann-document/ann-document.js +116 -116
  7. package/dist/lib/api/abstract-api.js +267 -267
  8. package/dist/lib/api/api.js +85 -85
  9. package/dist/lib/api/bruce-api.js +228 -202
  10. package/dist/lib/api/bruce-api.js.map +1 -1
  11. package/dist/lib/api/cam-api.js +132 -132
  12. package/dist/lib/api/cam-api.js.map +1 -1
  13. package/dist/lib/api/global-api.js +131 -131
  14. package/dist/lib/api/global-api.js.map +1 -1
  15. package/dist/lib/api/idm-api.js +132 -132
  16. package/dist/lib/api/idm-api.js.map +1 -1
  17. package/dist/lib/bruce-models.js +84 -83
  18. package/dist/lib/bruce-models.js.map +1 -1
  19. package/dist/lib/calculator/calculator.js +158 -158
  20. package/dist/lib/client-file/client-file.js +188 -188
  21. package/dist/lib/common/bounds.js +2 -2
  22. package/dist/lib/common/bruce-event.js +48 -48
  23. package/dist/lib/common/bruce-variable.js +54 -54
  24. package/dist/lib/common/cache.js +86 -86
  25. package/dist/lib/common/camera.js +11 -11
  26. package/dist/lib/common/cartes.js +55 -55
  27. package/dist/lib/common/carto.js +60 -60
  28. package/dist/lib/common/color.js +86 -86
  29. package/dist/lib/common/delay-queue.js +60 -60
  30. package/dist/lib/common/dictionary.js +2 -2
  31. package/dist/lib/common/geometry.js +120 -120
  32. package/dist/lib/common/transform.js +2 -2
  33. package/dist/lib/common/utc.js +39 -39
  34. package/dist/lib/custom-form/custom-form.js +136 -136
  35. package/dist/lib/data-lab/data-lab.js +90 -90
  36. package/dist/lib/entity/entity-attachment-type.js +132 -132
  37. package/dist/lib/entity/entity-attachment.js +208 -208
  38. package/dist/lib/entity/entity-comment.js +132 -132
  39. package/dist/lib/entity/entity-coords.js +181 -181
  40. package/dist/lib/entity/entity-link.js +132 -132
  41. package/dist/lib/entity/entity-lod.js +189 -189
  42. package/dist/lib/entity/entity-relation-type.js +150 -150
  43. package/dist/lib/entity/entity-relation.js +189 -189
  44. package/dist/lib/entity/entity-source.js +176 -176
  45. package/dist/lib/entity/entity-tag.js +229 -229
  46. package/dist/lib/entity/entity-type.js +163 -163
  47. package/dist/lib/entity/entity.js +358 -358
  48. package/dist/lib/entity/getters/batched-data-getter.js +91 -91
  49. package/dist/lib/entity/getters/entity-filter-getter.js +344 -344
  50. package/dist/lib/entity/getters/entity-globe.js +135 -135
  51. package/dist/lib/entity/getters/view-monitor.js +2 -2
  52. package/dist/lib/import/import-cad.js +82 -82
  53. package/dist/lib/import/import-csv.js +51 -51
  54. package/dist/lib/import/import-json.js +51 -51
  55. package/dist/lib/import/import-kml.js +51 -51
  56. package/dist/lib/import/imported-file.js +121 -121
  57. package/dist/lib/markup/markup.js +40 -40
  58. package/dist/lib/program-key/program-key.js +152 -152
  59. package/dist/lib/project/menu-item.js +115 -115
  60. package/dist/lib/project/project-view-bookmark.js +183 -172
  61. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  62. package/dist/lib/project/{project-view-tile-source.js → project-view-legacy-tile.js} +116 -116
  63. package/dist/lib/project/project-view-legacy-tile.js.map +1 -0
  64. package/dist/lib/project/project-view-tile.js +120 -0
  65. package/dist/lib/project/project-view-tile.js.map +1 -0
  66. package/dist/lib/project/project-view.js +177 -166
  67. package/dist/lib/project/project-view.js.map +1 -1
  68. package/dist/lib/project/zoom-control.js +17 -17
  69. package/dist/lib/server/pending-action.js +106 -106
  70. package/dist/lib/server/task.js +113 -113
  71. package/dist/lib/style/style.js +152 -152
  72. package/dist/lib/tileset/tileset-cad.js +2 -2
  73. package/dist/lib/tileset/tileset-entities-map-tiles.js +18 -18
  74. package/dist/lib/tileset/tileset-entities.js +2 -2
  75. package/dist/lib/tileset/tileset-ext-map-tiles.js +17 -17
  76. package/dist/lib/tileset/tileset-ext-terrain-tiles.js +2 -2
  77. package/dist/lib/tileset/tileset-map-tiles.js +2 -2
  78. package/dist/lib/tileset/tileset-pointcloud.js +2 -2
  79. package/dist/lib/tileset/tileset-terrain-tiles.js +2 -2
  80. package/dist/lib/tileset/tileset.js +403 -403
  81. package/dist/lib/user/permission.js +20 -20
  82. package/dist/lib/user/session.js +160 -160
  83. package/dist/lib/user/user-group.js +139 -139
  84. package/dist/lib/user/user.js +451 -451
  85. package/dist/lib/util/encrypt-utils.js +20 -20
  86. package/dist/lib/util/math-utils.js +41 -41
  87. package/dist/lib/util/object-utils.js +17 -17
  88. package/dist/lib/util/path-utils.js +61 -61
  89. package/dist/lib/util/url-utils.js +107 -107
  90. package/dist/types/api/bruce-api.d.ts +22 -2
  91. package/dist/types/api/cam-api.d.ts +1 -1
  92. package/dist/types/api/global-api.d.ts +1 -1
  93. package/dist/types/api/idm-api.d.ts +1 -1
  94. package/dist/types/bruce-models.d.ts +2 -1
  95. package/dist/types/project/project-view-bookmark.d.ts +85 -36
  96. package/dist/types/project/{project-view-tile-source.d.ts → project-view-legacy-tile.d.ts} +1 -1
  97. package/dist/types/project/project-view-tile.d.ts +68 -0
  98. package/dist/types/project/project-view.d.ts +64 -39
  99. package/package.json +1 -1
  100. package/dist/lib/project/project-view-tile-source.js.map +0 -1
@@ -907,22 +907,30 @@
907
907
  */
908
908
  var Api$$1 = /** @class */ (function (_super) {
909
909
  __extends(Api$$1, _super);
910
- function Api$$1(accountId, env) {
910
+ /**
911
+ * @param accountId
912
+ * @param env (Optional) environment to use, this will default to PROD.
913
+ * @param cam (Optional) cam instance to use for loading the regional base url.
914
+ */
915
+ function Api$$1(accountId, env, cam) {
911
916
  var _this = _super.call(this, "x-sessionid") || this;
912
917
  _this.baseUrl = "";
918
+ _this.loadCancelled = false;
913
919
  _this.accountId = accountId;
914
920
  _this.env = env !== null && env !== void 0 ? env : exports.Api.EEnv.PROD;
915
- _this.loadProm = _this.setBaseUrl();
921
+ _this.loadProm = _this.setBaseUrl(cam);
916
922
  return _this;
917
923
  }
918
924
  Object.defineProperty(Api$$1.prototype, "Loading", {
925
+ // Indicates if the init process has finished loading.
926
+ // This means the regional base url has been set.
919
927
  get: function () {
920
928
  return this.loadProm;
921
929
  },
922
930
  enumerable: false,
923
931
  configurable: true
924
932
  });
925
- Api$$1.prototype.setBaseUrl = function () {
933
+ Api$$1.prototype.setBaseUrl = function (cam) {
926
934
  var _a;
927
935
  return __awaiter(this, void 0, void 0, function () {
928
936
  var prefix, url, env, camApi, settings, endpoint, e_1;
@@ -951,10 +959,14 @@
951
959
  _b.label = 1;
952
960
  case 1:
953
961
  _b.trys.push([1, 3, , 4]);
954
- camApi = new exports.CamApi.Api(env);
962
+ camApi = cam ? cam : new exports.CamApi.Api(env);
955
963
  return [4 /*yield*/, exports.Account.GetAppSettings(camApi, this.accountId, exports.Account.EAppId.BruceApi)];
956
964
  case 2:
957
965
  settings = _b.sent();
966
+ if (this.loadCancelled) {
967
+ console.warn("BruceApi: Loading was cancelled due to SetBaseUrl being called, not setting regional base url.");
968
+ return [2 /*return*/];
969
+ }
958
970
  endpoint = (_a = settings.BruceAPIURL) === null || _a === void 0 ? void 0 : _a[env];
959
971
  if (typeof endpoint == "string") {
960
972
  if (!endpoint.endsWith("/")) {
@@ -972,14 +984,28 @@
972
984
  });
973
985
  });
974
986
  };
987
+ /**
988
+ * Warning: This method does not wait for init to finish loading.
989
+ * This means the url could be changed once fully initialized.
990
+ * The url will be valid either way, but the loaded one may be faster as it is region specific.
991
+ * Await the "Loading" promise if you care about this.
992
+ * @returns
993
+ */
975
994
  Api$$1.prototype.GetBaseUrl = function () {
976
995
  return this.baseUrl;
977
996
  };
997
+ /**
998
+ * Warning: This will cancel the init process.
999
+ * The init process loads a region specific endpoint.
1000
+ * Setting a base url will stop that process from completing.
1001
+ * @param url
1002
+ */
978
1003
  Api$$1.prototype.SetBaseUrl = function (url) {
979
1004
  this.baseUrl = url;
980
1005
  if (!this.baseUrl.endsWith("/")) {
981
1006
  this.baseUrl += "/";
982
1007
  }
1008
+ this.loadCancelled = true;
983
1009
  };
984
1010
  Api$$1.prototype.GET = function (url, params) {
985
1011
  return __awaiter(this, void 0, void 0, function () {
@@ -4870,6 +4896,17 @@
4870
4896
  return "" + exports.Api.ECacheKey.ProjectViewBookmark + exports.Api.ECacheKey.Id + viewId;
4871
4897
  }
4872
4898
  ProjectViewBookmark.GetListCacheKey = GetListCacheKey;
4899
+ // This is the expected default version for the DataVersion value.
4900
+ // This value should NOT be changed without looking at our API and seeing what the default value is.
4901
+ ProjectViewBookmark.DEFAULT_DATA_VERSION = 1;
4902
+ var V1;
4903
+ (function (V1) {
4904
+ V1.DATA_VERSION = 1;
4905
+ })(V1 = ProjectViewBookmark.V1 || (ProjectViewBookmark.V1 = {}));
4906
+ var V2;
4907
+ (function (V2) {
4908
+ V2.DATA_VERSION = 2;
4909
+ })(V2 = ProjectViewBookmark.V2 || (ProjectViewBookmark.V2 = {}));
4873
4910
  function Get(api, viewId, bookmarkId) {
4874
4911
  return __awaiter(this, void 0, void 0, function () {
4875
4912
  var key, cacheData, req;
@@ -4995,6 +5032,17 @@
4995
5032
  return exports.Api.ECacheKey.ProjectView;
4996
5033
  }
4997
5034
  ProjectView.GetListCacheKey = GetListCacheKey;
5035
+ // This is the expected default version for the DataVersion value.
5036
+ // This value should NOT be changed without looking at our API and seeing what the default value is.
5037
+ ProjectView.DEFAULT_DATA_VERSION = 1;
5038
+ var V1;
5039
+ (function (V1) {
5040
+ V1.DATA_VERSION = 1;
5041
+ })(V1 = ProjectView.V1 || (ProjectView.V1 = {}));
5042
+ var V2;
5043
+ (function (V2) {
5044
+ V2.DATA_VERSION = 2;
5045
+ })(V2 = ProjectView.V2 || (ProjectView.V2 = {}));
4998
5046
  function Get(api, viewId) {
4999
5047
  return __awaiter(this, void 0, void 0, function () {
5000
5048
  var key, cacheData, req;
@@ -5112,7 +5160,7 @@
5112
5160
  var view;
5113
5161
  return __generator(this, function (_b) {
5114
5162
  switch (_b.label) {
5115
- case 0: return [4 /*yield*/, exports.ProjectView.Get(apiGetter.getApi(exports.Api.TEMPLATE_ACCOUNT_ID, apiGetter.env), "default")];
5163
+ case 0: return [4 /*yield*/, exports.ProjectView.Get(apiGetter.getApi(exports.Api.TEMPLATE_ACCOUNT_ID), "default")];
5116
5164
  case 1:
5117
5165
  view = _b.sent();
5118
5166
  return [2 /*return*/, (_a = view.Settings) !== null && _a !== void 0 ? _a : {}];
@@ -5132,7 +5180,7 @@
5132
5180
  items.push(templateItem);
5133
5181
  }
5134
5182
  }
5135
- (function (ProjectViewTileSource) {
5183
+ (function (ProjectViewLegacyTile) {
5136
5184
  function MergeMapTemplateData(getter, items, addIfMissing) {
5137
5185
  var _a;
5138
5186
  return __awaiter(this, void 0, void 0, function () {
@@ -5152,7 +5200,7 @@
5152
5200
  });
5153
5201
  });
5154
5202
  }
5155
- ProjectViewTileSource.MergeMapTemplateData = MergeMapTemplateData;
5203
+ ProjectViewLegacyTile.MergeMapTemplateData = MergeMapTemplateData;
5156
5204
  function MergeTerrainTemplateData(getter, items, addIfMissing) {
5157
5205
  var _a;
5158
5206
  return __awaiter(this, void 0, void 0, function () {
@@ -5172,8 +5220,124 @@
5172
5220
  });
5173
5221
  });
5174
5222
  }
5175
- ProjectViewTileSource.MergeTerrainTemplateData = MergeTerrainTemplateData;
5176
- })(exports.ProjectViewTileSource || (exports.ProjectViewTileSource = {}));
5223
+ ProjectViewLegacyTile.MergeTerrainTemplateData = MergeTerrainTemplateData;
5224
+ })(exports.ProjectViewLegacyTile || (exports.ProjectViewLegacyTile = {}));
5225
+
5226
+ (function (ProjectViewTile) {
5227
+ var EDefaultImagery;
5228
+ (function (EDefaultImagery) {
5229
+ EDefaultImagery["BingMapsAerial"] = "bingmapsaerial";
5230
+ EDefaultImagery["BingMapsAerialWithLabels"] = "bingmapsaerialwithlabels";
5231
+ EDefaultImagery["BingMapsRoads"] = "bingmapsroads";
5232
+ EDefaultImagery["MapboxSatellite"] = "mapboxsatellite";
5233
+ EDefaultImagery["MapBoxStreets"] = "mapboxstreets";
5234
+ EDefaultImagery["MapBoxStreetsClassic"] = "mapboxstreetsclassic";
5235
+ EDefaultImagery["EsriWorldImagery"] = "esriworldimagery";
5236
+ EDefaultImagery["EsriWorldStreetMap"] = "esriworldstreetmap";
5237
+ EDefaultImagery["EsriNationalGeographic"] = "esrinationalgeographic";
5238
+ EDefaultImagery["OpenStreetMap"] = "openstreetmap";
5239
+ EDefaultImagery["StamenWaterColor"] = "stamenwatercolor";
5240
+ EDefaultImagery["StamenToner"] = "stamentoner";
5241
+ EDefaultImagery["Grid"] = "grid";
5242
+ })(EDefaultImagery = ProjectViewTile.EDefaultImagery || (ProjectViewTile.EDefaultImagery = {}));
5243
+ /**
5244
+ * Prepared array for UI.
5245
+ * TODO: Im not happy with icon urls sitting in the code. I'd prefer we ship these icons in the library as files.
5246
+ */
5247
+ ProjectViewTile.DefaultImagery = [
5248
+ {
5249
+ id: EDefaultImagery.BingMapsAerial,
5250
+ name: "Bing Maps Aerial",
5251
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingAerial.png"
5252
+ },
5253
+ {
5254
+ id: EDefaultImagery.BingMapsAerialWithLabels,
5255
+ name: "Bing Maps Aerial with Labels",
5256
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingAerialLabels.png"
5257
+ },
5258
+ {
5259
+ id: EDefaultImagery.BingMapsRoads,
5260
+ name: "Bing Maps Roads",
5261
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingRoads.png"
5262
+ },
5263
+ {
5264
+ id: EDefaultImagery.MapboxSatellite,
5265
+ name: "Mapbox Satellite",
5266
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxSatellite.png"
5267
+ },
5268
+ {
5269
+ id: EDefaultImagery.MapBoxStreets,
5270
+ name: "Mapbox Streets",
5271
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxTerrain.png"
5272
+ },
5273
+ {
5274
+ id: EDefaultImagery.MapBoxStreetsClassic,
5275
+ name: "Mapbox Streets Classic",
5276
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxStreets.png"
5277
+ },
5278
+ {
5279
+ id: EDefaultImagery.EsriWorldImagery,
5280
+ name: "Esri World Imagery",
5281
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriWorldImagery.png"
5282
+ },
5283
+ {
5284
+ id: EDefaultImagery.EsriWorldStreetMap,
5285
+ name: "Esri World Street Map",
5286
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriWorldStreetMap.png"
5287
+ },
5288
+ {
5289
+ id: EDefaultImagery.EsriNationalGeographic,
5290
+ name: "Esri National Geographic",
5291
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriNationalGeographic.png"
5292
+ },
5293
+ {
5294
+ id: EDefaultImagery.OpenStreetMap,
5295
+ name: "Open Street Map",
5296
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/openStreetMap.png"
5297
+ },
5298
+ {
5299
+ id: EDefaultImagery.StamenWaterColor,
5300
+ name: "Stamen Water Color",
5301
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/stamenWatercolor.png"
5302
+ },
5303
+ {
5304
+ id: EDefaultImagery.StamenToner,
5305
+ name: "Stamen Toner",
5306
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/stamenToner.png"
5307
+ },
5308
+ {
5309
+ id: EDefaultImagery.Grid,
5310
+ name: "Grid",
5311
+ iconUrl: "https://template.api.nextspace-uat.net/file/2885d8df-028b-4f5c-80b3-2634f7e7cf69.png"
5312
+ }
5313
+ ];
5314
+ var EDefaultTerrain;
5315
+ (function (EDefaultTerrain) {
5316
+ EDefaultTerrain["CesiumWorldTerrain"] = "cesiumworldterrain";
5317
+ EDefaultTerrain["FlatTerrain"] = "flatterrain";
5318
+ EDefaultTerrain["LINZ"] = "linz";
5319
+ })(EDefaultTerrain = ProjectViewTile.EDefaultTerrain || (ProjectViewTile.EDefaultTerrain = {}));
5320
+ /**
5321
+ * Prepared array for UI.
5322
+ * TODO: Im not happy with icon urls sitting in the code. I'd prefer we ship these icons in the library as files.
5323
+ */
5324
+ ProjectViewTile.DefaultTerrains = [
5325
+ {
5326
+ id: EDefaultTerrain.CesiumWorldTerrain,
5327
+ name: "Cesium World Terrain",
5328
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/TerrainProviders/CesiumWorldTerrain.png"
5329
+ },
5330
+ {
5331
+ id: EDefaultTerrain.LINZ,
5332
+ name: "LINZ",
5333
+ iconUrl: "https://template.ui.nextspace.host/media/linz.jpg"
5334
+ },
5335
+ {
5336
+ id: EDefaultTerrain.FlatTerrain,
5337
+ name: "Flat Terrain",
5338
+ }
5339
+ ];
5340
+ })(exports.ProjectViewTile || (exports.ProjectViewTile = {}));
5177
5341
 
5178
5342
  (function (PendingAction) {
5179
5343
  var EStatus;