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
@@ -923,22 +923,30 @@ var BruceApi;
923
923
  */
924
924
  var Api$$1 = /** @class */ (function (_super) {
925
925
  __extends(Api$$1, _super);
926
- function Api$$1(accountId, env) {
926
+ /**
927
+ * @param accountId
928
+ * @param env (Optional) environment to use, this will default to PROD.
929
+ * @param cam (Optional) cam instance to use for loading the regional base url.
930
+ */
931
+ function Api$$1(accountId, env, cam) {
927
932
  var _this = _super.call(this, "x-sessionid") || this;
928
933
  _this.baseUrl = "";
934
+ _this.loadCancelled = false;
929
935
  _this.accountId = accountId;
930
936
  _this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
931
- _this.loadProm = _this.setBaseUrl();
937
+ _this.loadProm = _this.setBaseUrl(cam);
932
938
  return _this;
933
939
  }
934
940
  Object.defineProperty(Api$$1.prototype, "Loading", {
941
+ // Indicates if the init process has finished loading.
942
+ // This means the regional base url has been set.
935
943
  get: function () {
936
944
  return this.loadProm;
937
945
  },
938
946
  enumerable: false,
939
947
  configurable: true
940
948
  });
941
- Api$$1.prototype.setBaseUrl = function () {
949
+ Api$$1.prototype.setBaseUrl = function (cam) {
942
950
  var _a;
943
951
  return __awaiter(this, void 0, void 0, function () {
944
952
  var prefix, url, env, camApi, settings, endpoint, e_1;
@@ -967,10 +975,14 @@ var BruceApi;
967
975
  _b.label = 1;
968
976
  case 1:
969
977
  _b.trys.push([1, 3, , 4]);
970
- camApi = new CamApi.Api(env);
978
+ camApi = cam ? cam : new CamApi.Api(env);
971
979
  return [4 /*yield*/, Account.GetAppSettings(camApi, this.accountId, Account.EAppId.BruceApi)];
972
980
  case 2:
973
981
  settings = _b.sent();
982
+ if (this.loadCancelled) {
983
+ console.warn("BruceApi: Loading was cancelled due to SetBaseUrl being called, not setting regional base url.");
984
+ return [2 /*return*/];
985
+ }
974
986
  endpoint = (_a = settings.BruceAPIURL) === null || _a === void 0 ? void 0 : _a[env];
975
987
  if (typeof endpoint == "string") {
976
988
  if (!endpoint.endsWith("/")) {
@@ -988,14 +1000,28 @@ var BruceApi;
988
1000
  });
989
1001
  });
990
1002
  };
1003
+ /**
1004
+ * Warning: This method does not wait for init to finish loading.
1005
+ * This means the url could be changed once fully initialized.
1006
+ * The url will be valid either way, but the loaded one may be faster as it is region specific.
1007
+ * Await the "Loading" promise if you care about this.
1008
+ * @returns
1009
+ */
991
1010
  Api$$1.prototype.GetBaseUrl = function () {
992
1011
  return this.baseUrl;
993
1012
  };
1013
+ /**
1014
+ * Warning: This will cancel the init process.
1015
+ * The init process loads a region specific endpoint.
1016
+ * Setting a base url will stop that process from completing.
1017
+ * @param url
1018
+ */
994
1019
  Api$$1.prototype.SetBaseUrl = function (url) {
995
1020
  this.baseUrl = url;
996
1021
  if (!this.baseUrl.endsWith("/")) {
997
1022
  this.baseUrl += "/";
998
1023
  }
1024
+ this.loadCancelled = true;
999
1025
  };
1000
1026
  Api$$1.prototype.GET = function (url, params) {
1001
1027
  return __awaiter(this, void 0, void 0, function () {
@@ -5018,6 +5044,17 @@ var ProjectViewBookmark;
5018
5044
  return "" + Api.ECacheKey.ProjectViewBookmark + Api.ECacheKey.Id + viewId;
5019
5045
  }
5020
5046
  ProjectViewBookmark.GetListCacheKey = GetListCacheKey;
5047
+ // This is the expected default version for the DataVersion value.
5048
+ // This value should NOT be changed without looking at our API and seeing what the default value is.
5049
+ ProjectViewBookmark.DEFAULT_DATA_VERSION = 1;
5050
+ var V1;
5051
+ (function (V1) {
5052
+ V1.DATA_VERSION = 1;
5053
+ })(V1 = ProjectViewBookmark.V1 || (ProjectViewBookmark.V1 = {}));
5054
+ var V2;
5055
+ (function (V2) {
5056
+ V2.DATA_VERSION = 2;
5057
+ })(V2 = ProjectViewBookmark.V2 || (ProjectViewBookmark.V2 = {}));
5021
5058
  function Get(api, viewId, bookmarkId) {
5022
5059
  return __awaiter(this, void 0, void 0, function () {
5023
5060
  var key, cacheData, req;
@@ -5149,6 +5186,17 @@ var ProjectView;
5149
5186
  return Api.ECacheKey.ProjectView;
5150
5187
  }
5151
5188
  ProjectView.GetListCacheKey = GetListCacheKey;
5189
+ // This is the expected default version for the DataVersion value.
5190
+ // This value should NOT be changed without looking at our API and seeing what the default value is.
5191
+ ProjectView.DEFAULT_DATA_VERSION = 1;
5192
+ var V1;
5193
+ (function (V1) {
5194
+ V1.DATA_VERSION = 1;
5195
+ })(V1 = ProjectView.V1 || (ProjectView.V1 = {}));
5196
+ var V2;
5197
+ (function (V2) {
5198
+ V2.DATA_VERSION = 2;
5199
+ })(V2 = ProjectView.V2 || (ProjectView.V2 = {}));
5152
5200
  function Get(api, viewId) {
5153
5201
  return __awaiter(this, void 0, void 0, function () {
5154
5202
  var key, cacheData, req;
@@ -5266,7 +5314,7 @@ function getTemplateSettings(apiGetter) {
5266
5314
  var view;
5267
5315
  return __generator(this, function (_b) {
5268
5316
  switch (_b.label) {
5269
- case 0: return [4 /*yield*/, ProjectView.Get(apiGetter.getApi(Api.TEMPLATE_ACCOUNT_ID, apiGetter.env), "default")];
5317
+ case 0: return [4 /*yield*/, ProjectView.Get(apiGetter.getApi(Api.TEMPLATE_ACCOUNT_ID), "default")];
5270
5318
  case 1:
5271
5319
  view = _b.sent();
5272
5320
  return [2 /*return*/, (_a = view.Settings) !== null && _a !== void 0 ? _a : {}];
@@ -5291,8 +5339,8 @@ function checkSourceToTemplate(items, templateItem, addIfMissing) {
5291
5339
  * This is a concept we want to trash as we're moving towards storing tileset ids instead.
5292
5340
  * This will help at least understand and manage this dying concept.
5293
5341
  */
5294
- var ProjectViewTileSource;
5295
- (function (ProjectViewTileSource) {
5342
+ var ProjectViewLegacyTile;
5343
+ (function (ProjectViewLegacyTile) {
5296
5344
  function MergeMapTemplateData(getter, items, addIfMissing) {
5297
5345
  var _a;
5298
5346
  return __awaiter(this, void 0, void 0, function () {
@@ -5312,7 +5360,7 @@ var ProjectViewTileSource;
5312
5360
  });
5313
5361
  });
5314
5362
  }
5315
- ProjectViewTileSource.MergeMapTemplateData = MergeMapTemplateData;
5363
+ ProjectViewLegacyTile.MergeMapTemplateData = MergeMapTemplateData;
5316
5364
  function MergeTerrainTemplateData(getter, items, addIfMissing) {
5317
5365
  var _a;
5318
5366
  return __awaiter(this, void 0, void 0, function () {
@@ -5332,8 +5380,125 @@ var ProjectViewTileSource;
5332
5380
  });
5333
5381
  });
5334
5382
  }
5335
- ProjectViewTileSource.MergeTerrainTemplateData = MergeTerrainTemplateData;
5336
- })(ProjectViewTileSource || (ProjectViewTileSource = {}));
5383
+ ProjectViewLegacyTile.MergeTerrainTemplateData = MergeTerrainTemplateData;
5384
+ })(ProjectViewLegacyTile || (ProjectViewLegacyTile = {}));
5385
+
5386
+ var ProjectViewTile;
5387
+ (function (ProjectViewTile) {
5388
+ var EDefaultImagery;
5389
+ (function (EDefaultImagery) {
5390
+ EDefaultImagery["BingMapsAerial"] = "bingmapsaerial";
5391
+ EDefaultImagery["BingMapsAerialWithLabels"] = "bingmapsaerialwithlabels";
5392
+ EDefaultImagery["BingMapsRoads"] = "bingmapsroads";
5393
+ EDefaultImagery["MapboxSatellite"] = "mapboxsatellite";
5394
+ EDefaultImagery["MapBoxStreets"] = "mapboxstreets";
5395
+ EDefaultImagery["MapBoxStreetsClassic"] = "mapboxstreetsclassic";
5396
+ EDefaultImagery["EsriWorldImagery"] = "esriworldimagery";
5397
+ EDefaultImagery["EsriWorldStreetMap"] = "esriworldstreetmap";
5398
+ EDefaultImagery["EsriNationalGeographic"] = "esrinationalgeographic";
5399
+ EDefaultImagery["OpenStreetMap"] = "openstreetmap";
5400
+ EDefaultImagery["StamenWaterColor"] = "stamenwatercolor";
5401
+ EDefaultImagery["StamenToner"] = "stamentoner";
5402
+ EDefaultImagery["Grid"] = "grid";
5403
+ })(EDefaultImagery = ProjectViewTile.EDefaultImagery || (ProjectViewTile.EDefaultImagery = {}));
5404
+ /**
5405
+ * Prepared array for UI.
5406
+ * TODO: Im not happy with icon urls sitting in the code. I'd prefer we ship these icons in the library as files.
5407
+ */
5408
+ ProjectViewTile.DefaultImagery = [
5409
+ {
5410
+ id: EDefaultImagery.BingMapsAerial,
5411
+ name: "Bing Maps Aerial",
5412
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingAerial.png"
5413
+ },
5414
+ {
5415
+ id: EDefaultImagery.BingMapsAerialWithLabels,
5416
+ name: "Bing Maps Aerial with Labels",
5417
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingAerialLabels.png"
5418
+ },
5419
+ {
5420
+ id: EDefaultImagery.BingMapsRoads,
5421
+ name: "Bing Maps Roads",
5422
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingRoads.png"
5423
+ },
5424
+ {
5425
+ id: EDefaultImagery.MapboxSatellite,
5426
+ name: "Mapbox Satellite",
5427
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxSatellite.png"
5428
+ },
5429
+ {
5430
+ id: EDefaultImagery.MapBoxStreets,
5431
+ name: "Mapbox Streets",
5432
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxTerrain.png"
5433
+ },
5434
+ {
5435
+ id: EDefaultImagery.MapBoxStreetsClassic,
5436
+ name: "Mapbox Streets Classic",
5437
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxStreets.png"
5438
+ },
5439
+ {
5440
+ id: EDefaultImagery.EsriWorldImagery,
5441
+ name: "Esri World Imagery",
5442
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriWorldImagery.png"
5443
+ },
5444
+ {
5445
+ id: EDefaultImagery.EsriWorldStreetMap,
5446
+ name: "Esri World Street Map",
5447
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriWorldStreetMap.png"
5448
+ },
5449
+ {
5450
+ id: EDefaultImagery.EsriNationalGeographic,
5451
+ name: "Esri National Geographic",
5452
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriNationalGeographic.png"
5453
+ },
5454
+ {
5455
+ id: EDefaultImagery.OpenStreetMap,
5456
+ name: "Open Street Map",
5457
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/openStreetMap.png"
5458
+ },
5459
+ {
5460
+ id: EDefaultImagery.StamenWaterColor,
5461
+ name: "Stamen Water Color",
5462
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/stamenWatercolor.png"
5463
+ },
5464
+ {
5465
+ id: EDefaultImagery.StamenToner,
5466
+ name: "Stamen Toner",
5467
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/stamenToner.png"
5468
+ },
5469
+ {
5470
+ id: EDefaultImagery.Grid,
5471
+ name: "Grid",
5472
+ iconUrl: "https://template.api.nextspace-uat.net/file/2885d8df-028b-4f5c-80b3-2634f7e7cf69.png"
5473
+ }
5474
+ ];
5475
+ var EDefaultTerrain;
5476
+ (function (EDefaultTerrain) {
5477
+ EDefaultTerrain["CesiumWorldTerrain"] = "cesiumworldterrain";
5478
+ EDefaultTerrain["FlatTerrain"] = "flatterrain";
5479
+ EDefaultTerrain["LINZ"] = "linz";
5480
+ })(EDefaultTerrain = ProjectViewTile.EDefaultTerrain || (ProjectViewTile.EDefaultTerrain = {}));
5481
+ /**
5482
+ * Prepared array for UI.
5483
+ * TODO: Im not happy with icon urls sitting in the code. I'd prefer we ship these icons in the library as files.
5484
+ */
5485
+ ProjectViewTile.DefaultTerrains = [
5486
+ {
5487
+ id: EDefaultTerrain.CesiumWorldTerrain,
5488
+ name: "Cesium World Terrain",
5489
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/TerrainProviders/CesiumWorldTerrain.png"
5490
+ },
5491
+ {
5492
+ id: EDefaultTerrain.LINZ,
5493
+ name: "LINZ",
5494
+ iconUrl: "https://template.ui.nextspace.host/media/linz.jpg"
5495
+ },
5496
+ {
5497
+ id: EDefaultTerrain.FlatTerrain,
5498
+ name: "Flat Terrain",
5499
+ }
5500
+ ];
5501
+ })(ProjectViewTile || (ProjectViewTile = {}));
5337
5502
 
5338
5503
  /**
5339
5504
  * Describes the "Pending Action" concept within Bruce.
@@ -6532,5 +6697,5 @@ var ImportedFile;
6532
6697
  ImportedFile.Get = Get;
6533
6698
  })(ImportedFile || (ImportedFile = {}));
6534
6699
 
6535
- export { AnnDocument, CustomForm, AbstractApi, Api, BruceApi, CamApi, IdmApi, GlobalApi, Calculator, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, BatchedDataGetter, EntityCoords, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewTileSource, PendingAction, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Permission, Session, UserGroup, User, Account, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile };
6700
+ export { AnnDocument, CustomForm, AbstractApi, Api, BruceApi, CamApi, IdmApi, GlobalApi, Calculator, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityGlobe, EntityFilterGetter, BatchedDataGetter, EntityCoords, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, PendingAction, Style, TilesetEntitiesMapTiles, TilesetExtMapTiles, Tileset, Permission, Session, UserGroup, User, Account, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile };
6536
6701
  //# sourceMappingURL=bruce-models.es5.js.map