bruce-models 5.4.3 → 5.4.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 +40 -27
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +40 -27
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/api/abstract-api.js +25 -12
- package/dist/lib/api/abstract-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/entity/entity.js +14 -14
- package/dist/lib/entity/entity.js.map +1 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/package.json +1 -1
package/dist/bruce-models.es5.js
CHANGED
|
@@ -307,6 +307,19 @@ function parseResult(data) {
|
|
|
307
307
|
return text;
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Ensuring obvious faults in our session ID storage don't waste DB time.
|
|
312
|
+
* @param ssid
|
|
313
|
+
* @returns
|
|
314
|
+
*/
|
|
315
|
+
const prepSessionId = (ssid) => {
|
|
316
|
+
let tmp = ssid;
|
|
317
|
+
if (!tmp || "null" == tmp || "undefined" == tmp) {
|
|
318
|
+
tmp = "";
|
|
319
|
+
}
|
|
320
|
+
// Anonymous SSID will mean Guardian doesn't bother touching the DB.
|
|
321
|
+
return tmp ? tmp : "anonymous";
|
|
322
|
+
};
|
|
310
323
|
/**
|
|
311
324
|
* This is a base class for communication with an arbitrary Nextspace API.
|
|
312
325
|
*/
|
|
@@ -382,14 +395,14 @@ class AbstractApi {
|
|
|
382
395
|
* @returns
|
|
383
396
|
*/
|
|
384
397
|
GetSessionId() {
|
|
385
|
-
return this.ssid;
|
|
398
|
+
return prepSessionId(this.ssid);
|
|
386
399
|
}
|
|
387
400
|
/**
|
|
388
401
|
* Sets the session ID.
|
|
389
402
|
* @param value
|
|
390
403
|
*/
|
|
391
404
|
SetSessionId(value) {
|
|
392
|
-
this.ssid = value;
|
|
405
|
+
this.ssid = prepSessionId(value);
|
|
393
406
|
}
|
|
394
407
|
/**
|
|
395
408
|
* Returns the session header.
|
|
@@ -419,8 +432,8 @@ class AbstractApi {
|
|
|
419
432
|
}
|
|
420
433
|
params.headers = params.headers || {};
|
|
421
434
|
params.headers = Object.assign({ "Content-Type": "application/json;" }, params.headers);
|
|
422
|
-
if (this.ssidHeader
|
|
423
|
-
params.headers[this.ssidHeader] = this.
|
|
435
|
+
if (this.ssidHeader) {
|
|
436
|
+
params.headers[this.ssidHeader] = this.GetSessionId();
|
|
424
437
|
}
|
|
425
438
|
const res = yield fetch(url, {
|
|
426
439
|
headers: params.headers,
|
|
@@ -443,8 +456,8 @@ class AbstractApi {
|
|
|
443
456
|
}
|
|
444
457
|
params.headers = params.headers || {};
|
|
445
458
|
params.headers = Object.assign({ "Content-Type": "application/json;" }, params.headers);
|
|
446
|
-
if (this.ssidHeader
|
|
447
|
-
params.headers[this.ssidHeader] = this.
|
|
459
|
+
if (this.ssidHeader) {
|
|
460
|
+
params.headers[this.ssidHeader] = this.GetSessionId();
|
|
448
461
|
}
|
|
449
462
|
const res = yield fetch(url, {
|
|
450
463
|
headers: params.headers,
|
|
@@ -469,8 +482,8 @@ class AbstractApi {
|
|
|
469
482
|
}
|
|
470
483
|
params.headers = params.headers || {};
|
|
471
484
|
params.headers = Object.assign({ "Content-Type": "application/json;" }, params.headers);
|
|
472
|
-
if (this.ssidHeader
|
|
473
|
-
params.headers[this.ssidHeader] = this.
|
|
485
|
+
if (this.ssidHeader) {
|
|
486
|
+
params.headers[this.ssidHeader] = this.GetSessionId();
|
|
474
487
|
}
|
|
475
488
|
if (!data) {
|
|
476
489
|
data = {};
|
|
@@ -502,8 +515,8 @@ class AbstractApi {
|
|
|
502
515
|
}
|
|
503
516
|
params.headers = params.headers || {};
|
|
504
517
|
params.headers = Object.assign({ "Content-Type": "application/json;" }, params.headers);
|
|
505
|
-
if (this.ssidHeader
|
|
506
|
-
params.headers[this.ssidHeader] = this.
|
|
518
|
+
if (this.ssidHeader) {
|
|
519
|
+
params.headers[this.ssidHeader] = this.GetSessionId();
|
|
507
520
|
}
|
|
508
521
|
if (!data) {
|
|
509
522
|
data = {};
|
|
@@ -534,8 +547,8 @@ class AbstractApi {
|
|
|
534
547
|
params = {};
|
|
535
548
|
}
|
|
536
549
|
params.headers = Object.assign({}, params.headers);
|
|
537
|
-
if (this.ssidHeader
|
|
538
|
-
params.headers[this.ssidHeader] = this.
|
|
550
|
+
if (this.ssidHeader) {
|
|
551
|
+
params.headers[this.ssidHeader] = this.GetSessionId();
|
|
539
552
|
}
|
|
540
553
|
const formData = params.formData instanceof FormData ? params.formData : new FormData();
|
|
541
554
|
if (formData.has("file")) {
|
|
@@ -3246,11 +3259,23 @@ var Entity;
|
|
|
3246
3259
|
if (!api) {
|
|
3247
3260
|
api = ENVIRONMENT.Api().GetBruceApi();
|
|
3248
3261
|
}
|
|
3262
|
+
const cacheKeyData = {
|
|
3263
|
+
expandLocation,
|
|
3264
|
+
expandRelations,
|
|
3265
|
+
expandImports,
|
|
3266
|
+
expandSources,
|
|
3267
|
+
entityTypeId: null,
|
|
3268
|
+
historicFrom: historicFrom,
|
|
3269
|
+
historicKey: historicKey,
|
|
3270
|
+
historicTo: historicTo,
|
|
3271
|
+
historicPoint: historicPoint,
|
|
3272
|
+
schemaId: schemaId
|
|
3273
|
+
};
|
|
3249
3274
|
const crashRiskReqs = [];
|
|
3250
3275
|
const reqIds = [];
|
|
3251
3276
|
for (let i = 0; i < entityIds.length; i++) {
|
|
3252
3277
|
const entityId = entityIds[i];
|
|
3253
|
-
const key = GetCacheKey({
|
|
3278
|
+
const key = GetCacheKey(Object.assign(Object.assign({}, cacheKeyData), { entityId }));
|
|
3254
3279
|
const cache = api.GetCacheItem(key, reqParams);
|
|
3255
3280
|
if (cache === null || cache === void 0 ? void 0 : cache.found) {
|
|
3256
3281
|
crashRiskReqs.push(cache.data);
|
|
@@ -3315,19 +3340,7 @@ var Entity;
|
|
|
3315
3340
|
const req = api.POST(url, reqData, Api.PrepReqParams(reqParams));
|
|
3316
3341
|
for (let i = 0; i < reqIds.length; i++) {
|
|
3317
3342
|
const entityId = reqIds[i];
|
|
3318
|
-
const key = GetCacheKey({
|
|
3319
|
-
entityId,
|
|
3320
|
-
expandLocation,
|
|
3321
|
-
expandRelations,
|
|
3322
|
-
expandImports,
|
|
3323
|
-
expandSources,
|
|
3324
|
-
entityTypeId: null,
|
|
3325
|
-
historicFrom: historicFrom,
|
|
3326
|
-
historicKey: historicKey,
|
|
3327
|
-
historicTo: historicTo,
|
|
3328
|
-
historicPoint: historicPoint,
|
|
3329
|
-
schemaId: schemaId
|
|
3330
|
-
});
|
|
3343
|
+
const key = GetCacheKey(Object.assign(Object.assign({}, cacheKeyData), { entityId }));
|
|
3331
3344
|
const prom = new Promise((res) => __awaiter(this, void 0, void 0, function* () {
|
|
3332
3345
|
try {
|
|
3333
3346
|
const data = yield req;
|
|
@@ -14745,7 +14758,7 @@ var DataSource;
|
|
|
14745
14758
|
})(DataSource || (DataSource = {}));
|
|
14746
14759
|
|
|
14747
14760
|
// This is updated with the package.json version on build.
|
|
14748
|
-
const VERSION = "5.4.
|
|
14761
|
+
const VERSION = "5.4.5";
|
|
14749
14762
|
|
|
14750
14763
|
export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
|
|
14751
14764
|
//# sourceMappingURL=bruce-models.es5.js.map
|