bruce-models 0.7.5 → 0.7.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.
Files changed (102) hide show
  1. package/dist/bruce-models.es5.js +183 -16
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +180 -14
  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 -267
  8. package/dist/lib/api/abstract-api.js.map +1 -1
  9. package/dist/lib/api/api.js +85 -85
  10. package/dist/lib/api/bruce-api.js +228 -202
  11. package/dist/lib/api/bruce-api.js.map +1 -1
  12. package/dist/lib/api/cam-api.js +132 -132
  13. package/dist/lib/api/cam-api.js.map +1 -1
  14. package/dist/lib/api/global-api.js +131 -131
  15. package/dist/lib/api/global-api.js.map +1 -1
  16. package/dist/lib/api/idm-api.js +132 -132
  17. package/dist/lib/api/idm-api.js.map +1 -1
  18. package/dist/lib/bruce-models.js +84 -83
  19. package/dist/lib/bruce-models.js.map +1 -1
  20. package/dist/lib/calculator/calculator.js +158 -158
  21. package/dist/lib/client-file/client-file.js +188 -188
  22. package/dist/lib/common/bounds.js +2 -2
  23. package/dist/lib/common/bruce-event.js +48 -48
  24. package/dist/lib/common/bruce-variable.js +54 -54
  25. package/dist/lib/common/cache.js +86 -86
  26. package/dist/lib/common/camera.js +11 -11
  27. package/dist/lib/common/cartes.js +55 -55
  28. package/dist/lib/common/carto.js +60 -60
  29. package/dist/lib/common/color.js +86 -86
  30. package/dist/lib/common/delay-queue.js +60 -60
  31. package/dist/lib/common/dictionary.js +2 -2
  32. package/dist/lib/common/geometry.js +120 -120
  33. package/dist/lib/common/transform.js +2 -2
  34. package/dist/lib/common/utc.js +39 -39
  35. package/dist/lib/custom-form/custom-form.js +136 -136
  36. package/dist/lib/data-lab/data-lab.js +90 -90
  37. package/dist/lib/entity/entity-attachment-type.js +132 -132
  38. package/dist/lib/entity/entity-attachment.js +208 -208
  39. package/dist/lib/entity/entity-comment.js +132 -132
  40. package/dist/lib/entity/entity-coords.js +181 -181
  41. package/dist/lib/entity/entity-link.js +132 -132
  42. package/dist/lib/entity/entity-lod.js +189 -189
  43. package/dist/lib/entity/entity-relation-type.js +150 -150
  44. package/dist/lib/entity/entity-relation.js +189 -189
  45. package/dist/lib/entity/entity-source.js +176 -176
  46. package/dist/lib/entity/entity-tag.js +229 -229
  47. package/dist/lib/entity/entity-type.js +163 -163
  48. package/dist/lib/entity/entity.js +358 -358
  49. package/dist/lib/entity/getters/batched-data-getter.js +91 -91
  50. package/dist/lib/entity/getters/entity-filter-getter.js +344 -344
  51. package/dist/lib/entity/getters/entity-globe.js +135 -135
  52. package/dist/lib/entity/getters/view-monitor.js +2 -2
  53. package/dist/lib/import/import-cad.js +82 -82
  54. package/dist/lib/import/import-csv.js +51 -51
  55. package/dist/lib/import/import-json.js +51 -51
  56. package/dist/lib/import/import-kml.js +51 -51
  57. package/dist/lib/import/imported-file.js +121 -121
  58. package/dist/lib/markup/markup.js +40 -40
  59. package/dist/lib/program-key/program-key.js +152 -152
  60. package/dist/lib/project/menu-item.js +115 -115
  61. package/dist/lib/project/project-view-bookmark.js +183 -172
  62. package/dist/lib/project/project-view-bookmark.js.map +1 -1
  63. package/dist/lib/project/{project-view-tile-source.js → project-view-legacy-tile.js} +116 -116
  64. package/dist/lib/project/project-view-legacy-tile.js.map +1 -0
  65. package/dist/lib/project/project-view-tile.js +120 -0
  66. package/dist/lib/project/project-view-tile.js.map +1 -0
  67. package/dist/lib/project/project-view.js +177 -166
  68. package/dist/lib/project/project-view.js.map +1 -1
  69. package/dist/lib/project/zoom-control.js +17 -17
  70. package/dist/lib/server/pending-action.js +106 -106
  71. package/dist/lib/server/task.js +113 -113
  72. package/dist/lib/style/style.js +152 -152
  73. package/dist/lib/tileset/tileset-cad.js +2 -2
  74. package/dist/lib/tileset/tileset-entities-map-tiles.js +18 -18
  75. package/dist/lib/tileset/tileset-entities.js +2 -2
  76. package/dist/lib/tileset/tileset-ext-map-tiles.js +17 -17
  77. package/dist/lib/tileset/tileset-ext-terrain-tiles.js +2 -2
  78. package/dist/lib/tileset/tileset-map-tiles.js +2 -2
  79. package/dist/lib/tileset/tileset-pointcloud.js +2 -2
  80. package/dist/lib/tileset/tileset-terrain-tiles.js +2 -2
  81. package/dist/lib/tileset/tileset.js +403 -403
  82. package/dist/lib/user/permission.js +20 -20
  83. package/dist/lib/user/session.js +160 -160
  84. package/dist/lib/user/user-group.js +139 -139
  85. package/dist/lib/user/user.js +451 -451
  86. package/dist/lib/util/encrypt-utils.js +20 -20
  87. package/dist/lib/util/math-utils.js +41 -41
  88. package/dist/lib/util/object-utils.js +17 -17
  89. package/dist/lib/util/path-utils.js +61 -61
  90. package/dist/lib/util/url-utils.js +107 -107
  91. package/dist/types/api/abstract-api.d.ts +1 -1
  92. package/dist/types/api/bruce-api.d.ts +22 -2
  93. package/dist/types/api/cam-api.d.ts +1 -1
  94. package/dist/types/api/global-api.d.ts +1 -1
  95. package/dist/types/api/idm-api.d.ts +1 -1
  96. package/dist/types/bruce-models.d.ts +2 -1
  97. package/dist/types/project/project-view-bookmark.d.ts +85 -36
  98. package/dist/types/project/{project-view-tile-source.d.ts → project-view-legacy-tile.d.ts} +1 -1
  99. package/dist/types/project/project-view-tile.d.ts +68 -0
  100. package/dist/types/project/project-view.d.ts +64 -39
  101. package/package.json +1 -1
  102. package/dist/lib/project/project-view-tile-source.js.map +0 -1
