bruce-models 0.7.9 → 0.8.1

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 (85) hide show
  1. package/dist/bruce-models.es5.js +107 -21
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +107 -21
  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 +269 -269
  8. package/dist/lib/api/api.js +85 -85
  9. package/dist/lib/api/bruce-api.js +243 -243
  10. package/dist/lib/api/cam-api.js +132 -132
  11. package/dist/lib/api/global-api.js +131 -131
  12. package/dist/lib/api/idm-api.js +132 -132
  13. package/dist/lib/bruce-models.js +85 -85
  14. package/dist/lib/calculator/calculator.js +159 -159
  15. package/dist/lib/client-file/client-file.js +188 -188
  16. package/dist/lib/common/bounds.js +2 -2
  17. package/dist/lib/common/bruce-event.js +48 -48
  18. package/dist/lib/common/bruce-variable.js +54 -54
  19. package/dist/lib/common/cache.js +86 -86
  20. package/dist/lib/common/camera.js +11 -11
  21. package/dist/lib/common/cartes.js +55 -55
  22. package/dist/lib/common/carto.js +60 -60
  23. package/dist/lib/common/color.js +86 -86
  24. package/dist/lib/common/delay-queue.js +60 -60
  25. package/dist/lib/common/dictionary.js +2 -2
  26. package/dist/lib/common/geometry.js +120 -120
  27. package/dist/lib/common/transform.js +2 -2
  28. package/dist/lib/common/utc.js +39 -39
  29. package/dist/lib/custom-form/custom-form.js +136 -136
  30. package/dist/lib/data-lab/data-lab.js +90 -90
  31. package/dist/lib/entity/entity-attachment-type.js +132 -132
  32. package/dist/lib/entity/entity-attachment.js +208 -208
  33. package/dist/lib/entity/entity-comment.js +132 -132
  34. package/dist/lib/entity/entity-coords.js +181 -181
  35. package/dist/lib/entity/entity-link.js +132 -132
  36. package/dist/lib/entity/entity-lod.js +189 -189
  37. package/dist/lib/entity/entity-relation-type.js +150 -150
  38. package/dist/lib/entity/entity-relation.js +189 -189
  39. package/dist/lib/entity/entity-source.js +176 -176
  40. package/dist/lib/entity/entity-tag.js +229 -229
  41. package/dist/lib/entity/entity-type.js +163 -163
  42. package/dist/lib/entity/entity.js +358 -358
  43. package/dist/lib/entity/getters/batched-data-getter.js +91 -91
  44. package/dist/lib/entity/getters/entity-filter-getter.js +344 -344
  45. package/dist/lib/entity/getters/entity-globe.js +221 -135
  46. package/dist/lib/entity/getters/entity-globe.js.map +1 -1
  47. package/dist/lib/entity/getters/view-monitor.js +2 -2
  48. package/dist/lib/import/import-cad.js +82 -82
  49. package/dist/lib/import/import-csv.js +51 -51
  50. package/dist/lib/import/import-json.js +51 -51
  51. package/dist/lib/import/import-kml.js +51 -51
  52. package/dist/lib/import/imported-file.js +121 -121
  53. package/dist/lib/import/imported-file.js.map +1 -1
  54. package/dist/lib/markup/markup.js +40 -40
  55. package/dist/lib/program-key/program-key.js +152 -152
  56. package/dist/lib/project/menu-item.js +115 -115
  57. package/dist/lib/project/project-view-bookmark.js +183 -183
  58. package/dist/lib/project/project-view-legacy-tile.js +115 -115
  59. package/dist/lib/project/project-view-tile.js +119 -119
  60. package/dist/lib/project/project-view.js +177 -177
  61. package/dist/lib/project/zoom-control.js +17 -17
  62. package/dist/lib/server/message-broker.js +158 -158
  63. package/dist/lib/server/pending-action.js +106 -106
  64. package/dist/lib/server/task.js +113 -113
  65. package/dist/lib/style/style.js +152 -152
  66. package/dist/lib/tileset/tileset-cad.js +2 -2
  67. package/dist/lib/tileset/tileset-entities-map-tiles.js +18 -18
  68. package/dist/lib/tileset/tileset-entities.js +2 -2
  69. package/dist/lib/tileset/tileset-ext-map-tiles.js +17 -17
  70. package/dist/lib/tileset/tileset-ext-terrain-tiles.js +2 -2
  71. package/dist/lib/tileset/tileset-map-tiles.js +2 -2
  72. package/dist/lib/tileset/tileset-pointcloud.js +2 -2
  73. package/dist/lib/tileset/tileset-terrain-tiles.js +2 -2
  74. package/dist/lib/tileset/tileset.js +403 -403
  75. package/dist/lib/user/permission.js +20 -20
  76. package/dist/lib/user/session.js +160 -160
  77. package/dist/lib/user/user-group.js +139 -139
  78. package/dist/lib/user/user.js +451 -451
  79. package/dist/lib/util/encrypt-utils.js +20 -20
  80. package/dist/lib/util/math-utils.js +41 -41
  81. package/dist/lib/util/object-utils.js +17 -17
  82. package/dist/lib/util/path-utils.js +61 -61
  83. package/dist/lib/util/url-utils.js +107 -107
  84. package/dist/types/entity/getters/entity-globe.d.ts +2 -0
  85. package/package.json +1 -1
