bruce-models 0.6.5 → 0.6.8

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 (96) hide show
  1. package/dist/bruce-models.es5.js +292 -57
  2. package/dist/bruce-models.es5.js.map +1 -1
  3. package/dist/bruce-models.umd.js +276 -50
  4. package/dist/bruce-models.umd.js.map +1 -1
  5. package/dist/lib/account/account.js +244 -230
  6. package/dist/lib/account/account.js.map +1 -1
  7. package/dist/lib/ann-document/ann-document.js +116 -116
  8. package/dist/lib/api/abstract-api.js +267 -267
  9. package/dist/lib/api/api.js +85 -85
  10. package/dist/lib/api/bruce-api.js +202 -140
  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/global-api.js +131 -131
  14. package/dist/lib/api/idm-api.js +132 -132
  15. package/dist/lib/bruce-models.js +83 -78
  16. package/dist/lib/bruce-models.js.map +1 -1
  17. package/dist/lib/calculator/calculator.js +158 -158
  18. package/dist/lib/client-file/client-file.js +185 -185
  19. package/dist/lib/common/bounds.js +2 -2
  20. package/dist/lib/common/bruce-event.js +48 -48
  21. package/dist/lib/common/bruce-variable.js +54 -54
  22. package/dist/lib/common/cache.js +86 -86
  23. package/dist/lib/common/camera.js +11 -11
  24. package/dist/lib/common/cartes.js +55 -55
  25. package/dist/lib/common/carto.js +60 -60
  26. package/dist/lib/common/color.js +86 -86
  27. package/dist/lib/common/delay-queue.js +60 -60
  28. package/dist/lib/common/dictionary.js +2 -2
  29. package/dist/lib/common/geometry.js +120 -120
  30. package/dist/lib/common/transform.js +2 -2
  31. package/dist/lib/common/utc.js +39 -39
  32. package/dist/lib/custom-form/custom-form.js +136 -136
  33. package/dist/lib/data-lab/data-lab.js +90 -90
  34. package/dist/lib/entity/entity-attachment-type.js +132 -132
  35. package/dist/lib/entity/entity-attachment.js +208 -208
  36. package/dist/lib/entity/entity-comment.js +132 -132
  37. package/dist/lib/entity/entity-link.js +132 -132
  38. package/dist/lib/entity/entity-lod.js +189 -189
  39. package/dist/lib/entity/entity-relation-type.js +150 -150
  40. package/dist/lib/entity/entity-relation.js +189 -189
  41. package/dist/lib/entity/entity-source.js +176 -176
  42. package/dist/lib/entity/entity-tag.js +229 -229
  43. package/dist/lib/entity/entity-type.js +163 -163
  44. package/dist/lib/entity/entity.js +349 -349
  45. package/dist/lib/entity/getters/batched-data-getter.js +91 -91
  46. package/dist/lib/entity/getters/entity-filter-getter.js +344 -344
  47. package/dist/lib/entity/getters/entity-globe.js +135 -135
  48. package/dist/lib/entity/getters/view-monitor.js +2 -2
  49. package/dist/lib/import/import-cad.js +83 -0
  50. package/dist/lib/import/import-cad.js.map +1 -0
  51. package/dist/lib/import/import-csv.js +52 -0
  52. package/dist/lib/import/import-csv.js.map +1 -0
  53. package/dist/lib/import/import-json.js +52 -0
  54. package/dist/lib/import/import-json.js.map +1 -0
  55. package/dist/lib/import/import-kml.js +52 -0
  56. package/dist/lib/import/import-kml.js.map +1 -0
  57. package/dist/lib/import/imported-file.js +121 -121
  58. package/dist/lib/import/imported-file.js.map +1 -1
  59. package/dist/lib/markup/markup.js +40 -40
  60. package/dist/lib/program-key/program-key.js +152 -152
  61. package/dist/lib/project/menu-item.js +115 -115
  62. package/dist/lib/project/project-view-bookmark.js +172 -172
  63. package/dist/lib/project/project-view-tile-source.js +115 -115
  64. package/dist/lib/project/project-view.js +166 -166
  65. package/dist/lib/project/zoom-control.js +17 -17
  66. package/dist/lib/server/pending-action.js +106 -106
  67. package/dist/lib/server/task.js +113 -113
  68. package/dist/lib/style/style.js +152 -152
  69. package/dist/lib/tileset/tileset-cad.js +2 -2
  70. package/dist/lib/tileset/tileset-entities-map-tiles.js +18 -18
  71. package/dist/lib/tileset/tileset-entities.js +2 -2
  72. package/dist/lib/tileset/tileset-ext-map-tiles.js +17 -17
  73. package/dist/lib/tileset/tileset-ext-terrain-tiles.js +2 -2
  74. package/dist/lib/tileset/tileset-map-tiles.js +2 -2
  75. package/dist/lib/tileset/tileset-pointcloud.js +2 -2
  76. package/dist/lib/tileset/tileset-terrain-tiles.js +2 -2
  77. package/dist/lib/tileset/tileset.js +397 -397
  78. package/dist/lib/ucs/ucs.js +135 -135
  79. package/dist/lib/user/permission.js +20 -20
  80. package/dist/lib/user/session.js +160 -160
  81. package/dist/lib/user/user-group.js +139 -139
  82. package/dist/lib/user/user.js +451 -451
  83. package/dist/lib/util/encrypt-utils.js +20 -20
  84. package/dist/lib/util/math-utils.js +41 -41
  85. package/dist/lib/util/object-utils.js +17 -17
  86. package/dist/lib/util/path-utils.js +61 -61
  87. package/dist/lib/util/url-utils.js +107 -107
  88. package/dist/types/account/account.d.ts +11 -2
  89. package/dist/types/api/bruce-api.d.ts +2 -0
  90. package/dist/types/bruce-models.d.ts +5 -0
  91. package/dist/types/import/import-cad.d.ts +39 -0
  92. package/dist/types/import/import-csv.d.ts +26 -0
  93. package/dist/types/import/import-json.d.ts +21 -0
  94. package/dist/types/import/import-kml.d.ts +14 -0
  95. package/dist/types/import/imported-file.d.ts +2 -1
  96. package/package.json +1 -1