@@ -1,136 +1,136 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EntityGlobe = void 0;
4
- var Cell = /** @class */ (function () {
5
- function Cell() {
6
- this.Fetched = false;
7
- this.IsFetched = null;
8
- this.FetchPageIndex = 0;
9
- this.Boundaries = null;
10
- }
11
- Cell.prototype.GetBounds = function () {
12
- // Entity data works in -180 to 180 range.
13
- function prepareRangeForBounds(range) {
14
- if (range > 180) {
15
- return range - 360;
16
- }
17
- return range;
18
- }
19
- // Add minor decimal as API crashes when giving it whole numbers.
20
- var maxLon = prepareRangeForBounds(this.Boundaries.maxLongitude) + 0.00001;
21
- var minLon = prepareRangeForBounds(this.Boundaries.minLongitude) - 0.00001;
22
- var maxLat = prepareRangeForBounds(this.Boundaries.maxLatitude) + 0.00001;
23
- var minLat = prepareRangeForBounds(this.Boundaries.minLatitude) - 0.00001;
24
- return {
25
- east: maxLon,
26
- north: maxLat,
27
- south: minLat,
28
- west: minLon
29
- };
30
- };
31
- return Cell;
32
- }());
33
- function floorValueToCellSize(size, value) {
34
- return Math.floor(value / size) * size;
35
- }
36
- function getCellSizeFromHeight(height) {
37
- if (height < 1000) {
38
- return 0.01;
39
- }
40
- if (height < 5000) {
41
- return 0.025;
42
- }
43
- else if (height < 10000) {
44
- return 0.05;
45
- }
46
- else if (height < 30000) {
47
- return 0.1;
48
- }
49
- else if (height < 70000) {
50
- return 0.2;
51
- }
52
- else if (height < 100000) {
53
- return 0.3;
54
- }
55
- else if (height < 150000) {
56
- return 0.4;
57
- }
58
- else if (height < 200000) {
59
- return 0.5;
60
- }
61
- else if (height < 300000) {
62
- return 0.6;
63
- }
64
- else if (height < 500000) {
65
- return 1;
66
- }
67
- return 1.5;
68
- }
69
- function getCell(cells, cellSize, lon, maxLon, lat, maxLat) {
70
- var id = cellSize + "_" + lon + "_" + maxLon + "_" + lat + "_" + maxLat;
71
- return cells[id];
72
- }
73
- function isCellFetched(cell) {
74
- if (cell.Fetched) {
75
- return true;
76
- }
77
- // TODO: If all cells of the size smaller are fetched then this is fetched.
78
- // TODO: If this is a cell within a larger cell that is fetched then this is fetched.
79
- return false;
80
- }
81
- function getOrCreateCell(cells, cellSize, lon, maxLon, lat, maxLat) {
82
- var id = cellSize + "_" + lon + "_" + maxLon + "_" + lat + "_" + maxLat;
83
- var cell = getCell(cells, cellSize, lon, maxLon, lat, maxLat);
84
- if (!cell) {
85
- cell = cells[id] = new Cell();
86
- cell.Boundaries = {
87
- minLatitude: lat,
88
- maxLatitude: maxLat,
89
- minLongitude: lon,
90
- maxLongitude: maxLon
91
- };
92
- cell.IsFetched = function () { return isCellFetched(cell); };
93
- }
94
- return cell;
95
- }
96
- /**
97
- * This is a helper for making entity requests based on a grid area.
98
- * It will return grid cells based on given view-area then will remember when stuff-
99
- * was fully-fetched for those cells to avoid making duplicate requests.
100
- */
101
- var EntityGlobe;
102
- (function (EntityGlobe) {
103
- var Grid = /** @class */ (function () {
104
- function Grid() {
105
- this.cells = {};
106
- }
107
- Grid.prototype.GetCellsForView = function (viewRect) {
108
- var cells = [];
109
- var minLat = viewRect.south;
110
- var minLon = viewRect.west;
111
- var maxLat = viewRect.north;
112
- var maxLon = viewRect.east;
113
- var MAX_CELLS = 150;
114
- var cellDegreeSize = getCellSizeFromHeight(viewRect.alt);
115
- var curMinLon = floorValueToCellSize(cellDegreeSize, minLon);
116
- var curMinLat = floorValueToCellSize(cellDegreeSize, minLat);
117
- var width = (maxLon - curMinLon) / cellDegreeSize;
118
- var height = (maxLat - curMinLat) / cellDegreeSize;
119
- for (var x = 0; x < width; x++) {
120
- for (var y = 0; y < height; y++) {
121
- var lon = x * cellDegreeSize + curMinLon;
122
- var lat = y * cellDegreeSize + curMinLat;
123
- var cell = getOrCreateCell(this.cells, cellDegreeSize, lon, lon + cellDegreeSize, lat, lat + cellDegreeSize);
124
- cells.push(cell);
125
- if (cells.length > MAX_CELLS) {
126
- break;
127
- }
128
- }
129
- }
130
- return cells;
131
- };
132
- return Grid;
133
- }());
134
- EntityGlobe.Grid = Grid;
135
- })(EntityGlobe = exports.EntityGlobe || (exports.EntityGlobe = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EntityGlobe = void 0;
4
+ var Cell = /** @class */ (function () {
5
+ function Cell() {
6
+ this.Fetched = false;
7
+ this.IsFetched = null;
8
+ this.FetchPageIndex = 0;
9
+ this.Boundaries = null;
10
+ }
11
+ Cell.prototype.GetBounds = function () {
12
+ // Entity data works in -180 to 180 range.
13
+ function prepareRangeForBounds(range) {
14
+ if (range > 180) {
15
+ return range - 360;
16
+ }
17
+ return range;
18
+ }
19
+ // Add minor decimal as API crashes when giving it whole numbers.
20
+ var maxLon = prepareRangeForBounds(this.Boundaries.maxLongitude) + 0.00001;
21
+ var minLon = prepareRangeForBounds(this.Boundaries.minLongitude) - 0.00001;
22
+ var maxLat = prepareRangeForBounds(this.Boundaries.maxLatitude) + 0.00001;
23
+ var minLat = prepareRangeForBounds(this.Boundaries.minLatitude) - 0.00001;
24
+ return {
25
+ east: maxLon,
26
+ north: maxLat,
27
+ south: minLat,
28
+ west: minLon
29
+ };
30
+ };
31
+ return Cell;
32
+ }());
33
+ function floorValueToCellSize(size, value) {
34
+ return Math.floor(value / size) * size;
35
+ }
36
+ function getCellSizeFromHeight(height) {
37
+ if (height < 1000) {
38
+ return 0.01;
39
+ }
40
+ if (height < 5000) {
41
+ return 0.025;
42
+ }
43
+ else if (height < 10000) {
44
+ return 0.05;
45
+ }
46
+ else if (height < 30000) {
47
+ return 0.1;
48
+ }
49
+ else if (height < 70000) {
50
+ return 0.2;
51
+ }
52
+ else if (height < 100000) {
53
+ return 0.3;
54
+ }
55
+ else if (height < 150000) {
56
+ return 0.4;
57
+ }
58
+ else if (height < 200000) {
59
+ return 0.5;
60
+ }
61
+ else if (height < 300000) {
62
+ return 0.6;
63
+ }
64
+ else if (height < 500000) {
65
+ return 1;
66
+ }
67
+ return 1.5;
68
+ }
69
+ function getCell(cells, cellSize, lon, maxLon, lat, maxLat) {
70
+ var id = cellSize + "_" + lon + "_" + maxLon + "_" + lat + "_" + maxLat;
71
+ return cells[id];
72
+ }
73
+ function isCellFetched(cell) {
74
+ if (cell.Fetched) {
75
+ return true;
76
+ }
77
+ // TODO: If all cells of the size smaller are fetched then this is fetched.
78
+ // TODO: If this is a cell within a larger cell that is fetched then this is fetched.
79
+ return false;
80
+ }
81
+ function getOrCreateCell(cells, cellSize, lon, maxLon, lat, maxLat) {
82
+ var id = cellSize + "_" + lon + "_" + maxLon + "_" + lat + "_" + maxLat;
83
+ var cell = getCell(cells, cellSize, lon, maxLon, lat, maxLat);
84
+ if (!cell) {
85
+ cell = cells[id] = new Cell();
86
+ cell.Boundaries = {
87
+ minLatitude: lat,
88
+ maxLatitude: maxLat,
89
+ minLongitude: lon,
90
+ maxLongitude: maxLon
91
+ };
92
+ cell.IsFetched = function () { return isCellFetched(cell); };
93
+ }
94
+ return cell;
95
+ }
96
+ /**
97
+ * This is a helper for making entity requests based on a grid area.
98
+ * It will return grid cells based on given view-area then will remember when stuff-
99
+ * was fully-fetched for those cells to avoid making duplicate requests.
100
+ */
101
+ var EntityGlobe;
102
+ (function (EntityGlobe) {
103
+ var Grid = /** @class */ (function () {
104
+ function Grid() {
105
+ this.cells = {};
106
+ }
107
+ Grid.prototype.GetCellsForView = function (viewRect) {
108
+ var cells = [];
109
+ var minLat = viewRect.south;
110
+ var minLon = viewRect.west;
111
+ var maxLat = viewRect.north;
112
+ var maxLon = viewRect.east;
113
+ var MAX_CELLS = 150;
114
+ var cellDegreeSize = getCellSizeFromHeight(viewRect.alt);
115
+ var curMinLon = floorValueToCellSize(cellDegreeSize, minLon);
116
+ var curMinLat = floorValueToCellSize(cellDegreeSize, minLat);
117
+ var width = (maxLon - curMinLon) / cellDegreeSize;
118
+ var height = (maxLat - curMinLat) / cellDegreeSize;
119
+ for (var x = 0; x < width; x++) {
120
+ for (var y = 0; y < height; y++) {
121
+ var lon = x * cellDegreeSize + curMinLon;
122
+ var lat = y * cellDegreeSize + curMinLat;
123
+ var cell = getOrCreateCell(this.cells, cellDegreeSize, lon, lon + cellDegreeSize, lat, lat + cellDegreeSize);
124
+ cells.push(cell);
125
+ if (cells.length > MAX_CELLS) {
126
+ break;
127
+ }
128
+ }
129
+ }
130
+ return cells;
131
+ };
132
+ return Grid;
133
+ }());
134
+ EntityGlobe.Grid = Grid;
135
+ })(EntityGlobe = exports.EntityGlobe || (exports.EntityGlobe = {}));
136
136
  //# sourceMappingURL=entity-globe.js.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=view-monitor.js.map
@@ -1,83 +1,83 @@
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.ImportCad = void 0;
40
- var api_1 = require("../api/api");
41
- /**
42
- * TODO: The analysis result is currently a mix of multiple layers of legacy.
43
- * We will first decide what we want it to do and then describe just the needed portions of the existing implementation.
44
- */
45
- var ImportCad;
46
- (function (ImportCad) {
47
- function Analyze(api, params) {
48
- return __awaiter(this, void 0, void 0, function () {
49
- return __generator(this, function (_a) {
50
- return [2 /*return*/, api.POST("entities/PrepareIFCForImport", params, api_1.Api.PrepReqParams())];
51
- });
52
- });
53
- }
54
- ImportCad.Analyze = Analyze;
55
- function ImportEntities(api, params) {
56
- return __awaiter(this, void 0, void 0, function () {
57
- return __generator(this, function (_a) {
58
- return [2 /*return*/, api.POST("entities/importIFCWithProgress", params, api_1.Api.PrepReqParams())];
59
- });
60
- });
61
- }
62
- ImportCad.ImportEntities = ImportEntities;
63
- /**
64
- * Parses the completed pending action result from running "ImportEntities".
65
- * This will return the root entity's id if any is present.
66
- * @param paResult
67
- */
68
- function ParseRootId(paResult) {
69
- var _a;
70
- try {
71
- var obj = typeof paResult == "string" ? JSON.parse(paResult) : paResult;
72
- if ((_a = obj === null || obj === void 0 ? void 0 : obj.result) === null || _a === void 0 ? void 0 : _a.length) {
73
- return obj.result[0];
74
- }
75
- }
76
- catch (_b) {
77
- // Failed to parse json.
78
- }
79
- return null;
80
- }
81
- ImportCad.ParseRootId = ParseRootId;
82
- })(ImportCad = exports.ImportCad || (exports.ImportCad = {}));
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.ImportCad = void 0;
40
+ var api_1 = require("../api/api");
41
+ /**
42
+ * TODO: The analysis result is currently a mix of multiple layers of legacy.
43
+ * We will first decide what we want it to do and then describe just the needed portions of the existing implementation.
44
+ */
45
+ var ImportCad;
46
+ (function (ImportCad) {
47
+ function Analyze(api, params) {
48
+ return __awaiter(this, void 0, void 0, function () {
49
+ return __generator(this, function (_a) {
50
+ return [2 /*return*/, api.POST("entities/PrepareIFCForImport", params, api_1.Api.PrepReqParams())];
51
+ });
52
+ });
53
+ }
54
+ ImportCad.Analyze = Analyze;
55
+ function ImportEntities(api, params) {
56
+ return __awaiter(this, void 0, void 0, function () {
57
+ return __generator(this, function (_a) {
58
+ return [2 /*return*/, api.POST("entities/importIFCWithProgress", params, api_1.Api.PrepReqParams())];
59
+ });
60
+ });
61
+ }
62
+ ImportCad.ImportEntities = ImportEntities;
63
+ /**
64
+ * Parses the completed pending action result from running "ImportEntities".
65
+ * This will return the root entity's id if any is present.
66
+ * @param paResult
67
+ */
68
+ function ParseRootId(paResult) {
69
+ var _a;
70
+ try {
71
+ var obj = typeof paResult == "string" ? JSON.parse(paResult) : paResult;
72
+ if ((_a = obj === null || obj === void 0 ? void 0 : obj.result) === null || _a === void 0 ? void 0 : _a.length) {
73
+ return obj.result[0];
74
+ }
75
+ }
76
+ catch (_b) {
77
+ // Failed to parse json.
78
+ }
79
+ return null;
80
+ }
81
+ ImportCad.ParseRootId = ParseRootId;
82
+ })(ImportCad = exports.ImportCad || (exports.ImportCad = {}));
83
83
  //# sourceMappingURL=import-cad.js.map
@@ -1,52 +1,52 @@
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.ImportCsv = void 0;
40
- var api_1 = require("../api/api");
41
- var ImportCsv;
42
- (function (ImportCsv) {
43
- function ImportEntities(api, params) {
44
- return __awaiter(this, void 0, void 0, function () {
45
- return __generator(this, function (_a) {
46
- return [2 /*return*/, api.POST("entities/importCSVWithProgress2", params, api_1.Api.PrepReqParams())];
47
- });
48
- });
49
- }
50
- ImportCsv.ImportEntities = ImportEntities;
51
- })(ImportCsv = exports.ImportCsv || (exports.ImportCsv = {}));
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.ImportCsv = void 0;
40
+ var api_1 = require("../api/api");
41
+ var ImportCsv;
42
+ (function (ImportCsv) {
43
+ function ImportEntities(api, params) {
44
+ return __awaiter(this, void 0, void 0, function () {
45
+ return __generator(this, function (_a) {
46
+ return [2 /*return*/, api.POST("entities/importCSVWithProgress2", params, api_1.Api.PrepReqParams())];
47
+ });
48
+ });
49
+ }
50
+ ImportCsv.ImportEntities = ImportEntities;
51
+ })(ImportCsv = exports.ImportCsv || (exports.ImportCsv = {}));
52
52
  //# sourceMappingURL=import-csv.js.map