@@ -1,120 +1,120 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProjectViewTile = void 0;
4
- var ProjectViewTile;
5
- (function (ProjectViewTile) {
6
- var EDefaultImagery;
7
- (function (EDefaultImagery) {
8
- EDefaultImagery["BingMapsAerial"] = "bingmapsaerial";
9
- EDefaultImagery["BingMapsAerialWithLabels"] = "bingmapsaerialwithlabels";
10
- EDefaultImagery["BingMapsRoads"] = "bingmapsroads";
11
- EDefaultImagery["MapboxSatellite"] = "mapboxsatellite";
12
- EDefaultImagery["MapBoxStreets"] = "mapboxstreets";
13
- EDefaultImagery["MapBoxStreetsClassic"] = "mapboxstreetsclassic";
14
- EDefaultImagery["EsriWorldImagery"] = "esriworldimagery";
15
- EDefaultImagery["EsriWorldStreetMap"] = "esriworldstreetmap";
16
- EDefaultImagery["EsriNationalGeographic"] = "esrinationalgeographic";
17
- EDefaultImagery["OpenStreetMap"] = "openstreetmap";
18
- EDefaultImagery["StamenWaterColor"] = "stamenwatercolor";
19
- EDefaultImagery["StamenToner"] = "stamentoner";
20
- EDefaultImagery["Grid"] = "grid";
21
- })(EDefaultImagery = ProjectViewTile.EDefaultImagery || (ProjectViewTile.EDefaultImagery = {}));
22
- /**
23
- * Prepared array for UI.
24
- * TODO: Im not happy with icon urls sitting in the code. I'd prefer we ship these icons in the library as files.
25
- */
26
- ProjectViewTile.DefaultImagery = [
27
- {
28
- id: EDefaultImagery.BingMapsAerial,
29
- name: "Bing Maps Aerial",
30
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingAerial.png"
31
- },
32
- {
33
- id: EDefaultImagery.BingMapsAerialWithLabels,
34
- name: "Bing Maps Aerial with Labels",
35
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingAerialLabels.png"
36
- },
37
- {
38
- id: EDefaultImagery.BingMapsRoads,
39
- name: "Bing Maps Roads",
40
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingRoads.png"
41
- },
42
- {
43
- id: EDefaultImagery.MapboxSatellite,
44
- name: "Mapbox Satellite",
45
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxSatellite.png"
46
- },
47
- {
48
- id: EDefaultImagery.MapBoxStreets,
49
- name: "Mapbox Streets",
50
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxTerrain.png"
51
- },
52
- {
53
- id: EDefaultImagery.MapBoxStreetsClassic,
54
- name: "Mapbox Streets Classic",
55
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxStreets.png"
56
- },
57
- {
58
- id: EDefaultImagery.EsriWorldImagery,
59
- name: "Esri World Imagery",
60
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriWorldImagery.png"
61
- },
62
- {
63
- id: EDefaultImagery.EsriWorldStreetMap,
64
- name: "Esri World Street Map",
65
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriWorldStreetMap.png"
66
- },
67
- {
68
- id: EDefaultImagery.EsriNationalGeographic,
69
- name: "Esri National Geographic",
70
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriNationalGeographic.png"
71
- },
72
- {
73
- id: EDefaultImagery.OpenStreetMap,
74
- name: "Open Street Map",
75
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/openStreetMap.png"
76
- },
77
- {
78
- id: EDefaultImagery.StamenWaterColor,
79
- name: "Stamen Water Color",
80
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/stamenWatercolor.png"
81
- },
82
- {
83
- id: EDefaultImagery.StamenToner,
84
- name: "Stamen Toner",
85
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/stamenToner.png"
86
- },
87
- {
88
- id: EDefaultImagery.Grid,
89
- name: "Grid",
90
- iconUrl: "https://template.api.nextspace-uat.net/file/2885d8df-028b-4f5c-80b3-2634f7e7cf69.png"
91
- }
92
- ];
93
- var EDefaultTerrain;
94
- (function (EDefaultTerrain) {
95
- EDefaultTerrain["CesiumWorldTerrain"] = "cesiumworldterrain";
96
- EDefaultTerrain["FlatTerrain"] = "flatterrain";
97
- EDefaultTerrain["LINZ"] = "linz";
98
- })(EDefaultTerrain = ProjectViewTile.EDefaultTerrain || (ProjectViewTile.EDefaultTerrain = {}));
99
- /**
100
- * Prepared array for UI.
101
- * TODO: Im not happy with icon urls sitting in the code. I'd prefer we ship these icons in the library as files.
102
- */
103
- ProjectViewTile.DefaultTerrains = [
104
- {
105
- id: EDefaultTerrain.CesiumWorldTerrain,
106
- name: "Cesium World Terrain",
107
- iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/TerrainProviders/CesiumWorldTerrain.png"
108
- },
109
- {
110
- id: EDefaultTerrain.LINZ,
111
- name: "LINZ",
112
- iconUrl: "https://template.ui.nextspace.host/media/linz.jpg"
113
- },
114
- {
115
- id: EDefaultTerrain.FlatTerrain,
116
- name: "Flat Terrain",
117
- }
118
- ];
119
- })(ProjectViewTile = exports.ProjectViewTile || (exports.ProjectViewTile = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectViewTile = void 0;
4
+ var ProjectViewTile;
5
+ (function (ProjectViewTile) {
6
+ var EDefaultImagery;
7
+ (function (EDefaultImagery) {
8
+ EDefaultImagery["BingMapsAerial"] = "bingmapsaerial";
9
+ EDefaultImagery["BingMapsAerialWithLabels"] = "bingmapsaerialwithlabels";
10
+ EDefaultImagery["BingMapsRoads"] = "bingmapsroads";
11
+ EDefaultImagery["MapboxSatellite"] = "mapboxsatellite";
12
+ EDefaultImagery["MapBoxStreets"] = "mapboxstreets";
13
+ EDefaultImagery["MapBoxStreetsClassic"] = "mapboxstreetsclassic";
14
+ EDefaultImagery["EsriWorldImagery"] = "esriworldimagery";
15
+ EDefaultImagery["EsriWorldStreetMap"] = "esriworldstreetmap";
16
+ EDefaultImagery["EsriNationalGeographic"] = "esrinationalgeographic";
17
+ EDefaultImagery["OpenStreetMap"] = "openstreetmap";
18
+ EDefaultImagery["StamenWaterColor"] = "stamenwatercolor";
19
+ EDefaultImagery["StamenToner"] = "stamentoner";
20
+ EDefaultImagery["Grid"] = "grid";
21
+ })(EDefaultImagery = ProjectViewTile.EDefaultImagery || (ProjectViewTile.EDefaultImagery = {}));
22
+ /**
23
+ * Prepared array for UI.
24
+ * TODO: Im not happy with icon urls sitting in the code. I'd prefer we ship these icons in the library as files.
25
+ */
26
+ ProjectViewTile.DefaultImagery = [
27
+ {
28
+ id: EDefaultImagery.BingMapsAerial,
29
+ name: "Bing Maps Aerial",
30
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingAerial.png"
31
+ },
32
+ {
33
+ id: EDefaultImagery.BingMapsAerialWithLabels,
34
+ name: "Bing Maps Aerial with Labels",
35
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingAerialLabels.png"
36
+ },
37
+ {
38
+ id: EDefaultImagery.BingMapsRoads,
39
+ name: "Bing Maps Roads",
40
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/bingRoads.png"
41
+ },
42
+ {
43
+ id: EDefaultImagery.MapboxSatellite,
44
+ name: "Mapbox Satellite",
45
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxSatellite.png"
46
+ },
47
+ {
48
+ id: EDefaultImagery.MapBoxStreets,
49
+ name: "Mapbox Streets",
50
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxTerrain.png"
51
+ },
52
+ {
53
+ id: EDefaultImagery.MapBoxStreetsClassic,
54
+ name: "Mapbox Streets Classic",
55
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/mapboxStreets.png"
56
+ },
57
+ {
58
+ id: EDefaultImagery.EsriWorldImagery,
59
+ name: "Esri World Imagery",
60
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriWorldImagery.png"
61
+ },
62
+ {
63
+ id: EDefaultImagery.EsriWorldStreetMap,
64
+ name: "Esri World Street Map",
65
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriWorldStreetMap.png"
66
+ },
67
+ {
68
+ id: EDefaultImagery.EsriNationalGeographic,
69
+ name: "Esri National Geographic",
70
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/esriNationalGeographic.png"
71
+ },
72
+ {
73
+ id: EDefaultImagery.OpenStreetMap,
74
+ name: "Open Street Map",
75
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/openStreetMap.png"
76
+ },
77
+ {
78
+ id: EDefaultImagery.StamenWaterColor,
79
+ name: "Stamen Water Color",
80
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/stamenWatercolor.png"
81
+ },
82
+ {
83
+ id: EDefaultImagery.StamenToner,
84
+ name: "Stamen Toner",
85
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/ImageryProviders/stamenToner.png"
86
+ },
87
+ {
88
+ id: EDefaultImagery.Grid,
89
+ name: "Grid",
90
+ iconUrl: "https://template.api.nextspace-uat.net/file/2885d8df-028b-4f5c-80b3-2634f7e7cf69.png"
91
+ }
92
+ ];
93
+ var EDefaultTerrain;
94
+ (function (EDefaultTerrain) {
95
+ EDefaultTerrain["CesiumWorldTerrain"] = "cesiumworldterrain";
96
+ EDefaultTerrain["FlatTerrain"] = "flatterrain";
97
+ EDefaultTerrain["LINZ"] = "linz";
98
+ })(EDefaultTerrain = ProjectViewTile.EDefaultTerrain || (ProjectViewTile.EDefaultTerrain = {}));
99
+ /**
100
+ * Prepared array for UI.
101
+ * TODO: Im not happy with icon urls sitting in the code. I'd prefer we ship these icons in the library as files.
102
+ */
103
+ ProjectViewTile.DefaultTerrains = [
104
+ {
105
+ id: EDefaultTerrain.CesiumWorldTerrain,
106
+ name: "Cesium World Terrain",
107
+ iconUrl: "https://template.ui.nextspace.host/Default/media/Cesium/TerrainProviders/CesiumWorldTerrain.png"
108
+ },
109
+ {
110
+ id: EDefaultTerrain.LINZ,
111
+ name: "LINZ",
112
+ iconUrl: "https://template.ui.nextspace.host/media/linz.jpg"
113
+ },
114
+ {
115
+ id: EDefaultTerrain.FlatTerrain,
116
+ name: "Flat Terrain",
117
+ }
118
+ ];
119
+ })(ProjectViewTile = exports.ProjectViewTile || (exports.ProjectViewTile = {}));
120
120
  //# sourceMappingURL=project-view-tile.js.map
@@ -1,178 +1,178 @@
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
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.ProjectView = void 0;
40
- var api_1 = require("../api/api");
41
- var object_utils_1 = require("../util/object-utils");
42
- /**
43
- * Describes the "Project View" concept within Bruce.
44
- * A project view is a collection of settings for a visualization application we support.
45
- * It will describe what panels to show and how, it will also describe all possible ways data can be displayed.
46
- */
47
- var ProjectView;
48
- (function (ProjectView) {
49
- function GetCacheKey(viewId) {
50
- return "" + api_1.Api.ECacheKey.ProjectView + api_1.Api.ECacheKey.Id + viewId;
51
- }
52
- ProjectView.GetCacheKey = GetCacheKey;
53
- function GetListCacheKey() {
54
- return api_1.Api.ECacheKey.ProjectView;
55
- }
56
- ProjectView.GetListCacheKey = GetListCacheKey;
57
- // This is the expected default version for the DataVersion value.
58
- // This value should NOT be changed without looking at our API and seeing what the default value is.
59
- ProjectView.DEFAULT_DATA_VERSION = 1;
60
- var V1;
61
- (function (V1) {
62
- V1.DATA_VERSION = 1;
63
- })(V1 = ProjectView.V1 || (ProjectView.V1 = {}));
64
- var V2;
65
- (function (V2) {
66
- V2.DATA_VERSION = 2;
67
- })(V2 = ProjectView.V2 || (ProjectView.V2 = {}));
68
- function Get(api, viewId) {
69
- return __awaiter(this, void 0, void 0, function () {
70
- var key, cacheData, req;
71
- return __generator(this, function (_a) {
72
- if (!viewId) {
73
- throw ("View ID is required.");
74
- }
75
- key = GetCacheKey(viewId);
76
- cacheData = api.Cache.Get(key);
77
- if (cacheData) {
78
- return [2 /*return*/, cacheData];
79
- }
80
- req = api.GET("ui.view/" + viewId, api_1.Api.PrepReqParams());
81
- api.Cache.Set(key, req, api_1.Api.DEFAULT_CACHE_DURATION);
82
- return [2 /*return*/, req];
83
- });
84
- });
85
- }
86
- ProjectView.Get = Get;
87
- function GetList(api) {
88
- return __awaiter(this, void 0, void 0, function () {
89
- var cacheData, req;
90
- var _this = this;
91
- return __generator(this, function (_a) {
92
- cacheData = api.Cache.Get(GetListCacheKey());
93
- if (cacheData) {
94
- return [2 /*return*/, cacheData];
95
- }
96
- req = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
97
- var data, e_1;
98
- return __generator(this, function (_a) {
99
- switch (_a.label) {
100
- case 0:
101
- _a.trys.push([0, 2, , 3]);
102
- return [4 /*yield*/, api.GET("ui.view/list", api_1.Api.PrepReqParams())];
103
- case 1:
104
- data = _a.sent();
105
- res(data.Items);
106
- return [3 /*break*/, 3];
107
- case 2:
108
- e_1 = _a.sent();
109
- rej(e_1);
110
- return [3 /*break*/, 3];
111
- case 3: return [2 /*return*/];
112
- }
113
- });
114
- }); });
115
- api.Cache.Set(GetListCacheKey(), req, api_1.Api.DEFAULT_CACHE_DURATION);
116
- return [2 /*return*/, req];
117
- });
118
- });
119
- }
120
- ProjectView.GetList = GetList;
121
- function Delete(api, viewId) {
122
- return __awaiter(this, void 0, void 0, function () {
123
- return __generator(this, function (_a) {
124
- switch (_a.label) {
125
- case 0:
126
- if (!viewId) {
127
- throw ("View ID is required.");
128
- }
129
- return [4 /*yield*/, api.DELETE("ui.view/" + viewId, api_1.Api.PrepReqParams())];
130
- case 1:
131
- _a.sent();
132
- api.Cache.Remove(GetCacheKey(viewId));
133
- api.Cache.Remove(GetListCacheKey());
134
- return [2 /*return*/];
135
- }
136
- });
137
- });
138
- }
139
- ProjectView.Delete = Delete;
140
- function Update(api, data) {
141
- return __awaiter(this, void 0, void 0, function () {
142
- var isNew;
143
- return __generator(this, function (_a) {
144
- switch (_a.label) {
145
- case 0:
146
- if (!data) {
147
- data = {};
148
- }
149
- isNew = !data.ID;
150
- if (!data.ID) {
151
- data.ID = object_utils_1.ObjectUtils.UId();
152
- }
153
- if (!data.Name) {
154
- data.Name = data.ID;
155
- }
156
- if (!data.CreatedByUIVersion) {
157
- data.CreatedByUIVersion = "-1";
158
- }
159
- if (!isNew) return [3 /*break*/, 2];
160
- return [4 /*yield*/, api.POST("ui.view/" + data.ID, data, api_1.Api.PrepReqParams())];
161
- case 1:
162
- data = _a.sent();
163
- return [3 /*break*/, 4];
164
- case 2: return [4 /*yield*/, api.PUT("ui.view/" + data.ID, data, api_1.Api.PrepReqParams())];
165
- case 3:
166
- data = _a.sent();
167
- _a.label = 4;
168
- case 4:
169
- api.Cache.Remove(GetCacheKey(data.ID));
170
- api.Cache.Remove(GetListCacheKey());
171
- return [2 /*return*/, data];
172
- }
173
- });
174
- });
175
- }
176
- ProjectView.Update = Update;
177
- })(ProjectView = exports.ProjectView || (exports.ProjectView = {}));
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
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ProjectView = void 0;
40
+ var api_1 = require("../api/api");
41
+ var object_utils_1 = require("../util/object-utils");
42
+ /**
43
+ * Describes the "Project View" concept within Bruce.
44
+ * A project view is a collection of settings for a visualization application we support.
45
+ * It will describe what panels to show and how, it will also describe all possible ways data can be displayed.
46
+ */
47
+ var ProjectView;
48
+ (function (ProjectView) {
49
+ function GetCacheKey(viewId) {
50
+ return "" + api_1.Api.ECacheKey.ProjectView + api_1.Api.ECacheKey.Id + viewId;
51
+ }
52
+ ProjectView.GetCacheKey = GetCacheKey;
53
+ function GetListCacheKey() {
54
+ return api_1.Api.ECacheKey.ProjectView;
55
+ }
56
+ ProjectView.GetListCacheKey = GetListCacheKey;
57
+ // This is the expected default version for the DataVersion value.
58
+ // This value should NOT be changed without looking at our API and seeing what the default value is.
59
+ ProjectView.DEFAULT_DATA_VERSION = 1;
60
+ var V1;
61
+ (function (V1) {
62
+ V1.DATA_VERSION = 1;
63
+ })(V1 = ProjectView.V1 || (ProjectView.V1 = {}));
64
+ var V2;
65
+ (function (V2) {
66
+ V2.DATA_VERSION = 2;
67
+ })(V2 = ProjectView.V2 || (ProjectView.V2 = {}));
68
+ function Get(api, viewId) {
69
+ return __awaiter(this, void 0, void 0, function () {
70
+ var key, cacheData, req;
71
+ return __generator(this, function (_a) {
72
+ if (!viewId) {
73
+ throw ("View ID is required.");
74
+ }
75
+ key = GetCacheKey(viewId);
76
+ cacheData = api.Cache.Get(key);
77
+ if (cacheData) {
78
+ return [2 /*return*/, cacheData];
79
+ }
80
+ req = api.GET("ui.view/" + viewId, api_1.Api.PrepReqParams());
81
+ api.Cache.Set(key, req, api_1.Api.DEFAULT_CACHE_DURATION);
82
+ return [2 /*return*/, req];
83
+ });
84
+ });
85
+ }
86
+ ProjectView.Get = Get;
87
+ function GetList(api) {
88
+ return __awaiter(this, void 0, void 0, function () {
89
+ var cacheData, req;
90
+ var _this = this;
91
+ return __generator(this, function (_a) {
92
+ cacheData = api.Cache.Get(GetListCacheKey());
93
+ if (cacheData) {
94
+ return [2 /*return*/, cacheData];
95
+ }
96
+ req = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
97
+ var data, e_1;
98
+ return __generator(this, function (_a) {
99
+ switch (_a.label) {
100
+ case 0:
101
+ _a.trys.push([0, 2, , 3]);
102
+ return [4 /*yield*/, api.GET("ui.view/list", api_1.Api.PrepReqParams())];
103
+ case 1:
104
+ data = _a.sent();
105
+ res(data.Items);
106
+ return [3 /*break*/, 3];
107
+ case 2:
108
+ e_1 = _a.sent();
109
+ rej(e_1);
110
+ return [3 /*break*/, 3];
111
+ case 3: return [2 /*return*/];
112
+ }
113
+ });
114
+ }); });
115
+ api.Cache.Set(GetListCacheKey(), req, api_1.Api.DEFAULT_CACHE_DURATION);
116
+ return [2 /*return*/, req];
117
+ });
118
+ });
119
+ }
120
+ ProjectView.GetList = GetList;
121
+ function Delete(api, viewId) {
122
+ return __awaiter(this, void 0, void 0, function () {
123
+ return __generator(this, function (_a) {
124
+ switch (_a.label) {
125
+ case 0:
126
+ if (!viewId) {
127
+ throw ("View ID is required.");
128
+ }
129
+ return [4 /*yield*/, api.DELETE("ui.view/" + viewId, api_1.Api.PrepReqParams())];
130
+ case 1:
131
+ _a.sent();
132
+ api.Cache.Remove(GetCacheKey(viewId));
133
+ api.Cache.Remove(GetListCacheKey());
134
+ return [2 /*return*/];
135
+ }
136
+ });
137
+ });
138
+ }
139
+ ProjectView.Delete = Delete;
140
+ function Update(api, data) {
141
+ return __awaiter(this, void 0, void 0, function () {
142
+ var isNew;
143
+ return __generator(this, function (_a) {
144
+ switch (_a.label) {
145
+ case 0:
146
+ if (!data) {
147
+ data = {};
148
+ }
149
+ isNew = !data.ID;
150
+ if (!data.ID) {
151
+ data.ID = object_utils_1.ObjectUtils.UId();
152
+ }
153
+ if (!data.Name) {
154
+ data.Name = data.ID;
155
+ }
156
+ if (!data.CreatedByUIVersion) {
157
+ data.CreatedByUIVersion = "-1";
158
+ }
159
+ if (!isNew) return [3 /*break*/, 2];
160
+ return [4 /*yield*/, api.POST("ui.view/" + data.ID, data, api_1.Api.PrepReqParams())];
161
+ case 1:
162
+ data = _a.sent();
163
+ return [3 /*break*/, 4];
164
+ case 2: return [4 /*yield*/, api.PUT("ui.view/" + data.ID, data, api_1.Api.PrepReqParams())];
165
+ case 3:
166
+ data = _a.sent();
167
+ _a.label = 4;
168
+ case 4:
169
+ api.Cache.Remove(GetCacheKey(data.ID));
170
+ api.Cache.Remove(GetListCacheKey());
171
+ return [2 /*return*/, data];
172
+ }
173
+ });
174
+ });
175
+ }
176
+ ProjectView.Update = Update;
177
+ })(ProjectView = exports.ProjectView || (exports.ProjectView = {}));
178
178
  //# sourceMappingURL=project-view.js.map
