bruce-models 0.8.3 → 0.8.5
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.
- package/dist/bruce-models.es5.js +778 -441
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +770 -438
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account.js +15 -13
- package/dist/lib/account/account.js.map +1 -1
- package/dist/lib/ann-document/ann-document.js +6 -6
- package/dist/lib/ann-document/ann-document.js.map +1 -1
- package/dist/lib/api/api.js +19 -2
- package/dist/lib/api/api.js.map +1 -1
- package/dist/lib/api/bruce-api.js +10 -6
- package/dist/lib/api/bruce-api.js.map +1 -1
- package/dist/lib/bruce-models.js +2 -0
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/calculator/calculator.js +53 -0
- package/dist/lib/calculator/calculator.js.map +1 -1
- package/dist/lib/client-file/client-file.js +11 -12
- package/dist/lib/client-file/client-file.js.map +1 -1
- package/dist/lib/common/cache.js +83 -0
- package/dist/lib/common/cache.js.map +1 -1
- package/dist/lib/custom-form/custom-form-content.js +27 -0
- package/dist/lib/custom-form/custom-form-content.js.map +1 -0
- package/dist/lib/custom-form/custom-form.js +10 -10
- package/dist/lib/custom-form/custom-form.js.map +1 -1
- package/dist/lib/data-lab/data-lab.js +2 -2
- package/dist/lib/data-lab/data-lab.js.map +1 -1
- package/dist/lib/entity/entity-attachment-type.js +7 -7
- package/dist/lib/entity/entity-attachment-type.js.map +1 -1
- package/dist/lib/entity/entity-attachment.js +13 -13
- package/dist/lib/entity/entity-attachment.js.map +1 -1
- package/dist/lib/entity/entity-comment.js +7 -7
- package/dist/lib/entity/entity-comment.js.map +1 -1
- package/dist/lib/entity/entity-coords.js +11 -11
- package/dist/lib/entity/entity-coords.js.map +1 -1
- package/dist/lib/entity/entity-link.js +7 -7
- package/dist/lib/entity/entity-link.js.map +1 -1
- package/dist/lib/entity/entity-lod.js +11 -10
- package/dist/lib/entity/entity-lod.js.map +1 -1
- package/dist/lib/entity/entity-relation-type.js +10 -10
- package/dist/lib/entity/entity-relation-type.js.map +1 -1
- package/dist/lib/entity/entity-relation.js +10 -10
- package/dist/lib/entity/entity-relation.js.map +1 -1
- package/dist/lib/entity/entity-source.js +8 -8
- package/dist/lib/entity/entity-source.js.map +1 -1
- package/dist/lib/entity/entity-tag.js +12 -12
- package/dist/lib/entity/entity-tag.js.map +1 -1
- package/dist/lib/entity/entity-type.js +10 -10
- package/dist/lib/entity/entity-type.js.map +1 -1
- package/dist/lib/entity/entity.js +14 -14
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/lib/entity/getters/entity-globe.js +2 -6
- package/dist/lib/entity/getters/entity-globe.js.map +1 -1
- package/dist/lib/import/import-cad.js +4 -4
- package/dist/lib/import/import-cad.js.map +1 -1
- package/dist/lib/import/import-csv.js +2 -2
- package/dist/lib/import/import-csv.js.map +1 -1
- package/dist/lib/import/import-json.js +2 -2
- package/dist/lib/import/import-json.js.map +1 -1
- package/dist/lib/import/import-kml.js +2 -2
- package/dist/lib/import/import-kml.js.map +1 -1
- package/dist/lib/import/imported-file.js +6 -6
- package/dist/lib/import/imported-file.js.map +1 -1
- package/dist/lib/markup/markup.js +111 -1
- package/dist/lib/markup/markup.js.map +1 -1
- package/dist/lib/program-key/program-key.js +10 -10
- package/dist/lib/program-key/program-key.js.map +1 -1
- package/dist/lib/project/project-view-bookmark.js +12 -12
- package/dist/lib/project/project-view-bookmark.js.map +1 -1
- package/dist/lib/project/project-view-legacy-tile.js +6 -6
- package/dist/lib/project/project-view-legacy-tile.js.map +1 -1
- package/dist/lib/project/project-view.js +11 -11
- package/dist/lib/project/project-view.js.map +1 -1
- package/dist/lib/server/message-broker.js +56 -34
- package/dist/lib/server/message-broker.js.map +1 -1
- package/dist/lib/server/pending-action.js +6 -6
- package/dist/lib/server/pending-action.js.map +1 -1
- package/dist/lib/server/task.js +4 -4
- package/dist/lib/server/task.js.map +1 -1
- package/dist/lib/style/style.js +10 -10
- package/dist/lib/style/style.js.map +1 -1
- package/dist/lib/tileset/tileset.js +30 -32
- package/dist/lib/tileset/tileset.js.map +1 -1
- package/dist/lib/user/session.js +7 -7
- package/dist/lib/user/session.js.map +1 -1
- package/dist/lib/user/user-group.js +12 -12
- package/dist/lib/user/user-group.js.map +1 -1
- package/dist/lib/user/user.js +30 -30
- package/dist/lib/user/user.js.map +1 -1
- package/dist/types/account/account.d.ts +8 -5
- package/dist/types/ann-document/ann-document.d.ts +18 -3
- package/dist/types/api/api.d.ts +3 -1
- package/dist/types/api/bruce-api.d.ts +1 -1
- package/dist/types/bruce-models.d.ts +2 -0
- package/dist/types/calculator/calculator.d.ts +8 -0
- package/dist/types/client-file/client-file.d.ts +6 -5
- package/dist/types/common/cache.d.ts +9 -0
- package/dist/types/custom-form/custom-form-content.d.ts +67 -0
- package/dist/types/custom-form/custom-form.d.ts +7 -5
- package/dist/types/data-lab/data-lab.d.ts +2 -1
- package/dist/types/entity/entity-attachment-type.d.ts +4 -3
- package/dist/types/entity/entity-attachment.d.ts +7 -6
- package/dist/types/entity/entity-comment.d.ts +4 -3
- package/dist/types/entity/entity-coords.d.ts +6 -5
- package/dist/types/entity/entity-link.d.ts +4 -3
- package/dist/types/entity/entity-lod.d.ts +6 -4
- package/dist/types/entity/entity-relation-type.d.ts +5 -4
- package/dist/types/entity/entity-relation.d.ts +5 -4
- package/dist/types/entity/entity-source.d.ts +4 -3
- package/dist/types/entity/entity-tag.d.ts +6 -5
- package/dist/types/entity/entity-type.d.ts +5 -4
- package/dist/types/entity/entity.d.ts +6 -6
- package/dist/types/import/import-cad.d.ts +3 -2
- package/dist/types/import/import-csv.d.ts +2 -1
- package/dist/types/import/import-json.d.ts +2 -1
- package/dist/types/import/import-kml.d.ts +2 -1
- package/dist/types/import/imported-file.d.ts +3 -2
- package/dist/types/markup/markup.d.ts +95 -31
- package/dist/types/program-key/program-key.d.ts +5 -4
- package/dist/types/project/project-view-bookmark.d.ts +6 -5
- package/dist/types/project/project-view-legacy-tile.d.ts +3 -2
- package/dist/types/project/project-view.d.ts +5 -4
- package/dist/types/server/message-broker.d.ts +54 -35
- package/dist/types/server/pending-action.d.ts +3 -3
- package/dist/types/server/task.d.ts +3 -3
- package/dist/types/style/style.d.ts +5 -4
- package/dist/types/tileset/tileset.d.ts +13 -12
- package/dist/types/user/session.d.ts +4 -3
- package/dist/types/user/user-group.d.ts +7 -7
- package/dist/types/user/user.d.ts +14 -13
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -81,9 +81,6 @@
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
/**
|
|
85
|
-
* Contains generic descriptions used for Bruce requests.
|
|
86
|
-
*/
|
|
87
84
|
(function (Api) {
|
|
88
85
|
var ECacheKey;
|
|
89
86
|
(function (ECacheKey) {
|
|
@@ -155,10 +152,16 @@
|
|
|
155
152
|
/**
|
|
156
153
|
* Prepares default settings for a request to Bruce Api.
|
|
157
154
|
* Our requests WRONGLY have utf-16 for 95% of them. Please be wary of that.
|
|
155
|
+
* @param base
|
|
158
156
|
* @returns
|
|
159
157
|
*/
|
|
160
|
-
function PrepReqParams() {
|
|
161
|
-
|
|
158
|
+
function PrepReqParams(base) {
|
|
159
|
+
base = __assign({}, base);
|
|
160
|
+
base.headers = __assign({}, base.headers);
|
|
161
|
+
if (!base.headers.encoding) {
|
|
162
|
+
base.headers.encoding = Api.EEncoding.UTF16;
|
|
163
|
+
}
|
|
164
|
+
return base;
|
|
162
165
|
}
|
|
163
166
|
Api.PrepReqParams = PrepReqParams;
|
|
164
167
|
})(exports.Api || (exports.Api = {}));
|
|
@@ -176,7 +179,7 @@
|
|
|
176
179
|
(function (EType) {
|
|
177
180
|
EType["SVG"] = "SVG";
|
|
178
181
|
})(EType = AnnDocument.EType || (AnnDocument.EType = {}));
|
|
179
|
-
function Get(api, docId) {
|
|
182
|
+
function Get(api, docId, reqParams) {
|
|
180
183
|
return __awaiter(this, void 0, void 0, function () {
|
|
181
184
|
var key, cacheData, req;
|
|
182
185
|
return __generator(this, function (_a) {
|
|
@@ -184,18 +187,18 @@
|
|
|
184
187
|
throw ("Doc ID is required.");
|
|
185
188
|
}
|
|
186
189
|
key = GetCacheKey(docId);
|
|
187
|
-
cacheData = api.Cache.Get(key);
|
|
190
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
188
191
|
if (cacheData) {
|
|
189
192
|
return [2 /*return*/, cacheData];
|
|
190
193
|
}
|
|
191
|
-
req = api.GET("documentView/" + docId, exports.Api.PrepReqParams());
|
|
194
|
+
req = api.GET("documentView/" + docId, exports.Api.PrepReqParams(reqParams));
|
|
192
195
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
193
196
|
return [2 /*return*/, req];
|
|
194
197
|
});
|
|
195
198
|
});
|
|
196
199
|
}
|
|
197
200
|
AnnDocument.Get = Get;
|
|
198
|
-
function GetList(api, type) {
|
|
201
|
+
function GetList(api, type, reqParams) {
|
|
199
202
|
return __awaiter(this, void 0, void 0, function () {
|
|
200
203
|
var cacheData, req;
|
|
201
204
|
var _this = this;
|
|
@@ -203,7 +206,7 @@
|
|
|
203
206
|
if (!type) {
|
|
204
207
|
type = "";
|
|
205
208
|
}
|
|
206
|
-
cacheData = api.Cache.Get(GetListCacheKey(type));
|
|
209
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(type));
|
|
207
210
|
if (cacheData) {
|
|
208
211
|
return [2 /*return*/, cacheData];
|
|
209
212
|
}
|
|
@@ -214,7 +217,7 @@
|
|
|
214
217
|
case 0:
|
|
215
218
|
_a.trys.push([0, 2, , 3]);
|
|
216
219
|
url = "documentViews" + (type ? "?type=" + type : "");
|
|
217
|
-
return [4 /*yield*/, api.GET(url, exports.Api.PrepReqParams())];
|
|
220
|
+
return [4 /*yield*/, api.GET(url, exports.Api.PrepReqParams(reqParams))];
|
|
218
221
|
case 1:
|
|
219
222
|
data = _a.sent();
|
|
220
223
|
res(data.Items);
|
|
@@ -252,25 +255,25 @@
|
|
|
252
255
|
EType["Form"] = "GENERIC";
|
|
253
256
|
EType["Markup"] = "MARKUP";
|
|
254
257
|
})(EType = CustomForm.EType || (CustomForm.EType = {}));
|
|
255
|
-
function Get(api, id) {
|
|
258
|
+
function Get(api, id, reqParams) {
|
|
256
259
|
return __awaiter(this, void 0, void 0, function () {
|
|
257
260
|
var cacheData, req;
|
|
258
261
|
return __generator(this, function (_a) {
|
|
259
262
|
if (!id) {
|
|
260
263
|
throw ("Id is required.");
|
|
261
264
|
}
|
|
262
|
-
cacheData = api.Cache.Get(GetCacheKey(id));
|
|
265
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(id));
|
|
263
266
|
if (cacheData) {
|
|
264
267
|
return [2 /*return*/, cacheData];
|
|
265
268
|
}
|
|
266
|
-
req = api.GET("customForm/" + id, exports.Api.PrepReqParams());
|
|
269
|
+
req = api.GET("customForm/" + id, exports.Api.PrepReqParams(reqParams));
|
|
267
270
|
api.Cache.Set(GetCacheKey(id), req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
268
271
|
return [2 /*return*/, req];
|
|
269
272
|
});
|
|
270
273
|
});
|
|
271
274
|
}
|
|
272
275
|
CustomForm.Get = Get;
|
|
273
|
-
function Delete(api, id) {
|
|
276
|
+
function Delete(api, id, reqParams) {
|
|
274
277
|
return __awaiter(this, void 0, void 0, function () {
|
|
275
278
|
return __generator(this, function (_a) {
|
|
276
279
|
switch (_a.label) {
|
|
@@ -278,7 +281,7 @@
|
|
|
278
281
|
if (!id) {
|
|
279
282
|
throw ("Id is required.");
|
|
280
283
|
}
|
|
281
|
-
return [4 /*yield*/, api.DELETE("customForm/" + id, exports.Api.PrepReqParams())];
|
|
284
|
+
return [4 /*yield*/, api.DELETE("customForm/" + id, exports.Api.PrepReqParams(reqParams))];
|
|
282
285
|
case 1:
|
|
283
286
|
_a.sent();
|
|
284
287
|
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.CustomForm);
|
|
@@ -288,16 +291,16 @@
|
|
|
288
291
|
});
|
|
289
292
|
}
|
|
290
293
|
CustomForm.Delete = Delete;
|
|
291
|
-
function GetList(api, typeId) {
|
|
294
|
+
function GetList(api, typeId, reqParams) {
|
|
292
295
|
return __awaiter(this, void 0, void 0, function () {
|
|
293
296
|
var url, cacheData, req, prom;
|
|
294
297
|
return __generator(this, function (_a) {
|
|
295
298
|
url = typeId ? "entityType/" + typeId + "/customForms" : "customForms";
|
|
296
|
-
cacheData = api.Cache.Get(GetListCacheKey(typeId));
|
|
299
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(typeId));
|
|
297
300
|
if (cacheData) {
|
|
298
301
|
return [2 /*return*/, cacheData];
|
|
299
302
|
}
|
|
300
|
-
req = api.GET(url, exports.Api.PrepReqParams());
|
|
303
|
+
req = api.GET(url, exports.Api.PrepReqParams(reqParams));
|
|
301
304
|
prom = req.then(function (data) {
|
|
302
305
|
return data.Items;
|
|
303
306
|
});
|
|
@@ -307,7 +310,7 @@
|
|
|
307
310
|
});
|
|
308
311
|
}
|
|
309
312
|
CustomForm.GetList = GetList;
|
|
310
|
-
function Update(api, data) {
|
|
313
|
+
function Update(api, data, reqParams) {
|
|
311
314
|
return __awaiter(this, void 0, void 0, function () {
|
|
312
315
|
return __generator(this, function (_a) {
|
|
313
316
|
switch (_a.label) {
|
|
@@ -315,7 +318,7 @@
|
|
|
315
318
|
if (!data.ID) {
|
|
316
319
|
data.ID = 0;
|
|
317
320
|
}
|
|
318
|
-
return [4 /*yield*/, api.POST("customForm/" + data.ID, data, exports.Api.PrepReqParams())];
|
|
321
|
+
return [4 /*yield*/, api.POST("customForm/" + data.ID, data, exports.Api.PrepReqParams(reqParams))];
|
|
319
322
|
case 1:
|
|
320
323
|
data = _a.sent();
|
|
321
324
|
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.CustomForm);
|
|
@@ -327,7 +330,35 @@
|
|
|
327
330
|
CustomForm.Update = Update;
|
|
328
331
|
})(exports.CustomForm || (exports.CustomForm = {}));
|
|
329
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Describes content of a GENERIC type custom form.
|
|
335
|
+
* The alternative type is MARKUP (Markup.IMarkup).
|
|
336
|
+
*/
|
|
337
|
+
(function (CustomFormContent) {
|
|
338
|
+
var ECellType;
|
|
339
|
+
(function (ECellType) {
|
|
340
|
+
ECellType[ECellType["StaticText"] = 0] = "StaticText";
|
|
341
|
+
ECellType[ECellType["DataValue"] = 1] = "DataValue";
|
|
342
|
+
ECellType[ECellType["StaticPicture"] = 2] = "StaticPicture";
|
|
343
|
+
ECellType[ECellType["SubSection"] = 3] = "SubSection";
|
|
344
|
+
ECellType[ECellType["ButtonMore"] = 4] = "ButtonMore";
|
|
345
|
+
ECellType[ECellType["EntityPhoto"] = 5] = "EntityPhoto";
|
|
346
|
+
ECellType[ECellType["EmbeddedMedia"] = 6] = "EmbeddedMedia";
|
|
347
|
+
ECellType[ECellType["Chart"] = 7] = "Chart";
|
|
348
|
+
})(ECellType = CustomFormContent.ECellType || (CustomFormContent.ECellType = {}));
|
|
349
|
+
var EFlowDirection;
|
|
350
|
+
(function (EFlowDirection) {
|
|
351
|
+
EFlowDirection["Vertically"] = "v";
|
|
352
|
+
EFlowDirection["Horizontally"] = "h";
|
|
353
|
+
})(EFlowDirection = CustomFormContent.EFlowDirection || (CustomFormContent.EFlowDirection = {}));
|
|
354
|
+
})(exports.CustomFormContent || (exports.CustomFormContent = {}));
|
|
355
|
+
|
|
330
356
|
var CacheItem = /** @class */ (function () {
|
|
357
|
+
/**
|
|
358
|
+
* @param id
|
|
359
|
+
* @param data
|
|
360
|
+
* @param duration in seconds until considered expired.
|
|
361
|
+
*/
|
|
331
362
|
function CacheItem(id, data, duration) {
|
|
332
363
|
this.Id = id;
|
|
333
364
|
this.Data = data;
|
|
@@ -342,6 +373,13 @@
|
|
|
342
373
|
};
|
|
343
374
|
return CacheItem;
|
|
344
375
|
}());
|
|
376
|
+
// Milliseconds between each data cleaning.
|
|
377
|
+
var CLEANER_INTERVAL = 5000;
|
|
378
|
+
// Max number of items to clean in each cleaning.
|
|
379
|
+
var MAX_CLEAN_BATCH = 100;
|
|
380
|
+
// (Default) Max idle time to keep the cleaner alive.
|
|
381
|
+
// Set to default API cache duration by default.
|
|
382
|
+
var DEFAULT_MAX_CLEAN_IDLE = 60 * 5;
|
|
345
383
|
/**
|
|
346
384
|
* Simple local cache controller.
|
|
347
385
|
*/
|
|
@@ -349,10 +387,26 @@
|
|
|
349
387
|
function CacheControl() {
|
|
350
388
|
this.data = {};
|
|
351
389
|
this.Disabled = false;
|
|
390
|
+
this.cleanerInterval = null;
|
|
391
|
+
// Max idle time to keep the cleaner alive.
|
|
392
|
+
// This value is increased when a new item is added with a larger cache duration.
|
|
393
|
+
this.maxCleanIdle = DEFAULT_MAX_CLEAN_IDLE;
|
|
352
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* @param id
|
|
397
|
+
* @param data
|
|
398
|
+
* @param duration seconds to keep the data in cache. -1 for infinite.
|
|
399
|
+
*/
|
|
353
400
|
CacheControl.prototype.Set = function (id, data, duration) {
|
|
354
401
|
if (duration === void 0) { duration = -1; }
|
|
355
402
|
this.data[id + ""] = new CacheItem(id + "", data, duration);
|
|
403
|
+
if (duration > -1) {
|
|
404
|
+
this.startCleaning();
|
|
405
|
+
if (this.maxCleanIdle < duration) {
|
|
406
|
+
// Add 5 seconds to be sure cleaner stays alive to get it.
|
|
407
|
+
this.maxCleanIdle = duration + 5;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
356
410
|
};
|
|
357
411
|
CacheControl.prototype.Get = function (id) {
|
|
358
412
|
if (this.Disabled) {
|
|
@@ -370,9 +424,13 @@
|
|
|
370
424
|
};
|
|
371
425
|
CacheControl.prototype.Clear = function () {
|
|
372
426
|
this.data = {};
|
|
427
|
+
this.stopCleaning();
|
|
373
428
|
};
|
|
374
429
|
CacheControl.prototype.Remove = function (id) {
|
|
375
430
|
delete this.data[id + ""];
|
|
431
|
+
if (Object.keys(this.data).length <= 0) {
|
|
432
|
+
this.stopCleaning();
|
|
433
|
+
}
|
|
376
434
|
};
|
|
377
435
|
CacheControl.prototype.RemoveByStartsWith = function (text) {
|
|
378
436
|
for (var key in this.data) {
|
|
@@ -380,6 +438,9 @@
|
|
|
380
438
|
delete this.data[key];
|
|
381
439
|
}
|
|
382
440
|
}
|
|
441
|
+
if (Object.keys(this.data).length <= 0) {
|
|
442
|
+
this.stopCleaning();
|
|
443
|
+
}
|
|
383
444
|
};
|
|
384
445
|
CacheControl.prototype.RemoveByContains = function (text) {
|
|
385
446
|
for (var key in this.data) {
|
|
@@ -387,6 +448,9 @@
|
|
|
387
448
|
delete this.data[key];
|
|
388
449
|
}
|
|
389
450
|
}
|
|
451
|
+
if (Object.keys(this.data).length <= 0) {
|
|
452
|
+
this.stopCleaning();
|
|
453
|
+
}
|
|
390
454
|
};
|
|
391
455
|
CacheControl.prototype.GetKeys = function () {
|
|
392
456
|
if (this.Disabled) {
|
|
@@ -407,6 +471,51 @@
|
|
|
407
471
|
}
|
|
408
472
|
return values;
|
|
409
473
|
};
|
|
474
|
+
CacheControl.prototype.startCleaning = function () {
|
|
475
|
+
var _this = this;
|
|
476
|
+
if (this.cleanerInterval == null) {
|
|
477
|
+
var cleanIdleStart_1 = null;
|
|
478
|
+
this.cleanerInterval = setInterval(function () {
|
|
479
|
+
var cleaned = 0;
|
|
480
|
+
for (var key in _this.data) {
|
|
481
|
+
var item = _this.data[key];
|
|
482
|
+
if (item.IsExpired()) {
|
|
483
|
+
delete _this.data[key];
|
|
484
|
+
cleaned += 1;
|
|
485
|
+
}
|
|
486
|
+
if (cleaned >= MAX_CLEAN_BATCH) {
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
if (cleaned <= 0) {
|
|
491
|
+
// Stop cleaner if nothing in cache.
|
|
492
|
+
if (Object.keys(_this.data).length <= 0) {
|
|
493
|
+
_this.stopCleaning();
|
|
494
|
+
}
|
|
495
|
+
// Stop cleaner if idle time is reached.
|
|
496
|
+
else {
|
|
497
|
+
if (cleanIdleStart_1 == null) {
|
|
498
|
+
cleanIdleStart_1 = new Date().getTime();
|
|
499
|
+
}
|
|
500
|
+
var now = new Date().getTime();
|
|
501
|
+
if (now - cleanIdleStart_1 > _this.maxCleanIdle * 1000) {
|
|
502
|
+
_this.stopCleaning();
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
cleanIdleStart_1 = null;
|
|
508
|
+
}
|
|
509
|
+
}, CLEANER_INTERVAL);
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
CacheControl.prototype.stopCleaning = function () {
|
|
513
|
+
if (this.cleanerInterval != null) {
|
|
514
|
+
clearInterval(this.cleanerInterval);
|
|
515
|
+
this.cleanerInterval = null;
|
|
516
|
+
this.maxCleanIdle = DEFAULT_MAX_CLEAN_IDLE;
|
|
517
|
+
}
|
|
518
|
+
};
|
|
410
519
|
return CacheControl;
|
|
411
520
|
}());
|
|
412
521
|
|
|
@@ -675,17 +784,17 @@
|
|
|
675
784
|
value: EDbRegion.Australia
|
|
676
785
|
}
|
|
677
786
|
];
|
|
678
|
-
function Get(api, id) {
|
|
787
|
+
function Get(api, id, reqParams) {
|
|
679
788
|
return __awaiter(this, void 0, void 0, function () {
|
|
680
789
|
var cacheData, req;
|
|
681
790
|
return __generator(this, function (_a) {
|
|
682
791
|
switch (_a.label) {
|
|
683
792
|
case 0:
|
|
684
|
-
cacheData = api.Cache.Get(GetCacheKey(id));
|
|
793
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(id));
|
|
685
794
|
if (cacheData) {
|
|
686
795
|
return [2 /*return*/, cacheData];
|
|
687
796
|
}
|
|
688
|
-
return [4 /*yield*/, api.GET("account/" + id)];
|
|
797
|
+
return [4 /*yield*/, api.GET("account/" + id, reqParams)];
|
|
689
798
|
case 1:
|
|
690
799
|
req = _a.sent();
|
|
691
800
|
api.Cache.Set(GetCacheKey(id), req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
@@ -695,16 +804,16 @@
|
|
|
695
804
|
});
|
|
696
805
|
}
|
|
697
806
|
Account.Get = Get;
|
|
698
|
-
function GetRelatedList(api) {
|
|
807
|
+
function GetRelatedList(api, reqParams) {
|
|
699
808
|
return __awaiter(this, void 0, void 0, function () {
|
|
700
809
|
var cacheData, req, prom;
|
|
701
810
|
var _this = this;
|
|
702
811
|
return __generator(this, function (_a) {
|
|
703
|
-
cacheData = api.Cache.Get(GetListCacheKey(api.GetSessionId()));
|
|
812
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(api.GetSessionId()));
|
|
704
813
|
if (cacheData) {
|
|
705
814
|
return [2 /*return*/, cacheData];
|
|
706
815
|
}
|
|
707
|
-
req = api.GET("user/relatedClientAccounts");
|
|
816
|
+
req = api.GET("user/relatedClientAccounts", reqParams);
|
|
708
817
|
prom = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
709
818
|
var data, items, e_1;
|
|
710
819
|
return __generator(this, function (_a) {
|
|
@@ -731,18 +840,18 @@
|
|
|
731
840
|
});
|
|
732
841
|
}
|
|
733
842
|
Account.GetRelatedList = GetRelatedList;
|
|
734
|
-
function GetAppSettings(api, id, appId) {
|
|
843
|
+
function GetAppSettings(api, id, appId, reqParams) {
|
|
735
844
|
return __awaiter(this, void 0, void 0, function () {
|
|
736
845
|
var cacheData, req, prom;
|
|
737
846
|
var _this = this;
|
|
738
847
|
return __generator(this, function (_a) {
|
|
739
848
|
switch (_a.label) {
|
|
740
849
|
case 0:
|
|
741
|
-
cacheData = api.Cache.Get(GetCacheKey(id, appId));
|
|
850
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(id, appId));
|
|
742
851
|
if (cacheData) {
|
|
743
852
|
return [2 /*return*/, cacheData];
|
|
744
853
|
}
|
|
745
|
-
return [4 /*yield*/, api.GET("account/" + id + "?ApplicationID=" + appId)];
|
|
854
|
+
return [4 /*yield*/, api.GET("account/" + id + "?ApplicationID=" + appId, reqParams)];
|
|
746
855
|
case 1:
|
|
747
856
|
req = _a.sent();
|
|
748
857
|
prom = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -779,13 +888,14 @@
|
|
|
779
888
|
* @param id
|
|
780
889
|
* @param appId
|
|
781
890
|
* @param data
|
|
891
|
+
* @param reqParams
|
|
782
892
|
* @returns
|
|
783
893
|
*/
|
|
784
|
-
function UpdateAppSettings(api, id, appId, data) {
|
|
894
|
+
function UpdateAppSettings(api, id, appId, data, reqParams) {
|
|
785
895
|
return __awaiter(this, void 0, void 0, function () {
|
|
786
896
|
return __generator(this, function (_a) {
|
|
787
897
|
switch (_a.label) {
|
|
788
|
-
case 0: return [4 /*yield*/, api.POST("account/" + id + "/applicationSettings/" + appId, data)];
|
|
898
|
+
case 0: return [4 /*yield*/, api.POST("account/" + id + "/applicationSettings/" + appId, data, reqParams)];
|
|
789
899
|
case 1:
|
|
790
900
|
data = _a.sent();
|
|
791
901
|
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + id);
|
|
@@ -802,9 +912,10 @@
|
|
|
802
912
|
* @param name
|
|
803
913
|
* @param region
|
|
804
914
|
* @param starterContent
|
|
915
|
+
* @param reqParams
|
|
805
916
|
* @returns
|
|
806
917
|
*/
|
|
807
|
-
function Create(api, id, name, region, starterContent) {
|
|
918
|
+
function Create(api, id, name, region, starterContent, reqParams) {
|
|
808
919
|
return __awaiter(this, void 0, void 0, function () {
|
|
809
920
|
var reqData, res;
|
|
810
921
|
return __generator(this, function (_a) {
|
|
@@ -819,7 +930,7 @@
|
|
|
819
930
|
"DBLocation": region,
|
|
820
931
|
"StarterContent": starterContent
|
|
821
932
|
};
|
|
822
|
-
res = api.POST("clientAccount/" + id, reqData, exports.Api.PrepReqParams());
|
|
933
|
+
res = api.POST("clientAccount/" + id, reqData, exports.Api.PrepReqParams(reqParams));
|
|
823
934
|
api.Cache.Remove(GetListCacheKey(api.GetSessionId()));
|
|
824
935
|
return [2 /*return*/, res];
|
|
825
936
|
});
|
|
@@ -828,100 +939,28 @@
|
|
|
828
939
|
Account.Create = Create;
|
|
829
940
|
})(exports.Account || (exports.Account = {}));
|
|
830
941
|
|
|
831
|
-
(function (CamApi) {
|
|
832
|
-
var Api$$1 = /** @class */ (function (_super) {
|
|
833
|
-
__extends(Api$$1, _super);
|
|
834
|
-
function Api$$1(env) {
|
|
835
|
-
var _this = _super.call(this, "SSID") || this;
|
|
836
|
-
_this.baseUrl = "";
|
|
837
|
-
_this.env = env !== null && env !== void 0 ? env : exports.Api.EEnv.PROD;
|
|
838
|
-
_this.setBaseUrl();
|
|
839
|
-
return _this;
|
|
840
|
-
}
|
|
841
|
-
Api$$1.prototype.setBaseUrl = function () {
|
|
842
|
-
var prefix = "https://cam.nextspace";
|
|
843
|
-
var url;
|
|
844
|
-
var env = this.env.toUpperCase();
|
|
845
|
-
switch (env) {
|
|
846
|
-
case exports.Api.EEnv.DEV:
|
|
847
|
-
url = prefix + "-dev.net/";
|
|
848
|
-
break;
|
|
849
|
-
case exports.Api.EEnv.STG:
|
|
850
|
-
url = prefix + "-stg.net/";
|
|
851
|
-
break;
|
|
852
|
-
case exports.Api.EEnv.UAT:
|
|
853
|
-
url = prefix + "-uat.net/";
|
|
854
|
-
break;
|
|
855
|
-
case exports.Api.EEnv.PROD:
|
|
856
|
-
url = prefix + ".host/";
|
|
857
|
-
break;
|
|
858
|
-
default:
|
|
859
|
-
throw ("Specified Environment is not valid. SuppliedEnv=" + env);
|
|
860
|
-
}
|
|
861
|
-
this.baseUrl = url;
|
|
862
|
-
};
|
|
863
|
-
Api$$1.prototype.GetBaseUrl = function () {
|
|
864
|
-
return this.baseUrl;
|
|
865
|
-
};
|
|
866
|
-
Api$$1.prototype.SetBaseUrl = function (url) {
|
|
867
|
-
this.baseUrl = url;
|
|
868
|
-
if (!this.baseUrl.endsWith("/")) {
|
|
869
|
-
this.baseUrl += "/";
|
|
870
|
-
}
|
|
871
|
-
};
|
|
872
|
-
Api$$1.prototype.GET = function (url, params) {
|
|
873
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
874
|
-
return __generator(this, function (_a) {
|
|
875
|
-
return [2 /*return*/, this.get(this.baseUrl + url, params)];
|
|
876
|
-
});
|
|
877
|
-
});
|
|
878
|
-
};
|
|
879
|
-
Api$$1.prototype.DELETE = function (url, params) {
|
|
880
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
881
|
-
return __generator(this, function (_a) {
|
|
882
|
-
return [2 /*return*/, this.delete(this.baseUrl + url, params)];
|
|
883
|
-
});
|
|
884
|
-
});
|
|
885
|
-
};
|
|
886
|
-
Api$$1.prototype.POST = function (url, data, params) {
|
|
887
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
888
|
-
return __generator(this, function (_a) {
|
|
889
|
-
return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
|
|
890
|
-
});
|
|
891
|
-
});
|
|
892
|
-
};
|
|
893
|
-
Api$$1.prototype.UPLOAD = function (url, blob, params) {
|
|
894
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
895
|
-
return __generator(this, function (_a) {
|
|
896
|
-
return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
|
|
897
|
-
});
|
|
898
|
-
});
|
|
899
|
-
};
|
|
900
|
-
return Api$$1;
|
|
901
|
-
}(AbstractApi));
|
|
902
|
-
CamApi.Api = Api$$1;
|
|
903
|
-
})(exports.CamApi || (exports.CamApi = {}));
|
|
904
|
-
|
|
905
942
|
(function (MessageBroker) {
|
|
906
|
-
var
|
|
907
|
-
(function (
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
})(
|
|
943
|
+
var EAction;
|
|
944
|
+
(function (EAction) {
|
|
945
|
+
EAction["SUBSCRIBE"] = "subscribe";
|
|
946
|
+
EAction["SUBSCRIBE_SHADOW"] = "subscribeShadow";
|
|
947
|
+
EAction["UNSUBSCRIBE"] = "unsubscribe";
|
|
948
|
+
EAction["BROADCAST"] = "broadcast";
|
|
949
|
+
EAction["GET_TOPIC_SUBSCRIBERS"] = "getTopicSubscribers"; // requests topic subscribers without subscribing
|
|
950
|
+
})(EAction = MessageBroker.EAction || (MessageBroker.EAction = {}));
|
|
914
951
|
/** Events types any component may get from server */
|
|
915
|
-
var
|
|
916
|
-
(function (
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
})(
|
|
924
|
-
/**
|
|
952
|
+
var EEvent;
|
|
953
|
+
(function (EEvent) {
|
|
954
|
+
EEvent["SAVED"] = "saved";
|
|
955
|
+
EEvent["UPDATED"] = "updated";
|
|
956
|
+
EEvent["DELETED"] = "deleted";
|
|
957
|
+
EEvent["EDIT_STARTED"] = "editStarted";
|
|
958
|
+
EEvent["EDIT_FINISHED"] = "editFinished";
|
|
959
|
+
EEvent["USERS_UPDATE"] = "usersUpdate";
|
|
960
|
+
})(EEvent = MessageBroker.EEvent || (MessageBroker.EEvent = {}));
|
|
961
|
+
/**
|
|
962
|
+
* Communicates with a server message broker.
|
|
963
|
+
*/
|
|
925
964
|
var WebSocketBroker = /** @class */ (function () {
|
|
926
965
|
function WebSocketBroker(uri, env) {
|
|
927
966
|
this.uri = uri;
|
|
@@ -933,6 +972,9 @@
|
|
|
933
972
|
}
|
|
934
973
|
WebSocketBroker.prototype.connect = function () {
|
|
935
974
|
try {
|
|
975
|
+
if (!WebSocket) {
|
|
976
|
+
throw new Error("WebSocket is not supported by this browser");
|
|
977
|
+
}
|
|
936
978
|
this.ws = new WebSocket(this.formatApiUri(this.uri));
|
|
937
979
|
this.ws.onopen = this.onOpen.bind(this);
|
|
938
980
|
this.ws.onmessage = this.onMessage.bind(this);
|
|
@@ -947,7 +989,7 @@
|
|
|
947
989
|
var ws = document.location.protocol === "https:" ? "wss" : "ws";
|
|
948
990
|
return uri.replace(/^(https|http)/, ws) + "websocket";
|
|
949
991
|
};
|
|
950
|
-
WebSocketBroker.prototype.
|
|
992
|
+
WebSocketBroker.prototype.SetUser = function (user) {
|
|
951
993
|
this.user = this.user ? this.user : user;
|
|
952
994
|
};
|
|
953
995
|
WebSocketBroker.prototype.onOpen = function (ev) {
|
|
@@ -986,7 +1028,11 @@
|
|
|
986
1028
|
console.groupEnd();
|
|
987
1029
|
}
|
|
988
1030
|
};
|
|
989
|
-
/**
|
|
1031
|
+
/**
|
|
1032
|
+
* Send message to server.
|
|
1033
|
+
* @param msg
|
|
1034
|
+
* @returns
|
|
1035
|
+
*/
|
|
990
1036
|
WebSocketBroker.prototype.sendMessage = function (msg) {
|
|
991
1037
|
if (this.ws.readyState !== WebSocket.OPEN) {
|
|
992
1038
|
return;
|
|
@@ -1002,43 +1048,56 @@
|
|
|
1002
1048
|
console.warn(e);
|
|
1003
1049
|
}
|
|
1004
1050
|
};
|
|
1005
|
-
Object.defineProperty(WebSocketBroker.prototype, "
|
|
1051
|
+
Object.defineProperty(WebSocketBroker.prototype, "IsConnected", {
|
|
1006
1052
|
get: function () {
|
|
1007
1053
|
return this.ws.readyState === WebSocket.OPEN;
|
|
1008
1054
|
},
|
|
1009
1055
|
enumerable: false,
|
|
1010
1056
|
configurable: true
|
|
1011
1057
|
});
|
|
1012
|
-
/**
|
|
1013
|
-
|
|
1014
|
-
|
|
1058
|
+
/**
|
|
1059
|
+
* Add a subscriber to a topic.
|
|
1060
|
+
* @param topic
|
|
1061
|
+
* @param callback
|
|
1062
|
+
* @param action
|
|
1063
|
+
*/
|
|
1064
|
+
WebSocketBroker.prototype.Subscribe = function (topic, callback, action) {
|
|
1065
|
+
if (action === void 0) { action = EAction.SUBSCRIBE; }
|
|
1015
1066
|
this.addSubscriber(topic, callback);
|
|
1016
1067
|
this.sendMessage({ topic: topic, action: action });
|
|
1017
1068
|
if (this.env === exports.Api.EEnv.DEV) {
|
|
1018
1069
|
console.log("Subscribe [" + action + "] called for topic", topic);
|
|
1019
1070
|
}
|
|
1020
1071
|
};
|
|
1021
|
-
/**
|
|
1022
|
-
|
|
1023
|
-
|
|
1072
|
+
/**
|
|
1073
|
+
* Add a shadow subscriber to a topic.
|
|
1074
|
+
* @param topic
|
|
1075
|
+
* @param callback
|
|
1076
|
+
*/
|
|
1077
|
+
WebSocketBroker.prototype.SubscribeShadow = function (topic, callback) {
|
|
1078
|
+
this.Subscribe(topic, callback, EAction.SUBSCRIBE_SHADOW);
|
|
1024
1079
|
};
|
|
1025
|
-
/**
|
|
1026
|
-
|
|
1080
|
+
/**
|
|
1081
|
+
* Remove a subscriber from a topic.
|
|
1082
|
+
* @param topic
|
|
1083
|
+
* @param callback
|
|
1084
|
+
*/
|
|
1085
|
+
WebSocketBroker.prototype.Unsubscribe = function (topic, callback) {
|
|
1027
1086
|
var subscribers = this.subscriptions.get(topic) || [];
|
|
1028
1087
|
this.subscriptions.set(topic, subscribers.filter(function (fn) { return fn != callback; }));
|
|
1029
|
-
this.sendMessage({ topic: topic, action:
|
|
1088
|
+
this.sendMessage({ topic: topic, action: EAction.UNSUBSCRIBE });
|
|
1030
1089
|
if (this.env === exports.Api.EEnv.DEV) {
|
|
1031
1090
|
console.groupCollapsed("MessageBroker subscription removed: ", topic);
|
|
1032
1091
|
console.table(Array.from(this.subscriptions.entries()));
|
|
1033
1092
|
console.groupEnd();
|
|
1034
1093
|
}
|
|
1035
1094
|
};
|
|
1036
|
-
WebSocketBroker.prototype.
|
|
1037
|
-
this.sendMessage(__assign(__assign({}, msg), { action:
|
|
1095
|
+
WebSocketBroker.prototype.SendBroadcastMessage = function (msg) {
|
|
1096
|
+
this.sendMessage(__assign(__assign({}, msg), { action: EAction.BROADCAST }));
|
|
1038
1097
|
};
|
|
1039
|
-
WebSocketBroker.prototype.
|
|
1098
|
+
WebSocketBroker.prototype.RequestTopicUsers = function (topic, callback) {
|
|
1040
1099
|
this.addSubscriber(topic, callback);
|
|
1041
|
-
this.sendMessage({ topic: topic, action:
|
|
1100
|
+
this.sendMessage({ topic: topic, action: EAction.GET_TOPIC_SUBSCRIBERS });
|
|
1042
1101
|
};
|
|
1043
1102
|
return WebSocketBroker;
|
|
1044
1103
|
}());
|
|
@@ -1084,13 +1143,13 @@
|
|
|
1084
1143
|
});
|
|
1085
1144
|
/**
|
|
1086
1145
|
* Loads regional base url and sets up message broker.
|
|
1087
|
-
* @param cam
|
|
1146
|
+
* @param cam Required for loading regional base url.
|
|
1088
1147
|
* @returns
|
|
1089
1148
|
*/
|
|
1090
1149
|
Api$$1.prototype.init = function (cam) {
|
|
1091
1150
|
var _a;
|
|
1092
1151
|
return __awaiter(this, void 0, void 0, function () {
|
|
1093
|
-
var prefix, url, env,
|
|
1152
|
+
var prefix, url, env, settings, endpoint, e_1;
|
|
1094
1153
|
return __generator(this, function (_b) {
|
|
1095
1154
|
switch (_b.label) {
|
|
1096
1155
|
case 0:
|
|
@@ -1113,11 +1172,11 @@
|
|
|
1113
1172
|
throw ("Specified Environment is not valid. SuppliedEnv=" + env);
|
|
1114
1173
|
}
|
|
1115
1174
|
this.baseUrl = url;
|
|
1175
|
+
if (!cam) return [3 /*break*/, 4];
|
|
1116
1176
|
_b.label = 1;
|
|
1117
1177
|
case 1:
|
|
1118
1178
|
_b.trys.push([1, 3, , 4]);
|
|
1119
|
-
|
|
1120
|
-
return [4 /*yield*/, exports.Account.GetAppSettings(camApi, this.accountId, exports.Account.EAppId.BruceApi)];
|
|
1179
|
+
return [4 /*yield*/, exports.Account.GetAppSettings(cam, this.accountId, exports.Account.EAppId.BruceApi)];
|
|
1121
1180
|
case 2:
|
|
1122
1181
|
settings = _b.sent();
|
|
1123
1182
|
if (this.loadCancelled) {
|
|
@@ -1137,7 +1196,12 @@
|
|
|
1137
1196
|
console.error(e_1);
|
|
1138
1197
|
return [3 /*break*/, 4];
|
|
1139
1198
|
case 4:
|
|
1140
|
-
|
|
1199
|
+
try {
|
|
1200
|
+
this.messageBroker = new exports.MessageBroker.WebSocketBroker(this.baseUrl, this.env);
|
|
1201
|
+
}
|
|
1202
|
+
catch (e) {
|
|
1203
|
+
console.warn("BruceApi: Failed to create message broker.", e);
|
|
1204
|
+
}
|
|
1141
1205
|
return [2 /*return*/];
|
|
1142
1206
|
}
|
|
1143
1207
|
});
|
|
@@ -1231,6 +1295,80 @@
|
|
|
1231
1295
|
BruceApi.Api = Api$$1;
|
|
1232
1296
|
})(exports.BruceApi || (exports.BruceApi = {}));
|
|
1233
1297
|
|
|
1298
|
+
(function (CamApi) {
|
|
1299
|
+
var Api$$1 = /** @class */ (function (_super) {
|
|
1300
|
+
__extends(Api$$1, _super);
|
|
1301
|
+
function Api$$1(env) {
|
|
1302
|
+
var _this = _super.call(this, "SSID") || this;
|
|
1303
|
+
_this.baseUrl = "";
|
|
1304
|
+
_this.env = env !== null && env !== void 0 ? env : exports.Api.EEnv.PROD;
|
|
1305
|
+
_this.setBaseUrl();
|
|
1306
|
+
return _this;
|
|
1307
|
+
}
|
|
1308
|
+
Api$$1.prototype.setBaseUrl = function () {
|
|
1309
|
+
var prefix = "https://cam.nextspace";
|
|
1310
|
+
var url;
|
|
1311
|
+
var env = this.env.toUpperCase();
|
|
1312
|
+
switch (env) {
|
|
1313
|
+
case exports.Api.EEnv.DEV:
|
|
1314
|
+
url = prefix + "-dev.net/";
|
|
1315
|
+
break;
|
|
1316
|
+
case exports.Api.EEnv.STG:
|
|
1317
|
+
url = prefix + "-stg.net/";
|
|
1318
|
+
break;
|
|
1319
|
+
case exports.Api.EEnv.UAT:
|
|
1320
|
+
url = prefix + "-uat.net/";
|
|
1321
|
+
break;
|
|
1322
|
+
case exports.Api.EEnv.PROD:
|
|
1323
|
+
url = prefix + ".host/";
|
|
1324
|
+
break;
|
|
1325
|
+
default:
|
|
1326
|
+
throw ("Specified Environment is not valid. SuppliedEnv=" + env);
|
|
1327
|
+
}
|
|
1328
|
+
this.baseUrl = url;
|
|
1329
|
+
};
|
|
1330
|
+
Api$$1.prototype.GetBaseUrl = function () {
|
|
1331
|
+
return this.baseUrl;
|
|
1332
|
+
};
|
|
1333
|
+
Api$$1.prototype.SetBaseUrl = function (url) {
|
|
1334
|
+
this.baseUrl = url;
|
|
1335
|
+
if (!this.baseUrl.endsWith("/")) {
|
|
1336
|
+
this.baseUrl += "/";
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
Api$$1.prototype.GET = function (url, params) {
|
|
1340
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1341
|
+
return __generator(this, function (_a) {
|
|
1342
|
+
return [2 /*return*/, this.get(this.baseUrl + url, params)];
|
|
1343
|
+
});
|
|
1344
|
+
});
|
|
1345
|
+
};
|
|
1346
|
+
Api$$1.prototype.DELETE = function (url, params) {
|
|
1347
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1348
|
+
return __generator(this, function (_a) {
|
|
1349
|
+
return [2 /*return*/, this.delete(this.baseUrl + url, params)];
|
|
1350
|
+
});
|
|
1351
|
+
});
|
|
1352
|
+
};
|
|
1353
|
+
Api$$1.prototype.POST = function (url, data, params) {
|
|
1354
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1355
|
+
return __generator(this, function (_a) {
|
|
1356
|
+
return [2 /*return*/, this.post(this.baseUrl + url, data, params)];
|
|
1357
|
+
});
|
|
1358
|
+
});
|
|
1359
|
+
};
|
|
1360
|
+
Api$$1.prototype.UPLOAD = function (url, blob, params) {
|
|
1361
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1362
|
+
return __generator(this, function (_a) {
|
|
1363
|
+
return [2 /*return*/, this.upload(this.baseUrl + url, blob, params)];
|
|
1364
|
+
});
|
|
1365
|
+
});
|
|
1366
|
+
};
|
|
1367
|
+
return Api$$1;
|
|
1368
|
+
}(AbstractApi));
|
|
1369
|
+
CamApi.Api = Api$$1;
|
|
1370
|
+
})(exports.CamApi || (exports.CamApi = {}));
|
|
1371
|
+
|
|
1234
1372
|
(function (IdmApi) {
|
|
1235
1373
|
/**
|
|
1236
1374
|
* This is the request handler for Idm Api,
|
|
@@ -1546,7 +1684,7 @@
|
|
|
1546
1684
|
return "" + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
|
|
1547
1685
|
}
|
|
1548
1686
|
Entity.GetCacheKey = GetCacheKey;
|
|
1549
|
-
function Get(api, entityId) {
|
|
1687
|
+
function Get(api, entityId, reqParams) {
|
|
1550
1688
|
return __awaiter(this, void 0, void 0, function () {
|
|
1551
1689
|
var key, cacheData, req;
|
|
1552
1690
|
return __generator(this, function (_a) {
|
|
@@ -1554,18 +1692,18 @@
|
|
|
1554
1692
|
throw ("Entity ID is required.");
|
|
1555
1693
|
}
|
|
1556
1694
|
key = GetCacheKey(entityId);
|
|
1557
|
-
cacheData = api.Cache.Get(key);
|
|
1695
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
1558
1696
|
if (cacheData) {
|
|
1559
1697
|
return [2 /*return*/, cacheData];
|
|
1560
1698
|
}
|
|
1561
|
-
req = api.GET("entity/" + entityId, exports.Api.PrepReqParams());
|
|
1699
|
+
req = api.GET("entity/" + entityId, exports.Api.PrepReqParams(reqParams));
|
|
1562
1700
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
1563
1701
|
return [2 /*return*/, req];
|
|
1564
1702
|
});
|
|
1565
1703
|
});
|
|
1566
1704
|
}
|
|
1567
1705
|
Entity.Get = Get;
|
|
1568
|
-
function GetListByIds(api, entityIds) {
|
|
1706
|
+
function GetListByIds(api, entityIds, reqParams) {
|
|
1569
1707
|
return __awaiter(this, void 0, void 0, function () {
|
|
1570
1708
|
var reqs, reqIds, i, entityId, key, cacheData, reqData, req_1, _loop_1, i;
|
|
1571
1709
|
var _this = this;
|
|
@@ -1580,7 +1718,7 @@
|
|
|
1580
1718
|
for (i = 0; i < entityIds.length; i++) {
|
|
1581
1719
|
entityId = entityIds[i];
|
|
1582
1720
|
key = GetCacheKey(entityId);
|
|
1583
|
-
cacheData = api.Cache.Get(key);
|
|
1721
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
1584
1722
|
if (cacheData) {
|
|
1585
1723
|
reqs.push(cacheData);
|
|
1586
1724
|
}
|
|
@@ -1597,7 +1735,7 @@
|
|
|
1597
1735
|
PageSize: reqIds.length
|
|
1598
1736
|
};
|
|
1599
1737
|
if (reqIds.length > 0) {
|
|
1600
|
-
req_1 = api.POST("entities", reqData, exports.Api.PrepReqParams());
|
|
1738
|
+
req_1 = api.POST("entities", reqData, exports.Api.PrepReqParams(reqParams));
|
|
1601
1739
|
_loop_1 = function (i) {
|
|
1602
1740
|
var entityId = reqIds[i];
|
|
1603
1741
|
var key = GetCacheKey(entityId);
|
|
@@ -1636,7 +1774,7 @@
|
|
|
1636
1774
|
});
|
|
1637
1775
|
}
|
|
1638
1776
|
Entity.GetListByIds = GetListByIds;
|
|
1639
|
-
function Delete(api, entityId) {
|
|
1777
|
+
function Delete(api, entityId, reqParams) {
|
|
1640
1778
|
return __awaiter(this, void 0, void 0, function () {
|
|
1641
1779
|
return __generator(this, function (_a) {
|
|
1642
1780
|
switch (_a.label) {
|
|
@@ -1644,7 +1782,7 @@
|
|
|
1644
1782
|
if (!entityId) {
|
|
1645
1783
|
throw ("Entity ID is required.");
|
|
1646
1784
|
}
|
|
1647
|
-
return [4 /*yield*/, api.DELETE("entity/" + entityId, exports.Api.PrepReqParams())];
|
|
1785
|
+
return [4 /*yield*/, api.DELETE("entity/" + entityId, exports.Api.PrepReqParams(reqParams))];
|
|
1648
1786
|
case 1:
|
|
1649
1787
|
_a.sent();
|
|
1650
1788
|
api.Cache.Remove(GetCacheKey(entityId));
|
|
@@ -1654,7 +1792,7 @@
|
|
|
1654
1792
|
});
|
|
1655
1793
|
}
|
|
1656
1794
|
Entity.Delete = Delete;
|
|
1657
|
-
function DeleteList(api, entityIds) {
|
|
1795
|
+
function DeleteList(api, entityIds, reqParams) {
|
|
1658
1796
|
return __awaiter(this, void 0, void 0, function () {
|
|
1659
1797
|
var i, entityId;
|
|
1660
1798
|
return __generator(this, function (_a) {
|
|
@@ -1665,7 +1803,7 @@
|
|
|
1665
1803
|
}
|
|
1666
1804
|
return [4 /*yield*/, api.POST("deleteEntities", {
|
|
1667
1805
|
Items: entityIds
|
|
1668
|
-
}, exports.Api.PrepReqParams())];
|
|
1806
|
+
}, exports.Api.PrepReqParams(reqParams))];
|
|
1669
1807
|
case 1:
|
|
1670
1808
|
_a.sent();
|
|
1671
1809
|
for (i = 0; i < entityIds.length; i++) {
|
|
@@ -1678,7 +1816,7 @@
|
|
|
1678
1816
|
});
|
|
1679
1817
|
}
|
|
1680
1818
|
Entity.DeleteList = DeleteList;
|
|
1681
|
-
function Update(api, data, override) {
|
|
1819
|
+
function Update(api, data, override, reqParams) {
|
|
1682
1820
|
var _a, _b;
|
|
1683
1821
|
return __awaiter(this, void 0, void 0, function () {
|
|
1684
1822
|
var reqUrl;
|
|
@@ -1692,7 +1830,7 @@
|
|
|
1692
1830
|
data.Bruce = __assign(__assign({}, data.Bruce), { ID: exports.ObjectUtils.UId() });
|
|
1693
1831
|
}
|
|
1694
1832
|
reqUrl = "entity/" + data.Bruce.ID + "/?dataoverride=" + override + "&BruceEntityType=" + data.Bruce["EntityType.ID"];
|
|
1695
|
-
return [4 /*yield*/, api.POST(reqUrl, data, exports.Api.PrepReqParams())];
|
|
1833
|
+
return [4 /*yield*/, api.POST(reqUrl, data, exports.Api.PrepReqParams(reqParams))];
|
|
1696
1834
|
case 1:
|
|
1697
1835
|
data = _c.sent();
|
|
1698
1836
|
api.Cache.Remove(GetCacheKey(data.Bruce.ID));
|
|
@@ -1780,7 +1918,7 @@
|
|
|
1780
1918
|
(function (Filter) {
|
|
1781
1919
|
var V1;
|
|
1782
1920
|
(function (V1) {
|
|
1783
|
-
function GetList(api, filter) {
|
|
1921
|
+
function GetList(api, filter, reqParams) {
|
|
1784
1922
|
return __awaiter(this, void 0, void 0, function () {
|
|
1785
1923
|
var requestFilter, url, data, entities, i, entity, id;
|
|
1786
1924
|
return __generator(this, function (_a) {
|
|
@@ -1821,7 +1959,7 @@
|
|
|
1821
1959
|
// Order by attribute + sort order.
|
|
1822
1960
|
(!filter.orderBy ? "" : "&OrderBy=" + filter.orderBy) +
|
|
1823
1961
|
(filter.sortOrder ? "&SortOrder=" + (filter.sortOrder == exports.Api.ESortOrder.Asc ? "ASC" : "DESC") : "");
|
|
1824
|
-
return [4 /*yield*/, api.GET(url, exports.Api.PrepReqParams())];
|
|
1962
|
+
return [4 /*yield*/, api.GET(url, exports.Api.PrepReqParams(reqParams))];
|
|
1825
1963
|
case 1:
|
|
1826
1964
|
data = _a.sent();
|
|
1827
1965
|
entities = data.Items;
|
|
@@ -1955,6 +2093,59 @@
|
|
|
1955
2093
|
return null;
|
|
1956
2094
|
}
|
|
1957
2095
|
Calculator.GetValue = GetValue;
|
|
2096
|
+
/**
|
|
2097
|
+
* Calculates the value of arbitrary field options with assumption that desired result is a color.
|
|
2098
|
+
* Will return null if a color is not found.
|
|
2099
|
+
* @param fields
|
|
2100
|
+
* @param entity
|
|
2101
|
+
* @param tags
|
|
2102
|
+
*/
|
|
2103
|
+
function GetColor(fields, entity, tags) {
|
|
2104
|
+
if (!tags) {
|
|
2105
|
+
tags = [];
|
|
2106
|
+
}
|
|
2107
|
+
if (!entity) {
|
|
2108
|
+
entity = {};
|
|
2109
|
+
}
|
|
2110
|
+
for (var i = 0; i < fields.length; i++) {
|
|
2111
|
+
var field = fields[i];
|
|
2112
|
+
var value = void 0;
|
|
2113
|
+
switch (field.type) {
|
|
2114
|
+
case EValueType.Color:
|
|
2115
|
+
value = field.value;
|
|
2116
|
+
break;
|
|
2117
|
+
case EValueType.Gradient:
|
|
2118
|
+
value = GetGradientValue(field.value, entity);
|
|
2119
|
+
break;
|
|
2120
|
+
case EValueType.Input:
|
|
2121
|
+
value = GetInputValue(field.value, entity);
|
|
2122
|
+
break;
|
|
2123
|
+
case EValueType.Mapping:
|
|
2124
|
+
value = GetMappingValue(field.value, entity);
|
|
2125
|
+
break;
|
|
2126
|
+
case EValueType.RandomColor:
|
|
2127
|
+
value = exports.Color.RandomColor();
|
|
2128
|
+
break;
|
|
2129
|
+
case EValueType.TagColor:
|
|
2130
|
+
for (var i_2 = 0; i_2 < tags.length; i_2++) {
|
|
2131
|
+
var tag = tags[i_2];
|
|
2132
|
+
if (tag.Color) {
|
|
2133
|
+
value = exports.Color.ColorFromStr(tag.Color);
|
|
2134
|
+
break;
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
break;
|
|
2138
|
+
}
|
|
2139
|
+
if (typeof value === "string") {
|
|
2140
|
+
value = exports.Color.ColorFromStr(value);
|
|
2141
|
+
}
|
|
2142
|
+
if (value && typeof value === "object" && (value.red || value.red == 0)) {
|
|
2143
|
+
return value;
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
return null;
|
|
2147
|
+
}
|
|
2148
|
+
Calculator.GetColor = GetColor;
|
|
1958
2149
|
function GetMappingValue(value, entity) {
|
|
1959
2150
|
var attrPath = exports.PathUtils.Parse(value.field);
|
|
1960
2151
|
var eValue = +exports.Entity.GetValue(entity, attrPath);
|
|
@@ -2425,7 +2616,7 @@
|
|
|
2425
2616
|
EType["Photo"] = "photo";
|
|
2426
2617
|
EType["Document"] = "document";
|
|
2427
2618
|
})(EType = EntityAttachmentType.EType || (EntityAttachmentType.EType = {}));
|
|
2428
|
-
function Delete(api, id) {
|
|
2619
|
+
function Delete(api, id, reqParams) {
|
|
2429
2620
|
return __awaiter(this, void 0, void 0, function () {
|
|
2430
2621
|
return __generator(this, function (_a) {
|
|
2431
2622
|
switch (_a.label) {
|
|
@@ -2433,7 +2624,7 @@
|
|
|
2433
2624
|
if (!id) {
|
|
2434
2625
|
throw ("Type ID is required.");
|
|
2435
2626
|
}
|
|
2436
|
-
return [4 /*yield*/, api.DELETE("entityAttachmentType/" + id, exports.Api.PrepReqParams())];
|
|
2627
|
+
return [4 /*yield*/, api.DELETE("entityAttachmentType/" + id, exports.Api.PrepReqParams(reqParams))];
|
|
2437
2628
|
case 1:
|
|
2438
2629
|
_a.sent();
|
|
2439
2630
|
api.Cache.Remove(GetCacheKey(id));
|
|
@@ -2444,7 +2635,7 @@
|
|
|
2444
2635
|
});
|
|
2445
2636
|
}
|
|
2446
2637
|
EntityAttachmentType.Delete = Delete;
|
|
2447
|
-
function Update(api, data) {
|
|
2638
|
+
function Update(api, data, reqParams) {
|
|
2448
2639
|
return __awaiter(this, void 0, void 0, function () {
|
|
2449
2640
|
return __generator(this, function (_a) {
|
|
2450
2641
|
switch (_a.label) {
|
|
@@ -2452,7 +2643,7 @@
|
|
|
2452
2643
|
if (!(data === null || data === void 0 ? void 0 : data.ID)) {
|
|
2453
2644
|
throw ("Type ID is required.");
|
|
2454
2645
|
}
|
|
2455
|
-
return [4 /*yield*/, api.POST("entityAttachmentType/" + data.ID, data, exports.Api.PrepReqParams())];
|
|
2646
|
+
return [4 /*yield*/, api.POST("entityAttachmentType/" + data.ID, data, exports.Api.PrepReqParams(reqParams))];
|
|
2456
2647
|
case 1:
|
|
2457
2648
|
data = _a.sent();
|
|
2458
2649
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
@@ -2463,12 +2654,12 @@
|
|
|
2463
2654
|
});
|
|
2464
2655
|
}
|
|
2465
2656
|
EntityAttachmentType.Update = Update;
|
|
2466
|
-
function GetList(api) {
|
|
2657
|
+
function GetList(api, reqParams) {
|
|
2467
2658
|
return __awaiter(this, void 0, void 0, function () {
|
|
2468
2659
|
var cacheData, req;
|
|
2469
2660
|
var _this = this;
|
|
2470
2661
|
return __generator(this, function (_a) {
|
|
2471
|
-
cacheData = api.Cache.Get(GetListCacheKey());
|
|
2662
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey());
|
|
2472
2663
|
if (cacheData) {
|
|
2473
2664
|
return [2 /*return*/, cacheData];
|
|
2474
2665
|
}
|
|
@@ -2478,7 +2669,7 @@
|
|
|
2478
2669
|
switch (_a.label) {
|
|
2479
2670
|
case 0:
|
|
2480
2671
|
_a.trys.push([0, 2, , 3]);
|
|
2481
|
-
return [4 /*yield*/, api.GET("entityAttachmentTypes", exports.Api.PrepReqParams())];
|
|
2672
|
+
return [4 /*yield*/, api.GET("entityAttachmentTypes", exports.Api.PrepReqParams(reqParams))];
|
|
2482
2673
|
case 1:
|
|
2483
2674
|
data = _a.sent();
|
|
2484
2675
|
res(data.Items);
|
|
@@ -2508,7 +2699,7 @@
|
|
|
2508
2699
|
return exports.Api.ECacheKey.Attachment + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
|
|
2509
2700
|
}
|
|
2510
2701
|
EntityAttachment.GetListCacheKey = GetListCacheKey;
|
|
2511
|
-
function Update(api, data) {
|
|
2702
|
+
function Update(api, data, reqParams) {
|
|
2512
2703
|
return __awaiter(this, void 0, void 0, function () {
|
|
2513
2704
|
var url;
|
|
2514
2705
|
return __generator(this, function (_a) {
|
|
@@ -2518,7 +2709,7 @@
|
|
|
2518
2709
|
throw ("Entity ID, Type ID, and File ID are required.");
|
|
2519
2710
|
}
|
|
2520
2711
|
url = "entity/" + data["Entity.ID"] + "/attachment/" + data["EntityAttachmentType.ID"] + "/" + data["ClientFile.ID"];
|
|
2521
|
-
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams())];
|
|
2712
|
+
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams(reqParams))];
|
|
2522
2713
|
case 1:
|
|
2523
2714
|
data = _a.sent();
|
|
2524
2715
|
api.Cache.Remove(GetCacheKey(data["Entity.ID"], data["EntityAttachmentType.ID"], data["ClientFile.ID"]));
|
|
@@ -2529,7 +2720,7 @@
|
|
|
2529
2720
|
});
|
|
2530
2721
|
}
|
|
2531
2722
|
EntityAttachment.Update = Update;
|
|
2532
|
-
function UpdateOrder(api, entityId, typeId, fileIds) {
|
|
2723
|
+
function UpdateOrder(api, entityId, typeId, fileIds, reqParams) {
|
|
2533
2724
|
return __awaiter(this, void 0, void 0, function () {
|
|
2534
2725
|
var reqData, i;
|
|
2535
2726
|
return __generator(this, function (_a) {
|
|
@@ -2542,7 +2733,7 @@
|
|
|
2542
2733
|
"DisplayOrder.Start": 0,
|
|
2543
2734
|
"ClientFile.ID": fileIds
|
|
2544
2735
|
};
|
|
2545
|
-
return [4 /*yield*/, api.POST("entity/" + entityId + "/attachments/" + typeId + "/setOrder", reqData, exports.Api.PrepReqParams())];
|
|
2736
|
+
return [4 /*yield*/, api.POST("entity/" + entityId + "/attachments/" + typeId + "/setOrder", reqData, exports.Api.PrepReqParams(reqParams))];
|
|
2546
2737
|
case 1:
|
|
2547
2738
|
_a.sent();
|
|
2548
2739
|
for (i = 0; i < fileIds.length; i++) {
|
|
@@ -2555,7 +2746,7 @@
|
|
|
2555
2746
|
});
|
|
2556
2747
|
}
|
|
2557
2748
|
EntityAttachment.UpdateOrder = UpdateOrder;
|
|
2558
|
-
function Delete(api, data) {
|
|
2749
|
+
function Delete(api, data, reqParams) {
|
|
2559
2750
|
return __awaiter(this, void 0, void 0, function () {
|
|
2560
2751
|
var reqData;
|
|
2561
2752
|
return __generator(this, function (_a) {
|
|
@@ -2567,7 +2758,7 @@
|
|
|
2567
2758
|
reqData = {
|
|
2568
2759
|
"ClientFile.ID": [data["ClientFile.ID"]]
|
|
2569
2760
|
};
|
|
2570
|
-
return [4 /*yield*/, api.POST("entity/" + data["Entity.ID"] + "/attachments/" + data["EntityAttachmentType.ID"] + "/delete", reqData, exports.Api.PrepReqParams())];
|
|
2761
|
+
return [4 /*yield*/, api.POST("entity/" + data["Entity.ID"] + "/attachments/" + data["EntityAttachmentType.ID"] + "/delete", reqData, exports.Api.PrepReqParams(reqParams))];
|
|
2571
2762
|
case 1:
|
|
2572
2763
|
_a.sent();
|
|
2573
2764
|
api.Cache.Remove(GetCacheKey(data["Entity.ID"], data["EntityAttachmentType.ID"], data["ClientFile.ID"]));
|
|
@@ -2578,7 +2769,7 @@
|
|
|
2578
2769
|
});
|
|
2579
2770
|
}
|
|
2580
2771
|
EntityAttachment.Delete = Delete;
|
|
2581
|
-
function DeleteByFileIds(api, entityId, typeId, fileIds) {
|
|
2772
|
+
function DeleteByFileIds(api, entityId, typeId, fileIds, reqParams) {
|
|
2582
2773
|
return __awaiter(this, void 0, void 0, function () {
|
|
2583
2774
|
var reqData, i;
|
|
2584
2775
|
return __generator(this, function (_a) {
|
|
@@ -2590,7 +2781,7 @@
|
|
|
2590
2781
|
reqData = {
|
|
2591
2782
|
"ClientFile.ID": fileIds
|
|
2592
2783
|
};
|
|
2593
|
-
return [4 /*yield*/, api.POST("entity/" + entityId + "/attachments/" + typeId + "/delete", reqData, exports.Api.PrepReqParams())];
|
|
2784
|
+
return [4 /*yield*/, api.POST("entity/" + entityId + "/attachments/" + typeId + "/delete", reqData, exports.Api.PrepReqParams(reqParams))];
|
|
2594
2785
|
case 1:
|
|
2595
2786
|
_a.sent();
|
|
2596
2787
|
for (i = 0; i < fileIds.length; i++) {
|
|
@@ -2603,7 +2794,7 @@
|
|
|
2603
2794
|
});
|
|
2604
2795
|
}
|
|
2605
2796
|
EntityAttachment.DeleteByFileIds = DeleteByFileIds;
|
|
2606
|
-
function GetListByEntityId(api, entityId) {
|
|
2797
|
+
function GetListByEntityId(api, entityId, reqParams) {
|
|
2607
2798
|
return __awaiter(this, void 0, void 0, function () {
|
|
2608
2799
|
var cacheData, req;
|
|
2609
2800
|
var _this = this;
|
|
@@ -2611,7 +2802,7 @@
|
|
|
2611
2802
|
if (!entityId) {
|
|
2612
2803
|
throw ("Entity ID is required.");
|
|
2613
2804
|
}
|
|
2614
|
-
cacheData = api.Cache.Get(GetListCacheKey(entityId));
|
|
2805
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(entityId));
|
|
2615
2806
|
if (cacheData) {
|
|
2616
2807
|
return [2 /*return*/, cacheData];
|
|
2617
2808
|
}
|
|
@@ -2621,7 +2812,7 @@
|
|
|
2621
2812
|
switch (_a.label) {
|
|
2622
2813
|
case 0:
|
|
2623
2814
|
_a.trys.push([0, 2, , 3]);
|
|
2624
|
-
return [4 /*yield*/, api.GET("entity/" + entityId + "/attachments", exports.Api.PrepReqParams())];
|
|
2815
|
+
return [4 /*yield*/, api.GET("entity/" + entityId + "/attachments", exports.Api.PrepReqParams(reqParams))];
|
|
2625
2816
|
case 1:
|
|
2626
2817
|
data = _a.sent();
|
|
2627
2818
|
res(data.Items);
|
|
@@ -2640,7 +2831,7 @@
|
|
|
2640
2831
|
});
|
|
2641
2832
|
}
|
|
2642
2833
|
EntityAttachment.GetListByEntityId = GetListByEntityId;
|
|
2643
|
-
function Upload(api, file, entityId, typeId,
|
|
2834
|
+
function Upload(api, file, entityId, typeId, reqParams) {
|
|
2644
2835
|
return __awaiter(this, void 0, void 0, function () {
|
|
2645
2836
|
var url, req;
|
|
2646
2837
|
return __generator(this, function (_a) {
|
|
@@ -2650,7 +2841,7 @@
|
|
|
2650
2841
|
throw ("Entity ID, Type ID, and File are required.");
|
|
2651
2842
|
}
|
|
2652
2843
|
url = "entity/" + entityId + "/attachment/" + typeId;
|
|
2653
|
-
return [4 /*yield*/, api.UPLOAD(url, file,
|
|
2844
|
+
return [4 /*yield*/, api.UPLOAD(url, file, reqParams)];
|
|
2654
2845
|
case 1:
|
|
2655
2846
|
req = _a.sent();
|
|
2656
2847
|
api.Cache.RemoveByStartsWith(GetListCacheKey(entityId));
|
|
@@ -2671,7 +2862,7 @@
|
|
|
2671
2862
|
return exports.Api.ECacheKey.Comment + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
|
|
2672
2863
|
}
|
|
2673
2864
|
EntityComment.GetListCacheKey = GetListCacheKey;
|
|
2674
|
-
function Update(api, data) {
|
|
2865
|
+
function Update(api, data, reqParams) {
|
|
2675
2866
|
return __awaiter(this, void 0, void 0, function () {
|
|
2676
2867
|
var url;
|
|
2677
2868
|
return __generator(this, function (_a) {
|
|
@@ -2681,7 +2872,7 @@
|
|
|
2681
2872
|
throw ("TargetObject.ID (entity id) is required.");
|
|
2682
2873
|
}
|
|
2683
2874
|
url = "entity/" + data["TargetObject.ID"] + "/comment" + (data.ID == null ? "" : "/" + data.ID);
|
|
2684
|
-
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams())];
|
|
2875
|
+
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams(reqParams))];
|
|
2685
2876
|
case 1:
|
|
2686
2877
|
data = _a.sent();
|
|
2687
2878
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
@@ -2692,7 +2883,7 @@
|
|
|
2692
2883
|
});
|
|
2693
2884
|
}
|
|
2694
2885
|
EntityComment.Update = Update;
|
|
2695
|
-
function Delete(api, entityId, commentId) {
|
|
2886
|
+
function Delete(api, entityId, commentId, reqParams) {
|
|
2696
2887
|
return __awaiter(this, void 0, void 0, function () {
|
|
2697
2888
|
return __generator(this, function (_a) {
|
|
2698
2889
|
switch (_a.label) {
|
|
@@ -2700,7 +2891,7 @@
|
|
|
2700
2891
|
if (!commentId) {
|
|
2701
2892
|
throw ("Comment ID is required.");
|
|
2702
2893
|
}
|
|
2703
|
-
return [4 /*yield*/, api.DELETE("entity/" + entityId + "/comment/" + commentId, exports.Api.PrepReqParams())];
|
|
2894
|
+
return [4 /*yield*/, api.DELETE("entity/" + entityId + "/comment/" + commentId, exports.Api.PrepReqParams(reqParams))];
|
|
2704
2895
|
case 1:
|
|
2705
2896
|
_a.sent();
|
|
2706
2897
|
api.Cache.Remove(GetCacheKey(commentId));
|
|
@@ -2711,7 +2902,7 @@
|
|
|
2711
2902
|
});
|
|
2712
2903
|
}
|
|
2713
2904
|
EntityComment.Delete = Delete;
|
|
2714
|
-
function GetListByEntityId(api, entityId) {
|
|
2905
|
+
function GetListByEntityId(api, entityId, reqParams) {
|
|
2715
2906
|
return __awaiter(this, void 0, void 0, function () {
|
|
2716
2907
|
var cacheData, req;
|
|
2717
2908
|
var _this = this;
|
|
@@ -2719,7 +2910,7 @@
|
|
|
2719
2910
|
if (!entityId) {
|
|
2720
2911
|
throw ("Entity ID is required.");
|
|
2721
2912
|
}
|
|
2722
|
-
cacheData = api.Cache.Get(GetListCacheKey(entityId));
|
|
2913
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(entityId));
|
|
2723
2914
|
if (cacheData) {
|
|
2724
2915
|
return [2 /*return*/, cacheData];
|
|
2725
2916
|
}
|
|
@@ -2729,7 +2920,7 @@
|
|
|
2729
2920
|
switch (_a.label) {
|
|
2730
2921
|
case 0:
|
|
2731
2922
|
_a.trys.push([0, 2, , 3]);
|
|
2732
|
-
return [4 /*yield*/, api.GET("entity/" + entityId + "/comments", exports.Api.PrepReqParams())];
|
|
2923
|
+
return [4 /*yield*/, api.GET("entity/" + entityId + "/comments", exports.Api.PrepReqParams(reqParams))];
|
|
2733
2924
|
case 1:
|
|
2734
2925
|
data = _a.sent();
|
|
2735
2926
|
res(data.Items);
|
|
@@ -2759,7 +2950,7 @@
|
|
|
2759
2950
|
return exports.Api.ECacheKey.Link + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
|
|
2760
2951
|
}
|
|
2761
2952
|
EntityLink.GetListCacheKey = GetListCacheKey;
|
|
2762
|
-
function Update(api, data) {
|
|
2953
|
+
function Update(api, data, reqParams) {
|
|
2763
2954
|
return __awaiter(this, void 0, void 0, function () {
|
|
2764
2955
|
var url;
|
|
2765
2956
|
return __generator(this, function (_a) {
|
|
@@ -2769,7 +2960,7 @@
|
|
|
2769
2960
|
throw ("Entity ID is required.");
|
|
2770
2961
|
}
|
|
2771
2962
|
url = "entity/" + data["Entity.ID"] + "/link" + (data.ID == null ? "" : "/" + data.ID);
|
|
2772
|
-
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams())];
|
|
2963
|
+
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams(reqParams))];
|
|
2773
2964
|
case 1:
|
|
2774
2965
|
data = _a.sent();
|
|
2775
2966
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
@@ -2780,7 +2971,7 @@
|
|
|
2780
2971
|
});
|
|
2781
2972
|
}
|
|
2782
2973
|
EntityLink.Update = Update;
|
|
2783
|
-
function Delete(api, entityId, linkId) {
|
|
2974
|
+
function Delete(api, entityId, linkId, reqParams) {
|
|
2784
2975
|
return __awaiter(this, void 0, void 0, function () {
|
|
2785
2976
|
return __generator(this, function (_a) {
|
|
2786
2977
|
switch (_a.label) {
|
|
@@ -2788,7 +2979,7 @@
|
|
|
2788
2979
|
if (!linkId) {
|
|
2789
2980
|
throw ("Link ID is required.");
|
|
2790
2981
|
}
|
|
2791
|
-
return [4 /*yield*/, api.DELETE("entity/" + entityId + "/link/" + linkId, exports.Api.PrepReqParams())];
|
|
2982
|
+
return [4 /*yield*/, api.DELETE("entity/" + entityId + "/link/" + linkId, exports.Api.PrepReqParams(reqParams))];
|
|
2792
2983
|
case 1:
|
|
2793
2984
|
_a.sent();
|
|
2794
2985
|
api.Cache.Remove(GetCacheKey(linkId));
|
|
@@ -2799,7 +2990,7 @@
|
|
|
2799
2990
|
});
|
|
2800
2991
|
}
|
|
2801
2992
|
EntityLink.Delete = Delete;
|
|
2802
|
-
function GetListByEntityId(api, entityId) {
|
|
2993
|
+
function GetListByEntityId(api, entityId, reqParams) {
|
|
2803
2994
|
return __awaiter(this, void 0, void 0, function () {
|
|
2804
2995
|
var cacheData, req;
|
|
2805
2996
|
var _this = this;
|
|
@@ -2807,7 +2998,7 @@
|
|
|
2807
2998
|
if (!entityId) {
|
|
2808
2999
|
throw ("Entity ID is required.");
|
|
2809
3000
|
}
|
|
2810
|
-
cacheData = api.Cache.Get(GetListCacheKey(entityId));
|
|
3001
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(entityId));
|
|
2811
3002
|
if (cacheData) {
|
|
2812
3003
|
return [2 /*return*/, cacheData];
|
|
2813
3004
|
}
|
|
@@ -2817,7 +3008,7 @@
|
|
|
2817
3008
|
switch (_a.label) {
|
|
2818
3009
|
case 0:
|
|
2819
3010
|
_a.trys.push([0, 2, , 3]);
|
|
2820
|
-
return [4 /*yield*/, api.GET("entity/" + entityId + "/links", exports.Api.PrepReqParams())];
|
|
3011
|
+
return [4 /*yield*/, api.GET("entity/" + entityId + "/links", exports.Api.PrepReqParams(reqParams))];
|
|
2821
3012
|
case 1:
|
|
2822
3013
|
data = _a.sent();
|
|
2823
3014
|
res(data.Items);
|
|
@@ -2864,7 +3055,7 @@
|
|
|
2864
3055
|
return url;
|
|
2865
3056
|
}
|
|
2866
3057
|
EntityLod.GetUrl = GetUrl;
|
|
2867
|
-
function GetUrlFileId(api, url) {
|
|
3058
|
+
function GetUrlFileId(api, url, reqParams) {
|
|
2868
3059
|
return __awaiter(this, void 0, void 0, function () {
|
|
2869
3060
|
var cacheData, req;
|
|
2870
3061
|
var _this = this;
|
|
@@ -2872,7 +3063,7 @@
|
|
|
2872
3063
|
if (!url) {
|
|
2873
3064
|
throw ("Url is required.");
|
|
2874
3065
|
}
|
|
2875
|
-
cacheData = api.Cache.Get(GetCacheKey(url));
|
|
3066
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(url));
|
|
2876
3067
|
if (cacheData) {
|
|
2877
3068
|
return [2 /*return*/, cacheData];
|
|
2878
3069
|
}
|
|
@@ -2882,7 +3073,7 @@
|
|
|
2882
3073
|
switch (_a.label) {
|
|
2883
3074
|
case 0:
|
|
2884
3075
|
_a.trys.push([0, 2, , 3]);
|
|
2885
|
-
return [4 /*yield*/, api.get(url, exports.Api.PrepReqParams())];
|
|
3076
|
+
return [4 /*yield*/, api.get(url, exports.Api.PrepReqParams(reqParams))];
|
|
2886
3077
|
case 1:
|
|
2887
3078
|
record = _a.sent();
|
|
2888
3079
|
res(record["ClientFile.ID"]);
|
|
@@ -2901,7 +3092,7 @@
|
|
|
2901
3092
|
});
|
|
2902
3093
|
}
|
|
2903
3094
|
EntityLod.GetUrlFileId = GetUrlFileId;
|
|
2904
|
-
function GetLods(api, params) {
|
|
3095
|
+
function GetLods(api, params, reqParams) {
|
|
2905
3096
|
var _a;
|
|
2906
3097
|
return __awaiter(this, void 0, void 0, function () {
|
|
2907
3098
|
var data;
|
|
@@ -2911,7 +3102,7 @@
|
|
|
2911
3102
|
if (!((_a = params === null || params === void 0 ? void 0 : params.Items) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
2912
3103
|
throw ("Items are required.");
|
|
2913
3104
|
}
|
|
2914
|
-
return [4 /*yield*/, api.POST("entity/getlods", params)];
|
|
3105
|
+
return [4 /*yield*/, api.POST("entity/getlods", params, reqParams)];
|
|
2915
3106
|
case 1:
|
|
2916
3107
|
data = _b.sent();
|
|
2917
3108
|
return [2 /*return*/, data.Items];
|
|
@@ -2925,8 +3116,9 @@
|
|
|
2925
3116
|
* @param api
|
|
2926
3117
|
* @param typeId
|
|
2927
3118
|
* @param group default is "DEFAULT".
|
|
3119
|
+
* @param reqParams
|
|
2928
3120
|
*/
|
|
2929
|
-
function GetTypeLods(api, typeId, group) {
|
|
3121
|
+
function GetTypeLods(api, typeId, group, reqParams) {
|
|
2930
3122
|
return __awaiter(this, void 0, void 0, function () {
|
|
2931
3123
|
var cacheData, url, req, prom;
|
|
2932
3124
|
var _this = this;
|
|
@@ -2934,12 +3126,12 @@
|
|
|
2934
3126
|
if (!group) {
|
|
2935
3127
|
group = "DEFAULT";
|
|
2936
3128
|
}
|
|
2937
|
-
cacheData = api.Cache.Get(GetTypeListKey(typeId, group));
|
|
3129
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetTypeListKey(typeId, group));
|
|
2938
3130
|
if (cacheData) {
|
|
2939
3131
|
return [2 /*return*/, cacheData];
|
|
2940
3132
|
}
|
|
2941
3133
|
url = "entityType/" + typeId + "/lods?includeClientFiles=yes" + (group ? "&group=" + group : "");
|
|
2942
|
-
req = api.GET(url, exports.Api.PrepReqParams());
|
|
3134
|
+
req = api.GET(url, exports.Api.PrepReqParams(reqParams));
|
|
2943
3135
|
prom = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
2944
3136
|
var data, e_2;
|
|
2945
3137
|
return __generator(this, function (_a) {
|
|
@@ -2965,7 +3157,7 @@
|
|
|
2965
3157
|
});
|
|
2966
3158
|
}
|
|
2967
3159
|
EntityLod.GetTypeLods = GetTypeLods;
|
|
2968
|
-
function Update(api, entityId, params) {
|
|
3160
|
+
function Update(api, entityId, params, reqParams) {
|
|
2969
3161
|
return __awaiter(this, void 0, void 0, function () {
|
|
2970
3162
|
return __generator(this, function (_a) {
|
|
2971
3163
|
if (!params["ClientFile.ID"] || !params["LODCategory.Key"] || (!params.Level && params.Level !== 0)) {
|
|
@@ -2974,7 +3166,7 @@
|
|
|
2974
3166
|
return [2 /*return*/, api.POST("entity/" + entityId + "/lod/" + params["LODCategory.Key"] + "/" + params.Level, {
|
|
2975
3167
|
"Level": 0,
|
|
2976
3168
|
"ClientFile.ID": params["ClientFile.ID"]
|
|
2977
|
-
}, exports.Api.PrepReqParams())];
|
|
3169
|
+
}, exports.Api.PrepReqParams(reqParams))];
|
|
2978
3170
|
});
|
|
2979
3171
|
});
|
|
2980
3172
|
}
|
|
@@ -2990,7 +3182,7 @@
|
|
|
2990
3182
|
return exports.Api.ECacheKey.RelationType;
|
|
2991
3183
|
}
|
|
2992
3184
|
EntityRelationType.GetListCacheKey = GetListCacheKey;
|
|
2993
|
-
function Get(api, typeId) {
|
|
3185
|
+
function Get(api, typeId, reqParams) {
|
|
2994
3186
|
return __awaiter(this, void 0, void 0, function () {
|
|
2995
3187
|
var key, cacheData, req;
|
|
2996
3188
|
return __generator(this, function (_a) {
|
|
@@ -2998,18 +3190,18 @@
|
|
|
2998
3190
|
throw ("Type ID is required.");
|
|
2999
3191
|
}
|
|
3000
3192
|
key = GetCacheKey(typeId);
|
|
3001
|
-
cacheData = api.Cache.Get(key);
|
|
3193
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
3002
3194
|
if (cacheData) {
|
|
3003
3195
|
return [2 /*return*/, cacheData];
|
|
3004
3196
|
}
|
|
3005
|
-
req = api.GET("entityRelationType/" + typeId, exports.Api.PrepReqParams());
|
|
3197
|
+
req = api.GET("entityRelationType/" + typeId, exports.Api.PrepReqParams(reqParams));
|
|
3006
3198
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
3007
3199
|
return [2 /*return*/, req];
|
|
3008
3200
|
});
|
|
3009
3201
|
});
|
|
3010
3202
|
}
|
|
3011
3203
|
EntityRelationType.Get = Get;
|
|
3012
|
-
function Delete(api, typeId) {
|
|
3204
|
+
function Delete(api, typeId, reqParams) {
|
|
3013
3205
|
return __awaiter(this, void 0, void 0, function () {
|
|
3014
3206
|
return __generator(this, function (_a) {
|
|
3015
3207
|
switch (_a.label) {
|
|
@@ -3017,7 +3209,7 @@
|
|
|
3017
3209
|
if (!typeId) {
|
|
3018
3210
|
throw ("Type ID is required.");
|
|
3019
3211
|
}
|
|
3020
|
-
return [4 /*yield*/, api.DELETE("entityRelationType/" + typeId, exports.Api.PrepReqParams())];
|
|
3212
|
+
return [4 /*yield*/, api.DELETE("entityRelationType/" + typeId, exports.Api.PrepReqParams(reqParams))];
|
|
3021
3213
|
case 1:
|
|
3022
3214
|
_a.sent();
|
|
3023
3215
|
api.Cache.Remove(GetCacheKey(typeId));
|
|
@@ -3028,12 +3220,12 @@
|
|
|
3028
3220
|
});
|
|
3029
3221
|
}
|
|
3030
3222
|
EntityRelationType.Delete = Delete;
|
|
3031
|
-
function GetList(api) {
|
|
3223
|
+
function GetList(api, reqParams) {
|
|
3032
3224
|
return __awaiter(this, void 0, void 0, function () {
|
|
3033
3225
|
var cacheData, req;
|
|
3034
3226
|
var _this = this;
|
|
3035
3227
|
return __generator(this, function (_a) {
|
|
3036
|
-
cacheData = api.Cache.Get(GetListCacheKey());
|
|
3228
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey());
|
|
3037
3229
|
if (cacheData) {
|
|
3038
3230
|
return [2 /*return*/, cacheData];
|
|
3039
3231
|
}
|
|
@@ -3043,7 +3235,7 @@
|
|
|
3043
3235
|
switch (_a.label) {
|
|
3044
3236
|
case 0:
|
|
3045
3237
|
_a.trys.push([0, 2, , 3]);
|
|
3046
|
-
return [4 /*yield*/, api.GET("entityRelationTypes", exports.Api.PrepReqParams())];
|
|
3238
|
+
return [4 /*yield*/, api.GET("entityRelationTypes", exports.Api.PrepReqParams(reqParams))];
|
|
3047
3239
|
case 1:
|
|
3048
3240
|
data = _a.sent();
|
|
3049
3241
|
res(data.Items);
|
|
@@ -3062,7 +3254,7 @@
|
|
|
3062
3254
|
});
|
|
3063
3255
|
}
|
|
3064
3256
|
EntityRelationType.GetList = GetList;
|
|
3065
|
-
function Update(api, data) {
|
|
3257
|
+
function Update(api, data, reqParams) {
|
|
3066
3258
|
return __awaiter(this, void 0, void 0, function () {
|
|
3067
3259
|
return __generator(this, function (_a) {
|
|
3068
3260
|
switch (_a.label) {
|
|
@@ -3073,7 +3265,7 @@
|
|
|
3073
3265
|
if (!data.ID) {
|
|
3074
3266
|
data.ID = exports.ObjectUtils.UId();
|
|
3075
3267
|
}
|
|
3076
|
-
return [4 /*yield*/, api.POST("entityRelationType/" + data.ID, data, exports.Api.PrepReqParams())];
|
|
3268
|
+
return [4 /*yield*/, api.POST("entityRelationType/" + data.ID, data, exports.Api.PrepReqParams(reqParams))];
|
|
3077
3269
|
case 1:
|
|
3078
3270
|
data = _a.sent();
|
|
3079
3271
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
@@ -3103,7 +3295,7 @@
|
|
|
3103
3295
|
exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
|
|
3104
3296
|
}
|
|
3105
3297
|
EntityRelation.GetListCacheKey = GetListCacheKey;
|
|
3106
|
-
function Create(api, data) {
|
|
3298
|
+
function Create(api, data, reqParams) {
|
|
3107
3299
|
return __awaiter(this, void 0, void 0, function () {
|
|
3108
3300
|
var reqData, url;
|
|
3109
3301
|
return __generator(this, function (_a) {
|
|
@@ -3116,7 +3308,7 @@
|
|
|
3116
3308
|
"Related.Entity.ID": [data["Related.Entity.ID"]]
|
|
3117
3309
|
};
|
|
3118
3310
|
url = "entity/" + data["Principal.Entity.ID"] + "/relation/" + data["Relation.Type.ID"] + "/add";
|
|
3119
|
-
return [4 /*yield*/, api.POST(url, reqData, exports.Api.PrepReqParams())];
|
|
3311
|
+
return [4 /*yield*/, api.POST(url, reqData, exports.Api.PrepReqParams(reqParams))];
|
|
3120
3312
|
case 1:
|
|
3121
3313
|
_a.sent();
|
|
3122
3314
|
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + data["Principal.Entity.ID"]);
|
|
@@ -3131,7 +3323,7 @@
|
|
|
3131
3323
|
});
|
|
3132
3324
|
}
|
|
3133
3325
|
EntityRelation.Create = Create;
|
|
3134
|
-
function Update(api, data) {
|
|
3326
|
+
function Update(api, data, reqParams) {
|
|
3135
3327
|
return __awaiter(this, void 0, void 0, function () {
|
|
3136
3328
|
var url;
|
|
3137
3329
|
return __generator(this, function (_a) {
|
|
@@ -3141,7 +3333,7 @@
|
|
|
3141
3333
|
throw ("Principal Entity ID, Related Entity ID, and Relation Type ID are required.");
|
|
3142
3334
|
}
|
|
3143
3335
|
url = "entity/" + data["Principal.Entity.ID"] + "/otherEntityID/" + data["Related.Entity.ID"] + "/relation/" + data["Relation.Type.ID"] + "/update";
|
|
3144
|
-
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams())];
|
|
3336
|
+
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams(reqParams))];
|
|
3145
3337
|
case 1:
|
|
3146
3338
|
data = _a.sent();
|
|
3147
3339
|
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + data["Principal.Entity.ID"]);
|
|
@@ -3156,7 +3348,7 @@
|
|
|
3156
3348
|
});
|
|
3157
3349
|
}
|
|
3158
3350
|
EntityRelation.Update = Update;
|
|
3159
|
-
function GetList(api, entityId, params) {
|
|
3351
|
+
function GetList(api, entityId, params, reqParams) {
|
|
3160
3352
|
return __awaiter(this, void 0, void 0, function () {
|
|
3161
3353
|
var cacheData, req;
|
|
3162
3354
|
var _this = this;
|
|
@@ -3165,7 +3357,7 @@
|
|
|
3165
3357
|
throw ("Entity ID is required.");
|
|
3166
3358
|
}
|
|
3167
3359
|
params = __assign({ typeId: "", oneWayOnly: false, loadEntityData: false }, params);
|
|
3168
|
-
cacheData = api.Cache.Get(GetListCacheKey(entityId, params));
|
|
3360
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(entityId, params));
|
|
3169
3361
|
if (cacheData) {
|
|
3170
3362
|
return [2 /*return*/, cacheData];
|
|
3171
3363
|
}
|
|
@@ -3180,7 +3372,7 @@
|
|
|
3180
3372
|
url += "/" + params.typeId;
|
|
3181
3373
|
}
|
|
3182
3374
|
url += "?Oneway=" + params.oneWayOnly + "&LoadInfo=" + params.loadEntityData;
|
|
3183
|
-
return [4 /*yield*/, api.GET(url, exports.Api.PrepReqParams())];
|
|
3375
|
+
return [4 /*yield*/, api.GET(url, exports.Api.PrepReqParams(reqParams))];
|
|
3184
3376
|
case 1:
|
|
3185
3377
|
data = _a.sent();
|
|
3186
3378
|
res(data.Items);
|
|
@@ -3199,18 +3391,18 @@
|
|
|
3199
3391
|
});
|
|
3200
3392
|
}
|
|
3201
3393
|
EntityRelation.GetList = GetList;
|
|
3202
|
-
function GetByDataEntityId(api, entityId) {
|
|
3394
|
+
function GetByDataEntityId(api, entityId, reqParams) {
|
|
3203
3395
|
return __awaiter(this, void 0, void 0, function () {
|
|
3204
3396
|
var cacheData, req;
|
|
3205
3397
|
return __generator(this, function (_a) {
|
|
3206
3398
|
if (!entityId) {
|
|
3207
3399
|
throw ("Entity ID is required.");
|
|
3208
3400
|
}
|
|
3209
|
-
cacheData = api.Cache.Get(GetEntityCacheKey(entityId));
|
|
3401
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetEntityCacheKey(entityId));
|
|
3210
3402
|
if (cacheData) {
|
|
3211
3403
|
return [2 /*return*/, cacheData];
|
|
3212
3404
|
}
|
|
3213
|
-
req = api.GET("entity/relation/" + entityId + "/dataentity", exports.Api.PrepReqParams());
|
|
3405
|
+
req = api.GET("entity/relation/" + entityId + "/dataentity", exports.Api.PrepReqParams(reqParams));
|
|
3214
3406
|
api.Cache.Set(GetEntityCacheKey(entityId), req);
|
|
3215
3407
|
return [2 /*return*/, req];
|
|
3216
3408
|
});
|
|
@@ -3224,7 +3416,7 @@
|
|
|
3224
3416
|
return "" + exports.Api.ECacheKey.EntitySource + exports.Api.ECacheKey.Id + sourceId + exports.Api.ECacheKey.Id + sourceKey;
|
|
3225
3417
|
}
|
|
3226
3418
|
EntitySource.GetCacheKey = GetCacheKey;
|
|
3227
|
-
function Get(api, sourceId, sourceKey) {
|
|
3419
|
+
function Get(api, sourceId, sourceKey, reqParams) {
|
|
3228
3420
|
return __awaiter(this, void 0, void 0, function () {
|
|
3229
3421
|
var key, cacheData, req;
|
|
3230
3422
|
return __generator(this, function (_a) {
|
|
@@ -3232,18 +3424,18 @@
|
|
|
3232
3424
|
throw ("Source ID and Source Key are required.");
|
|
3233
3425
|
}
|
|
3234
3426
|
key = GetCacheKey(sourceId, sourceKey);
|
|
3235
|
-
cacheData = api.Cache.Get(key);
|
|
3427
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
3236
3428
|
if (cacheData) {
|
|
3237
3429
|
return [2 /*return*/, cacheData];
|
|
3238
3430
|
}
|
|
3239
|
-
req = api.GET("entitysource/" + sourceId + "/" + sourceKey, exports.Api.PrepReqParams());
|
|
3431
|
+
req = api.GET("entitysource/" + sourceId + "/" + sourceKey, exports.Api.PrepReqParams(reqParams));
|
|
3240
3432
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
3241
3433
|
return [2 /*return*/, req];
|
|
3242
3434
|
});
|
|
3243
3435
|
});
|
|
3244
3436
|
}
|
|
3245
3437
|
EntitySource.Get = Get;
|
|
3246
|
-
function GetListByKeys(api, sourceId, sourceKeys) {
|
|
3438
|
+
function GetListByKeys(api, sourceId, sourceKeys, reqParams) {
|
|
3247
3439
|
return __awaiter(this, void 0, void 0, function () {
|
|
3248
3440
|
var reqKeys, reqs, i, sourceKey, cacheData, prom_1, _loop_1, i;
|
|
3249
3441
|
var _this = this;
|
|
@@ -3257,7 +3449,7 @@
|
|
|
3257
3449
|
reqs = [];
|
|
3258
3450
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
3259
3451
|
sourceKey = sourceKeys[i];
|
|
3260
|
-
cacheData = api.Cache.Get(GetCacheKey(sourceId, sourceKey));
|
|
3452
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(sourceId, sourceKey));
|
|
3261
3453
|
if (cacheData) {
|
|
3262
3454
|
reqs.push(cacheData);
|
|
3263
3455
|
}
|
|
@@ -3272,7 +3464,7 @@
|
|
|
3272
3464
|
switch (_a.label) {
|
|
3273
3465
|
case 0:
|
|
3274
3466
|
_a.trys.push([0, 2, , 3]);
|
|
3275
|
-
return [4 /*yield*/, api.POST("entitysource/" + sourceId, { SourceRecordKeys: reqKeys }, exports.Api.PrepReqParams())];
|
|
3467
|
+
return [4 /*yield*/, api.POST("entitysource/" + sourceId, { SourceRecordKeys: reqKeys }, exports.Api.PrepReqParams(reqParams))];
|
|
3276
3468
|
case 1:
|
|
3277
3469
|
data = _a.sent();
|
|
3278
3470
|
res(data.Items);
|
|
@@ -3318,7 +3510,7 @@
|
|
|
3318
3510
|
});
|
|
3319
3511
|
}
|
|
3320
3512
|
EntitySource.GetListByKeys = GetListByKeys;
|
|
3321
|
-
function GetEntityIdsBySourceKeys(api, sourceId, sourceKeys) {
|
|
3513
|
+
function GetEntityIdsBySourceKeys(api, sourceId, sourceKeys, reqParams) {
|
|
3322
3514
|
return __awaiter(this, void 0, void 0, function () {
|
|
3323
3515
|
var result, sources, i, source, i_1, key;
|
|
3324
3516
|
return __generator(this, function (_a) {
|
|
@@ -3329,7 +3521,7 @@
|
|
|
3329
3521
|
}
|
|
3330
3522
|
result = {};
|
|
3331
3523
|
if (!(sourceKeys.length > 0)) return [3 /*break*/, 2];
|
|
3332
|
-
return [4 /*yield*/, GetListByKeys(api, sourceId, sourceKeys)];
|
|
3524
|
+
return [4 /*yield*/, GetListByKeys(api, sourceId, sourceKeys, reqParams)];
|
|
3333
3525
|
case 1:
|
|
3334
3526
|
sources = _a.sent();
|
|
3335
3527
|
for (i = 0; i < sources.length; i++) {
|
|
@@ -3362,7 +3554,7 @@
|
|
|
3362
3554
|
return exports.Api.ECacheKey.Tag;
|
|
3363
3555
|
}
|
|
3364
3556
|
EntityTag.GetListCacheKey = GetListCacheKey;
|
|
3365
|
-
function Get(api, tagId) {
|
|
3557
|
+
function Get(api, tagId, reqParams) {
|
|
3366
3558
|
return __awaiter(this, void 0, void 0, function () {
|
|
3367
3559
|
var data;
|
|
3368
3560
|
return __generator(this, function (_a) {
|
|
@@ -3371,7 +3563,7 @@
|
|
|
3371
3563
|
if (!tagId) {
|
|
3372
3564
|
throw ("Tag ID is required.");
|
|
3373
3565
|
}
|
|
3374
|
-
return [4 /*yield*/, GetListByIds(api, [tagId])];
|
|
3566
|
+
return [4 /*yield*/, GetListByIds(api, [tagId], reqParams)];
|
|
3375
3567
|
case 1:
|
|
3376
3568
|
data = _a.sent();
|
|
3377
3569
|
return [2 /*return*/, data.length ? data[0] : null];
|
|
@@ -3380,7 +3572,7 @@
|
|
|
3380
3572
|
});
|
|
3381
3573
|
}
|
|
3382
3574
|
EntityTag.Get = Get;
|
|
3383
|
-
function GetListByIds(api, tagIds) {
|
|
3575
|
+
function GetListByIds(api, tagIds, reqParams) {
|
|
3384
3576
|
return __awaiter(this, void 0, void 0, function () {
|
|
3385
3577
|
var reqIds, reqs, i, tagId, cacheData, prom_1, _loop_1, i;
|
|
3386
3578
|
var _this = this;
|
|
@@ -3394,7 +3586,7 @@
|
|
|
3394
3586
|
reqs = [];
|
|
3395
3587
|
for (i = 0; i < tagIds.length; i++) {
|
|
3396
3588
|
tagId = tagIds[i];
|
|
3397
|
-
cacheData = api.Cache.Get(GetCacheKey(tagId));
|
|
3589
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(tagId));
|
|
3398
3590
|
if (cacheData) {
|
|
3399
3591
|
reqs.push(cacheData);
|
|
3400
3592
|
}
|
|
@@ -3409,7 +3601,7 @@
|
|
|
3409
3601
|
switch (_a.label) {
|
|
3410
3602
|
case 0:
|
|
3411
3603
|
_a.trys.push([0, 2, , 3]);
|
|
3412
|
-
return [4 /*yield*/, api.POST("layers/get", { layerIds: reqIds }, exports.Api.PrepReqParams())];
|
|
3604
|
+
return [4 /*yield*/, api.POST("layers/get", { layerIds: reqIds }, exports.Api.PrepReqParams(reqParams))];
|
|
3413
3605
|
case 1:
|
|
3414
3606
|
data = _a.sent();
|
|
3415
3607
|
res(data.Items);
|
|
@@ -3458,12 +3650,12 @@
|
|
|
3458
3650
|
});
|
|
3459
3651
|
}
|
|
3460
3652
|
EntityTag.GetListByIds = GetListByIds;
|
|
3461
|
-
function GetList(api, entityTypeId) {
|
|
3653
|
+
function GetList(api, entityTypeId, reqParams) {
|
|
3462
3654
|
return __awaiter(this, void 0, void 0, function () {
|
|
3463
3655
|
var cacheData, req;
|
|
3464
3656
|
var _this = this;
|
|
3465
3657
|
return __generator(this, function (_a) {
|
|
3466
|
-
cacheData = api.Cache.Get(GetListCacheKey(entityTypeId));
|
|
3658
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(entityTypeId));
|
|
3467
3659
|
if (cacheData) {
|
|
3468
3660
|
return [2 /*return*/, cacheData];
|
|
3469
3661
|
}
|
|
@@ -3473,7 +3665,7 @@
|
|
|
3473
3665
|
switch (_a.label) {
|
|
3474
3666
|
case 0:
|
|
3475
3667
|
_a.trys.push([0, 2, , 3]);
|
|
3476
|
-
return [4 /*yield*/, api.GET(entityTypeId ? "entityType/" + entityTypeId + "/layers" : "layers", exports.Api.PrepReqParams())];
|
|
3668
|
+
return [4 /*yield*/, api.GET(entityTypeId ? "entityType/" + entityTypeId + "/layers" : "layers", exports.Api.PrepReqParams(reqParams))];
|
|
3477
3669
|
case 1:
|
|
3478
3670
|
data = _a.sent();
|
|
3479
3671
|
res(data.Items);
|
|
@@ -3492,7 +3684,7 @@
|
|
|
3492
3684
|
});
|
|
3493
3685
|
}
|
|
3494
3686
|
EntityTag.GetList = GetList;
|
|
3495
|
-
function Delete(api, tagId) {
|
|
3687
|
+
function Delete(api, tagId, reqParams) {
|
|
3496
3688
|
return __awaiter(this, void 0, void 0, function () {
|
|
3497
3689
|
return __generator(this, function (_a) {
|
|
3498
3690
|
switch (_a.label) {
|
|
@@ -3500,7 +3692,7 @@
|
|
|
3500
3692
|
if (!tagId) {
|
|
3501
3693
|
throw ("Tag ID is required.");
|
|
3502
3694
|
}
|
|
3503
|
-
return [4 /*yield*/, api.DELETE("layer/" + tagId, exports.Api.PrepReqParams())];
|
|
3695
|
+
return [4 /*yield*/, api.DELETE("layer/" + tagId, exports.Api.PrepReqParams(reqParams))];
|
|
3504
3696
|
case 1:
|
|
3505
3697
|
_a.sent();
|
|
3506
3698
|
api.Cache.Remove(GetCacheKey(tagId));
|
|
@@ -3511,7 +3703,7 @@
|
|
|
3511
3703
|
});
|
|
3512
3704
|
}
|
|
3513
3705
|
EntityTag.Delete = Delete;
|
|
3514
|
-
function Update(api, data) {
|
|
3706
|
+
function Update(api, data, reqParams) {
|
|
3515
3707
|
return __awaiter(this, void 0, void 0, function () {
|
|
3516
3708
|
var url;
|
|
3517
3709
|
return __generator(this, function (_a) {
|
|
@@ -3521,7 +3713,7 @@
|
|
|
3521
3713
|
throw ("Tag ID is required.");
|
|
3522
3714
|
}
|
|
3523
3715
|
url = data.ID ? "layer/" + data.ID : "layer";
|
|
3524
|
-
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams())];
|
|
3716
|
+
return [4 /*yield*/, api.POST(url, data, exports.Api.PrepReqParams(reqParams))];
|
|
3525
3717
|
case 1:
|
|
3526
3718
|
data = _a.sent();
|
|
3527
3719
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
@@ -3552,7 +3744,7 @@
|
|
|
3552
3744
|
EAttributeType["Structure"] = "Structure";
|
|
3553
3745
|
EAttributeType["Geometry"] = "Geometry";
|
|
3554
3746
|
})(EAttributeType = EntityType.EAttributeType || (EntityType.EAttributeType = {}));
|
|
3555
|
-
function Get(api, typeId) {
|
|
3747
|
+
function Get(api, typeId, reqParams) {
|
|
3556
3748
|
return __awaiter(this, void 0, void 0, function () {
|
|
3557
3749
|
var key, cacheData, req;
|
|
3558
3750
|
return __generator(this, function (_a) {
|
|
@@ -3560,18 +3752,18 @@
|
|
|
3560
3752
|
throw ("Type ID is required.");
|
|
3561
3753
|
}
|
|
3562
3754
|
key = GetCacheKey(typeId);
|
|
3563
|
-
cacheData = api.Cache.Get(key);
|
|
3755
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
3564
3756
|
if (cacheData) {
|
|
3565
3757
|
return [2 /*return*/, cacheData];
|
|
3566
3758
|
}
|
|
3567
|
-
req = api.GET("entitytype/" + typeId, exports.Api.PrepReqParams());
|
|
3759
|
+
req = api.GET("entitytype/" + typeId, exports.Api.PrepReqParams(reqParams));
|
|
3568
3760
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
3569
3761
|
return [2 /*return*/, req];
|
|
3570
3762
|
});
|
|
3571
3763
|
});
|
|
3572
3764
|
}
|
|
3573
3765
|
EntityType.Get = Get;
|
|
3574
|
-
function Delete(api, typeId) {
|
|
3766
|
+
function Delete(api, typeId, reqParams) {
|
|
3575
3767
|
return __awaiter(this, void 0, void 0, function () {
|
|
3576
3768
|
return __generator(this, function (_a) {
|
|
3577
3769
|
switch (_a.label) {
|
|
@@ -3579,7 +3771,7 @@
|
|
|
3579
3771
|
if (!typeId) {
|
|
3580
3772
|
throw ("Type ID is required.");
|
|
3581
3773
|
}
|
|
3582
|
-
return [4 /*yield*/, api.DELETE("entitytype/" + typeId, exports.Api.PrepReqParams())];
|
|
3774
|
+
return [4 /*yield*/, api.DELETE("entitytype/" + typeId, exports.Api.PrepReqParams(reqParams))];
|
|
3583
3775
|
case 1:
|
|
3584
3776
|
_a.sent();
|
|
3585
3777
|
api.Cache.Remove(GetCacheKey(typeId));
|
|
@@ -3590,12 +3782,12 @@
|
|
|
3590
3782
|
});
|
|
3591
3783
|
}
|
|
3592
3784
|
EntityType.Delete = Delete;
|
|
3593
|
-
function GetList(api) {
|
|
3785
|
+
function GetList(api, reqParams) {
|
|
3594
3786
|
return __awaiter(this, void 0, void 0, function () {
|
|
3595
3787
|
var cacheData, req;
|
|
3596
3788
|
var _this = this;
|
|
3597
3789
|
return __generator(this, function (_a) {
|
|
3598
|
-
cacheData = api.Cache.Get(GetListCacheKey());
|
|
3790
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey());
|
|
3599
3791
|
if (cacheData) {
|
|
3600
3792
|
return [2 /*return*/, cacheData];
|
|
3601
3793
|
}
|
|
@@ -3605,7 +3797,7 @@
|
|
|
3605
3797
|
switch (_a.label) {
|
|
3606
3798
|
case 0:
|
|
3607
3799
|
_a.trys.push([0, 2, , 3]);
|
|
3608
|
-
return [4 /*yield*/, api.GET("entitytypes", exports.Api.PrepReqParams())];
|
|
3800
|
+
return [4 /*yield*/, api.GET("entitytypes", exports.Api.PrepReqParams(reqParams))];
|
|
3609
3801
|
case 1:
|
|
3610
3802
|
data = _a.sent();
|
|
3611
3803
|
res(data.Items);
|
|
@@ -3624,7 +3816,7 @@
|
|
|
3624
3816
|
});
|
|
3625
3817
|
}
|
|
3626
3818
|
EntityType.GetList = GetList;
|
|
3627
|
-
function Update(api, data) {
|
|
3819
|
+
function Update(api, data, reqParams) {
|
|
3628
3820
|
return __awaiter(this, void 0, void 0, function () {
|
|
3629
3821
|
return __generator(this, function (_a) {
|
|
3630
3822
|
switch (_a.label) {
|
|
@@ -3638,7 +3830,7 @@
|
|
|
3638
3830
|
if (!data.Name) {
|
|
3639
3831
|
data.Name = data.ID;
|
|
3640
3832
|
}
|
|
3641
|
-
return [4 /*yield*/, api.POST("entitytype/" + data.ID, data, exports.Api.PrepReqParams())];
|
|
3833
|
+
return [4 /*yield*/, api.POST("entitytype/" + data.ID, data, exports.Api.PrepReqParams(reqParams))];
|
|
3642
3834
|
case 1:
|
|
3643
3835
|
data = _a.sent();
|
|
3644
3836
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
@@ -3716,10 +3908,6 @@
|
|
|
3716
3908
|
}
|
|
3717
3909
|
return 1.5;
|
|
3718
3910
|
}
|
|
3719
|
-
function getCell(cells, cellSize, lon, maxLon, lat, maxLat) {
|
|
3720
|
-
var id = cellSize + "_" + lon + "_" + maxLon + "_" + lat + "_" + maxLat;
|
|
3721
|
-
return cells[id];
|
|
3722
|
-
}
|
|
3723
3911
|
function isCellFetched(cell) {
|
|
3724
3912
|
if (cell.Fetched) {
|
|
3725
3913
|
return true;
|
|
@@ -3728,9 +3916,9 @@
|
|
|
3728
3916
|
}
|
|
3729
3917
|
function getOrCreateCell(cells, cellSize, lon, maxLon, lat, maxLat) {
|
|
3730
3918
|
var id = cellSize + "_" + lon + "_" + maxLon + "_" + lat + "_" + maxLat;
|
|
3731
|
-
var cell =
|
|
3919
|
+
var cell = cells[id];
|
|
3732
3920
|
if (!cell) {
|
|
3733
|
-
cell = new Cell();
|
|
3921
|
+
cell = cells[id] = new Cell();
|
|
3734
3922
|
cell.Boundaries = {
|
|
3735
3923
|
minLatitude: lat,
|
|
3736
3924
|
maxLatitude: maxLat,
|
|
@@ -4288,22 +4476,22 @@
|
|
|
4288
4476
|
return exports.Api.ECacheKey.EntityCoords + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + entityId;
|
|
4289
4477
|
}
|
|
4290
4478
|
EntityCoords.GetCacheKey = GetCacheKey;
|
|
4291
|
-
function GetEntityCoords(api, entityId) {
|
|
4479
|
+
function GetEntityCoords(api, entityId, reqParams) {
|
|
4292
4480
|
return __awaiter(this, void 0, void 0, function () {
|
|
4293
4481
|
var cacheData, req;
|
|
4294
4482
|
return __generator(this, function (_a) {
|
|
4295
|
-
cacheData = api.Cache.Get(GetCacheKey(entityId));
|
|
4483
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(entityId));
|
|
4296
4484
|
if (cacheData) {
|
|
4297
4485
|
return [2 /*return*/, cacheData];
|
|
4298
4486
|
}
|
|
4299
|
-
req = api.GET("entity/" + entityId + "/ucs");
|
|
4487
|
+
req = api.GET("entity/" + entityId + "/ucs", reqParams);
|
|
4300
4488
|
api.Cache.Set(GetCacheKey(entityId), req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
4301
4489
|
return [2 /*return*/, req];
|
|
4302
4490
|
});
|
|
4303
4491
|
});
|
|
4304
4492
|
}
|
|
4305
4493
|
EntityCoords.GetEntityCoords = GetEntityCoords;
|
|
4306
|
-
function EntityRelativeToPoint(api, entityId, params) {
|
|
4494
|
+
function EntityRelativeToPoint(api, entityId, params, reqParams) {
|
|
4307
4495
|
return __awaiter(this, void 0, void 0, function () {
|
|
4308
4496
|
var point, name, res;
|
|
4309
4497
|
return __generator(this, function (_a) {
|
|
@@ -4331,7 +4519,7 @@
|
|
|
4331
4519
|
}
|
|
4332
4520
|
},
|
|
4333
4521
|
"test": params.test
|
|
4334
|
-
})];
|
|
4522
|
+
}, reqParams)];
|
|
4335
4523
|
case 3:
|
|
4336
4524
|
res = _a.sent();
|
|
4337
4525
|
if (!params.test) {
|
|
@@ -4343,7 +4531,7 @@
|
|
|
4343
4531
|
});
|
|
4344
4532
|
}
|
|
4345
4533
|
EntityCoords.EntityRelativeToPoint = EntityRelativeToPoint;
|
|
4346
|
-
function EntityRelativeToEpsg(api, entityId, params) {
|
|
4534
|
+
function EntityRelativeToEpsg(api, entityId, params, reqParams) {
|
|
4347
4535
|
var _a;
|
|
4348
4536
|
return __awaiter(this, void 0, void 0, function () {
|
|
4349
4537
|
var epsg, name, res;
|
|
@@ -4370,7 +4558,7 @@
|
|
|
4370
4558
|
}
|
|
4371
4559
|
},
|
|
4372
4560
|
"test": params.test
|
|
4373
|
-
})];
|
|
4561
|
+
}, reqParams)];
|
|
4374
4562
|
case 3:
|
|
4375
4563
|
res = _b.sent();
|
|
4376
4564
|
if (!params.test) {
|
|
@@ -4382,7 +4570,7 @@
|
|
|
4382
4570
|
});
|
|
4383
4571
|
}
|
|
4384
4572
|
EntityCoords.EntityRelativeToEpsg = EntityRelativeToEpsg;
|
|
4385
|
-
function EntityRelativeToUcs(api, entityId, params) {
|
|
4573
|
+
function EntityRelativeToUcs(api, entityId, params, reqParams) {
|
|
4386
4574
|
return __awaiter(this, void 0, void 0, function () {
|
|
4387
4575
|
var ucsId, res;
|
|
4388
4576
|
return __generator(this, function (_a) {
|
|
@@ -4400,7 +4588,7 @@
|
|
|
4400
4588
|
"Entity.ID": ucsId
|
|
4401
4589
|
},
|
|
4402
4590
|
"test": params.test
|
|
4403
|
-
})];
|
|
4591
|
+
}, reqParams)];
|
|
4404
4592
|
case 3:
|
|
4405
4593
|
res = _a.sent();
|
|
4406
4594
|
if (!params.test) {
|
|
@@ -4412,10 +4600,10 @@
|
|
|
4412
4600
|
});
|
|
4413
4601
|
}
|
|
4414
4602
|
EntityCoords.EntityRelativeToUcs = EntityRelativeToUcs;
|
|
4415
|
-
function UnlinkCoords(api, entityId) {
|
|
4603
|
+
function UnlinkCoords(api, entityId, reqParams) {
|
|
4416
4604
|
return __awaiter(this, void 0, void 0, function () {
|
|
4417
4605
|
return __generator(this, function (_a) {
|
|
4418
|
-
return [2 /*return*/, api.DELETE("entity/" + entityId + "/ucs")];
|
|
4606
|
+
return [2 /*return*/, api.DELETE("entity/" + entityId + "/ucs", reqParams)];
|
|
4419
4607
|
});
|
|
4420
4608
|
});
|
|
4421
4609
|
}
|
|
@@ -4435,7 +4623,7 @@
|
|
|
4435
4623
|
return api.GetBaseUrl() + "/file/" + file.ID + (file.FileExt ? file.FileExt : "");
|
|
4436
4624
|
}
|
|
4437
4625
|
ClientFile.GetUrlWithExt = GetUrlWithExt;
|
|
4438
|
-
function Get(api, fileId) {
|
|
4626
|
+
function Get(api, fileId, reqParams) {
|
|
4439
4627
|
return __awaiter(this, void 0, void 0, function () {
|
|
4440
4628
|
var key, cacheData, req;
|
|
4441
4629
|
return __generator(this, function (_a) {
|
|
@@ -4443,18 +4631,18 @@
|
|
|
4443
4631
|
throw ("File ID is required.");
|
|
4444
4632
|
}
|
|
4445
4633
|
key = GetCacheKey(fileId);
|
|
4446
|
-
cacheData = api.Cache.Get(key);
|
|
4634
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
4447
4635
|
if (cacheData) {
|
|
4448
4636
|
return [2 /*return*/, cacheData];
|
|
4449
4637
|
}
|
|
4450
|
-
req = api.GET("file/" + fileId + "/details", exports.Api.PrepReqParams());
|
|
4638
|
+
req = api.GET("file/" + fileId + "/details", exports.Api.PrepReqParams(reqParams));
|
|
4451
4639
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
4452
4640
|
return [2 /*return*/, req];
|
|
4453
4641
|
});
|
|
4454
4642
|
});
|
|
4455
4643
|
}
|
|
4456
4644
|
ClientFile.Get = Get;
|
|
4457
|
-
function Delete(api, fileIds) {
|
|
4645
|
+
function Delete(api, fileIds, reqParams) {
|
|
4458
4646
|
return __awaiter(this, void 0, void 0, function () {
|
|
4459
4647
|
var data, i, key;
|
|
4460
4648
|
return __generator(this, function (_a) {
|
|
@@ -4466,7 +4654,7 @@
|
|
|
4466
4654
|
data = {
|
|
4467
4655
|
Items: fileIds
|
|
4468
4656
|
};
|
|
4469
|
-
return [4 /*yield*/, api.POST("deleteFiles", data, exports.Api.PrepReqParams())];
|
|
4657
|
+
return [4 /*yield*/, api.POST("deleteFiles", data, exports.Api.PrepReqParams(reqParams))];
|
|
4470
4658
|
case 1:
|
|
4471
4659
|
_a.sent();
|
|
4472
4660
|
for (i = 0; i < fileIds.length; i++) {
|
|
@@ -4479,7 +4667,7 @@
|
|
|
4479
4667
|
});
|
|
4480
4668
|
}
|
|
4481
4669
|
ClientFile.Delete = Delete;
|
|
4482
|
-
function Upload(api, file, purpose,
|
|
4670
|
+
function Upload(api, file, purpose, reqParams) {
|
|
4483
4671
|
return __awaiter(this, void 0, void 0, function () {
|
|
4484
4672
|
var formData, params;
|
|
4485
4673
|
return __generator(this, function (_a) {
|
|
@@ -4492,8 +4680,7 @@
|
|
|
4492
4680
|
"Purpose": purpose
|
|
4493
4681
|
};
|
|
4494
4682
|
}
|
|
4495
|
-
params = exports.Api.PrepReqParams();
|
|
4496
|
-
params.onProgress = onProgress;
|
|
4683
|
+
params = exports.Api.PrepReqParams(reqParams);
|
|
4497
4684
|
params.formData = formData;
|
|
4498
4685
|
return [2 /*return*/, api.UPLOAD("file/uploadNew", file, params)];
|
|
4499
4686
|
});
|
|
@@ -4524,12 +4711,12 @@
|
|
|
4524
4711
|
ERowOperator["AND"] = "AND";
|
|
4525
4712
|
ERowOperator["OR"] = "OR";
|
|
4526
4713
|
})(ERowOperator = V1.ERowOperator || (V1.ERowOperator = {}));
|
|
4527
|
-
function GetList(api, filter) {
|
|
4714
|
+
function GetList(api, filter, reqParams) {
|
|
4528
4715
|
return __awaiter(this, void 0, void 0, function () {
|
|
4529
4716
|
var data;
|
|
4530
4717
|
return __generator(this, function (_a) {
|
|
4531
4718
|
switch (_a.label) {
|
|
4532
|
-
case 0: return [4 /*yield*/, api.POST("files/filtered", filter, exports.Api.PrepReqParams())];
|
|
4719
|
+
case 0: return [4 /*yield*/, api.POST("files/filtered", filter, exports.Api.PrepReqParams(reqParams))];
|
|
4533
4720
|
case 1:
|
|
4534
4721
|
data = _a.sent();
|
|
4535
4722
|
return [2 /*return*/, data.Items];
|
|
@@ -4548,7 +4735,7 @@
|
|
|
4548
4735
|
EConvertExt["GLB"] = ".glb";
|
|
4549
4736
|
EConvertExt["SKP"] = ".skp";
|
|
4550
4737
|
})(EConvertExt = Processor.EConvertExt || (Processor.EConvertExt = {}));
|
|
4551
|
-
function ConvertFormat(api, clientFileId, ext) {
|
|
4738
|
+
function ConvertFormat(api, clientFileId, ext, reqParams) {
|
|
4552
4739
|
return __awaiter(this, void 0, void 0, function () {
|
|
4553
4740
|
return __generator(this, function (_a) {
|
|
4554
4741
|
if (!clientFileId || !ext) {
|
|
@@ -4558,7 +4745,7 @@
|
|
|
4558
4745
|
clientFileId: clientFileId,
|
|
4559
4746
|
destinationFormat: ext,
|
|
4560
4747
|
operations: []
|
|
4561
|
-
})];
|
|
4748
|
+
}, reqParams)];
|
|
4562
4749
|
});
|
|
4563
4750
|
});
|
|
4564
4751
|
}
|
|
@@ -4581,7 +4768,7 @@
|
|
|
4581
4768
|
EProgramId["BingMaps"] = "BingMaps";
|
|
4582
4769
|
EProgramId["Mapbox"] = "Mapbox";
|
|
4583
4770
|
})(EProgramId = ProgramKey.EProgramId || (ProgramKey.EProgramId = {}));
|
|
4584
|
-
function Get(api, programId) {
|
|
4771
|
+
function Get(api, programId, reqParams) {
|
|
4585
4772
|
return __awaiter(this, void 0, void 0, function () {
|
|
4586
4773
|
var key, cacheData, req;
|
|
4587
4774
|
return __generator(this, function (_a) {
|
|
@@ -4589,23 +4776,23 @@
|
|
|
4589
4776
|
throw ("Program ID is required.");
|
|
4590
4777
|
}
|
|
4591
4778
|
key = GetCacheKey(programId);
|
|
4592
|
-
cacheData = api.Cache.Get(key);
|
|
4779
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
4593
4780
|
if (cacheData) {
|
|
4594
4781
|
return [2 /*return*/, cacheData];
|
|
4595
4782
|
}
|
|
4596
|
-
req = api.GET("programkey/" + programId, exports.Api.PrepReqParams());
|
|
4783
|
+
req = api.GET("programkey/" + programId, exports.Api.PrepReqParams(reqParams));
|
|
4597
4784
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
4598
4785
|
return [2 /*return*/, req];
|
|
4599
4786
|
});
|
|
4600
4787
|
});
|
|
4601
4788
|
}
|
|
4602
4789
|
ProgramKey.Get = Get;
|
|
4603
|
-
function GetList(api) {
|
|
4790
|
+
function GetList(api, reqParams) {
|
|
4604
4791
|
return __awaiter(this, void 0, void 0, function () {
|
|
4605
4792
|
var cacheData, req;
|
|
4606
4793
|
var _this = this;
|
|
4607
4794
|
return __generator(this, function (_a) {
|
|
4608
|
-
cacheData = api.Cache.Get(GetListCacheKey());
|
|
4795
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey());
|
|
4609
4796
|
if (cacheData) {
|
|
4610
4797
|
return [2 /*return*/, cacheData];
|
|
4611
4798
|
}
|
|
@@ -4615,7 +4802,7 @@
|
|
|
4615
4802
|
switch (_a.label) {
|
|
4616
4803
|
case 0:
|
|
4617
4804
|
_a.trys.push([0, 2, , 3]);
|
|
4618
|
-
return [4 /*yield*/, api.GET("programkeys", exports.Api.PrepReqParams())];
|
|
4805
|
+
return [4 /*yield*/, api.GET("programkeys", exports.Api.PrepReqParams(reqParams))];
|
|
4619
4806
|
case 1:
|
|
4620
4807
|
data = _a.sent();
|
|
4621
4808
|
res(data.Items);
|
|
@@ -4634,7 +4821,7 @@
|
|
|
4634
4821
|
});
|
|
4635
4822
|
}
|
|
4636
4823
|
ProgramKey.GetList = GetList;
|
|
4637
|
-
function Delete(api, programId) {
|
|
4824
|
+
function Delete(api, programId, reqParams) {
|
|
4638
4825
|
return __awaiter(this, void 0, void 0, function () {
|
|
4639
4826
|
return __generator(this, function (_a) {
|
|
4640
4827
|
switch (_a.label) {
|
|
@@ -4642,7 +4829,7 @@
|
|
|
4642
4829
|
if (!programId) {
|
|
4643
4830
|
throw ("Program ID is required.");
|
|
4644
4831
|
}
|
|
4645
|
-
return [4 /*yield*/, api.DELETE("programkey/" + programId, exports.Api.PrepReqParams())];
|
|
4832
|
+
return [4 /*yield*/, api.DELETE("programkey/" + programId, exports.Api.PrepReqParams(reqParams))];
|
|
4646
4833
|
case 1:
|
|
4647
4834
|
_a.sent();
|
|
4648
4835
|
api.Cache.Remove(GetCacheKey(programId));
|
|
@@ -4653,7 +4840,7 @@
|
|
|
4653
4840
|
});
|
|
4654
4841
|
}
|
|
4655
4842
|
ProgramKey.Delete = Delete;
|
|
4656
|
-
function Update(api, data) {
|
|
4843
|
+
function Update(api, data, reqParams) {
|
|
4657
4844
|
return __awaiter(this, void 0, void 0, function () {
|
|
4658
4845
|
return __generator(this, function (_a) {
|
|
4659
4846
|
switch (_a.label) {
|
|
@@ -4661,7 +4848,7 @@
|
|
|
4661
4848
|
if (!(data === null || data === void 0 ? void 0 : data.ProgramId)) {
|
|
4662
4849
|
throw ("Program ID is required.");
|
|
4663
4850
|
}
|
|
4664
|
-
return [4 /*yield*/, api.POST("programkey", data, exports.Api.PrepReqParams())];
|
|
4851
|
+
return [4 /*yield*/, api.POST("programkey", data, exports.Api.PrepReqParams(reqParams))];
|
|
4665
4852
|
case 1:
|
|
4666
4853
|
data = _a.sent();
|
|
4667
4854
|
api.Cache.Remove(GetCacheKey(data.ProgramId));
|
|
@@ -4715,7 +4902,7 @@
|
|
|
4715
4902
|
EPivot["Weight"] = "weight";
|
|
4716
4903
|
EPivot["UCS"] = "ucs";
|
|
4717
4904
|
})(EPivot = Tileset.EPivot || (Tileset.EPivot = {}));
|
|
4718
|
-
function Get(api, tilesetId, loadFiles) {
|
|
4905
|
+
function Get(api, tilesetId, loadFiles, reqParams) {
|
|
4719
4906
|
if (loadFiles === void 0) { loadFiles = false; }
|
|
4720
4907
|
return __awaiter(this, void 0, void 0, function () {
|
|
4721
4908
|
var cacheData, req;
|
|
@@ -4723,23 +4910,23 @@
|
|
|
4723
4910
|
if (!tilesetId) {
|
|
4724
4911
|
throw ("Tileset ID is required.");
|
|
4725
4912
|
}
|
|
4726
|
-
cacheData = api.Cache.Get(GetCacheKey(tilesetId, loadFiles));
|
|
4913
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(tilesetId, loadFiles));
|
|
4727
4914
|
if (cacheData) {
|
|
4728
4915
|
return [2 /*return*/, cacheData];
|
|
4729
4916
|
}
|
|
4730
|
-
req = api.GET("tileset/get/" + tilesetId + "?noFiles=" + (loadFiles ? 0 : 1));
|
|
4917
|
+
req = api.GET("tileset/get/" + tilesetId + "?noFiles=" + (loadFiles ? 0 : 1), reqParams);
|
|
4731
4918
|
api.Cache.Set(GetCacheKey(tilesetId, loadFiles), req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
4732
4919
|
return [2 /*return*/, req];
|
|
4733
4920
|
});
|
|
4734
4921
|
});
|
|
4735
4922
|
}
|
|
4736
4923
|
Tileset.Get = Get;
|
|
4737
|
-
function GetList(api) {
|
|
4924
|
+
function GetList(api, reqParams) {
|
|
4738
4925
|
return __awaiter(this, void 0, void 0, function () {
|
|
4739
4926
|
var cacheData, req;
|
|
4740
4927
|
var _this = this;
|
|
4741
4928
|
return __generator(this, function (_a) {
|
|
4742
|
-
cacheData = api.Cache.Get(GetListCacheKey());
|
|
4929
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey());
|
|
4743
4930
|
if (cacheData) {
|
|
4744
4931
|
return [2 /*return*/, cacheData];
|
|
4745
4932
|
}
|
|
@@ -4749,7 +4936,7 @@
|
|
|
4749
4936
|
switch (_a.label) {
|
|
4750
4937
|
case 0:
|
|
4751
4938
|
_a.trys.push([0, 2, , 3]);
|
|
4752
|
-
return [4 /*yield*/, api.GET("tileset/getList")];
|
|
4939
|
+
return [4 /*yield*/, api.GET("tileset/getList", reqParams)];
|
|
4753
4940
|
case 1:
|
|
4754
4941
|
data = _a.sent();
|
|
4755
4942
|
res(data);
|
|
@@ -4768,7 +4955,7 @@
|
|
|
4768
4955
|
});
|
|
4769
4956
|
}
|
|
4770
4957
|
Tileset.GetList = GetList;
|
|
4771
|
-
function Delete(api, tilesetId) {
|
|
4958
|
+
function Delete(api, tilesetId, reqParams) {
|
|
4772
4959
|
return __awaiter(this, void 0, void 0, function () {
|
|
4773
4960
|
return __generator(this, function (_a) {
|
|
4774
4961
|
switch (_a.label) {
|
|
@@ -4776,7 +4963,7 @@
|
|
|
4776
4963
|
if (!tilesetId) {
|
|
4777
4964
|
throw ("Tileset ID is required.");
|
|
4778
4965
|
}
|
|
4779
|
-
return [4 /*yield*/, api.DELETE("tileset/delete/" + tilesetId)];
|
|
4966
|
+
return [4 /*yield*/, api.DELETE("tileset/delete/" + tilesetId, reqParams)];
|
|
4780
4967
|
case 1:
|
|
4781
4968
|
_a.sent();
|
|
4782
4969
|
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Tileset + exports.Api.ECacheKey.Id + tilesetId);
|
|
@@ -4787,7 +4974,7 @@
|
|
|
4787
4974
|
});
|
|
4788
4975
|
}
|
|
4789
4976
|
Tileset.Delete = Delete;
|
|
4790
|
-
function Update(api, data) {
|
|
4977
|
+
function Update(api, data, reqParams) {
|
|
4791
4978
|
return __awaiter(this, void 0, void 0, function () {
|
|
4792
4979
|
var isNew, res;
|
|
4793
4980
|
return __generator(this, function (_a) {
|
|
@@ -4798,12 +4985,12 @@
|
|
|
4798
4985
|
}
|
|
4799
4986
|
isNew = !data.id;
|
|
4800
4987
|
if (!isNew) return [3 /*break*/, 2];
|
|
4801
|
-
return [4 /*yield*/, api.GET("tileset/new?type=" + data.type + "&name=" + exports.Api.Encode(data.name))];
|
|
4988
|
+
return [4 /*yield*/, api.GET("tileset/new?type=" + data.type + "&name=" + exports.Api.Encode(data.name), reqParams)];
|
|
4802
4989
|
case 1:
|
|
4803
4990
|
res = _a.sent();
|
|
4804
4991
|
data = __assign(__assign(__assign({}, res), data), { settings: __assign(__assign({}, res.settings), data.settings), id: res.id });
|
|
4805
4992
|
_a.label = 2;
|
|
4806
|
-
case 2: return [4 /*yield*/, api.POST("tileset/update/" + data.id, data, exports.Api.PrepReqParams())];
|
|
4993
|
+
case 2: return [4 /*yield*/, api.POST("tileset/update/" + data.id, data, exports.Api.PrepReqParams(reqParams))];
|
|
4807
4994
|
case 3:
|
|
4808
4995
|
_a.sent();
|
|
4809
4996
|
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Tileset + exports.Api.ECacheKey.Id + data.id);
|
|
@@ -4814,21 +5001,20 @@
|
|
|
4814
5001
|
});
|
|
4815
5002
|
}
|
|
4816
5003
|
Tileset.Update = Update;
|
|
4817
|
-
function UploadFile(api, tilesetId, file,
|
|
5004
|
+
function UploadFile(api, tilesetId, file, reqParams) {
|
|
4818
5005
|
return __awaiter(this, void 0, void 0, function () {
|
|
4819
5006
|
var params;
|
|
4820
5007
|
return __generator(this, function (_a) {
|
|
4821
5008
|
if (!tilesetId || !file) {
|
|
4822
5009
|
throw ("Tileset ID and file are required.");
|
|
4823
5010
|
}
|
|
4824
|
-
params = exports.Api.PrepReqParams();
|
|
4825
|
-
params.onProgress = onProgress;
|
|
5011
|
+
params = exports.Api.PrepReqParams(reqParams);
|
|
4826
5012
|
return [2 /*return*/, api.UPLOAD("tileset/uploadFile/" + tilesetId + "/files", file, params)];
|
|
4827
5013
|
});
|
|
4828
5014
|
});
|
|
4829
5015
|
}
|
|
4830
5016
|
Tileset.UploadFile = UploadFile;
|
|
4831
|
-
function DeleteFile(api, tilesetId, file) {
|
|
5017
|
+
function DeleteFile(api, tilesetId, file, reqParams) {
|
|
4832
5018
|
return __awaiter(this, void 0, void 0, function () {
|
|
4833
5019
|
return __generator(this, function (_a) {
|
|
4834
5020
|
switch (_a.label) {
|
|
@@ -4836,7 +5022,7 @@
|
|
|
4836
5022
|
if (!tilesetId || !file) {
|
|
4837
5023
|
throw ("Tileset ID and file are required.");
|
|
4838
5024
|
}
|
|
4839
|
-
return [4 /*yield*/, api.DELETE("tileset/deleteFile/" + tilesetId + "/files/" + file)];
|
|
5025
|
+
return [4 /*yield*/, api.DELETE("tileset/deleteFile/" + tilesetId + "/files/" + file, reqParams)];
|
|
4840
5026
|
case 1:
|
|
4841
5027
|
_a.sent();
|
|
4842
5028
|
api.Cache.Remove(GetCacheKey(tilesetId, true));
|
|
@@ -4846,7 +5032,7 @@
|
|
|
4846
5032
|
});
|
|
4847
5033
|
}
|
|
4848
5034
|
Tileset.DeleteFile = DeleteFile;
|
|
4849
|
-
function UploadSrcFile(api, tilesetId, file,
|
|
5035
|
+
function UploadSrcFile(api, tilesetId, file, reqParams) {
|
|
4850
5036
|
return __awaiter(this, void 0, void 0, function () {
|
|
4851
5037
|
var params;
|
|
4852
5038
|
return __generator(this, function (_a) {
|
|
@@ -4855,8 +5041,7 @@
|
|
|
4855
5041
|
if (!tilesetId || !file) {
|
|
4856
5042
|
throw ("Tileset ID and file are required.");
|
|
4857
5043
|
}
|
|
4858
|
-
params = exports.Api.PrepReqParams();
|
|
4859
|
-
params.onProgress = onProgress;
|
|
5044
|
+
params = exports.Api.PrepReqParams(reqParams);
|
|
4860
5045
|
return [4 /*yield*/, api.UPLOAD("tileset/uploadFile/" + tilesetId + "/src", file, params)];
|
|
4861
5046
|
case 1:
|
|
4862
5047
|
_a.sent();
|
|
@@ -4867,7 +5052,7 @@
|
|
|
4867
5052
|
});
|
|
4868
5053
|
}
|
|
4869
5054
|
Tileset.UploadSrcFile = UploadSrcFile;
|
|
4870
|
-
function DeleteSrcFile(api, tilesetId, file) {
|
|
5055
|
+
function DeleteSrcFile(api, tilesetId, file, reqParams) {
|
|
4871
5056
|
return __awaiter(this, void 0, void 0, function () {
|
|
4872
5057
|
return __generator(this, function (_a) {
|
|
4873
5058
|
switch (_a.label) {
|
|
@@ -4875,7 +5060,7 @@
|
|
|
4875
5060
|
if (!tilesetId || !file) {
|
|
4876
5061
|
throw ("Tileset ID and file are required.");
|
|
4877
5062
|
}
|
|
4878
|
-
return [4 /*yield*/, api.DELETE("tileset/deleteFile/" + tilesetId + "/src/" + file)];
|
|
5063
|
+
return [4 /*yield*/, api.DELETE("tileset/deleteFile/" + tilesetId + "/src/" + file, reqParams)];
|
|
4879
5064
|
case 1:
|
|
4880
5065
|
_a.sent();
|
|
4881
5066
|
api.Cache.Remove(GetCacheKey(tilesetId, true));
|
|
@@ -4915,7 +5100,7 @@
|
|
|
4915
5100
|
return api.GetBaseUrl() + ("tileset/file/" + tilesetId + "/" + file);
|
|
4916
5101
|
}
|
|
4917
5102
|
Tileset.GetPublicFileUrl = GetPublicFileUrl;
|
|
4918
|
-
function Generate(api, tilesetId) {
|
|
5103
|
+
function Generate(api, tilesetId, reqParams) {
|
|
4919
5104
|
return __awaiter(this, void 0, void 0, function () {
|
|
4920
5105
|
var res;
|
|
4921
5106
|
return __generator(this, function (_a) {
|
|
@@ -4924,7 +5109,7 @@
|
|
|
4924
5109
|
if (!tilesetId) {
|
|
4925
5110
|
throw ("Tileset ID is required.");
|
|
4926
5111
|
}
|
|
4927
|
-
return [4 /*yield*/, api.GET("tileset/generate/" + tilesetId, exports.Api.PrepReqParams())];
|
|
5112
|
+
return [4 /*yield*/, api.GET("tileset/generate/" + tilesetId, exports.Api.PrepReqParams(reqParams))];
|
|
4928
5113
|
case 1:
|
|
4929
5114
|
res = _a.sent();
|
|
4930
5115
|
return [2 /*return*/, res.ID];
|
|
@@ -4942,7 +5127,7 @@
|
|
|
4942
5127
|
return exports.Api.ECacheKey.PublishTileset + exports.Api.ECacheKey.Id + accountId + exports.Api.ECacheKey.Id + tilesetId;
|
|
4943
5128
|
}
|
|
4944
5129
|
Publish.GetCacheKey = GetCacheKey;
|
|
4945
|
-
function Update(api, data) {
|
|
5130
|
+
function Update(api, data, reqParams) {
|
|
4946
5131
|
return __awaiter(this, void 0, void 0, function () {
|
|
4947
5132
|
var res, req;
|
|
4948
5133
|
return __generator(this, function (_a) {
|
|
@@ -4954,14 +5139,14 @@
|
|
|
4954
5139
|
if (!data.ID) {
|
|
4955
5140
|
data.ID = 0;
|
|
4956
5141
|
}
|
|
4957
|
-
return [4 /*yield*/, api.POST("tileset/" + data.ID, data)];
|
|
5142
|
+
return [4 /*yield*/, api.POST("tileset/" + data.ID, data, reqParams)];
|
|
4958
5143
|
case 1:
|
|
4959
5144
|
res = _a.sent();
|
|
4960
5145
|
req = {
|
|
4961
5146
|
"ClientAccount.ID": data["EnabledFor.ClientAccount.ID"]
|
|
4962
5147
|
};
|
|
4963
5148
|
data.ID = res.ID;
|
|
4964
|
-
return [4 /*yield*/, api.POST("tileset/" + data.ID + "/enableForAccounts", req)];
|
|
5149
|
+
return [4 /*yield*/, api.POST("tileset/" + data.ID + "/enableForAccounts", req, reqParams)];
|
|
4965
5150
|
case 2:
|
|
4966
5151
|
_a.sent();
|
|
4967
5152
|
api.Cache.Remove(GetCacheKey(data["PublishedBy.ClientAccount.ID"], data["Tileset.ID"]));
|
|
@@ -4972,25 +5157,25 @@
|
|
|
4972
5157
|
});
|
|
4973
5158
|
}
|
|
4974
5159
|
Publish.Update = Update;
|
|
4975
|
-
function Get(api, accountId, tilesetId) {
|
|
5160
|
+
function Get(api, accountId, tilesetId, reqParams) {
|
|
4976
5161
|
return __awaiter(this, void 0, void 0, function () {
|
|
4977
5162
|
var cacheData, req;
|
|
4978
5163
|
return __generator(this, function (_a) {
|
|
4979
5164
|
if (!accountId || !tilesetId) {
|
|
4980
5165
|
throw ("Client account ID and tileset ID are required.");
|
|
4981
5166
|
}
|
|
4982
|
-
cacheData = api.Cache.Get(GetCacheKey(accountId, tilesetId));
|
|
5167
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(accountId, tilesetId));
|
|
4983
5168
|
if (cacheData) {
|
|
4984
5169
|
return [2 /*return*/, cacheData];
|
|
4985
5170
|
}
|
|
4986
|
-
req = api.GET("tilesetByPublisher/" + accountId + "/" + tilesetId);
|
|
5171
|
+
req = api.GET("tilesetByPublisher/" + accountId + "/" + tilesetId, reqParams);
|
|
4987
5172
|
api.Cache.Set(GetCacheKey(accountId, tilesetId), req);
|
|
4988
5173
|
return [2 /*return*/, req];
|
|
4989
5174
|
});
|
|
4990
5175
|
});
|
|
4991
5176
|
}
|
|
4992
5177
|
Publish.Get = Get;
|
|
4993
|
-
function GetList(api, accountId) {
|
|
5178
|
+
function GetList(api, accountId, reqParams) {
|
|
4994
5179
|
return __awaiter(this, void 0, void 0, function () {
|
|
4995
5180
|
var cacheData, req;
|
|
4996
5181
|
var _this = this;
|
|
@@ -4998,7 +5183,7 @@
|
|
|
4998
5183
|
if (!accountId) {
|
|
4999
5184
|
throw ("Client account ID is required.");
|
|
5000
5185
|
}
|
|
5001
|
-
cacheData = api.Cache.Get(GetCacheKey(accountId));
|
|
5186
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(accountId));
|
|
5002
5187
|
if (cacheData) {
|
|
5003
5188
|
return [2 /*return*/, cacheData];
|
|
5004
5189
|
}
|
|
@@ -5008,7 +5193,7 @@
|
|
|
5008
5193
|
switch (_a.label) {
|
|
5009
5194
|
case 0:
|
|
5010
5195
|
_a.trys.push([0, 2, , 3]);
|
|
5011
|
-
return [4 /*yield*/, api.GET("tilesets/enabledForAccount/" + accountId)];
|
|
5196
|
+
return [4 /*yield*/, api.GET("tilesets/enabledForAccount/" + accountId, reqParams)];
|
|
5012
5197
|
case 1:
|
|
5013
5198
|
data = _a.sent();
|
|
5014
5199
|
res(data.Items);
|
|
@@ -5154,7 +5339,7 @@
|
|
|
5154
5339
|
(function (V2) {
|
|
5155
5340
|
V2.DATA_VERSION = 2;
|
|
5156
5341
|
})(V2 = ProjectViewBookmark.V2 || (ProjectViewBookmark.V2 = {}));
|
|
5157
|
-
function Get(api, viewId, bookmarkId) {
|
|
5342
|
+
function Get(api, viewId, bookmarkId, reqParams) {
|
|
5158
5343
|
return __awaiter(this, void 0, void 0, function () {
|
|
5159
5344
|
var key, cacheData, req;
|
|
5160
5345
|
return __generator(this, function (_a) {
|
|
@@ -5162,18 +5347,18 @@
|
|
|
5162
5347
|
throw ("View ID and Bookmark ID are required.");
|
|
5163
5348
|
}
|
|
5164
5349
|
key = GetCacheKey(viewId, bookmarkId);
|
|
5165
|
-
cacheData = api.Cache.Get(key);
|
|
5350
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
5166
5351
|
if (cacheData) {
|
|
5167
5352
|
return [2 /*return*/, cacheData];
|
|
5168
5353
|
}
|
|
5169
|
-
req = api.GET("ui.view/" + viewId + "/slide/" + bookmarkId, exports.Api.PrepReqParams());
|
|
5354
|
+
req = api.GET("ui.view/" + viewId + "/slide/" + bookmarkId, exports.Api.PrepReqParams(reqParams));
|
|
5170
5355
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
5171
5356
|
return [2 /*return*/, req];
|
|
5172
5357
|
});
|
|
5173
5358
|
});
|
|
5174
5359
|
}
|
|
5175
5360
|
ProjectViewBookmark.Get = Get;
|
|
5176
|
-
function Delete(api, viewId, bookmarkId) {
|
|
5361
|
+
function Delete(api, viewId, bookmarkId, reqParams) {
|
|
5177
5362
|
return __awaiter(this, void 0, void 0, function () {
|
|
5178
5363
|
return __generator(this, function (_a) {
|
|
5179
5364
|
switch (_a.label) {
|
|
@@ -5181,7 +5366,7 @@
|
|
|
5181
5366
|
if (!viewId || !bookmarkId) {
|
|
5182
5367
|
throw ("View ID and Bookmark ID are required.");
|
|
5183
5368
|
}
|
|
5184
|
-
return [4 /*yield*/, api.DELETE("ui.view/" + viewId + "/slide/" + bookmarkId, exports.Api.PrepReqParams())];
|
|
5369
|
+
return [4 /*yield*/, api.DELETE("ui.view/" + viewId + "/slide/" + bookmarkId, exports.Api.PrepReqParams(reqParams))];
|
|
5185
5370
|
case 1:
|
|
5186
5371
|
_a.sent();
|
|
5187
5372
|
api.Cache.Remove(GetCacheKey(viewId, bookmarkId));
|
|
@@ -5192,7 +5377,7 @@
|
|
|
5192
5377
|
});
|
|
5193
5378
|
}
|
|
5194
5379
|
ProjectViewBookmark.Delete = Delete;
|
|
5195
|
-
function GetList(api, viewId) {
|
|
5380
|
+
function GetList(api, viewId, reqParams) {
|
|
5196
5381
|
return __awaiter(this, void 0, void 0, function () {
|
|
5197
5382
|
var cacheData, req;
|
|
5198
5383
|
var _this = this;
|
|
@@ -5200,7 +5385,7 @@
|
|
|
5200
5385
|
if (!viewId) {
|
|
5201
5386
|
throw ("View ID is required.");
|
|
5202
5387
|
}
|
|
5203
|
-
cacheData = api.Cache.Get(GetListCacheKey(viewId));
|
|
5388
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(viewId));
|
|
5204
5389
|
if (cacheData) {
|
|
5205
5390
|
return [2 /*return*/, cacheData];
|
|
5206
5391
|
}
|
|
@@ -5210,7 +5395,7 @@
|
|
|
5210
5395
|
switch (_a.label) {
|
|
5211
5396
|
case 0:
|
|
5212
5397
|
_a.trys.push([0, 2, , 3]);
|
|
5213
|
-
return [4 /*yield*/, api.GET("ui.view/" + viewId + "/slides", exports.Api.PrepReqParams())];
|
|
5398
|
+
return [4 /*yield*/, api.GET("ui.view/" + viewId + "/slides", exports.Api.PrepReqParams(reqParams))];
|
|
5214
5399
|
case 1:
|
|
5215
5400
|
data = _a.sent();
|
|
5216
5401
|
res(data.Items);
|
|
@@ -5229,7 +5414,7 @@
|
|
|
5229
5414
|
});
|
|
5230
5415
|
}
|
|
5231
5416
|
ProjectViewBookmark.GetList = GetList;
|
|
5232
|
-
function Update(api, viewId, data) {
|
|
5417
|
+
function Update(api, viewId, data, reqParams) {
|
|
5233
5418
|
return __awaiter(this, void 0, void 0, function () {
|
|
5234
5419
|
return __generator(this, function (_a) {
|
|
5235
5420
|
switch (_a.label) {
|
|
@@ -5237,7 +5422,7 @@
|
|
|
5237
5422
|
if (!(data === null || data === void 0 ? void 0 : data.Title)) {
|
|
5238
5423
|
data.Title = data.ID;
|
|
5239
5424
|
}
|
|
5240
|
-
return [4 /*yield*/, api.POST("ui.view/" + viewId + "/slide/" + (data.ID ? data.ID : ""), data, exports.Api.PrepReqParams())];
|
|
5425
|
+
return [4 /*yield*/, api.POST("ui.view/" + viewId + "/slide/" + (data.ID ? data.ID : ""), data, exports.Api.PrepReqParams(reqParams))];
|
|
5241
5426
|
case 1:
|
|
5242
5427
|
data = _a.sent();
|
|
5243
5428
|
api.Cache.Remove(GetCacheKey(viewId, data.ID));
|
|
@@ -5248,7 +5433,7 @@
|
|
|
5248
5433
|
});
|
|
5249
5434
|
}
|
|
5250
5435
|
ProjectViewBookmark.Update = Update;
|
|
5251
|
-
function SetOrder(api, viewId, bookmarkIds) {
|
|
5436
|
+
function SetOrder(api, viewId, bookmarkIds, reqParams) {
|
|
5252
5437
|
return __awaiter(this, void 0, void 0, function () {
|
|
5253
5438
|
var reqData;
|
|
5254
5439
|
return __generator(this, function (_a) {
|
|
@@ -5258,7 +5443,7 @@
|
|
|
5258
5443
|
"UISlide.ID": bookmarkIds,
|
|
5259
5444
|
"DisplayOrder.Start": 0
|
|
5260
5445
|
};
|
|
5261
|
-
return [4 /*yield*/, api.POST("ui.view/" + viewId + "/slides/setOrder", reqData, exports.Api.PrepReqParams())];
|
|
5446
|
+
return [4 /*yield*/, api.POST("ui.view/" + viewId + "/slides/setOrder", reqData, exports.Api.PrepReqParams(reqParams))];
|
|
5262
5447
|
case 1:
|
|
5263
5448
|
_a.sent();
|
|
5264
5449
|
api.Cache.RemoveByStartsWith(GetListCacheKey(viewId));
|
|
@@ -5290,7 +5475,7 @@
|
|
|
5290
5475
|
(function (V2) {
|
|
5291
5476
|
V2.DATA_VERSION = 2;
|
|
5292
5477
|
})(V2 = ProjectView.V2 || (ProjectView.V2 = {}));
|
|
5293
|
-
function Get(api, viewId) {
|
|
5478
|
+
function Get(api, viewId, reqParams) {
|
|
5294
5479
|
return __awaiter(this, void 0, void 0, function () {
|
|
5295
5480
|
var key, cacheData, req;
|
|
5296
5481
|
return __generator(this, function (_a) {
|
|
@@ -5298,23 +5483,23 @@
|
|
|
5298
5483
|
throw ("View ID is required.");
|
|
5299
5484
|
}
|
|
5300
5485
|
key = GetCacheKey(viewId);
|
|
5301
|
-
cacheData = api.Cache.Get(key);
|
|
5486
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
5302
5487
|
if (cacheData) {
|
|
5303
5488
|
return [2 /*return*/, cacheData];
|
|
5304
5489
|
}
|
|
5305
|
-
req = api.GET("ui.view/" + viewId, exports.Api.PrepReqParams());
|
|
5490
|
+
req = api.GET("ui.view/" + viewId, exports.Api.PrepReqParams(reqParams));
|
|
5306
5491
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
5307
5492
|
return [2 /*return*/, req];
|
|
5308
5493
|
});
|
|
5309
5494
|
});
|
|
5310
5495
|
}
|
|
5311
5496
|
ProjectView.Get = Get;
|
|
5312
|
-
function GetList(api) {
|
|
5497
|
+
function GetList(api, reqParams) {
|
|
5313
5498
|
return __awaiter(this, void 0, void 0, function () {
|
|
5314
5499
|
var cacheData, req;
|
|
5315
5500
|
var _this = this;
|
|
5316
5501
|
return __generator(this, function (_a) {
|
|
5317
|
-
cacheData = api.Cache.Get(GetListCacheKey());
|
|
5502
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey());
|
|
5318
5503
|
if (cacheData) {
|
|
5319
5504
|
return [2 /*return*/, cacheData];
|
|
5320
5505
|
}
|
|
@@ -5324,7 +5509,7 @@
|
|
|
5324
5509
|
switch (_a.label) {
|
|
5325
5510
|
case 0:
|
|
5326
5511
|
_a.trys.push([0, 2, , 3]);
|
|
5327
|
-
return [4 /*yield*/, api.GET("ui.view/list", exports.Api.PrepReqParams())];
|
|
5512
|
+
return [4 /*yield*/, api.GET("ui.view/list", exports.Api.PrepReqParams(reqParams))];
|
|
5328
5513
|
case 1:
|
|
5329
5514
|
data = _a.sent();
|
|
5330
5515
|
res(data.Items);
|
|
@@ -5343,7 +5528,7 @@
|
|
|
5343
5528
|
});
|
|
5344
5529
|
}
|
|
5345
5530
|
ProjectView.GetList = GetList;
|
|
5346
|
-
function Delete(api, viewId) {
|
|
5531
|
+
function Delete(api, viewId, reqParams) {
|
|
5347
5532
|
return __awaiter(this, void 0, void 0, function () {
|
|
5348
5533
|
return __generator(this, function (_a) {
|
|
5349
5534
|
switch (_a.label) {
|
|
@@ -5351,7 +5536,7 @@
|
|
|
5351
5536
|
if (!viewId) {
|
|
5352
5537
|
throw ("View ID is required.");
|
|
5353
5538
|
}
|
|
5354
|
-
return [4 /*yield*/, api.DELETE("ui.view/" + viewId, exports.Api.PrepReqParams())];
|
|
5539
|
+
return [4 /*yield*/, api.DELETE("ui.view/" + viewId, exports.Api.PrepReqParams(reqParams))];
|
|
5355
5540
|
case 1:
|
|
5356
5541
|
_a.sent();
|
|
5357
5542
|
api.Cache.Remove(GetCacheKey(viewId));
|
|
@@ -5362,7 +5547,7 @@
|
|
|
5362
5547
|
});
|
|
5363
5548
|
}
|
|
5364
5549
|
ProjectView.Delete = Delete;
|
|
5365
|
-
function Update(api, data) {
|
|
5550
|
+
function Update(api, data, reqParams) {
|
|
5366
5551
|
return __awaiter(this, void 0, void 0, function () {
|
|
5367
5552
|
var isNew;
|
|
5368
5553
|
return __generator(this, function (_a) {
|
|
@@ -5382,11 +5567,11 @@
|
|
|
5382
5567
|
data.CreatedByUIVersion = "-1";
|
|
5383
5568
|
}
|
|
5384
5569
|
if (!isNew) return [3 /*break*/, 2];
|
|
5385
|
-
return [4 /*yield*/, api.POST("ui.view/" + data.ID, data, exports.Api.PrepReqParams())];
|
|
5570
|
+
return [4 /*yield*/, api.POST("ui.view/" + data.ID, data, exports.Api.PrepReqParams(reqParams))];
|
|
5386
5571
|
case 1:
|
|
5387
5572
|
data = _a.sent();
|
|
5388
5573
|
return [3 /*break*/, 4];
|
|
5389
|
-
case 2: return [4 /*yield*/, api.PUT("ui.view/" + data.ID, data, exports.Api.PrepReqParams())];
|
|
5574
|
+
case 2: return [4 /*yield*/, api.PUT("ui.view/" + data.ID, data, exports.Api.PrepReqParams(reqParams))];
|
|
5390
5575
|
case 3:
|
|
5391
5576
|
data = _a.sent();
|
|
5392
5577
|
_a.label = 4;
|
|
@@ -5401,13 +5586,13 @@
|
|
|
5401
5586
|
ProjectView.Update = Update;
|
|
5402
5587
|
})(exports.ProjectView || (exports.ProjectView = {}));
|
|
5403
5588
|
|
|
5404
|
-
function getTemplateSettings(apiGetter) {
|
|
5589
|
+
function getTemplateSettings(apiGetter, reqParams) {
|
|
5405
5590
|
var _a;
|
|
5406
5591
|
return __awaiter(this, void 0, void 0, function () {
|
|
5407
5592
|
var view;
|
|
5408
5593
|
return __generator(this, function (_b) {
|
|
5409
5594
|
switch (_b.label) {
|
|
5410
|
-
case 0: return [4 /*yield*/, exports.ProjectView.Get(apiGetter.getApi(exports.Api.TEMPLATE_ACCOUNT_ID), "default")];
|
|
5595
|
+
case 0: return [4 /*yield*/, exports.ProjectView.Get(apiGetter.getApi(exports.Api.TEMPLATE_ACCOUNT_ID), "default", reqParams)];
|
|
5411
5596
|
case 1:
|
|
5412
5597
|
view = _b.sent();
|
|
5413
5598
|
return [2 /*return*/, (_a = view.Settings) !== null && _a !== void 0 ? _a : {}];
|
|
@@ -5428,13 +5613,13 @@
|
|
|
5428
5613
|
}
|
|
5429
5614
|
}
|
|
5430
5615
|
(function (ProjectViewLegacyTile) {
|
|
5431
|
-
function MergeMapTemplateData(getter, items, addIfMissing) {
|
|
5616
|
+
function MergeMapTemplateData(getter, items, addIfMissing, reqParams) {
|
|
5432
5617
|
var _a;
|
|
5433
5618
|
return __awaiter(this, void 0, void 0, function () {
|
|
5434
5619
|
var settings, maps, i, mapSource;
|
|
5435
5620
|
return __generator(this, function (_b) {
|
|
5436
5621
|
switch (_b.label) {
|
|
5437
|
-
case 0: return [4 /*yield*/, getTemplateSettings(getter)];
|
|
5622
|
+
case 0: return [4 /*yield*/, getTemplateSettings(getter, reqParams)];
|
|
5438
5623
|
case 1:
|
|
5439
5624
|
settings = _b.sent();
|
|
5440
5625
|
maps = (_a = settings.CesiumMapSources) !== null && _a !== void 0 ? _a : [];
|
|
@@ -5448,13 +5633,13 @@
|
|
|
5448
5633
|
});
|
|
5449
5634
|
}
|
|
5450
5635
|
ProjectViewLegacyTile.MergeMapTemplateData = MergeMapTemplateData;
|
|
5451
|
-
function MergeTerrainTemplateData(getter, items, addIfMissing) {
|
|
5636
|
+
function MergeTerrainTemplateData(getter, items, addIfMissing, reqParams) {
|
|
5452
5637
|
var _a;
|
|
5453
5638
|
return __awaiter(this, void 0, void 0, function () {
|
|
5454
5639
|
var settings, terrains, i, terrainSource;
|
|
5455
5640
|
return __generator(this, function (_b) {
|
|
5456
5641
|
switch (_b.label) {
|
|
5457
|
-
case 0: return [4 /*yield*/, getTemplateSettings(getter)];
|
|
5642
|
+
case 0: return [4 /*yield*/, getTemplateSettings(getter, reqParams)];
|
|
5458
5643
|
case 1:
|
|
5459
5644
|
settings = _b.sent();
|
|
5460
5645
|
terrains = (_a = settings.CesiumTerrainSources) !== null && _a !== void 0 ? _a : [];
|
|
@@ -5594,24 +5779,24 @@
|
|
|
5594
5779
|
EStatus["Complete"] = "COMPLETE";
|
|
5595
5780
|
EStatus["Failed"] = "FAILED";
|
|
5596
5781
|
})(EStatus = PendingAction.EStatus || (PendingAction.EStatus = {}));
|
|
5597
|
-
function Get(api, actionId) {
|
|
5782
|
+
function Get(api, actionId, reqParams) {
|
|
5598
5783
|
return __awaiter(this, void 0, void 0, function () {
|
|
5599
5784
|
return __generator(this, function (_a) {
|
|
5600
5785
|
if (!actionId) {
|
|
5601
5786
|
throw ("Action ID is required.");
|
|
5602
5787
|
}
|
|
5603
|
-
return [2 /*return*/, api.GET("pendingAction/" + actionId, exports.Api.PrepReqParams())];
|
|
5788
|
+
return [2 /*return*/, api.GET("pendingAction/" + actionId, exports.Api.PrepReqParams(reqParams))];
|
|
5604
5789
|
});
|
|
5605
5790
|
});
|
|
5606
5791
|
}
|
|
5607
5792
|
PendingAction.Get = Get;
|
|
5608
|
-
function GetRelevantList(api, stricter) {
|
|
5793
|
+
function GetRelevantList(api, stricter, reqParams) {
|
|
5609
5794
|
if (stricter === void 0) { stricter = false; }
|
|
5610
5795
|
return __awaiter(this, void 0, void 0, function () {
|
|
5611
5796
|
var data;
|
|
5612
5797
|
return __generator(this, function (_a) {
|
|
5613
5798
|
switch (_a.label) {
|
|
5614
|
-
case 0: return [4 /*yield*/, api.GET("pendingActions/important?Update=" + stricter, exports.Api.PrepReqParams())];
|
|
5799
|
+
case 0: return [4 /*yield*/, api.GET("pendingActions/important?Update=" + stricter, exports.Api.PrepReqParams(reqParams))];
|
|
5615
5800
|
case 1:
|
|
5616
5801
|
data = _a.sent();
|
|
5617
5802
|
return [2 /*return*/, data.Items];
|
|
@@ -5620,7 +5805,7 @@
|
|
|
5620
5805
|
});
|
|
5621
5806
|
}
|
|
5622
5807
|
PendingAction.GetRelevantList = GetRelevantList;
|
|
5623
|
-
function GetMessages(api, actionId, order, startIndex, amount) {
|
|
5808
|
+
function GetMessages(api, actionId, order, startIndex, amount, reqParams) {
|
|
5624
5809
|
return __awaiter(this, void 0, void 0, function () {
|
|
5625
5810
|
var args, data;
|
|
5626
5811
|
return __generator(this, function (_a) {
|
|
@@ -5636,7 +5821,7 @@
|
|
|
5636
5821
|
order = exports.Api.ESortOrder.Asc;
|
|
5637
5822
|
}
|
|
5638
5823
|
args = "?SortOrder=" + (order == exports.Api.ESortOrder.Desc ? "DESC" : "ASC") + "&PageSize=" + amount + "&PageIndex=" + startIndex;
|
|
5639
|
-
return [4 /*yield*/, api.GET("pendingAction/" + actionId + "/progressMessages" + args, exports.Api.PrepReqParams())];
|
|
5824
|
+
return [4 /*yield*/, api.GET("pendingAction/" + actionId + "/progressMessages" + args, exports.Api.PrepReqParams(reqParams))];
|
|
5640
5825
|
case 1:
|
|
5641
5826
|
data = _a.sent();
|
|
5642
5827
|
return [2 /*return*/, data.Items];
|
|
@@ -5667,9 +5852,9 @@
|
|
|
5667
5852
|
EPointType["Icon"] = "ICON";
|
|
5668
5853
|
EPointType["Cylinder"] = "CYLINDER";
|
|
5669
5854
|
})(EPointType = Style.EPointType || (Style.EPointType = {}));
|
|
5670
|
-
function GetList(api) {
|
|
5855
|
+
function GetList(api, reqParams) {
|
|
5671
5856
|
var _this = this;
|
|
5672
|
-
var cacheData = api.Cache.Get(GetListCacheKey());
|
|
5857
|
+
var cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey());
|
|
5673
5858
|
if (cacheData) {
|
|
5674
5859
|
return cacheData;
|
|
5675
5860
|
}
|
|
@@ -5679,7 +5864,7 @@
|
|
|
5679
5864
|
switch (_a.label) {
|
|
5680
5865
|
case 0:
|
|
5681
5866
|
_a.trys.push([0, 2, , 3]);
|
|
5682
|
-
return [4 /*yield*/, api.GET("ui.entityDisplaySettings", exports.Api.PrepReqParams())];
|
|
5867
|
+
return [4 /*yield*/, api.GET("ui.entityDisplaySettings", exports.Api.PrepReqParams(reqParams))];
|
|
5683
5868
|
case 1:
|
|
5684
5869
|
data = _a.sent();
|
|
5685
5870
|
res(data.Items);
|
|
@@ -5696,20 +5881,20 @@
|
|
|
5696
5881
|
return req;
|
|
5697
5882
|
}
|
|
5698
5883
|
Style.GetList = GetList;
|
|
5699
|
-
function Get(api, id) {
|
|
5884
|
+
function Get(api, id, reqParams) {
|
|
5700
5885
|
if (!id) {
|
|
5701
5886
|
throw ("Style ID is required.");
|
|
5702
5887
|
}
|
|
5703
|
-
var cacheData = api.Cache.Get(GetCacheKey(id));
|
|
5888
|
+
var cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(id));
|
|
5704
5889
|
if (cacheData) {
|
|
5705
5890
|
return cacheData;
|
|
5706
5891
|
}
|
|
5707
|
-
var req = api.GET("ui.entityDisplaySetting/" + id, exports.Api.PrepReqParams());
|
|
5892
|
+
var req = api.GET("ui.entityDisplaySetting/" + id, exports.Api.PrepReqParams(reqParams));
|
|
5708
5893
|
api.Cache.Set(GetCacheKey(id), req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
5709
5894
|
return req;
|
|
5710
5895
|
}
|
|
5711
5896
|
Style.Get = Get;
|
|
5712
|
-
function Update(api, data) {
|
|
5897
|
+
function Update(api, data, reqParams) {
|
|
5713
5898
|
return __awaiter(this, void 0, void 0, function () {
|
|
5714
5899
|
return __generator(this, function (_a) {
|
|
5715
5900
|
switch (_a.label) {
|
|
@@ -5720,7 +5905,7 @@
|
|
|
5720
5905
|
if (!data.ID) {
|
|
5721
5906
|
data.ID = 0;
|
|
5722
5907
|
}
|
|
5723
|
-
return [4 /*yield*/, api.POST("ui.entityDisplaySetting/" + data.ID, data, exports.Api.PrepReqParams())];
|
|
5908
|
+
return [4 /*yield*/, api.POST("ui.entityDisplaySetting/" + data.ID, data, exports.Api.PrepReqParams(reqParams))];
|
|
5724
5909
|
case 1:
|
|
5725
5910
|
data = _a.sent();
|
|
5726
5911
|
api.Cache.Remove(GetCacheKey(data.ID));
|
|
@@ -5731,7 +5916,7 @@
|
|
|
5731
5916
|
});
|
|
5732
5917
|
}
|
|
5733
5918
|
Style.Update = Update;
|
|
5734
|
-
function Delete(api, id) {
|
|
5919
|
+
function Delete(api, id, reqParams) {
|
|
5735
5920
|
return __awaiter(this, void 0, void 0, function () {
|
|
5736
5921
|
return __generator(this, function (_a) {
|
|
5737
5922
|
switch (_a.label) {
|
|
@@ -5739,7 +5924,7 @@
|
|
|
5739
5924
|
if (!id) {
|
|
5740
5925
|
throw ("Style ID is required.");
|
|
5741
5926
|
}
|
|
5742
|
-
return [4 /*yield*/, api.DELETE("ui.entityDisplaySetting/" + id, exports.Api.PrepReqParams())];
|
|
5927
|
+
return [4 /*yield*/, api.DELETE("ui.entityDisplaySetting/" + id, exports.Api.PrepReqParams(reqParams))];
|
|
5743
5928
|
case 1:
|
|
5744
5929
|
_a.sent();
|
|
5745
5930
|
api.Cache.Remove(GetCacheKey(id));
|
|
@@ -5802,7 +5987,7 @@
|
|
|
5802
5987
|
function GetCacheKey(sessionId) {
|
|
5803
5988
|
return "" + exports.Api.ECacheKey.Session + exports.Api.ECacheKey.Id + sessionId;
|
|
5804
5989
|
}
|
|
5805
|
-
function Get(api, sessionId) {
|
|
5990
|
+
function Get(api, sessionId, reqParams) {
|
|
5806
5991
|
return __awaiter(this, void 0, void 0, function () {
|
|
5807
5992
|
var key, cacheData, req;
|
|
5808
5993
|
return __generator(this, function (_a) {
|
|
@@ -5810,18 +5995,18 @@
|
|
|
5810
5995
|
throw ("Session ID is required.");
|
|
5811
5996
|
}
|
|
5812
5997
|
key = GetCacheKey(sessionId);
|
|
5813
|
-
cacheData = api.Cache.Get(key);
|
|
5998
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(key);
|
|
5814
5999
|
if (cacheData) {
|
|
5815
6000
|
return [2 /*return*/, cacheData];
|
|
5816
6001
|
}
|
|
5817
|
-
req = api.GET("session/" + sessionId);
|
|
6002
|
+
req = api.GET("session/" + sessionId, reqParams);
|
|
5818
6003
|
api.Cache.Set(key, req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
5819
6004
|
return [2 /*return*/, req];
|
|
5820
6005
|
});
|
|
5821
6006
|
});
|
|
5822
6007
|
}
|
|
5823
6008
|
Session.Get = Get;
|
|
5824
|
-
function Login(api, username, password, accountId) {
|
|
6009
|
+
function Login(api, username, password, accountId, reqParams) {
|
|
5825
6010
|
return __awaiter(this, void 0, void 0, function () {
|
|
5826
6011
|
var data, session, ssid;
|
|
5827
6012
|
return __generator(this, function (_a) {
|
|
@@ -5834,7 +6019,7 @@
|
|
|
5834
6019
|
account: accountId ? accountId : "",
|
|
5835
6020
|
login: username,
|
|
5836
6021
|
password: password
|
|
5837
|
-
})];
|
|
6022
|
+
}, reqParams)];
|
|
5838
6023
|
case 1:
|
|
5839
6024
|
data = _a.sent();
|
|
5840
6025
|
session = data === null || data === void 0 ? void 0 : data.Session;
|
|
@@ -5847,7 +6032,7 @@
|
|
|
5847
6032
|
});
|
|
5848
6033
|
}
|
|
5849
6034
|
Session.Login = Login;
|
|
5850
|
-
function Logout(api) {
|
|
6035
|
+
function Logout(api, reqParams) {
|
|
5851
6036
|
return __awaiter(this, void 0, void 0, function () {
|
|
5852
6037
|
var ssid;
|
|
5853
6038
|
return __generator(this, function (_a) {
|
|
@@ -5855,7 +6040,7 @@
|
|
|
5855
6040
|
case 0:
|
|
5856
6041
|
ssid = api.GetSessionId();
|
|
5857
6042
|
if (!ssid) return [3 /*break*/, 2];
|
|
5858
|
-
return [4 /*yield*/, api.POST("logout", null)];
|
|
6043
|
+
return [4 /*yield*/, api.POST("logout", null, reqParams)];
|
|
5859
6044
|
case 1:
|
|
5860
6045
|
_a.sent();
|
|
5861
6046
|
api.SetSessionId(null);
|
|
@@ -5913,18 +6098,18 @@
|
|
|
5913
6098
|
})(exports.Session || (exports.Session = {}));
|
|
5914
6099
|
|
|
5915
6100
|
(function (UserGroup) {
|
|
5916
|
-
function GetByName(api, accountId, name) {
|
|
6101
|
+
function GetByName(api, accountId, name, reqParams) {
|
|
5917
6102
|
return __awaiter(this, void 0, void 0, function () {
|
|
5918
6103
|
return __generator(this, function (_a) {
|
|
5919
6104
|
if (!name || !accountId) {
|
|
5920
6105
|
throw ("Name and AccountID are required.");
|
|
5921
6106
|
}
|
|
5922
|
-
return [2 /*return*/, api.GET("account/" + accountId + "/userGroupByName/" + name)];
|
|
6107
|
+
return [2 /*return*/, api.GET("account/" + accountId + "/userGroupByName/" + name, reqParams)];
|
|
5923
6108
|
});
|
|
5924
6109
|
});
|
|
5925
6110
|
}
|
|
5926
6111
|
UserGroup.GetByName = GetByName;
|
|
5927
|
-
function GetUsers(api, accountId, id) {
|
|
6112
|
+
function GetUsers(api, accountId, id, reqParams) {
|
|
5928
6113
|
return __awaiter(this, void 0, void 0, function () {
|
|
5929
6114
|
var data;
|
|
5930
6115
|
return __generator(this, function (_a) {
|
|
@@ -5933,7 +6118,7 @@
|
|
|
5933
6118
|
if (!accountId || !id) {
|
|
5934
6119
|
throw ("AccountID and ID are required.");
|
|
5935
6120
|
}
|
|
5936
|
-
return [4 /*yield*/, api.GET("userGroup/" + accountId + "/" + id + "/users")];
|
|
6121
|
+
return [4 /*yield*/, api.GET("userGroup/" + accountId + "/" + id + "/users", reqParams)];
|
|
5937
6122
|
case 1:
|
|
5938
6123
|
data = _a.sent();
|
|
5939
6124
|
return [2 /*return*/, data.Items];
|
|
@@ -5942,7 +6127,7 @@
|
|
|
5942
6127
|
});
|
|
5943
6128
|
}
|
|
5944
6129
|
UserGroup.GetUsers = GetUsers;
|
|
5945
|
-
function GetListByPerm(api, accountId, perm) {
|
|
6130
|
+
function GetListByPerm(api, accountId, perm, reqParams) {
|
|
5946
6131
|
return __awaiter(this, void 0, void 0, function () {
|
|
5947
6132
|
var data;
|
|
5948
6133
|
return __generator(this, function (_a) {
|
|
@@ -5951,7 +6136,7 @@
|
|
|
5951
6136
|
if (!accountId || !perm) {
|
|
5952
6137
|
throw ("AccountID and Perm are required.");
|
|
5953
6138
|
}
|
|
5954
|
-
return [4 /*yield*/, api.GET("userGroupsByFeature/" + accountId + "/" + perm)];
|
|
6139
|
+
return [4 /*yield*/, api.GET("userGroupsByFeature/" + accountId + "/" + perm, reqParams)];
|
|
5955
6140
|
case 1:
|
|
5956
6141
|
data = _a.sent();
|
|
5957
6142
|
return [2 /*return*/, data.Items];
|
|
@@ -5960,7 +6145,7 @@
|
|
|
5960
6145
|
});
|
|
5961
6146
|
}
|
|
5962
6147
|
UserGroup.GetListByPerm = GetListByPerm;
|
|
5963
|
-
function GetList(api, accountId) {
|
|
6148
|
+
function GetList(api, accountId, reqParams) {
|
|
5964
6149
|
return __awaiter(this, void 0, void 0, function () {
|
|
5965
6150
|
var data;
|
|
5966
6151
|
return __generator(this, function (_a) {
|
|
@@ -5969,7 +6154,7 @@
|
|
|
5969
6154
|
if (!accountId) {
|
|
5970
6155
|
throw ("AccountID is required.");
|
|
5971
6156
|
}
|
|
5972
|
-
return [4 /*yield*/, api.GET("userGroups/" + accountId)];
|
|
6157
|
+
return [4 /*yield*/, api.GET("userGroups/" + accountId, reqParams)];
|
|
5973
6158
|
case 1:
|
|
5974
6159
|
data = _a.sent();
|
|
5975
6160
|
return [2 /*return*/, data.Items];
|
|
@@ -5978,18 +6163,18 @@
|
|
|
5978
6163
|
});
|
|
5979
6164
|
}
|
|
5980
6165
|
UserGroup.GetList = GetList;
|
|
5981
|
-
function Delete(api, accountId, id) {
|
|
6166
|
+
function Delete(api, accountId, id, reqParams) {
|
|
5982
6167
|
return __awaiter(this, void 0, void 0, function () {
|
|
5983
6168
|
return __generator(this, function (_a) {
|
|
5984
6169
|
if (!accountId || !id) {
|
|
5985
6170
|
throw ("AccountID and ID are required.");
|
|
5986
6171
|
}
|
|
5987
|
-
return [2 /*return*/, api.DELETE("account/" + accountId + "/userGroupID/" + id)];
|
|
6172
|
+
return [2 /*return*/, api.DELETE("account/" + accountId + "/userGroupID/" + id, reqParams)];
|
|
5988
6173
|
});
|
|
5989
6174
|
});
|
|
5990
6175
|
}
|
|
5991
6176
|
UserGroup.Delete = Delete;
|
|
5992
|
-
function Update(api, data) {
|
|
6177
|
+
function Update(api, data, reqParams) {
|
|
5993
6178
|
return __awaiter(this, void 0, void 0, function () {
|
|
5994
6179
|
return __generator(this, function (_a) {
|
|
5995
6180
|
switch (_a.label) {
|
|
@@ -5997,7 +6182,7 @@
|
|
|
5997
6182
|
if (!data.Name || !data["ClientAccount.ID"]) {
|
|
5998
6183
|
throw ("User group name and client account ID are required.");
|
|
5999
6184
|
}
|
|
6000
|
-
return [4 /*yield*/, api.POST("userGroup" + (data.ID ? ("/" + data.ID) : ""), data)];
|
|
6185
|
+
return [4 /*yield*/, api.POST("userGroup" + (data.ID ? ("/" + data.ID) : ""), data, reqParams)];
|
|
6001
6186
|
case 1:
|
|
6002
6187
|
data = _a.sent();
|
|
6003
6188
|
return [2 /*return*/, data];
|
|
@@ -6028,7 +6213,7 @@
|
|
|
6028
6213
|
EType["User"] = "LOGIN_USER";
|
|
6029
6214
|
EType["AccessToken"] = "ACCESS_TOKEN";
|
|
6030
6215
|
})(EType = User.EType || (User.EType = {}));
|
|
6031
|
-
function Get(api, id, accountId) {
|
|
6216
|
+
function Get(api, id, accountId, reqParams) {
|
|
6032
6217
|
return __awaiter(this, void 0, void 0, function () {
|
|
6033
6218
|
var cacheData, req;
|
|
6034
6219
|
return __generator(this, function (_a) {
|
|
@@ -6037,11 +6222,11 @@
|
|
|
6037
6222
|
if (!id) {
|
|
6038
6223
|
throw ("ID is required.");
|
|
6039
6224
|
}
|
|
6040
|
-
cacheData = api.Cache.Get(GetCacheKey(id, accountId));
|
|
6225
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(id, accountId));
|
|
6041
6226
|
if (cacheData) {
|
|
6042
6227
|
return [2 /*return*/, cacheData];
|
|
6043
6228
|
}
|
|
6044
|
-
return [4 /*yield*/, api.GET("user/" + id + (accountId ? "?clientAccountID=" + accountId : ""))];
|
|
6229
|
+
return [4 /*yield*/, api.GET("user/" + id + (accountId ? "?clientAccountID=" + accountId : ""), reqParams)];
|
|
6045
6230
|
case 1:
|
|
6046
6231
|
req = _a.sent();
|
|
6047
6232
|
api.Cache.Set(GetCacheKey(id, accountId), req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
@@ -6051,7 +6236,7 @@
|
|
|
6051
6236
|
});
|
|
6052
6237
|
}
|
|
6053
6238
|
User.Get = Get;
|
|
6054
|
-
function Update(api, data) {
|
|
6239
|
+
function Update(api, data, reqParams) {
|
|
6055
6240
|
return __awaiter(this, void 0, void 0, function () {
|
|
6056
6241
|
return __generator(this, function (_a) {
|
|
6057
6242
|
switch (_a.label) {
|
|
@@ -6059,7 +6244,7 @@
|
|
|
6059
6244
|
if (!(data === null || data === void 0 ? void 0 : data.ID) || !(data === null || data === void 0 ? void 0 : data.Type)) {
|
|
6060
6245
|
throw ("ID and Type are required.");
|
|
6061
6246
|
}
|
|
6062
|
-
return [4 /*yield*/, api.POST("user/" + data.ID, data)];
|
|
6247
|
+
return [4 /*yield*/, api.POST("user/" + data.ID, data, reqParams)];
|
|
6063
6248
|
case 1:
|
|
6064
6249
|
data = _a.sent();
|
|
6065
6250
|
api.Cache.RemoveByContains(exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + data.ID);
|
|
@@ -6075,7 +6260,7 @@
|
|
|
6075
6260
|
});
|
|
6076
6261
|
}
|
|
6077
6262
|
User.Update = Update;
|
|
6078
|
-
function GetUsernameAvailable(api, username) {
|
|
6263
|
+
function GetUsernameAvailable(api, username, reqParams) {
|
|
6079
6264
|
return __awaiter(this, void 0, void 0, function () {
|
|
6080
6265
|
var req, prom;
|
|
6081
6266
|
var _this = this;
|
|
@@ -6083,7 +6268,7 @@
|
|
|
6083
6268
|
if (!username) {
|
|
6084
6269
|
throw ("Username is required.");
|
|
6085
6270
|
}
|
|
6086
|
-
req = api.GET("user/loginavailable/" + username);
|
|
6271
|
+
req = api.GET("user/loginavailable/" + username, reqParams);
|
|
6087
6272
|
prom = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
6088
6273
|
var data, e_1;
|
|
6089
6274
|
return __generator(this, function (_a) {
|
|
@@ -6114,7 +6299,7 @@
|
|
|
6114
6299
|
return exports.Api.ECacheKey.User + exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + accountId;
|
|
6115
6300
|
}
|
|
6116
6301
|
LoginUser.GetListCacheKey = GetListCacheKey;
|
|
6117
|
-
function GetByEmail(api, email, accountId) {
|
|
6302
|
+
function GetByEmail(api, email, accountId, reqParams) {
|
|
6118
6303
|
return __awaiter(this, void 0, void 0, function () {
|
|
6119
6304
|
var cacheData, req;
|
|
6120
6305
|
return __generator(this, function (_a) {
|
|
@@ -6123,11 +6308,11 @@
|
|
|
6123
6308
|
if (!email) {
|
|
6124
6309
|
throw ("Email is required.");
|
|
6125
6310
|
}
|
|
6126
|
-
cacheData = api.Cache.Get(GetEmailCacheKey(email, accountId));
|
|
6311
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetEmailCacheKey(email, accountId));
|
|
6127
6312
|
if (cacheData) {
|
|
6128
6313
|
return [2 /*return*/, cacheData];
|
|
6129
6314
|
}
|
|
6130
|
-
return [4 /*yield*/, api.GET("userByEmail/" + email + (accountId ? "?clientAccountID=" + accountId : ""))];
|
|
6315
|
+
return [4 /*yield*/, api.GET("userByEmail/" + email + (accountId ? "?clientAccountID=" + accountId : ""), reqParams)];
|
|
6131
6316
|
case 1:
|
|
6132
6317
|
req = _a.sent();
|
|
6133
6318
|
api.Cache.Set(GetEmailCacheKey(email, accountId), req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
@@ -6137,7 +6322,7 @@
|
|
|
6137
6322
|
});
|
|
6138
6323
|
}
|
|
6139
6324
|
LoginUser.GetByEmail = GetByEmail;
|
|
6140
|
-
function GetList(api, accountId, exclusive) {
|
|
6325
|
+
function GetList(api, accountId, exclusive, reqParams) {
|
|
6141
6326
|
return __awaiter(this, void 0, void 0, function () {
|
|
6142
6327
|
var cacheData, req;
|
|
6143
6328
|
var _this = this;
|
|
@@ -6148,7 +6333,7 @@
|
|
|
6148
6333
|
if (!exclusive) {
|
|
6149
6334
|
exclusive = false;
|
|
6150
6335
|
}
|
|
6151
|
-
cacheData = exclusive ? null : api.Cache.Get(GetListCacheKey(accountId));
|
|
6336
|
+
cacheData = exclusive || (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(accountId));
|
|
6152
6337
|
if (cacheData) {
|
|
6153
6338
|
return [2 /*return*/, cacheData];
|
|
6154
6339
|
}
|
|
@@ -6158,7 +6343,7 @@
|
|
|
6158
6343
|
switch (_a.label) {
|
|
6159
6344
|
case 0:
|
|
6160
6345
|
_a.trys.push([0, 2, , 3]);
|
|
6161
|
-
return [4 /*yield*/, api.GET("users?clientAccountID=" + accountId + (exclusive ? "&allExcludingClientAccount=true" : ""))];
|
|
6346
|
+
return [4 /*yield*/, api.GET("users?clientAccountID=" + accountId + (exclusive ? "&allExcludingClientAccount=true" : ""), reqParams)];
|
|
6162
6347
|
case 1:
|
|
6163
6348
|
data = _a.sent();
|
|
6164
6349
|
res(data.Items);
|
|
@@ -6190,7 +6375,7 @@
|
|
|
6190
6375
|
* @param email
|
|
6191
6376
|
* @returns
|
|
6192
6377
|
*/
|
|
6193
|
-
function Signup(api, email) {
|
|
6378
|
+
function Signup(api, email, reqParams) {
|
|
6194
6379
|
return __awaiter(this, void 0, void 0, function () {
|
|
6195
6380
|
return __generator(this, function (_a) {
|
|
6196
6381
|
if (!email) {
|
|
@@ -6198,7 +6383,7 @@
|
|
|
6198
6383
|
}
|
|
6199
6384
|
return [2 /*return*/, api.POST("clientaccount/signup", {
|
|
6200
6385
|
Email: email
|
|
6201
|
-
})];
|
|
6386
|
+
}, reqParams)];
|
|
6202
6387
|
});
|
|
6203
6388
|
});
|
|
6204
6389
|
}
|
|
@@ -6209,13 +6394,13 @@
|
|
|
6209
6394
|
* @param expiredCode
|
|
6210
6395
|
* @returns
|
|
6211
6396
|
*/
|
|
6212
|
-
function SignupResend(api, expiredCode) {
|
|
6397
|
+
function SignupResend(api, expiredCode, reqParams) {
|
|
6213
6398
|
return __awaiter(this, void 0, void 0, function () {
|
|
6214
6399
|
return __generator(this, function (_a) {
|
|
6215
6400
|
if (!expiredCode) {
|
|
6216
6401
|
throw ("Expired activation code is required.");
|
|
6217
6402
|
}
|
|
6218
|
-
return [2 /*return*/, api.POST("clientaccount/signup/resend?activationKey=" + exports.Api.Encode(expiredCode), null)];
|
|
6403
|
+
return [2 /*return*/, api.POST("clientaccount/signup/resend?activationKey=" + exports.Api.Encode(expiredCode), null, reqParams)];
|
|
6219
6404
|
});
|
|
6220
6405
|
});
|
|
6221
6406
|
}
|
|
@@ -6228,7 +6413,7 @@
|
|
|
6228
6413
|
* @param accountId
|
|
6229
6414
|
* @returns
|
|
6230
6415
|
*/
|
|
6231
|
-
function SignupComplete(api, code, data, accountId) {
|
|
6416
|
+
function SignupComplete(api, code, data, accountId, reqParams) {
|
|
6232
6417
|
return __awaiter(this, void 0, void 0, function () {
|
|
6233
6418
|
var res;
|
|
6234
6419
|
return __generator(this, function (_a) {
|
|
@@ -6241,7 +6426,7 @@
|
|
|
6241
6426
|
data.IsActivated = true;
|
|
6242
6427
|
data.IsDisabled = false;
|
|
6243
6428
|
data.key = code;
|
|
6244
|
-
return [4 /*yield*/, api.POST("UserActivate/" + (accountId ? accountId : ""), data)];
|
|
6429
|
+
return [4 /*yield*/, api.POST("UserActivate/" + (accountId ? accountId : ""), data, reqParams)];
|
|
6245
6430
|
case 1:
|
|
6246
6431
|
res = _a.sent();
|
|
6247
6432
|
api.Cache.RemoveByContains(exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + res.ID);
|
|
@@ -6261,7 +6446,7 @@
|
|
|
6261
6446
|
* @param email
|
|
6262
6447
|
* @returns user id associated with provided email.
|
|
6263
6448
|
*/
|
|
6264
|
-
function ForgotPassword(api, accountId, email) {
|
|
6449
|
+
function ForgotPassword(api, accountId, email, reqParams) {
|
|
6265
6450
|
return __awaiter(this, void 0, void 0, function () {
|
|
6266
6451
|
var req, prom;
|
|
6267
6452
|
var _this = this;
|
|
@@ -6271,7 +6456,7 @@
|
|
|
6271
6456
|
}
|
|
6272
6457
|
req = api.POST("UserForgotPassword/" + accountId, {
|
|
6273
6458
|
Email: email
|
|
6274
|
-
});
|
|
6459
|
+
}, reqParams);
|
|
6275
6460
|
prom = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
6276
6461
|
var data, e_3;
|
|
6277
6462
|
return __generator(this, function (_a) {
|
|
@@ -6304,7 +6489,7 @@
|
|
|
6304
6489
|
* @param password
|
|
6305
6490
|
* @returns
|
|
6306
6491
|
*/
|
|
6307
|
-
function ForgotPasswordComplete(api, code, userId, password) {
|
|
6492
|
+
function ForgotPasswordComplete(api, code, userId, password, reqParams) {
|
|
6308
6493
|
return __awaiter(this, void 0, void 0, function () {
|
|
6309
6494
|
var user;
|
|
6310
6495
|
return __generator(this, function (_a) {
|
|
@@ -6318,7 +6503,7 @@
|
|
|
6318
6503
|
ActivationCode: code,
|
|
6319
6504
|
Password: password,
|
|
6320
6505
|
FullName: user.FullName
|
|
6321
|
-
})];
|
|
6506
|
+
}, reqParams)];
|
|
6322
6507
|
}
|
|
6323
6508
|
});
|
|
6324
6509
|
});
|
|
@@ -6331,12 +6516,12 @@
|
|
|
6331
6516
|
return exports.Api.ECacheKey.AccessToken + exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + accountId;
|
|
6332
6517
|
}
|
|
6333
6518
|
AccessToken.GetListCacheKey = GetListCacheKey;
|
|
6334
|
-
function GetList(api, accountId) {
|
|
6519
|
+
function GetList(api, accountId, reqParams) {
|
|
6335
6520
|
return __awaiter(this, void 0, void 0, function () {
|
|
6336
6521
|
var cacheData, req;
|
|
6337
6522
|
var _this = this;
|
|
6338
6523
|
return __generator(this, function (_a) {
|
|
6339
|
-
cacheData = api.Cache.Get(GetListCacheKey(accountId));
|
|
6524
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(accountId));
|
|
6340
6525
|
if (cacheData) {
|
|
6341
6526
|
return [2 /*return*/, cacheData];
|
|
6342
6527
|
}
|
|
@@ -6346,7 +6531,7 @@
|
|
|
6346
6531
|
switch (_a.label) {
|
|
6347
6532
|
case 0:
|
|
6348
6533
|
_a.trys.push([0, 2, , 3]);
|
|
6349
|
-
return [4 /*yield*/, api.GET("usersByClientAccount/accessTokens")];
|
|
6534
|
+
return [4 /*yield*/, api.GET("usersByClientAccount/accessTokens", reqParams)];
|
|
6350
6535
|
case 1:
|
|
6351
6536
|
data = _a.sent();
|
|
6352
6537
|
res(data.Items);
|
|
@@ -6370,11 +6555,11 @@
|
|
|
6370
6555
|
});
|
|
6371
6556
|
}
|
|
6372
6557
|
AccessToken.GetList = GetList;
|
|
6373
|
-
function Delete(api, id) {
|
|
6558
|
+
function Delete(api, id, reqParams) {
|
|
6374
6559
|
return __awaiter(this, void 0, void 0, function () {
|
|
6375
6560
|
return __generator(this, function (_a) {
|
|
6376
6561
|
switch (_a.label) {
|
|
6377
|
-
case 0: return [4 /*yield*/, api.DELETE("accessToken/" + id)];
|
|
6562
|
+
case 0: return [4 /*yield*/, api.DELETE("accessToken/" + id, reqParams)];
|
|
6378
6563
|
case 1:
|
|
6379
6564
|
_a.sent();
|
|
6380
6565
|
api.Cache.RemoveByContains(exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + id);
|
|
@@ -6385,7 +6570,7 @@
|
|
|
6385
6570
|
});
|
|
6386
6571
|
}
|
|
6387
6572
|
AccessToken.Delete = Delete;
|
|
6388
|
-
function Create(api, data) {
|
|
6573
|
+
function Create(api, data, reqParams) {
|
|
6389
6574
|
return __awaiter(this, void 0, void 0, function () {
|
|
6390
6575
|
return __generator(this, function (_a) {
|
|
6391
6576
|
switch (_a.label) {
|
|
@@ -6399,7 +6584,7 @@
|
|
|
6399
6584
|
if (!data.Type) {
|
|
6400
6585
|
data.Type = EType.AccessToken;
|
|
6401
6586
|
}
|
|
6402
|
-
return [4 /*yield*/, api.POST("accessToken", data)];
|
|
6587
|
+
return [4 /*yield*/, api.POST("accessToken", data, reqParams)];
|
|
6403
6588
|
case 1:
|
|
6404
6589
|
data = _a.sent();
|
|
6405
6590
|
api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.AccessToken + exports.Api.ECacheKey.Account);
|
|
@@ -6541,7 +6726,7 @@
|
|
|
6541
6726
|
})(EReqKey = DataLab.EReqKey || (DataLab.EReqKey = {}));
|
|
6542
6727
|
var Entity;
|
|
6543
6728
|
(function (Entity) {
|
|
6544
|
-
function GetList(api, query, key, skip, load) {
|
|
6729
|
+
function GetList(api, query, key, skip, load, reqParams) {
|
|
6545
6730
|
return __awaiter(this, void 0, void 0, function () {
|
|
6546
6731
|
var req, prom;
|
|
6547
6732
|
var _this = this;
|
|
@@ -6555,7 +6740,7 @@
|
|
|
6555
6740
|
if (!load) {
|
|
6556
6741
|
load = 50;
|
|
6557
6742
|
}
|
|
6558
|
-
req = api.POST("entities/datalab/getMatchingEntities/" + key + "?skip=" + skip + "&load=" + load, query, exports.Api.PrepReqParams());
|
|
6743
|
+
req = api.POST("entities/datalab/getMatchingEntities/" + key + "?skip=" + skip + "&load=" + load, query, exports.Api.PrepReqParams(reqParams));
|
|
6559
6744
|
prom = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
6560
6745
|
var data, e_1;
|
|
6561
6746
|
return __generator(this, function (_a) {
|
|
@@ -6584,18 +6769,18 @@
|
|
|
6584
6769
|
})(exports.DataLab || (exports.DataLab = {}));
|
|
6585
6770
|
|
|
6586
6771
|
(function (ImportCad) {
|
|
6587
|
-
function Analyze(api, params) {
|
|
6772
|
+
function Analyze(api, params, reqParams) {
|
|
6588
6773
|
return __awaiter(this, void 0, void 0, function () {
|
|
6589
6774
|
return __generator(this, function (_a) {
|
|
6590
|
-
return [2 /*return*/, api.POST("entities/PrepareIFCForImport", params, exports.Api.PrepReqParams())];
|
|
6775
|
+
return [2 /*return*/, api.POST("entities/PrepareIFCForImport", params, exports.Api.PrepReqParams(reqParams))];
|
|
6591
6776
|
});
|
|
6592
6777
|
});
|
|
6593
6778
|
}
|
|
6594
6779
|
ImportCad.Analyze = Analyze;
|
|
6595
|
-
function ImportEntities(api, params) {
|
|
6780
|
+
function ImportEntities(api, params, reqParams) {
|
|
6596
6781
|
return __awaiter(this, void 0, void 0, function () {
|
|
6597
6782
|
return __generator(this, function (_a) {
|
|
6598
|
-
return [2 /*return*/, api.POST("entities/importIFCWithProgress", params, exports.Api.PrepReqParams())];
|
|
6783
|
+
return [2 /*return*/, api.POST("entities/importIFCWithProgress", params, exports.Api.PrepReqParams(reqParams))];
|
|
6599
6784
|
});
|
|
6600
6785
|
});
|
|
6601
6786
|
}
|
|
@@ -6622,10 +6807,10 @@
|
|
|
6622
6807
|
})(exports.ImportCad || (exports.ImportCad = {}));
|
|
6623
6808
|
|
|
6624
6809
|
(function (ImportCsv) {
|
|
6625
|
-
function ImportEntities(api, params) {
|
|
6810
|
+
function ImportEntities(api, params, reqParams) {
|
|
6626
6811
|
return __awaiter(this, void 0, void 0, function () {
|
|
6627
6812
|
return __generator(this, function (_a) {
|
|
6628
|
-
return [2 /*return*/, api.POST("entities/importCSVWithProgress2", params, exports.Api.PrepReqParams())];
|
|
6813
|
+
return [2 /*return*/, api.POST("entities/importCSVWithProgress2", params, exports.Api.PrepReqParams(reqParams))];
|
|
6629
6814
|
});
|
|
6630
6815
|
});
|
|
6631
6816
|
}
|
|
@@ -6633,10 +6818,10 @@
|
|
|
6633
6818
|
})(exports.ImportCsv || (exports.ImportCsv = {}));
|
|
6634
6819
|
|
|
6635
6820
|
(function (ImportJson) {
|
|
6636
|
-
function ImportEntities(api, params) {
|
|
6821
|
+
function ImportEntities(api, params, reqParams) {
|
|
6637
6822
|
return __awaiter(this, void 0, void 0, function () {
|
|
6638
6823
|
return __generator(this, function (_a) {
|
|
6639
|
-
return [2 /*return*/, api.POST("entities/importJsonWithProgress", params, exports.Api.PrepReqParams())];
|
|
6824
|
+
return [2 /*return*/, api.POST("entities/importJsonWithProgress", params, exports.Api.PrepReqParams(reqParams))];
|
|
6640
6825
|
});
|
|
6641
6826
|
});
|
|
6642
6827
|
}
|
|
@@ -6644,10 +6829,10 @@
|
|
|
6644
6829
|
})(exports.ImportJson || (exports.ImportJson = {}));
|
|
6645
6830
|
|
|
6646
6831
|
(function (ImportKml) {
|
|
6647
|
-
function ImportEntities(api, params) {
|
|
6832
|
+
function ImportEntities(api, params, reqParams) {
|
|
6648
6833
|
return __awaiter(this, void 0, void 0, function () {
|
|
6649
6834
|
return __generator(this, function (_a) {
|
|
6650
|
-
return [2 /*return*/, api.POST("entities/importKMLWithProgress2", params, exports.Api.PrepReqParams())];
|
|
6835
|
+
return [2 /*return*/, api.POST("entities/importKMLWithProgress2", params, exports.Api.PrepReqParams(reqParams))];
|
|
6651
6836
|
});
|
|
6652
6837
|
});
|
|
6653
6838
|
}
|
|
@@ -6668,7 +6853,7 @@
|
|
|
6668
6853
|
EFileType["CAD"] = "CAD";
|
|
6669
6854
|
EFileType["All"] = "All";
|
|
6670
6855
|
})(EFileType = ImportedFile.EFileType || (ImportedFile.EFileType = {}));
|
|
6671
|
-
function GetList(api, type, pageIndex) {
|
|
6856
|
+
function GetList(api, type, pageIndex, reqParams) {
|
|
6672
6857
|
return __awaiter(this, void 0, void 0, function () {
|
|
6673
6858
|
var cacheData, first, url, req, prom;
|
|
6674
6859
|
var _this = this;
|
|
@@ -6679,7 +6864,7 @@
|
|
|
6679
6864
|
if (!pageIndex) {
|
|
6680
6865
|
pageIndex = 0;
|
|
6681
6866
|
}
|
|
6682
|
-
cacheData = api.Cache.Get(GetListCacheKey(type, pageIndex));
|
|
6867
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetListCacheKey(type, pageIndex));
|
|
6683
6868
|
if (cacheData) {
|
|
6684
6869
|
return [2 /*return*/, cacheData];
|
|
6685
6870
|
}
|
|
@@ -6692,7 +6877,7 @@
|
|
|
6692
6877
|
if (pageIndex > 0) {
|
|
6693
6878
|
url += (first ? "?" : "&") + "pageIndex=" + pageIndex;
|
|
6694
6879
|
}
|
|
6695
|
-
req = api.GET(url, exports.Api.PrepReqParams());
|
|
6880
|
+
req = api.GET(url, exports.Api.PrepReqParams(reqParams));
|
|
6696
6881
|
prom = new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {
|
|
6697
6882
|
var data, e_1;
|
|
6698
6883
|
return __generator(this, function (_a) {
|
|
@@ -6718,15 +6903,15 @@
|
|
|
6718
6903
|
});
|
|
6719
6904
|
}
|
|
6720
6905
|
ImportedFile.GetList = GetList;
|
|
6721
|
-
function Get(api, fileId) {
|
|
6906
|
+
function Get(api, fileId, reqParams) {
|
|
6722
6907
|
return __awaiter(this, void 0, void 0, function () {
|
|
6723
6908
|
var cacheData, req;
|
|
6724
6909
|
return __generator(this, function (_a) {
|
|
6725
|
-
cacheData = api.Cache.Get(GetCacheKey(fileId));
|
|
6910
|
+
cacheData = (reqParams === null || reqParams === void 0 ? void 0 : reqParams.noCache) ? null : api.Cache.Get(GetCacheKey(fileId));
|
|
6726
6911
|
if (cacheData) {
|
|
6727
6912
|
return [2 /*return*/, cacheData];
|
|
6728
6913
|
}
|
|
6729
|
-
req = api.GET("entityImportFile/" + fileId, exports.Api.PrepReqParams());
|
|
6914
|
+
req = api.GET("entityImportFile/" + fileId, exports.Api.PrepReqParams(reqParams));
|
|
6730
6915
|
api.Cache.Set(GetCacheKey(fileId), req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
6731
6916
|
return [2 /*return*/, req];
|
|
6732
6917
|
});
|
|
@@ -6735,6 +6920,153 @@
|
|
|
6735
6920
|
ImportedFile.Get = Get;
|
|
6736
6921
|
})(exports.ImportedFile || (exports.ImportedFile = {}));
|
|
6737
6922
|
|
|
6923
|
+
/**
|
|
6924
|
+
* Description of a "Markup" which is stored in custom-form or bookmark records.
|
|
6925
|
+
*/
|
|
6926
|
+
(function (Markup) {
|
|
6927
|
+
var Element;
|
|
6928
|
+
(function (Element) {
|
|
6929
|
+
var Div;
|
|
6930
|
+
(function (Div) {
|
|
6931
|
+
// Types of div that can be created.
|
|
6932
|
+
var EType;
|
|
6933
|
+
(function (EType) {
|
|
6934
|
+
// Default, no special handling.
|
|
6935
|
+
EType["Default"] = "default";
|
|
6936
|
+
// Callout, assumes it will be positioned in 3d space.
|
|
6937
|
+
// Assumes existence of line that is used to anchor it.
|
|
6938
|
+
EType["Callout"] = "callout";
|
|
6939
|
+
})(EType = Div.EType || (Div.EType = {}));
|
|
6940
|
+
// Describes expected content of a row cell.
|
|
6941
|
+
var EItemType;
|
|
6942
|
+
(function (EItemType) {
|
|
6943
|
+
// Default, no special handling.
|
|
6944
|
+
EItemType["Default"] = "DEFAULT";
|
|
6945
|
+
// Embed, assume content is html.
|
|
6946
|
+
// Make it take over the whole cell instead of padding it and such.
|
|
6947
|
+
EItemType["Embed"] = "EMBED";
|
|
6948
|
+
})(EItemType = Div.EItemType || (Div.EItemType = {}));
|
|
6949
|
+
var ItemAction;
|
|
6950
|
+
(function (ItemAction) {
|
|
6951
|
+
// Types of actions that can be performed when a cell is clicked.
|
|
6952
|
+
// Null = "NONE".
|
|
6953
|
+
var EType;
|
|
6954
|
+
(function (EType) {
|
|
6955
|
+
EType["None"] = "NONE";
|
|
6956
|
+
// Open a link specified in params.
|
|
6957
|
+
EType["OpenLink"] = "LINK";
|
|
6958
|
+
// Open the markup's entity's details panel.
|
|
6959
|
+
EType["OpenInfoView"] = "INFOVIEW";
|
|
6960
|
+
// Open the markup's entity's gallery popup.
|
|
6961
|
+
EType["OpenEntityGallery"] = "GALLERY";
|
|
6962
|
+
// Toggle visibility of the markup's entity's relationships.
|
|
6963
|
+
EType["ToggleRelationships"] = "RELATIONSHIPS";
|
|
6964
|
+
// Dictates this cell can be used to drag the div around.
|
|
6965
|
+
EType["Draggable"] = "DRAGABBLE";
|
|
6966
|
+
// Closes the markup.
|
|
6967
|
+
EType["Close"] = "CLOSE";
|
|
6968
|
+
// Opens a bookmark specified in params.
|
|
6969
|
+
EType["OpenBookmark"] = "BOOKMARK";
|
|
6970
|
+
})(EType = ItemAction.EType || (ItemAction.EType = {}));
|
|
6971
|
+
})(ItemAction = Div.ItemAction || (Div.ItemAction = {}));
|
|
6972
|
+
})(Div = Element.Div || (Element.Div = {}));
|
|
6973
|
+
var Drawing;
|
|
6974
|
+
(function (Drawing) {
|
|
6975
|
+
var Line;
|
|
6976
|
+
(function (Line) {
|
|
6977
|
+
// Dictates where on a DIV an anchor should snap to.
|
|
6978
|
+
var EAnchorDivSide;
|
|
6979
|
+
(function (EAnchorDivSide) {
|
|
6980
|
+
EAnchorDivSide[EAnchorDivSide["TopLeft"] = 0] = "TopLeft";
|
|
6981
|
+
EAnchorDivSide[EAnchorDivSide["TopRight"] = 1] = "TopRight";
|
|
6982
|
+
EAnchorDivSide[EAnchorDivSide["BottomLeft"] = 2] = "BottomLeft";
|
|
6983
|
+
EAnchorDivSide[EAnchorDivSide["BottomRight"] = 3] = "BottomRight";
|
|
6984
|
+
EAnchorDivSide[EAnchorDivSide["Center"] = 4] = "Center";
|
|
6985
|
+
EAnchorDivSide[EAnchorDivSide["CenterLeft"] = 5] = "CenterLeft";
|
|
6986
|
+
EAnchorDivSide[EAnchorDivSide["CenterRight"] = 6] = "CenterRight";
|
|
6987
|
+
EAnchorDivSide[EAnchorDivSide["CenterTop"] = 7] = "CenterTop";
|
|
6988
|
+
EAnchorDivSide[EAnchorDivSide["CenterBottom"] = 8] = "CenterBottom";
|
|
6989
|
+
})(EAnchorDivSide = Line.EAnchorDivSide || (Line.EAnchorDivSide = {}));
|
|
6990
|
+
// Dictates what end of the line an anchor should render on.
|
|
6991
|
+
var EAnchorLineSide;
|
|
6992
|
+
(function (EAnchorLineSide) {
|
|
6993
|
+
EAnchorLineSide[EAnchorLineSide["Start"] = 0] = "Start";
|
|
6994
|
+
EAnchorLineSide[EAnchorLineSide["End"] = 1] = "End";
|
|
6995
|
+
})(EAnchorLineSide = Line.EAnchorLineSide || (Line.EAnchorLineSide = {}));
|
|
6996
|
+
// Types of anchor heads when anchor is used in context of a line.
|
|
6997
|
+
// None means the anchor is transparent.
|
|
6998
|
+
var EAnchorHeadStyle;
|
|
6999
|
+
(function (EAnchorHeadStyle) {
|
|
7000
|
+
EAnchorHeadStyle["None"] = "NONE";
|
|
7001
|
+
EAnchorHeadStyle["Circle"] = "CIRCLE";
|
|
7002
|
+
EAnchorHeadStyle["Arrow"] = "ARROW";
|
|
7003
|
+
})(EAnchorHeadStyle = Line.EAnchorHeadStyle || (Line.EAnchorHeadStyle = {}));
|
|
7004
|
+
Line.DEFAULT = {
|
|
7005
|
+
brushColor: "rgba(255, 255, 255, 1)",
|
|
7006
|
+
brushSize: 4,
|
|
7007
|
+
path: null,
|
|
7008
|
+
pathType: "LINE",
|
|
7009
|
+
transform: null,
|
|
7010
|
+
snaps: null
|
|
7011
|
+
};
|
|
7012
|
+
})(Line = Drawing.Line || (Drawing.Line = {}));
|
|
7013
|
+
var FreePaint;
|
|
7014
|
+
(function (FreePaint) {
|
|
7015
|
+
FreePaint.DEFAULT = {
|
|
7016
|
+
brushColor: "rgba(255, 255, 255, 1)",
|
|
7017
|
+
brushSize: 4,
|
|
7018
|
+
path: null,
|
|
7019
|
+
pathType: "PLAIN",
|
|
7020
|
+
transform: null
|
|
7021
|
+
};
|
|
7022
|
+
})(FreePaint = Drawing.FreePaint || (Drawing.FreePaint = {}));
|
|
7023
|
+
})(Drawing = Element.Drawing || (Element.Drawing = {}));
|
|
7024
|
+
var Entity3d;
|
|
7025
|
+
(function (Entity3d) {
|
|
7026
|
+
var Polygon;
|
|
7027
|
+
(function (Polygon) {
|
|
7028
|
+
// Determines if terrain and 3d models should be overlapped or not.
|
|
7029
|
+
var EClassificationType;
|
|
7030
|
+
(function (EClassificationType) {
|
|
7031
|
+
// 3d models and terrain are overlapped.
|
|
7032
|
+
EClassificationType["Both"] = "BOTH";
|
|
7033
|
+
// Only terrain is overlapped.
|
|
7034
|
+
EClassificationType["Terrain"] = "TERRAIN";
|
|
7035
|
+
})(EClassificationType = Polygon.EClassificationType || (Polygon.EClassificationType = {}));
|
|
7036
|
+
Polygon.DEFAULT = {
|
|
7037
|
+
id: null,
|
|
7038
|
+
positions: null,
|
|
7039
|
+
color: "rgba(254, 234, 57, 0.54)",
|
|
7040
|
+
outlineColor: "rgba(215, 215, 215, 0)",
|
|
7041
|
+
outlineWidth: 2,
|
|
7042
|
+
extrudedHeight: 0,
|
|
7043
|
+
classificationType: EClassificationType.Both,
|
|
7044
|
+
smoothen: 0
|
|
7045
|
+
};
|
|
7046
|
+
})(Polygon = Entity3d.Polygon || (Entity3d.Polygon = {}));
|
|
7047
|
+
var Polyline;
|
|
7048
|
+
(function (Polyline) {
|
|
7049
|
+
Polyline.DEFAULT = {
|
|
7050
|
+
id: null,
|
|
7051
|
+
positions: null,
|
|
7052
|
+
color: "rgba(254, 234, 57, 0.54)",
|
|
7053
|
+
outlineWidth: 4,
|
|
7054
|
+
smoothen: 0
|
|
7055
|
+
};
|
|
7056
|
+
})(Polyline = Entity3d.Polyline || (Entity3d.Polyline = {}));
|
|
7057
|
+
var Circle;
|
|
7058
|
+
(function (Circle) {
|
|
7059
|
+
Circle.DEFAULT = {
|
|
7060
|
+
id: null,
|
|
7061
|
+
position: null,
|
|
7062
|
+
radius: 50,
|
|
7063
|
+
color: "rgba(254, 234, 57, 0.54)"
|
|
7064
|
+
};
|
|
7065
|
+
})(Circle = Entity3d.Circle || (Entity3d.Circle = {}));
|
|
7066
|
+
})(Entity3d = Element.Entity3d || (Element.Entity3d = {}));
|
|
7067
|
+
})(Element = Markup.Element || (Markup.Element = {}));
|
|
7068
|
+
})(exports.Markup || (exports.Markup = {}));
|
|
7069
|
+
|
|
6738
7070
|
exports.AbstractApi = AbstractApi;
|
|
6739
7071
|
exports.BruceEvent = BruceEvent;
|
|
6740
7072
|
exports.CacheControl = CacheControl;
|