@@ -1,177 +1,177 @@
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.EntitySource = void 0;
40
- var api_1 = require("../api/api");
41
- /**
42
- * Describes the "Entity Source" concept within Bruce.
43
- * An entity source is a record which links an arbitrary source id to a Bruce entity id.
44
- * For example an OSM building id to a Bruce entity id.
45
- */
46
- var EntitySource;
47
- (function (EntitySource) {
48
- function GetCacheKey(sourceId, sourceKey) {
49
- return "" + api_1.Api.ECacheKey.EntitySource + api_1.Api.ECacheKey.Id + sourceId + api_1.Api.ECacheKey.Id + sourceKey;
50
- }
51
- EntitySource.GetCacheKey = GetCacheKey;
52
- function Get(api, sourceId, sourceKey) {
53
- return __awaiter(this, void 0, void 0, function () {
54
- var key, cacheData, req;
55
- return __generator(this, function (_a) {
56
- if (!sourceId || !sourceKey) {
57
- throw ("Source ID and Source Key are required.");
58
- }
59
- key = GetCacheKey(sourceId, sourceKey);
60
- cacheData = api.Cache.Get(key);
61
- if (cacheData) {
62
- return [2 /*return*/, cacheData];
63
- }
64
- req = api.GET("entitysource/" + sourceId + "/" + sourceKey, api_1.Api.PrepReqParams());
65
- api.Cache.Set(key, req, api_1.Api.DEFAULT_CACHE_DURATION);
66
- return [2 /*return*/, req];
67
- });
68
- });
69
- }
70
- EntitySource.Get = Get;
71
- function GetListByKeys(api, sourceId, sourceKeys) {
72
- return __awaiter(this, void 0, void 0, function () {
73
- var reqKeys, reqs, i, sourceKey, cacheData, prom_1, _loop_1, i;
74
- var _this = this;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0:
78
- if (!sourceId || !sourceKeys.length) {
79
- throw ("Source ID and Source Keys are required.");
80
- }
81
- reqKeys = [];
82
- reqs = [];
83
- for (i = 0; i < sourceKeys.length; i++) {
84
- sourceKey = sourceKeys[i];
85
- cacheData = api.Cache.Get(GetCacheKey(sourceId, sourceKey));
86
- if (cacheData) {
87
- reqs.push(cacheData);
88
- }
89
- else {
90
- reqKeys.push(sourceKey);
91
- }
92
- }
93
- if (reqKeys.length) {
94
- prom_1 = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
95
- var data, e_1;
96
- return __generator(this, function (_a) {
97
- switch (_a.label) {
98
- case 0:
99
- _a.trys.push([0, 2, , 3]);
100
- return [4 /*yield*/, api.POST("entitysource/" + sourceId, { SourceRecordKeys: reqKeys }, api_1.Api.PrepReqParams())];
101
- case 1:
102
- data = _a.sent();
103
- res(data.Items);
104
- return [3 /*break*/, 3];
105
- case 2:
106
- e_1 = _a.sent();
107
- rej(e_1);
108
- return [3 /*break*/, 3];
109
- case 3: return [2 /*return*/];
110
- }
111
- });
112
- }); });
113
- _loop_1 = function (i) {
114
- var req = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
115
- var sources, e_2;
116
- return __generator(this, function (_a) {
117
- switch (_a.label) {
118
- case 0:
119
- _a.trys.push([0, 2, , 3]);
120
- return [4 /*yield*/, prom_1];
121
- case 1:
122
- sources = _a.sent();
123
- res(sources.find(function (s) { return s["SourceRecord.Key"] === reqKeys[i]; }));
124
- return [3 /*break*/, 3];
125
- case 2:
126
- e_2 = _a.sent();
127
- rej(e_2);
128
- return [3 /*break*/, 3];
129
- case 3: return [2 /*return*/];
130
- }
131
- });
132
- }); });
133
- reqs.push(req);
134
- };
135
- for (i = 0; i < reqKeys.length; i++) {
136
- _loop_1(i);
137
- }
138
- }
139
- return [4 /*yield*/, Promise.all(reqs)];
140
- case 1: return [2 /*return*/, (_a.sent()).filter(function (x) { return !!x; })];
141
- }
142
- });
143
- });
144
- }
145
- EntitySource.GetListByKeys = GetListByKeys;
146
- function GetEntityIdsBySourceKeys(api, sourceId, sourceKeys) {
147
- return __awaiter(this, void 0, void 0, function () {
148
- var result, sources, i, source, i_1, key;
149
- return __generator(this, function (_a) {
150
- switch (_a.label) {
151
- case 0:
152
- if (!sourceId || !sourceKeys.length) {
153
- throw ("Source ID and Source Keys are required.");
154
- }
155
- result = {};
156
- if (!(sourceKeys.length > 0)) return [3 /*break*/, 2];
157
- return [4 /*yield*/, GetListByKeys(api, sourceId, sourceKeys)];
158
- case 1:
159
- sources = _a.sent();
160
- for (i = 0; i < sources.length; i++) {
161
- source = sources[i];
162
- for (i_1 = 0; i_1 < sourceKeys.length; i_1++) {
163
- key = sourceKeys[i_1];
164
- if (key == source["SourceRecord.Key"]) {
165
- result[key] = source["Entity.ID"];
166
- }
167
- }
168
- }
169
- _a.label = 2;
170
- case 2: return [2 /*return*/, result];
171
- }
172
- });
173
- });
174
- }
175
- EntitySource.GetEntityIdsBySourceKeys = GetEntityIdsBySourceKeys;
176
- })(EntitySource = exports.EntitySource || (exports.EntitySource = {}));
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.EntitySource = void 0;
40
+ var api_1 = require("../api/api");
41
+ /**
42
+ * Describes the "Entity Source" concept within Bruce.
43
+ * An entity source is a record which links an arbitrary source id to a Bruce entity id.
44
+ * For example an OSM building id to a Bruce entity id.
45
+ */
46
+ var EntitySource;
47
+ (function (EntitySource) {
48
+ function GetCacheKey(sourceId, sourceKey) {
49
+ return "" + api_1.Api.ECacheKey.EntitySource + api_1.Api.ECacheKey.Id + sourceId + api_1.Api.ECacheKey.Id + sourceKey;
50
+ }
51
+ EntitySource.GetCacheKey = GetCacheKey;
52
+ function Get(api, sourceId, sourceKey) {
53
+ return __awaiter(this, void 0, void 0, function () {
54
+ var key, cacheData, req;
55
+ return __generator(this, function (_a) {
56
+ if (!sourceId || !sourceKey) {
57
+ throw ("Source ID and Source Key are required.");
58
+ }
59
+ key = GetCacheKey(sourceId, sourceKey);
60
+ cacheData = api.Cache.Get(key);
61
+ if (cacheData) {
62
+ return [2 /*return*/, cacheData];
63
+ }
64
+ req = api.GET("entitysource/" + sourceId + "/" + sourceKey, api_1.Api.PrepReqParams());
65
+ api.Cache.Set(key, req, api_1.Api.DEFAULT_CACHE_DURATION);
66
+ return [2 /*return*/, req];
67
+ });
68
+ });
69
+ }
70
+ EntitySource.Get = Get;
71
+ function GetListByKeys(api, sourceId, sourceKeys) {
72
+ return __awaiter(this, void 0, void 0, function () {
73
+ var reqKeys, reqs, i, sourceKey, cacheData, prom_1, _loop_1, i;
74
+ var _this = this;
75
+ return __generator(this, function (_a) {
76
+ switch (_a.label) {
77
+ case 0:
78
+ if (!sourceId || !sourceKeys.length) {
79
+ throw ("Source ID and Source Keys are required.");
80
+ }
81
+ reqKeys = [];
82
+ reqs = [];
83
+ for (i = 0; i < sourceKeys.length; i++) {
84
+ sourceKey = sourceKeys[i];
85
+ cacheData = api.Cache.Get(GetCacheKey(sourceId, sourceKey));
86
+ if (cacheData) {
87
+ reqs.push(cacheData);
88
+ }
89
+ else {
90
+ reqKeys.push(sourceKey);
91
+ }
92
+ }
93
+ if (reqKeys.length) {
94
+ prom_1 = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
95
+ var data, e_1;
96
+ return __generator(this, function (_a) {
97
+ switch (_a.label) {
98
+ case 0:
99
+ _a.trys.push([0, 2, , 3]);
100
+ return [4 /*yield*/, api.POST("entitysource/" + sourceId, { SourceRecordKeys: reqKeys }, api_1.Api.PrepReqParams())];
101
+ case 1:
102
+ data = _a.sent();
103
+ res(data.Items);
104
+ return [3 /*break*/, 3];
105
+ case 2:
106
+ e_1 = _a.sent();
107
+ rej(e_1);
108
+ return [3 /*break*/, 3];
109
+ case 3: return [2 /*return*/];
110
+ }
111
+ });
112
+ }); });
113
+ _loop_1 = function (i) {
114
+ var req = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
115
+ var sources, e_2;
116
+ return __generator(this, function (_a) {
117
+ switch (_a.label) {
118
+ case 0:
119
+ _a.trys.push([0, 2, , 3]);
120
+ return [4 /*yield*/, prom_1];
121
+ case 1:
122
+ sources = _a.sent();
123
+ res(sources.find(function (s) { return s["SourceRecord.Key"] === reqKeys[i]; }));
124
+ return [3 /*break*/, 3];
125
+ case 2:
126
+ e_2 = _a.sent();
127
+ rej(e_2);
128
+ return [3 /*break*/, 3];
129
+ case 3: return [2 /*return*/];
130
+ }
131
+ });
132
+ }); });
133
+ reqs.push(req);
134
+ };
135
+ for (i = 0; i < reqKeys.length; i++) {
136
+ _loop_1(i);
137
+ }
138
+ }
139
+ return [4 /*yield*/, Promise.all(reqs)];
140
+ case 1: return [2 /*return*/, (_a.sent()).filter(function (x) { return !!x; })];
141
+ }
142
+ });
143
+ });
144
+ }
145
+ EntitySource.GetListByKeys = GetListByKeys;
146
+ function GetEntityIdsBySourceKeys(api, sourceId, sourceKeys) {
147
+ return __awaiter(this, void 0, void 0, function () {
148
+ var result, sources, i, source, i_1, key;
149
+ return __generator(this, function (_a) {
150
+ switch (_a.label) {
151
+ case 0:
152
+ if (!sourceId || !sourceKeys.length) {
153
+ throw ("Source ID and Source Keys are required.");
154
+ }
155
+ result = {};
156
+ if (!(sourceKeys.length > 0)) return [3 /*break*/, 2];
157
+ return [4 /*yield*/, GetListByKeys(api, sourceId, sourceKeys)];
158
+ case 1:
159
+ sources = _a.sent();
160
+ for (i = 0; i < sources.length; i++) {
161
+ source = sources[i];
162
+ for (i_1 = 0; i_1 < sourceKeys.length; i_1++) {
163
+ key = sourceKeys[i_1];
164
+ if (key == source["SourceRecord.Key"]) {
165
+ result[key] = source["Entity.ID"];
166
+ }
167
+ }
168
+ }
169
+ _a.label = 2;
170
+ case 2: return [2 /*return*/, result];
171
+ }
172
+ });
173
+ });
174
+ }
175
+ EntitySource.GetEntityIdsBySourceKeys = GetEntityIdsBySourceKeys;
176
+ })(EntitySource = exports.EntitySource || (exports.EntitySource = {}));
177
177
  //# sourceMappingURL=entity-source.js.map