bruce-models 3.7.1 → 3.7.3
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 +83 -56
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +81 -54
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/account/account.js.map +1 -1
- package/dist/lib/api/bruce-api.js +81 -53
- package/dist/lib/api/bruce-api.js.map +1 -1
- package/dist/lib/bruce-models.js +1 -1
- package/dist/lib/entity/entity-lod.js.map +1 -1
- package/dist/types/account/account.d.ts +8 -1
- package/dist/types/bruce-models.d.ts +1 -1
- package/dist/types/entity/entity-lod.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -1382,69 +1382,96 @@
|
|
|
1382
1382
|
env: this.env
|
|
1383
1383
|
});
|
|
1384
1384
|
}
|
|
1385
|
-
const
|
|
1386
|
-
const domain = this.getDomain();
|
|
1387
|
-
const host = yield exports.HostingLocation.GetByAccountId({
|
|
1385
|
+
const { account } = yield exports.Account.Get({
|
|
1388
1386
|
accountId: this.accountId,
|
|
1389
1387
|
api: guardian
|
|
1390
1388
|
});
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1389
|
+
// Precalculated URLs exist.
|
|
1390
|
+
// Soon this will be a stable requirement for any account record.
|
|
1391
|
+
if (account.URL) {
|
|
1392
|
+
const urls = account.URL;
|
|
1393
|
+
if (urls === null || urls === void 0 ? void 0 : urls.Base) {
|
|
1394
|
+
this.baseUrl = urls.Base;
|
|
1395
|
+
}
|
|
1396
|
+
if (urls === null || urls === void 0 ? void 0 : urls.CDNEntities) {
|
|
1397
|
+
this.EntityCdnUrl = urls.CDNEntities;
|
|
1398
|
+
}
|
|
1399
|
+
if (urls === null || urls === void 0 ? void 0 : urls.CDNTileset) {
|
|
1400
|
+
this.TilesetCdnUrl = urls.CDNTileset;
|
|
1401
|
+
}
|
|
1402
|
+
if (urls === null || urls === void 0 ? void 0 : urls.CDNLegacyTileset) {
|
|
1403
|
+
this.LegacyTilesetCdnUrl = urls.CDNLegacyTileset;
|
|
1404
|
+
}
|
|
1405
|
+
if (urls === null || urls === void 0 ? void 0 : urls.CDNBase) {
|
|
1406
|
+
this.cdnBaseUrl = urls.CDNBase;
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
// Deprecated and will eventually stop working at all.
|
|
1410
|
+
else {
|
|
1411
|
+
const env = this.env.toUpperCase();
|
|
1412
|
+
const domain = this.getDomain();
|
|
1413
|
+
const host = yield exports.HostingLocation.GetByAccountId({
|
|
1414
|
+
accountId: this.accountId,
|
|
1415
|
+
api: guardian
|
|
1416
|
+
});
|
|
1417
|
+
if (host === null || host === void 0 ? void 0 : host.location) {
|
|
1418
|
+
const settings = host.location.Settings;
|
|
1419
|
+
if (!this.loadCancelled) {
|
|
1420
|
+
// Attempt to load regional base url.
|
|
1421
|
+
// First try go through settings.
|
|
1422
|
+
let urlSet = false;
|
|
1423
|
+
if (settings === null || settings === void 0 ? void 0 : settings.BruceAPIURL) {
|
|
1424
|
+
let envUrl = settings.BruceAPIURL[env];
|
|
1425
|
+
if (envUrl) {
|
|
1426
|
+
envUrl = envUrl
|
|
1427
|
+
.replace("<ACCOUNTID>", this.accountId)
|
|
1428
|
+
.replace("<ACCOUNT>", this.accountId);
|
|
1429
|
+
if (envUrl && envUrl.length > 1) {
|
|
1430
|
+
this.baseUrl = envUrl;
|
|
1431
|
+
urlSet = true;
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
// Try go through host location's base url.
|
|
1436
|
+
// This may be wrong env which is why it's used as fallback right now.
|
|
1437
|
+
if (!urlSet && host.location.BruceAPIURL) {
|
|
1438
|
+
const regionalUrl = host.location.BruceAPIURL
|
|
1401
1439
|
.replace("<ACCOUNTID>", this.accountId)
|
|
1402
|
-
.replace("<ACCOUNT>", this.accountId)
|
|
1403
|
-
|
|
1404
|
-
|
|
1440
|
+
.replace("<ACCOUNT>", this.accountId)
|
|
1441
|
+
.replace("<DOMAIN>", domain);
|
|
1442
|
+
if (regionalUrl && regionalUrl.length > 1) {
|
|
1443
|
+
this.baseUrl = regionalUrl;
|
|
1405
1444
|
urlSet = true;
|
|
1406
1445
|
}
|
|
1407
1446
|
}
|
|
1408
1447
|
}
|
|
1409
|
-
//
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
.
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
// Attempt to load CDN settings.
|
|
1423
|
-
if (settings === null || settings === void 0 ? void 0 : settings.CDN) {
|
|
1424
|
-
this.EntityCdnUrl = (_a = settings.CDN.entityURL) === null || _a === void 0 ? void 0 : _a[env];
|
|
1425
|
-
// We need to fix our configs.
|
|
1426
|
-
if (this.EntityCdnUrl) {
|
|
1427
|
-
if (this.EntityCdnUrl.includes("entitiesListForCDN")) {
|
|
1428
|
-
this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", this.accountId);
|
|
1448
|
+
// Attempt to load CDN settings.
|
|
1449
|
+
if (settings === null || settings === void 0 ? void 0 : settings.CDN) {
|
|
1450
|
+
this.EntityCdnUrl = (_a = settings.CDN.entityURL) === null || _a === void 0 ? void 0 : _a[env];
|
|
1451
|
+
// We need to fix our configs.
|
|
1452
|
+
if (this.EntityCdnUrl) {
|
|
1453
|
+
if (this.EntityCdnUrl.includes("entitiesListForCDN")) {
|
|
1454
|
+
this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", this.accountId);
|
|
1455
|
+
}
|
|
1456
|
+
else {
|
|
1457
|
+
this.EntityCdnUrl = this.EntityCdnUrl.replace("<ACCOUNT>", "entitiesListForCDN/" + this.accountId);
|
|
1458
|
+
}
|
|
1429
1459
|
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1460
|
+
this.LegacyTilesetCdnUrl = (_b = settings.CDN.legacyTilesetURL) === null || _b === void 0 ? void 0 : _b[env];
|
|
1461
|
+
this.TilesetCdnUrl = (_c = settings.CDN.tilesetURL) === null || _c === void 0 ? void 0 : _c[env];
|
|
1462
|
+
if (this.TilesetCdnUrl) {
|
|
1463
|
+
this.TilesetCdnUrl = this.TilesetCdnUrl.replace("<ACCOUNT>", this.accountId);
|
|
1432
1464
|
}
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
const url = new URL(this.TilesetCdnUrl);
|
|
1444
|
-
this.cdnBaseUrl = `${url.protocol}//${url.hostname}/`;
|
|
1445
|
-
}
|
|
1446
|
-
catch (e) {
|
|
1447
|
-
console.error(e);
|
|
1465
|
+
// TilesetCdnUrl example: "https://blah.cloudfront.net/tilesets/<TILESETID>/files/<FILEPATH>?accountId=<ACCOUNT>".
|
|
1466
|
+
// Lazy at the moment to go around updating every region we have, I'll interpret the url from tilesetCdnUrl.
|
|
1467
|
+
if (this.TilesetCdnUrl) {
|
|
1468
|
+
try {
|
|
1469
|
+
const url = new URL(this.TilesetCdnUrl);
|
|
1470
|
+
this.cdnBaseUrl = `${url.protocol}//${url.hostname}/`;
|
|
1471
|
+
}
|
|
1472
|
+
catch (e) {
|
|
1473
|
+
console.error(e);
|
|
1474
|
+
}
|
|
1448
1475
|
}
|
|
1449
1476
|
}
|
|
1450
1477
|
}
|
|
@@ -10834,7 +10861,7 @@
|
|
|
10834
10861
|
})(exports.DataSource || (exports.DataSource = {}));
|
|
10835
10862
|
|
|
10836
10863
|
// This is updated with the package.json version on build.
|
|
10837
|
-
const VERSION = "3.7.
|
|
10864
|
+
const VERSION = "3.7.3";
|
|
10838
10865
|
|
|
10839
10866
|
exports.VERSION = VERSION;
|
|
10840
10867
|
exports.AbstractApi = AbstractApi;
|