@@ -1,18 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZoomControl = void 0;
4
- /**
5
- * Describes an expectation on what should be rendered for a menu item-
6
- * between a min-max distance of an entity to the camera.
7
- */
8
- var ZoomControl;
9
- (function (ZoomControl) {
10
- var EDisplayType;
11
- (function (EDisplayType) {
12
- EDisplayType["Hidden"] = "hidden";
13
- EDisplayType["Point"] = "point";
14
- EDisplayType["Geometry"] = "geometry";
15
- EDisplayType["Model3D"] = "3d";
16
- })(EDisplayType = ZoomControl.EDisplayType || (ZoomControl.EDisplayType = {}));
17
- })(ZoomControl = exports.ZoomControl || (exports.ZoomControl = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZoomControl = void 0;
4
+ /**
5
+ * Describes an expectation on what should be rendered for a menu item-
6
+ * between a min-max distance of an entity to the camera.
7
+ */
8
+ var ZoomControl;
9
+ (function (ZoomControl) {
10
+ var EDisplayType;
11
+ (function (EDisplayType) {
12
+ EDisplayType["Hidden"] = "hidden";
13
+ EDisplayType["Point"] = "point";
14
+ EDisplayType["Geometry"] = "geometry";
15
+ EDisplayType["Model3D"] = "3d";
16
+ })(EDisplayType = ZoomControl.EDisplayType || (ZoomControl.EDisplayType = {}));
17
+ })(ZoomControl = exports.ZoomControl || (exports.ZoomControl = {}));
18
18
  //# sourceMappingURL=zoom-control.js.map